//TESH.scrollpos=-1
//TESH.alwaysfold=0
globals
boolean PMme = false
trigger SteamTankSpells
boolean DestroyGate = false
boolean RusTips = false
boolean GateIsOpened = false
unit array HiddenPaladinMounted
group CallDownCD = CreateGroup()
constant integer ProgressBar = 'o000'
real VoidShadowR = 30.
group ZiccuratDefenseGroup = CreateGroup()
boolean ConcentratedHorror = false
boolean GreatIntention = false
real GoldIncome = 0.
//real array CallDownArray[5]
trigger Teleport
unit GreatSourcePortal
real X2
real Y2
boolean CallDowned = false
group SteamTanksGroup = CreateGroup()
boolean TESTdreadlordFocus = false //false
integer greatsourcenumber = 0
unit array GreatSources[16]
integer PalItemsMaxCount = 9
//group =
unit MasterMind
unit array SteamTank[3]
constant integer golemtype = 'ngst'
constant integer steamtank = 'hrtt'
unit CrystalShield //gg_unit_nmgv_0077
boolean OrcInvasion_made = false
boolean OrcInvasion_elapsed = false
boolean DreadInstantKillUnit = false // that also means new focus is on
real WhirlWindCD = 0.
boolean ComesToOrcBL = false
group OrcMovesBack = CreateGroup()
group OrcBase = CreateGroup()
group MountSpeedIncreasement = CreateGroup()
group UnmountedSlow = CreateGroup()
unit OrcHero
unit OrcMage
//boolean array MountSwapTime[9]
unit MilitiaMan
quest OrcInvasion
group GolemsGroup = CreateGroup()
trigger OrcInvasionTrigger
boolean OrcInvasionCanBeCanceled = true
real OrcInvasionReal = 0.
group MilitiaBrothers = CreateGroup()
group BarracksGroup = CreateGroup()
integer GreatSourceInt = 0
unit array Barrack[12]
unit array TeleportEffect[8]
region array TeleportRect[8]
region array LivingRegionGlobal[8]
//group AppearGroup
integer whatBarrack = 0
group RadianceFireEffect = CreateGroup()
boolean PalSurviveBl = false
boolean TESTupg1 = true
boolean TESTupg2 = true
boolean TESTupg3 = true
boolean TESTupg4 = true
boolean TESTupg5 = true
boolean TESTupg6 = true
integer array HumanKilled[10]
integer array PaladinsKilled[10]
integer array UndeadKilled[10]
integer array DreadLordsKilled[10]
integer array MilitiaKilled[10]
integer array NeutralsKilled[10]
group ThugsToBeRaidGroup// = CreateGroup()
group Radiance = CreateGroup()
group RainFire = CreateGroup()
unit array DarkSpirit[12]
unit array Knight[12]
group PatrolRepeatEffect = CreateGroup()
unit array EntQuestionMark[4]
boolean array SpyVision[3]
trigger CryptSpidersTrigger = CreateTrigger()
boolean CiliviansMurdered = false
integer PaladinsChanceGetItem = 8
integer PalItemCounter = 0
boolean array PalItem[9] // ...
boolean HalfIsDeadTip2 = false
//integer
integer array Preservation_Bar[10]
integer Preservation_Integer = 0
real array Circulation_HPRestoration[10]
real array Circulation_MPRestoration[10]
integer array ArcaneTerror_Level[10]
//real array ArcaneTerror_Damage[10]
unit array Shadows[10]
integer array ShadowsStacks[10]
group array ShadowsGroup[10]
integer DreadLordsCount = 0
integer ItemsSummary = 6
constant integer ItemsShouldBe = 6
constant integer itemplaces = 16 //16
integer array ItemId[6]
rect array ItemPlace[itemplaces]
boolean array PlaceUn[itemplaces]
boolean array ItemIdUn[6]
unit SoulUnit
boolean SoulPickedUp = false
unit BladeUnit = null
real BladeCd = 0.
trigger RebelsAttack
boolean NorthGateIsOpen = false
boolean SouthGateIsOpen = false
integer array Revelation_Bar[12]
integer Revelation_integer = 0
group InitiationG = CreateGroup()
boolean array ScreamVision[4]
boolean DefendingEnd = false
boolean array GuardTip[5]
real timeperm = 0.
boolean tip1 = false
boolean tip2 = false
boolean LVL2Raid = false
boolean LVL3Raid = false
real TESTautoUPGRADEtime = 140.
quest Furblogs
real FurblogsReal = 0.
boolean FurblogsCanBeCanceled = true
quest EntCorruption
boolean EntCorruptionTakeDown = false
integer EntCount = 3
quest ThugsRaid
real ThugsReal = 0. //6.5
group ThugsRaidGroup //= CreateGroup()
//boolean ThugsRaidGroupAlive = true
group ThugsCampGroup //= CreateGroup()
boolean ThugsRaidTakeDown = false
boolean ThugsRaidCanBeCanceled = true
quest CryptSpiders
real CryptSpidersReal = 0.
boolean CryptSpidersCanBeCanceled = true
boolean CryptSpidersCompleted = false
unit MortarUnitQuest
quest RebelsQuest
boolean RebelsCanBeCanceled = true
group RebelsAttackGroup //= CreateGroup()
group RebelsGroup// = CreateGroup()
group RebelsGroup2// = CreateGroup()
unit RebelsMainUnit
real RebelsReal = 0.
location L = Location(0.,0.)
integer array LVLUPadditionalHL[10]
hashtable Hash = InitHashtable()
leaderboard CilivianzAlive
group CryptSpidersGroup //= CreateGroup()
unit RangeUnit
force Frc
timer T
string Ss
effect Ef
effect Ef2
integer array DreadSpawnInteger[10]
unit array QuestVision[7]
unit array units
integer index
real TimeToFixAttack = 0.
boolean bl = false
group QuestVisionGroup = CreateGroup()
group DreadLordsVision = CreateGroup()
constant integer dummy = 'eCST'
constant integer zombie = 'nzom'
constant integer zombiew = 'n000'
constant integer skeleton = 'uske'
constant integer skeletonarcher = 'nska'
constant integer footman = 'hfoo'
//constant integer footmanms = 'hfo2'
constant integer sniper = 'hrif'
//constant integer sniperms = 'hrif'
constant integer kid = 'nvlk'
constant integer kid2 = 'nvk2'
constant integer murl = 'nmrl'
constant integer male = 'nvil'
constant integer male2 = 'nvl2'
constant integer female = 'nvlw'
constant integer female2 = 'nhef'
constant integer worker = 'hpea'
constant integer sorcerer = 'nmed'
constant integer priest = 'nchp'
constant integer skeletonmage = 'uskm'
constant integer captain = 'hcth'
constant integer locust = 'uloc'
constant integer tower = 'hwtw'
constant integer towerguard = 'hgtw'
constant integer ghoul = 'ugho'
constant integer knight = 'hkni'
integer T1Nplayer = 0
//integer T1Nactualplayers = 0
integer LVLfor1T
integer T2Nplayer = 0
integer LVLfor2T
real LVLspellfor1T = 1.
real LVLspellfor2T = 1.
boolean GameOver = false
real R2
integer PaladinsCount = 0
effect array HuntTargetEffect[50]
unit array HuntTargetUnitDummy[50]
integer QuestNumber
//1 furb
//2 ent
//3 thugs
//4 crypt
//5 rebels
group QuestGroup = CreateGroup()
boolean array QuestCompleted[6]
real RaidActionCommandInterval = 10.
integer RaidInt = 0
real array RaidXPoint
real array RaidYPoint
unit array RaidTargetUnit
boolean array RaidCommandIsActive
integer array RaidCommandType
//1 attack
//2 move
integer RaidLVL = 1
//integer MaxRaids = 1
group array RaidGroup //MaxRaids
integer RaidCurrentMax = 0
boolean array RaidActive
real RaidIntReal = 10 //10
real RaidInterval = 55. // 45 -RaidIntReal
real RaidSpawn = 120. //45
boolean RaidBoolean = false
integer NPlayer = 0
force PlayerForce = CreateForce()
force HumanForce = CreateForce()
force UndeadForce = CreateForce()
boolean array PlayerInGame[12]
unit array HERO[12]
unit array PaladinsUnit[5]
boolean array PlayerHasLost[12]
group CilivianzGroup = CreateGroup() // massive group
texttag TX
string S
boolean LeaderBoardActive = false
integer PalLack = 0
integer DreadLack = 0
real array distance[10]
group QuestionMarkGroup = CreateGroup()
group ReplicsGroup = CreateGroup()
group AppearingGroup = CreateGroup()
group ReplicsGroupIsOnPoint = CreateGroup()
group DistToUnitG = CreateGroup()
//real EveryFiveSeconds = 0.
//location L2 = Location(0.,0.)
integer PatrolMax = 100
unit array PatrolUnit[100]
rect array PatrolRect[100]
real every25sec = 0.
group FocusedUnitVision = CreateGroup()
boolean HalfIsDeadTip = false
constant integer UGMmax = 600 // +1 max groups of undead. has been 400 before 4.5 <Constant value, and mostly for optimization>
constant integer UndeadMaxCount = 7 // 6
constant real BasicalHauntSpeed = 165 // based on (zombie's speed) - 70
integer UGM = 1 // current count of undead groups
group array Undead[UGMmax]
boolean array UndeadGroupIsOn[UGMmax]
boolean array UndeadGroupShouldBeEliminated[UGMmax]
boolean array UndeadGroupEliminated[UGMmax]
integer UDUNITS = 0 //it's okay
real array UndeadFocusX[UGMmax]
real array UndeadFocusY[UGMmax]
//constant integer UDUNITSmax = 7
unit array FocusedUnit[UGMmax] // current focused unit
boolean array IsUnitFocused[UGMmax] // is unit focused now
//constant integer CGMmax = 6 // +1 max groups of cilivians
integer CGMMax = 0 // max count of cilivians
integer CGM = 0 // current count of cilivians
//group array Cilivians[CGMmax]
rect array LIVINGrect[12] // rect where people live
// unit or effect doesnt matter POP
unit array LIVINGrectPORTALEFFECT[12]
effect array LIVINGrectPORTALEFFECTbutitsreal[12]
group GreatSourcesDealAura = CreateGroup()
group Corruption = CreateGroup()
integer array RectCount[12]
integer array RectCountCr[12]
boolean array ISRECTALIVE[12] // false would mean that rect is totally cleared from people
boolean array MedRectWarn[12]
real MedRectWarnReal = 0.
boolean array RectDeadWarn[12]
real RectDeadReal = 0.
real array RectBlightWidth[12]
group array LIVINGgroup[12]
boolean CaptainActivated = false
group Sorcerers = CreateGroup()
group Paladins = CreateGroup()
group DreadLords = CreateGroup()
//integer DreadLordsCount = 0
group MilitiaGroup = CreateGroup()
unit F
unit F2
group P = CreateGroup()
group P2 = CreateGroup()
real time = 0.
boolean Bol
boolean BOOLEAN
real R
real X
real Y
integer I
integer I2
boolean PalSurvive = false
real PalSurviveReal = 0. // TIME FOR PALADINS TO DEFEND
real timesec = 0. // gg
integer timemin = 0
group ShareVisionGroup = CreateGroup()
group Revelation_Targets = CreateGroup()
//unit AC_Caster
//unit AC_Target
group Zeal_Casters = CreateGroup()
boolean array CinematicEnd[10]
real array CaptainCd[12]
boolean array CaptainIsOnCd[12]
//group array
//integer CaptainData
real CaptainX
real CaptainY
integer PalGold = 0
integer DreadEssence = 0
group BuildVision = CreateGroup()
group PowerDashHaste = CreateGroup()
group DSgroup = CreateGroup()
group DSgroupDread = CreateGroup()
boolexpr B
boolean BetterZombify = false
boolean FelGenome = false
boolean SoulLust = false
boolean Locust = false
boolean DarkReflection = false
boolean Everlasting = false
boolean Abominations = false
unit array VisionQuestDummy[15]
boolean Defend = false
group DefendOff = CreateGroup()
boolean TowerGrade = false
boolean Planning = false
boolean BetterPatrols = false
boolean EvilDefend = false
boolean MeditationProcees = false
boolean Golems = false
constant integer Invis = 'Agho'
group DreadStealth = CreateGroup()
group RaidOfOrcs = CreateGroup()
group RageOfTheDamned = CreateGroup()
integer ID
integer IDT
boolean DarkSourceTip = false
rect array Spawn[9]
boolean SpawnEngaged[9]
boolean array GoRunning[500]
group AttackingGroup = CreateGroup()
constant boolean TEST = false // that activates raither test map
// DO NOT FORGET TO CHANGE
endglobals
function UnitTypeNotDummy takes unit ui returns boolean
if GetUnitAbilityLevel(ui,'Aloc') > 0
return false //that means it's dummy
endif
return true
endfunction
function LeaderboardResizeJ takes leaderboard lb returns nothing
local integer size = LeaderboardGetItemCount(lb)
if (LeaderboardGetLabelText(lb) == "") then
set size = size - 1
endif
call LeaderboardSetSizeByItemCount(lb, size)
endfunction
function LeaderboardAddItemJ takes player whichPlayer, leaderboard lb, string label, integer value returns nothing
if (LeaderboardHasPlayerItem(lb, whichPlayer)) then
call LeaderboardRemovePlayerItem(lb, whichPlayer)
endif
call LeaderboardAddItem(lb, label, value, whichPlayer)
call LeaderboardResizeJ(lb)
//call LeaderboardSetSizeByItemCount(lb, LeaderboardGetItemCount(lb))
endfunction
function GroupCallback takes nothing returns nothing
set index = index + 1
set units[index] = GetEnumUnit()
endfunction
function GroupPickRandomUnitEx takes group g returns unit
set index = 0
call ForGroup(g, function GroupCallback)
return units[GetRandomInt(1, index)]
endfunction
/* ОБЗОР ВИДИМОСТИ */
function CreateFogModifierRadiusLocJ takes boolean enabled, player whichPlayer, fogstate whichFogState, location center, real radius returns fogmodifier
set bj_lastCreatedFogModifier = CreateFogModifierRadiusLoc(whichPlayer, whichFogState, center, radius, true, false)
if enabled then
call FogModifierStart(bj_lastCreatedFogModifier)
endif
return bj_lastCreatedFogModifier
endfunction
////////////////////////
function CinematicFadeJ takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans returns nothing
if (fadetype == bj_CINEFADETYPE_FADEOUT) then
// Fade out to the requested color.
call AbortCinematicFadeBJ()
call CinematicFadeCommonBJ(red, green, blue, duration, tex, 100, trans)
elseif (fadetype == bj_CINEFADETYPE_FADEIN) then
// Fade in from the requested color.
call AbortCinematicFadeBJ()
call CinematicFadeCommonBJ(red, green, blue, duration, tex, trans, 100)
call FinishCinematicFadeAfterBJ(duration)
elseif (fadetype == bj_CINEFADETYPE_FADEOUTIN) then
// Fade out to the requested color, and then fade back in from it.
if (duration > 0) then
call AbortCinematicFadeBJ()
call CinematicFadeCommonBJ(red, green, blue, duration * 0.5, tex, 100, trans)
call ContinueCinematicFadeAfterBJ(duration * 0.5, red, green, blue, trans, tex)
call FinishCinematicFadeAfterBJ(duration)
endif
else
// Unrecognized fadetype - ignore the request.
endif
endfunction
function LeaderboardResize takes leaderboard lb returns nothing
local integer size = LeaderboardGetItemCount(lb)
if (LeaderboardGetLabelText(lb) == "") then
set size = size - 1
endif
call LeaderboardSetSizeByItemCount(lb, size)
endfunction
function CreateTimerDialogJ takes timer t, string title returns timerdialog
set bj_lastCreatedTimerDialog = CreateTimerDialog(t)
call TimerDialogSetTitle(bj_lastCreatedTimerDialog, title)
call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
return bj_lastCreatedTimerDialog
endfunction
function AddLocalEffect takes string eff, real x, real y, player pl returns effect
local string e = ""
if (GetLocalPlayer() == pl) then
set e = eff
endif
return AddSpecialEffect(e, x, y)
endfunction
function GroupAddGroupEnumJ takes nothing returns nothing
call GroupAddUnit(bj_groupAddGroupDest, GetEnumUnit())
endfunction
function GroupPickRandomUnitEnumJ takes nothing returns nothing
set bj_groupRandomConsidered = bj_groupRandomConsidered + 1
if (GetRandomInt(1,bj_groupRandomConsidered) == 1) then
set bj_groupRandomCurrentPick = GetEnumUnit()
endif
endfunction
function CopyGroup takes group g returns group
set bj_groupAddGroupDest = CreateGroup()
call ForGroup(g, function GroupAddGroupEnumJ)
return bj_groupAddGroupDest
endfunction
function Cilivians_Expr takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and GetOwningPlayer(GetFilterUnit()) == Player(5) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function CiliviansMilitia_Expr takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and (GetOwningPlayer(GetFilterUnit()) == Player(5) or GetOwningPlayer(GetFilterUnit()) == Player(6)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function Militia_Expr takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and GetOwningPlayer(GetFilterUnit()) == Player(11) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
//***********************************пост всем игрокам**************************************************
function echo takes string s returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0.,0.,10.,s)
endfunction
function echoPo takes string s, real time returns nothing
local integer index
set index = 0
loop
exitwhen index > 12
if GetPlayerName(Player(index)) == "SinnerPo" then
call DisplayTimedTextToPlayer(Player(index),0,0,time,s)
endif
set index = index + 1
endloop
endfunction
function MsgP takes integer i, string msg,real time returns nothing
call DisplayTimedTextToPlayer(Player(i),0,0,time,msg)
endfunction
function Msg takes string msg,real time returns nothing
local integer i = 0
loop
call DisplayTimedTextToPlayer(Player(i),0,0,time,msg)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
endfunction
function MsgForce takes force toForce, string message returns nothing
if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, message)
endif
endfunction
//******************** Сообщение/текстаг игроку на время ***********************
function PlayerMsg takes integer p,string msg,real time returns nothing
call DisplayTimedTextToPlayer(Player(p),0,0,time,msg)
endfunction
function PercentInt takes real percentage, integer max returns integer
local integer result = R2I(percentage * I2R(max) * 0.01)
if (result < 0) then
set result = 0
elseif (result > max) then
set result = max
endif
return result
endfunction
function Percent255 takes real percentage returns integer
return PercentInt(percentage, 255)
endfunction
function RMaxJ takes real a, real b returns real
if (a < b) then
return b
else
return a
endif
endfunction
//*************************************************активен ли игрок***************************************
function PlayerIsActive takes player pWho returns boolean
if(GetPlayerSlotState(pWho)==PLAYER_SLOT_STATE_PLAYING)then
if(GetPlayerController(pWho)==MAP_CONTROL_USER)then
return true
endif
endif
return false
endfunction
//**********************************************MOVE FUNCTION*************************************************
//****************************универсальная проверка жив ли юнит***************************************
function IsUnitDead takes unit u returns boolean
return GetUnitTypeId(u) == 0 or IsUnitType(u, UNIT_TYPE_DEAD)
endfunction
function DistanceXY takes real x,real y,real x2,real y2 returns real
local real dx = x - x2
local real dy = y - y2
return SquareRoot(dx * dx + dy * dy)
endfunction
function AngleBetweenXY takes real x, real y, real x2, real y2 returns real
return bj_RADTODEG * Atan2(y2 - y, x2 - x)
endfunction
function FDFD takes unit u,unit u2 returns real
local real dx = GetUnitX(u2)-GetUnitX(u)
local real dy = GetUnitY(u2)-GetUnitY(u)
return SquareRoot(dx*dx+dy*dy)
endfunction
function GetLocZ takes real x, real y returns real
call MoveLocation(L,x,y)
return GetLocationZ(L)
endfunction
function GetUnitZ takes unit u returns real
call MoveLocation(L,GetUnitX(u),GetUnitY(u))
return GetLocationZ(L)
endfunction
function SQ takes real xa, real ya, real xb, real yb returns real
return SquareRoot((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))
endfunction
function SafeX takes real pxx returns real
local real lfr=GetRectMinX(bj_mapInitialPlayableArea)+50
if(pxx<lfr)then
return lfr
endif
set lfr=GetRectMaxX(bj_mapInitialPlayableArea)-50
if(pxx>lfr)then
return lfr
endif
return pxx
endfunction
function SafeY takes real pyy returns real
local real lfr=GetRectMinY(bj_mapInitialPlayableArea)+50
if(pyy<lfr)then
return lfr
endif
set lfr=GetRectMaxY(bj_mapInitialPlayableArea)-50
if(pyy>lfr)then
return lfr
endif
return pyy
endfunction
function ABU takes unit u,unit c returns real
return Atan2(GetUnitY(u)-GetUnitY(c),GetUnitX(u)-GetUnitX(c))
endfunction
function PlaySoundJ takes sound soundHandle returns nothing
set bj_lastPlayedSound = soundHandle
if (soundHandle != null) then
call StartSound(soundHandle)
endif
endfunction
//****** Проигрыш звука
function PlaySoundOnUnit takes sound soundHandle, real volumePercent, unit whichUnit,integer volume returns nothing
call AttachSoundToUnit(soundHandle, whichUnit)
call SetSoundVolume(soundHandle, PercentInt(volumePercent, volume))
call PlaySoundJ(soundHandle)
endfunction
//******************************мат вычисления
function GetUnitStatePercentJ takes unit whichUnit, unitstate whichState, unitstate whichMaxState returns real
local real value = GetUnitState(whichUnit, whichState)
local real maxValue = GetUnitState(whichUnit, whichMaxState)
// Return 0 for null units.
if (whichUnit == null) or (maxValue == 0) then
return 0.0
endif
return value / maxValue * 100.0
endfunction
//******************** Вычисление ближайщего юнита ***********************
function RectContainsCoordsJ takes rect r, real x, real y returns boolean
return (GetRectMinX(r) <= x) and (x <= GetRectMaxX(r)) and (GetRectMinY(r) <= y) and (y <= GetRectMaxY(r))
endfunction
function Dist takes real x1, real y1, real x2, real y2 returns real
set x2 = x2 - x1
set y2 = y2 - y1
return SquareRoot(x2*x2+y2*y2)
endfunction
function DistToUnit takes real x, real y, group g returns unit
local unit e
local real x1
local real y1
local real dist=0.
set RangeUnit=null
call GroupClear(DistToUnitG)
set bj_groupAddGroupDest = DistToUnitG
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set e=FirstOfGroup(DistToUnitG)
set x1=GetWidgetX(e)
set y1=GetWidgetY(e)
exitwhen e==null
if UnitTypeNotDummy(e) and not IsUnitDead(e) and not IsUnitType(e,UNIT_TYPE_STRUCTURE) and GetUnitTypeId(e) != 'eCST' then
if Dist(x,y,x1,y1)<dist or dist==0. then
set dist=Dist(x,y,x1,y1)
set RangeUnit=e
endif
endif
call GroupRemoveUnit(DistToUnitG,e)
endloop
set e=null
if RangeUnit==null then
return null
endif
return RangeUnit
endfunction
//****************************************************
function B2S takes boolean b returns string
if (b) then
return "true"
endif
return "false"
endfunction
function GetClosest takes unit h,group g,real c returns unit
local unit tmp = null
local unit u = null
local real d = 0.
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set tmp = FirstOfGroup(P2)
if tmp != null then
set d = FDFD(h,tmp)
if d < c then
set c = d
set u = tmp
endif
endif
call GroupRemoveUnit(P2,tmp)
exitwhen tmp == null
endloop
return u
endfunction
/* function GetClosestDestructable takes unit h, real c returns destructable
local destructable tmp = null
local unit u = null
local group g
local real d = 0.
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set tmp = FirstOfGroup(P2)
if tmp != null then
set d = FDFD(h,tmp)
if d < c then
set c = d
set u = tmp
endif
endif
call GroupRemoveUnit(P2,tmp)
exitwhen tmp == null
endloop
return u
endfunction */
function PickRandomUnit takes group whichGroup returns unit
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
set bj_groupRandomConsidered = 0
set bj_groupRandomCurrentPick = null
call ForGroup(whichGroup, function GroupPickRandomUnitEnumJ)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(whichGroup)
endif
return bj_groupRandomCurrentPick
endfunction
function TriggerRegisterEnterRect takes trigger trig, rect r returns event
local region rectRegion = CreateRegion()
call RegionAddRect(rectRegion, r)
return TriggerRegisterEnterRegion(trig, rectRegion, null)
endfunction
function TriggerRegisterLeaveRect takes trigger trig, rect r returns event
local region rectRegion = CreateRegion()
call RegionAddRect(rectRegion, r)
return TriggerRegisterLeaveRegion(trig, rectRegion, null)
endfunction
//***************Начисление ресурсов
function AdjustPlayerStateSimpleJ takes player whichPlayer, playerstate whichPlayerState, integer delta returns nothing
call SetPlayerState(whichPlayer, whichPlayerState, GetPlayerState(whichPlayer, whichPlayerState) + delta)
endfunction
function AdjustPlayerStateJ takes integer delta, player whichPlayer, playerstate whichPlayerState returns nothing
// If the change was positive, apply the difference to the player's
// gathered resources property as well.
if (delta > 0) then
if (whichPlayerState == PLAYER_STATE_RESOURCE_GOLD) then
call AdjustPlayerStateSimpleJ(whichPlayer, PLAYER_STATE_GOLD_GATHERED, delta)
elseif (whichPlayerState == PLAYER_STATE_RESOURCE_LUMBER) then
call AdjustPlayerStateSimpleJ(whichPlayer, PLAYER_STATE_LUMBER_GATHERED, delta)
endif
endif
call AdjustPlayerStateSimpleJ(whichPlayer, whichPlayerState, delta)
endfunction
//*************************** Ручной ввод ошибки использования *****************************
function SimError takes player pfH,string pfi returns nothing
local sound lfI=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
if(GetLocalPlayer()==pfH)then
if(pfi!="")and(pfi!=null)then
call ClearTextMessages()
call DisplayTimedTextToPlayer(pfH,.5,-1.,2.,"|cffffcc00"+pfi+"|r")
endif
call StartSound(lfI)
endif
call KillSoundWhenDone(lfI)
endfunction
function DropOrder takes unit pfo returns nothing
call PauseUnit(pfo,true)
call IssueImmediateOrderById(pfo,OrderId("stop"))
call PauseUnit(pfo,false)
endfunction
//=========================//=========================//=========================
//========================= Add Effect to Time ==================================
//=========================//=========================//=========================
function DestroyEffectTimeToUnit takes nothing returns nothing
local integer id = GetHandleId(GetExpiredTimer())
local real time = LoadReal(Hash,id,2)
if time <= 0. or GetWidgetLife(LoadUnitHandle(Hash,id,3)) <= 0. then
call DestroyEffect(LoadEffectHandle(Hash,id,1))
call DestroyTimer(GetExpiredTimer())
call FlushChildHashtable(Hash,id)
endif
call SaveReal(Hash,id,2,time - .2)
endfunction
function AddEffectTimeToUnit takes string eff,unit u,string attach,real time returns nothing
local timer t = CreateTimer()
call SaveEffectHandle(Hash,GetHandleId(t),1,AddSpecialEffectTarget(eff,u,attach))
call SaveReal(Hash,GetHandleId(t),2,time)
call SaveUnitHandle(Hash,GetHandleId(t),3,u)
call TimerStart(t,.2,true, function DestroyEffectTimeToUnit)
set t = null
endfunction
function DestroyEffectTimeToPoint takes nothing returns nothing
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(GetExpiredTimer()),1))
call DestroyTimer(GetExpiredTimer())
call FlushChildHashtable(Hash,GetHandleId(GetExpiredTimer()))
endfunction
function AddEffectTimeToPoint takes string eff, real x, real y,real time returns nothing
local timer t = CreateTimer()
call SaveEffectHandle(Hash,GetHandleId(t),1,AddSpecialEffect(eff,x,y))
call TimerStart(t,time,false, function DestroyEffectTimeToPoint)
set t = null
endfunction
//**************** ПИНГ **********************************
function PingMinimapForForceExJ takes force whichForce, real x, real y, real duration, integer style, real red, real green, real blue returns nothing
local integer red255 = Percent255(red)
local integer green255 = Percent255(green)
local integer blue255 = Percent255(blue)
if (IsPlayerInForce(GetLocalPlayer(), whichForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
// Prevent 100% red simple and flashy pings, as they become "attack" pings.
if (red255 == 255) and (green255 == 0) and (blue255 == 0) then
set red255 = 254
endif
if (style == bj_MINIMAPPINGSTYLE_SIMPLE) then
call PingMinimapEx(x, y, duration, red255, green255, blue255, false)
elseif (style == bj_MINIMAPPINGSTYLE_FLASHY) then
call PingMinimapEx(x, y, duration, red255, green255, blue255, true)
elseif (style == bj_MINIMAPPINGSTYLE_ATTACK) then
call PingMinimapEx(x, y, duration, 255, 0, 0, false)
else
// Unrecognized ping style - ignore the request.
endif
//call StartSound(bj_pingMinimapSound)
endif
endfunction
function GetInventoryIndexOfItemTypeJ takes unit whichUnit, integer itemId returns integer
local integer index
local item indexItem
set index = 0
loop
set indexItem = UnitItemInSlot(whichUnit, index)
if (indexItem != null) and (GetItemTypeId(indexItem) == itemId) then
return index + 1
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
return 0
endfunction
function GetItemOfTypeFromUnitJ takes unit whichUnit, integer itemId returns item
local integer index = GetInventoryIndexOfItemTypeJ(whichUnit, itemId)
if (index == 0) then
return null
else
return UnitItemInSlot(whichUnit, index - 1)
endif
endfunction
//************* REPLACE UNIT replace unit ****************
function ReplaceUnitJ takes unit whichUnit, integer newUnitId, integer unitStateMethod returns unit
local unit oldUnit = whichUnit
local unit newUnit
local boolean wasHidden
local integer index
local item indexItem
local real oldRatio
// If we have bogus data, don't attempt the replace.
if (oldUnit == null) then
set bj_lastReplacedUnit = oldUnit
return oldUnit
endif
// Hide the original unit.
set wasHidden = IsUnitHidden(oldUnit)
call ShowUnit(oldUnit, false)
// Create the replacement unit.
if (newUnitId == 'ugol') then
set newUnit = CreateBlightedGoldmine(GetOwningPlayer(oldUnit), GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
else
set newUnit = CreateUnit(GetOwningPlayer(oldUnit), newUnitId, GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
endif
// Set the unit's life and mana according to the requested method.
if (unitStateMethod == bj_UNIT_STATE_METHOD_RELATIVE) then
// Set the replacement's current/max life ratio to that of the old unit.
// If both units have mana, do the same for mana.
if (GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE) > 0) then
set oldRatio = GetUnitState(oldUnit, UNIT_STATE_LIFE) / GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE)
call SetUnitState(newUnit, UNIT_STATE_LIFE, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_LIFE))
endif
if (GetUnitState(oldUnit, UNIT_STATE_MAX_MANA) > 0) and (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then
set oldRatio = GetUnitState(oldUnit, UNIT_STATE_MANA) / GetUnitState(oldUnit, UNIT_STATE_MAX_MANA)
call SetUnitState(newUnit, UNIT_STATE_MANA, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_MANA))
endif
elseif (unitStateMethod == bj_UNIT_STATE_METHOD_ABSOLUTE) then
// Set the replacement's current life to that of the old unit.
// If the new unit has mana, do the same for mana.
call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(oldUnit, UNIT_STATE_LIFE))
if (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then
call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(oldUnit, UNIT_STATE_MANA))
endif
elseif (unitStateMethod == bj_UNIT_STATE_METHOD_DEFAULTS) then
// The newly created unit should already have default life and mana.
elseif (unitStateMethod == bj_UNIT_STATE_METHOD_MAXIMUM) then
// Use max life and mana.
call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(newUnit, UNIT_STATE_MAX_LIFE))
call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(newUnit, UNIT_STATE_MAX_MANA))
else
// Unrecognized unit state method - ignore the request.
endif
// Mirror properties of the old unit onto the new unit.
//call PauseUnit(newUnit, IsUnitPaused(oldUnit))
call SetResourceAmount(newUnit, GetResourceAmount(oldUnit))
// If both the old and new units are heroes, handle their hero info.
if (IsUnitType(oldUnit, UNIT_TYPE_HERO) and IsUnitType(newUnit, UNIT_TYPE_HERO)) then
call SetHeroXP(newUnit, GetHeroXP(oldUnit), false)
set index = 0
loop
set indexItem = UnitItemInSlot(oldUnit, index)
if (indexItem != null) then
call UnitRemoveItem(oldUnit, indexItem)
call UnitAddItem(newUnit, indexItem)
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
endif
// Remove or kill the original unit. It is sometimes unsafe to remove
// hidden units, so kill the original unit if it was previously hidden.
if wasHidden then
call KillUnit(oldUnit)
call RemoveUnit(oldUnit)
else
call RemoveUnit(oldUnit)
endif
set bj_lastReplacedUnit = newUnit
return newUnit
endfunction
//************* REPLACE UNIT replace unit ****************
function ReplaceUnitMountain takes unit whichUnit, integer newUnitId, integer unitStateMethod, boolean remove returns unit
local unit oldUnit = whichUnit
local unit newUnit
local boolean wasHidden
local integer index
local item indexItem
local real oldRatio
// If we have bogus data, don't attempt the replace.
if (oldUnit == null) then
set bj_lastReplacedUnit = oldUnit
return oldUnit
endif
// Hide the original unit.
set wasHidden = IsUnitHidden(oldUnit)
call ShowUnit(oldUnit, false)
// Create the replacement unit.
if (newUnitId == 'ugol') then
set newUnit = CreateBlightedGoldmine(GetOwningPlayer(oldUnit), GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
else
set newUnit = CreateUnit(GetOwningPlayer(oldUnit), newUnitId, GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
endif
// Set the unit's life and mana according to the requested method.
if (unitStateMethod == bj_UNIT_STATE_METHOD_RELATIVE) then
// Set the replacement's current/max life ratio to that of the old unit.
// If both units have mana, do the same for mana.
if (GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE) > 0) then
set oldRatio = GetUnitState(oldUnit, UNIT_STATE_LIFE) / GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE)
call SetUnitState(newUnit, UNIT_STATE_LIFE, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_LIFE))
endif
if (GetUnitState(oldUnit, UNIT_STATE_MAX_MANA) > 0) and (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then
set oldRatio = GetUnitState(oldUnit, UNIT_STATE_MANA) / GetUnitState(oldUnit, UNIT_STATE_MAX_MANA)
call SetUnitState(newUnit, UNIT_STATE_MANA, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_MANA))
endif
elseif (unitStateMethod == bj_UNIT_STATE_METHOD_ABSOLUTE) then
// Set the replacement's current life to that of the old unit.
// If the new unit has mana, do the same for mana.
call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(oldUnit, UNIT_STATE_LIFE))
if (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then
call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(oldUnit, UNIT_STATE_MANA))
endif
elseif (unitStateMethod == bj_UNIT_STATE_METHOD_DEFAULTS) then
// The newly created unit should already have default life and mana.
elseif (unitStateMethod == bj_UNIT_STATE_METHOD_MAXIMUM) then
// Use max life and mana.
call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(newUnit, UNIT_STATE_MAX_LIFE))
call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(newUnit, UNIT_STATE_MAX_MANA))
else
// Unrecognized unit state method - ignore the request.
endif
// Mirror properties of the old unit onto the new unit.
//call PauseUnit(newUnit, IsUnitPaused(oldUnit))
call SetResourceAmount(newUnit, GetResourceAmount(oldUnit))
// If both the old and new units are heroes, handle their hero info.
if (IsUnitType(oldUnit, UNIT_TYPE_HERO) and IsUnitType(newUnit, UNIT_TYPE_HERO)) then
call SetHeroXP(newUnit, GetHeroXP(oldUnit), false)
set index = 0
loop
set indexItem = UnitItemInSlot(oldUnit, index)
if (indexItem != null) then
call UnitRemoveItem(oldUnit, indexItem)
call UnitAddItem(newUnit, indexItem)
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
endif
// Remove or kill the original unit. It is sometimes unsafe to remove
// hidden units, so kill the original unit if it was previously hidden.
if wasHidden then
call KillUnit(oldUnit)
call RemoveUnit(oldUnit)
else
call RemoveUnit(oldUnit)
endif
set bj_lastReplacedUnit = newUnit
return newUnit
endfunction
function CountUnitsInGroupEnumJ takes nothing returns nothing
set bj_groupCountUnits = bj_groupCountUnits + 1
endfunction
function CountUnitsInGroupJ takes group g returns integer
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
set bj_groupCountUnits = 0
call ForGroup(g, function CountUnitsInGroupEnumJ)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(g)
endif
return bj_groupCountUnits
endfunction
function String2OrderId takes string orderIdString returns integer
local integer orderId
// Check to see if it's a generic order.
set orderId = OrderId(orderIdString)
if (orderId != 0) then
return orderId
endif
// Check to see if it's a (train) unit order.
set orderId = UnitId(orderIdString)
if (orderId != 0) then
return orderId
endif
// Unrecognized - return 0
return 0
endfunction
function TextTagSize2HeightJ takes real size returns real
return size * 0.023 / 10
endfunction
function SetTextTagTextJ takes texttag tt, string s, real size returns nothing
local real textHeight = TextTagSize2HeightJ(size)
call SetTextTagText(tt, s, textHeight)
endfunction
function ForGroupJ takes group whichGroup, code callback returns nothing
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
call ForGroup(whichGroup, callback)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(whichGroup)
endif
endfunction
function TerrainDeformationRippleJ takes real duration, boolean limitNeg, real x, real y, real startRadius, real endRadius, real depth, real wavePeriod, real waveWidth returns terraindeformation
local real spaceWave
local real timeWave
local real radiusRatio
if (endRadius <= 0 or waveWidth <= 0 or wavePeriod <= 0) then
return null
endif
set timeWave = 2.0 * duration / wavePeriod
set spaceWave = 2.0 * endRadius / waveWidth
set radiusRatio = startRadius / endRadius
set bj_lastCreatedTerrainDeformation = TerrainDeformRipple(x, y, endRadius, depth, R2I(duration * 1000), 1, spaceWave, timeWave, radiusRatio, limitNeg)
return bj_lastCreatedTerrainDeformation
endfunction
function PatrolsEnemy_Expr takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO) //and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function PatrolsEnemy_ExprHeroesIncluded takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11)) /*
*/ and not IsUnitInvisible(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) //and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function Initiation_GettingUnit takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and (IsUnitInGroup(GetFilterUnit(),MilitiaGroup) or GetUnitTypeId(GetFilterUnit()) == steamtank) and not IsUnitDead(GetFilterUnit()) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO) and not IsUnitInGroup(GetFilterUnit(),InitiationG)
endfunction
function Initiation_GettingEnemy takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11))
endfunction
function Revelation_F takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11)) and not IsUnitDead(GetFilterUnit())
endfunction
function SteamTank_F takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11)) and not IsUnitDead(GetFilterUnit()) and IsUnitVisible(GetFilterUnit(),Player(11))
endfunction
function Paladins_Filter takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and IsUnitInGroup(GetFilterUnit(),Paladins) and not IsUnitDead(GetFilterUnit())
endfunction
function Undead_Filter takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and ((IsUnitOwnedByPlayer(GetFilterUnit(),Player(6)) or IsUnitOwnedByPlayer(GetFilterUnit(),Player(7)) or IsUnitOwnedByPlayer(GetFilterUnit(),Player(8))/*
*/ or IsUnitOwnedByPlayer(GetFilterUnit(),Player(9)) or IsUnitOwnedByPlayer(GetFilterUnit(),Player(10))) and not IsUnitDead(GetFilterUnit()) )
endfunction
function Footman_Expr takes nothing returns boolean
return GetOwningPlayer(GetFilterUnit()) == Player(11) and (GetUnitTypeId(GetFilterUnit()) == footman or GetUnitTypeId(GetFilterUnit()) == captain or GetUnitTypeId(GetFilterUnit()) == 'h008' )
endfunction
function Tower_Expr takes nothing returns boolean
return (GetOwningPlayer(GetFilterUnit()) == Player(11) or GetOwningPlayer(GetFilterUnit()) == Player(5)) and (GetUnitTypeId(GetFilterUnit()) == tower or GetUnitTypeId(GetFilterUnit()) == towerguard)
endfunction
function ShadowsGroup_F takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit())
endfunction
function SoulLust_F takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitAlly(GetFilterUnit(),Player(10)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)
endfunction
function AltIcon_Shop takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and GetUnitTypeId(GetFilterUnit()) == 'hvlt'
endfunction
function HeroAroundOrQuest takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and (IsPlayerInForce(GetOwningPlayer(GetFilterUnit()),HumanForce) or IsPlayerInForce(GetOwningPlayer(GetFilterUnit()),UndeadForce)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO) and IsUnitInGroup(GetFilterUnit(),QuestGroup) //and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function RaidAttackFilter takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and (IsPlayerInForce(GetOwningPlayer(GetFilterUnit()),HumanForce) or IsPlayerInForce(GetOwningPlayer(GetFilterUnit()),UndeadForce)) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO) and not IsPlayerInForce(GetOwningPlayer(GetFilterUnit()),UndeadForce) //and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function GreatSourcesDealAuraEnemyFilter takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(6)) //and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction
function PlaySoundAtPoint takes string f, real x, real y returns nothing
local sound s = CreateSound( f, false, true, true, 10, 10, "" )
call SetSoundDuration( s, GetSoundFileDuration(f) )
call SetSoundChannel( s, 0 )
call SetSoundVolume( s, 127 )
call SetSoundPitch( s, 1.0 )
call SetSoundPosition(s, x, y, 0)
call StartSound(s)
call KillSoundWhenDone(s)
set s = null
endfunction
function PlaySoundAtPointEx takes string f, real x, real y, real distance,integer volume returns nothing
local sound s = CreateSound( f, false, true, true, 10, 10, "" )
call SetSoundDuration( s, GetSoundFileDuration(f) )
call SetSoundChannel( s, 0 )
call SetSoundVolume( s, volume )
call SetSoundPitch( s, 1.0 )
call SetSoundPosition(s, x, y, 0)
call SetSoundDistanceCutoff(s, distance)
call StartSound(s)
call KillSoundWhenDone(s)
set s = null
endfunction
function Rain_Filter takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(10))
endfunction
function Radiance_Filter takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11))
endfunction
//*************************************************************************************
//*
//* Escort by Almia
//*
//*************************************************************************************
//*
//* Artificial Intelligence System Member
//*
//* Allows you to apply an escort to a unit. The system is mainly created
//* for summoned AI units. You can use non-summon units if you want(esp. custom
//* summon spells such as with the action Create Unit)
//*
//*************************************************************************************
//*
//* API
//*
//* function AddEscort takes unit s, unit m returns nothing
//* s = summon : summoned unit
//* m = master : summoning unit
//* - applies "s" as an escort of "m"
//* - can also work on other units not just summons.
//*
//*************************************************************************************
//*
//* Credits
//*
//* mckill2009 - SummonedEscort, the code where the system was based on.
//* - I converted this to JASS and also optimized some parts of it.
//*
//* Sylvenon - GetClosestUnit snippet
//*
//*************************************************************************************
//*
//* GetClosestUnit
//* - retrieves the closest unit from a coordinate.
//*
//*************************************************************************************
function GetClosestUnit2 takes real x, real y, boolexpr e returns unit
local real md = 100000
local real d
local group g = CreateGroup()
local unit u
local real dx
local real dy
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, e)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
set dx = GetUnitX(u) - x
set dy = GetUnitY(u) - y
if (dx * dx + dy * dy) / 100000 < md then
set udg_ClosestUnit = u
set md = (dx * dx + dy * dy) / 100000
endif
endloop
call DestroyGroup(g)
call DestroyBoolExpr(e)
set g = null
return udg_ClosestUnit
endfunction
//*************************************************************************************
//*
//* GetClosestUnitInRange
//* - retrieves the closest unit from a coordinate in a given radius/range.
//*
//*************************************************************************************
function GetClosestUnitInRange2 takes real x, real y, real range, boolexpr e returns unit
local real md = 100000
local real d
local group g = CreateGroup()
local unit u
local real dx
local real dy
local real r
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, e)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
set dx = GetUnitX(u) - x
set dy = GetUnitY(u) - y
set r = (dx * dx + dy * dy)
if r / 100000 < md and r < range * range then
set udg_ClosestUnit = u
set md = (dx * dx + dy * dy) / 100000
endif
endloop
call DestroyGroup(g)
call DestroyBoolExpr(e)
set g = null
return udg_ClosestUnit
endfunction
//*************************************************************************************
//*
//* SETTINGS
//*
//*************************************************************************************
//*
//* Escort Periodic Interval value
//*
//*************************************************************************************
constant function EscortInterval takes nothing returns real
return 1.
endfunction
//*************************************************************************************
//*
//* Escort Auto Run
//* - if true, automatically applies summoned units as an escort.
//*
//*************************************************************************************
constant function EscortAutoRun takes nothing returns boolean
return true
endfunction
//*************************************************************************************
//*
//* Escort Search New Owner
//* - if true, summoned unit who lost its master searches a new owner.
//*
//*************************************************************************************
constant function EscortSearchNewOwner takes nothing returns boolean
return true
endfunction
//*************************************************************************************
//*
//* Escort Allow Ally Player
//* - if true, summoned units will find the nearest ally unit owned by an ally
//* player or the player that owns it.
//*
//*************************************************************************************
constant function EscortAllowAllyPlayer takes nothing returns boolean
return false
endfunction
//*************************************************************************************
//*
//* Escort Follow Hero
//* - if true, summoned units will find the nearest ally unit owned by an ally
//* player or the player that owns it that must be a hero.
//*
//*************************************************************************************
constant function EscortFollowHero takes nothing returns boolean
return true
endfunction
//*************************************************************************************
//*
//* Escort Follow Structures
//* - if true, summoned units will find the nearest ally unit owned by an ally
//* player or the player that owns it that must be a structure.
//*
//*************************************************************************************
constant function EscortFollowStructures takes nothing returns boolean
return false
endfunction
//*************************************************************************************
//*
//* Escort Offset
//* - distance of the escort from its master(max). Doesn't affect the summons if
//* it has a current order such as attacking.
//*
//*************************************************************************************
constant function EscortOffset takes nothing returns real
return 200.0
endfunction
//*************************************************************************************
//*
//* Escort Closest Ally
//* - maximum distance where the summons will search their new owner. Depends on
//* the boolean EscortSearchNewOwner.
//*
//*************************************************************************************
constant function EscortClosestAlly takes nothing returns real
return 1800.0 //400
endfunction
//*************************************************************************************
//*
//* Escort Closest Enemy
//* - range of the escort where it will acquire a target.
//*
//*************************************************************************************
constant function EscortClosestEnemy takes nothing returns real
return 600.0
endfunction
//*************************************************************************************
//*
//* Alive Filter
//*
//*************************************************************************************
function EscortAliveFilter takes unit u returns boolean
return not (GetUnitTypeId(u) == 0 and null == u and IsUnitType(u, UNIT_TYPE_DEAD))
endfunction
//*************************************************************************************
//*
//* Escort Ally Filter
//*
//*************************************************************************************
function EscortAllyFilter takes nothing returns boolean
local boolean b
local boolean b2
set udg_Escort_TempU = GetFilterUnit()
set b = EscortAliveFilter(udg_Escort_TempU) and udg_Escort_TempU != udg_Escort_Summon[udg_Escort_Data] and GetUnitMoveSpeed(udg_Escort_TempU) > 0
set b2 = IsUnitType(udg_Escort_TempU, UNIT_TYPE_STRUCTURE)
if EscortFollowStructures() then
set b = b and b2
else
set b = b and not b2
endif
if EscortFollowHero() and not b2 then
set b = b and IsUnitType(udg_Escort_TempU, UNIT_TYPE_HERO)
endif
if EscortAllowAllyPlayer() then
return b and IsUnitAlly(udg_Escort_TempU, udg_Escort_Player[udg_Escort_Data])
else
return b and udg_Escort_Player[udg_Escort_Data] == GetOwningPlayer(udg_Escort_TempU)
endif
endfunction
//*************************************************************************************
//*
//* Escort Enemy Filter
//*
//*************************************************************************************
function EscortEnemyFilter takes nothing returns boolean
set udg_Escort_TempU = GetFilterUnit()
return IsUnitEnemy(udg_Escort_TempU, udg_Escort_Player[udg_Escort_Data]) and EscortAliveFilter(udg_Escort_TempU)
endfunction
//*************************************************************************************
//*
//* Escort Loop
//*
//*************************************************************************************
function EscortLoop takes nothing returns nothing
local unit t
local integer order
local real a
local real mx
local real my
local real sx
local real sy
set udg_Escort_Data = udg_Escort_N[0]
loop
exitwhen 0 == udg_Escort_Data
if EscortAliveFilter(udg_Escort_Summon[udg_Escort_Data]) then
// Random attack offset.
set a = GetRandomReal(0, 6.28318)
set order = GetUnitCurrentOrder(udg_Escort_Summon[udg_Escort_Data])
if EscortAliveFilter(udg_Escort_Master[udg_Escort_Data]) then
if 0 == order then
// Acquire new attack offset
set mx = GetUnitX(udg_Escort_Master[udg_Escort_Data]) + EscortOffset() * Cos(a)
set my = GetUnitY(udg_Escort_Master[udg_Escort_Data]) + EscortOffset() * Sin(a)
// Order summon to attack the acquired offset
call IssuePointOrderById(udg_Escort_Summon[udg_Escort_Data], 851983, mx, my)
// Get nearest unit and set it as its target.
set t = GetClosestUnitInRange2(mx, my, EscortClosestEnemy(), Filter(function EscortEnemyFilter))
if null != t then
if IsUnitType(t,UNIT_TYPE_SLEEPING) then
// if unit is sleeping, attack target.
call IssueTargetOrderById(udg_Escort_Summon[udg_Escort_Data], 851983, t)
else
// attack-move to the target.
call IssuePointOrderById(udg_Escort_Summon[udg_Escort_Data], 851983, GetUnitX(t), GetUnitY(t))
endif
set t = null
endif
endif
else
// if master is dead, acquire new master.
set sx = GetUnitX(udg_Escort_Summon[udg_Escort_Data])
set sy = GetUnitY(udg_Escort_Summon[udg_Escort_Data])
if EscortSearchNewOwner() then
set udg_Escort_Master[udg_Escort_Data] = GetClosestUnitInRange2(sx, sy, EscortClosestAlly(), Filter(function EscortAllyFilter))
else
set udg_Escort_Master[udg_Escort_Data] = GetClosestUnit2(sx, sy, Filter(function EscortAllyFilter))
endif
// if alive and no orders, attack-move to the new master's position.
if null != udg_Escort_Master[udg_Escort_Data] and 0 == order then
call IssuePointOrderById(udg_Escort_Summon[udg_Escort_Data], 851983, udg_Escort_UnitX[udg_Escort_Data] + EscortOffset() * Cos(a), udg_Escort_UnitY[udg_Escort_Data] + EscortOffset() * Sin(a))
endif
endif
else
set udg_Escort_N[udg_Escort_P[udg_Escort_Data]] = udg_Escort_N[udg_Escort_Data]
set udg_Escort_P[udg_Escort_N[udg_Escort_Data]] = udg_Escort_P[udg_Escort_Data]
// Move last indexed variables to the to-be-allocated index.
set udg_Escort_Summon[udg_Escort_Data] = null
set udg_Escort_Master[udg_Escort_Data] = null
set udg_Escort_UnitX[udg_Escort_Data] = 0
set udg_Escort_UnitY[udg_Escort_Data] = 0
set udg_Escort_Player[udg_Escort_Data] = null
// Decrement count
set udg_Escort_Count = udg_Escort_Count - 1
// Pause if count is equal to 0
if 0 == udg_Escort_Count then
call PauseTimer(udg_EscortTimer)
endif
endif
set udg_Escort_Data = udg_Escort_N[udg_Escort_Data]
endloop
endfunction
//*************************************************************************************
//*
//* Add Escort
//*
//*************************************************************************************
function AddEscort takes unit s, unit m returns nothing
local integer i = GetUnitUserData(s)
set udg_Escort_Master[i] = m
set udg_Escort_UnitX[i] = GetUnitX(m)
set udg_Escort_UnitY[i] = GetUnitY(m)
set udg_Escort_Player[i] = GetOwningPlayer(s)
if not udg_Escort_IsInLoop[i] then
set udg_Escort_Summon[i] = s
set udg_Escort_N[i] = 0
set udg_Escort_P[i] = 0
set udg_Escort_N[udg_Escort_P[0]] = i
set udg_Escort_P[0] = i
set udg_Escort_Count = udg_Escort_Count + 1
if 1 == udg_Escort_Count then
call TimerStart(udg_EscortTimer, EscortInterval(), true, function EscortLoop)
endif
call RemoveGuardPosition(s)
endif
endfunction
//*************************************************************************************
//*
//* Escort Run Auto-Add Escort
//*
//*************************************************************************************
function EscortRun takes nothing returns boolean
call AddEscort(GetSummonedUnit(), GetSummoningUnit())
return false
endfunction
//*************************************************************************************
//*
//* Escort Init
//*
//*************************************************************************************
function EscortInit takes nothing returns nothing
local trigger t
set udg_EscortTimer = CreateTimer()
if EscortAutoRun() then
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(t, Condition(function EscortRun))
set t = null
endif
endfunction
function IsCitizensNearby takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitInGroup(GetFilterUnit(),CilivianzGroup)
endfunction
function IsCitizen takes unit u returns boolean
return UnitTypeNotDummy(u) and not IsUnitDead(u) and IsUnitInGroup(u,CilivianzGroup)
endfunction
function ToBeRaided_F takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and (IsUnitInGroup(GetFilterUnit(),CilivianzGroup) or GetOwningPlayer(GetFilterUnit()) == Player(11))
endfunction
function EnterMap_F takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) and GetUnitTypeId(GetFilterUnit()) != 'e001'
endfunction
function IsDreadLord_Nearby takes nothing returns boolean
return UnitTypeNotDummy(GetFilterUnit()) and not IsUnitDead(GetFilterUnit()) and IsUnitInGroup(GetFilterUnit(),DreadLords)
endfunction
function RectFromCenterSizeJ takes real x, real y, real width, real height returns rect
return Rect( x - width*0.5, y - height*0.5, x + width*0.5, y + height*0.5 )
endfunction
Name | Type | is_array | initial_value |
CastBar_Expires | real | No | |
ChangeColorGP | group | No | |
ClosestUnit | unit | No | |
CP_HiddenItems | item | Yes | |
CP_HiddenItemsIndex | integer | No | |
CP_Item | item | No | |
CP_Point | location | No | |
CP_PointIsWalkable | boolean | No | |
CP_Rect | rect | No | |
Escort_Count | integer | No | |
Escort_Data | integer | No | |
Escort_IsInLoop | boolean | Yes | |
Escort_Master | unit | Yes | |
Escort_N | integer | Yes | |
Escort_P | integer | Yes | |
Escort_Player | player | Yes | |
Escort_Summon | unit | Yes | |
Escort_TempU | unit | No | |
Escort_UnitX | real | Yes | |
Escort_UnitY | real | Yes | |
EscortTimer | timer | No | |
EVENT_MISSILE_COLLIDE_DEST | integer | No | |
EVENT_MISSILE_COLLIDE_UNIT | integer | No | |
EVENT_MISSILE_FINISH | integer | No | |
EVENT_MISSILE_NOTHING | integer | No | |
EVENT_MISSILE_PERIODIC | integer | No | |
EVENT_MISSILE_REMOVE | integer | No | |
group | group | No | |
grouptest | group | No | |
HandleID | handle | No | |
Height | real | No | |
IsUnitPreplaced | boolean | Yes | |
Last_Selected | unit | No | |
Missile__Acceleration | real | No | |
Missile__Angle | real | No | |
Missile__Arc | real | No | |
Missile__Collision | real | No | |
Missile__Curve | real | No | |
Missile__Damage | real | No | |
Missile__Data | integer | No | |
Missile__DestructableHit | destructable | No | |
Missile__Distance | real | No | |
Missile__Dummy | unit | No | |
Missile__DummyTypeId | unitcode | No | |
Missile__EventId | integer | No | |
Missile__EventIndex | integer | No | |
Missile__FlyTime | real | No | |
Missile__Height | real | No | |
Missile__Impact | location | No | |
Missile__ImpactZ | real | No | |
Missile__Index | integer | No | |
Missile__Model | string | No | |
Missile__OnCollideDestructable | trigger | No | |
Missile__OnCollideUnit | trigger | No | |
Missile__OnFinish | trigger | No | |
Missile__OnPeriodic | trigger | No | |
Missile__OnRemove | trigger | No | |
Missile__Open | real | No | |
Missile__Origin | location | No | |
Missile__OriginZ | real | No | |
Missile__Owner | player | No | |
Missile__Recycle | boolean | No | |
Missile__Scale | real | No | |
Missile__Source | unit | No | |
Missile__Speed | real | No | |
Missile__Target | unit | No | |
Missile__TempLoc | location | No | |
Missile__Turn | real | No | |
Missile__UnitHit | unit | No | |
Missile__WantDestroy | boolean | No | |
Missile_A_Z | real | Yes | |
Missile_AB_Angle | real | Yes | |
Missile_AB_Distance | real | Yes | |
Missile_AB_Pitch | real | Yes | |
Missile_AB_Square | real | Yes | |
Missile_AB_Traveled | real | Yes | |
Missile_Acceleration | real | Yes | |
Missile_Angle | real | Yes | |
Missile_Arc | real | Yes | |
Missile_B_Z | real | Yes | |
Missile_Collision | real | Yes | |
Missile_Curve | real | Yes | |
Missile_CurveX | real | Yes | |
Missile_CurveY | real | Yes | |
Missile_Damage | real | Yes | |
Missile_Data | integer | Yes | |
Missile_Distance | real | Yes | |
Missile_Dummy | unit | Yes | |
Missile_Effect | effect | Yes | |
Missile_FlyTime | real | Yes | |
Missile_Height | real | Yes | |
Missile_ImpactX | real | Yes | |
Missile_ImpactY | real | Yes | |
Missile_ImpactZ | real | Yes | |
Missile_Model | string | Yes | |
Missile_OnDest | trigger | Yes | |
Missile_OnFinish | trigger | Yes | |
Missile_OnPeriodic | trigger | Yes | |
Missile_OnRemove | trigger | Yes | |
Missile_OnUnit | trigger | Yes | |
Missile_Open | real | Yes | |
Missile_OriginX | real | Yes | |
Missile_OriginY | real | Yes | |
Missile_OriginZ | real | Yes | |
Missile_Owner | player | Yes | |
Missile_PosX | real | Yes | |
Missile_PosY | real | Yes | |
Missile_PosZ | real | Yes | |
Missile_PrevX | real | Yes | |
Missile_PrevY | real | Yes | |
Missile_Recycle | boolean | Yes | |
Missile_Scale | real | Yes | |
Missile_Source | unit | Yes | |
Missile_Speed | real | Yes | |
Missile_Target | unit | Yes | |
Missile_TerrainZ | real | Yes | |
Missile_Turn | real | Yes | |
Missile_WantDestroy | boolean | Yes | |
MissileAllocated | boolean | Yes | |
MissileCore | trigger | No | |
MissileDummyCount | integer | No | |
MissileDummyStack | unit | Yes | |
MissileDummyTime | integer | Yes | |
MissileDummyTimer | timer | No | |
MissileGroup | group | No | |
MissileHash | hashtable | No | |
MissileLaunched | boolean | Yes | |
MissileLocZ | location | No | |
MissileMaxX | integer | No | |
MissileMaxY | integer | No | |
MissileMinX | integer | No | |
MissileMinY | integer | No | |
MissileNextNode | integer | Yes | |
MissileNodes | integer | No | |
MissilePrevNode | integer | Yes | |
MissileRect | rect | No | |
MissileRecycler | integer | Yes | |
MissileTimer | timer | No | |
MS_AoEorSIboolean1 | boolean | No | |
MS_AttackType1 | attacktype | No | |
MS_Damage1 | real | No | |
MS_DamageOrHealDone1 | real | No | |
MS_DamageType1 | damagetype | No | |
MS_Heal1 | real | No | |
MS_HealAndDamageBoolean1 | boolean | No | |
MS_ImpactRadius1 | real | No | |
MS_MissileH1 | real | No | |
MS_MissileSpeed1 | real | No | |
MS_ModelofDummy | modelfile | No | |
MS_ModelSize | real | No | |
MS_parabolaBoolean1 | boolean | No | |
MS_SfxOnImpact1 | string | No | |
MS_Source1 | unit | No | |
MS_Target1 | unit | No | |
PlayerIndex | integer | No | |
Point | location | No | |
ProgressBarSpeed | real | No | |
Projectile_AoE | real | No | |
Projectile_AttackType | attacktype | No | |
Projectile_Damage | real | No | |
Projectile_DamageType | damagetype | No | |
Projectile_DestroyTree | boolean | No | |
Projectile_HArc | boolean | No | |
Projectile_HArcLeftOrRight | boolean | No | |
Projectile_HArcWidth | real | No | |
Projectile_Height | real | No | |
Projectile_Impact | string | No | |
Projectile_Model | modelfile | No | |
Projectile_Size | real | No | |
Projectile_Source | unit | No | |
Projectile_Speed | real | No | |
Projectile_TargetPoint | location | No | |
Projectile_TargetUnit | unit | No | |
Projectile_Trigger | trigger | No | |
Projectile_UnitOrPoint | boolean | No | |
Projectile_VArc | boolean | No | |
Projectile_VArcHeight | real | No | |
SurviveTD | timer | No | |
Temp_Group | group | No | |
TempPoint | location | No | |
tes_g | group | No | |
to | integer | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
WithinRange__DeRegister | trigger | No | |
WithinRangeEnteringUnit | unit | No | |
WithinRangeEvent | real | No | |
WithinRangeHash | hashtable | No | |
WithinRangeRange | real | No | |
WithinRangeUnit | unit | No | |
WithinRangeUsers | group | No | |
WithinRangeWanted_Event | real | No | |
WithinRangeWanted_Filter | boolexpr | No | |
WithinRangeWanted_Keep | boolean | No | |
WithinRangeWanted_Trigger | trigger | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope PreloadScope initializer TriggerPreload
function DreadLords_Start4 takes nothing returns nothing
local rect r
// cy echo("ss")
/* set Ass341 = CreateLeaderboard()
call LeaderboardSetLabel(Ass341, "Handle Counter")
call PlayerSetLeaderboard(GetLocalPlayer(),Ass341)
call LeaderboardDisplay(Ass341,true)
call LeaderboardAddItem(Ass341,"Handles",0,Player(0))
call SetSizeByItemCount(Ass341,1) */
//call CinematicModeExBJ(false, UndeadForce, bj_CINEMODE_INTERFACEFADE)
//call CinematicModeExBJ(false, UndeadForce, bj_CINEMODE_INTERFACEFADE)
call CameraSetSmoothingFactor( 3.00 )
//if not PlayerIsActive(Player(7)) then // тест - даем доп. героя
// call SetPlayerAllianceStateBJ( Player(7), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
//endif
set F = CreateUnit(Player(6),'e003',11700.,11300.,0)
call UnitApplyTimedLife(F,'BTLF',16)
set I = 6
loop
exitwhen I > 9
//call echo("meee")
if (PlayerInGame[I] and not PlayerHasLost[I]) or TEST == true then // and not
set Bol = false
loop
set I2 = GetRandomInt(1,9)
//set I2 = 4 тест
//set I2 = 1
if SpawnEngaged[I2] != true then
set SpawnEngaged[I2] = true
set r = Spawn[I2]
set Bol = true
endif
exitwhen Bol == true
endloop
//call echo(" creating missle " + I2S(I))
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Owner = Player(I)
set udg_Missile__Origin = GetUnitLoc(gg_unit_e006_0591)
set udg_Missile__OriginZ = 290.
set udg_Missile__Impact = Location(GetRectCenterX(r), GetRectCenterY(r))
set udg_Missile__ImpactZ = 290.00
set udg_Missile__Speed = 700.00 //700
set udg_Missile__Scale = 1.4
set udg_Missile__Arc = 1
set udg_Missile__Model = "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl"
set udg_Missile__OnFinish = gg_trg_DreadLordPitCreating
// set udg_Missile__Data = I
set DreadSpawnInteger[I] = I2
//call echo(I2S(I))
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
// if I == 6 then
// call echo("still for 6")
// endif
//call echo("sssddd")
if (GetLocalPlayer() == Player(I)) then
call PanCameraToTimed(GetRectCenterX(r), GetRectCenterY(r), DistanceXY(GetUnitX(gg_unit_e006_0591),GetUnitY(gg_unit_e006_0591),GetRectCenterX(r), GetRectCenterY(r))/690)
endif
else
//call GroupRemoveUnit
call FlushChildHashtable(Hash,GetHandleId(HERO[I]))
call RemoveUnit(HERO[I])
endif
I++
endloop
//call echo("end")
//if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then //+++++ REMOVING FOG MASK TO ALLOW PLAYER LOOK FOR MISSLE
//call FogEnable(false)
//call FogMaskEnable(false)
//endif
call KillUnit( gg_unit_e006_0591 )
call DestroyTimer(GetExpiredTimer())
set r = null
endfunction
function DreadLords_Start33 takes nothing returns nothing
set I = 6
loop
exitwhen I > 10
if GetLocalPlayer() == Player(I) then
call ResetToGameCamera(3.25)
endif
I++
endloop
call TimerStart(GetExpiredTimer(), 3.25, false, function DreadLords_Start4)
endfunction
function DreadLords_Start3 takes nothing returns nothing
if IsPlayerInForce(GetLocalPlayer(), UndeadForce) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call CameraSetupApplyForceDuration(gg_cam_CryptCam4, true, 5.25) //cryptcam3
endif
set I=6
loop
exitwhen I>9
set T = LoadTimerHandle(Hash,GetHandleId(GetExpiredTimer()),0)
call PauseTimer(T)
call DestroyTimer(T)
call RemoveSavedHandle(Hash,GetHandleId(GetExpiredTimer()),0)
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Owner = Player(I)
set udg_Missile__Origin = GetUnitLoc(HERO[I])
set udg_Missile__OriginZ = 0.
set udg_Missile__Impact = Location(11770.,11900.)
set udg_Missile__ImpactZ = 200.00
set udg_Missile__Speed = 900.00 //700
set udg_Missile__Scale = 1.3
set udg_Missile__Arc = 1
set udg_Missile__Model = "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl"
//if I == 6 then
set udg_Missile__OnFinish = gg_trg_DreadPreparedToMissle
//endif
call TriggerExecute( gg_trg_Missile )
I++
endloop
call TimerStart(GetExpiredTimer(), 4.65, false, function DreadLords_Start33)
endfunction
function DreadLords_Start2 takes nothing returns nothing
if IsPlayerInForce(GetLocalPlayer(), UndeadForce) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call CameraSetupApplyForceDuration(gg_cam_CryptCam3, true, 5.25) //cryptcam3
endif
set F = CreateUnit(Player(6),'e001',GetUnitX(HERO[6]), GetUnitY(HERO[6]),0)
call UnitApplyTimedLife(F,'BTLF',13.2)
call SaveReal(Hash,GetHandleId(HERO[6]),StringHash("DSD_trsp"),255)
call GroupAddUnit(DSgroupDread,HERO[6])
call SaveReal(Hash,GetHandleId(HERO[7]),StringHash("DSD_trsp"),255)
call GroupAddUnit(DSgroupDread,HERO[7])
call SaveReal(Hash,GetHandleId(HERO[8]),StringHash("DSD_trsp"),255)
call GroupAddUnit(DSgroupDread,HERO[8])
call SaveReal(Hash,GetHandleId(HERO[9]),StringHash("DSD_trsp"),255)
call GroupAddUnit(DSgroupDread,HERO[9])
call TimerStart(GetExpiredTimer(), 5.25, false, function DreadLords_Start3)
endfunction
function AddEffectDread takes nothing returns nothing
set T = GetExpiredTimer()
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",/*
*/GetRandomReal(GetRectMinX(gg_rct_DreadLordsStartingRegion), GetRectMaxX(gg_rct_DreadLordsStartingRegion)), GetRandomReal(GetRectMinY(gg_rct_DreadLordsStartingRegion), GetRectMaxY(gg_rct_DreadLordsStartingRegion))))
endfunction
function reset_source takes nothing returns nothing
local timer t = GetExpiredTimer()
call SetUnitAnimation(GreatSourcePortal,"stand")
call DestroyTimer(t)
set t = null
endfunction
function DreadLords_Start takes nothing returns nothing
if 1 == 1 then
//+++++++++++++++++++Dreadlord Cinematic
if IsPlayerInForce(GetLocalPlayer(), UndeadForce) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call CameraSetupApplyForceDuration(gg_cam_CryptCam22, true, 5.85)
endif
set T = CreateTimer()
call TimerStart(T,1.,true,function AddEffectDread)
call SaveTimerHandle(Hash,GetHandleId(GetExpiredTimer()),0,T)
call TimerStart(GetExpiredTimer(), 5.85, false, function DreadLords_Start2)
endif
set GreatSourcePortal = CreateUnit(Player(10),'e00L',GetUnitX(MasterMind), GetUnitY(MasterMind),0)
call SetUnitAnimation(GreatSourcePortal,"birth")
call TimerStart(CreateTimer(),0.25,false,function reset_source)
endfunction
function Connection_Set takes nothing returns nothing
local integer i = 0
local group g
local string s = ""
local integer lvl
call DestroyTimer(GetExpiredTimer())
set T1Nplayer = 0
set T2Nplayer = 0
//call echo("BOBOOBOB")
call GroupAddUnit(ZiccuratDefenseGroup,gg_unit_uzg2_0368) // ziccurat hp regen
call GroupAddUnit(ZiccuratDefenseGroup,gg_unit_uzg2_0903)
call GroupAddUnit(ZiccuratDefenseGroup,gg_unit_uzg2_0901)
call GroupAddUnit(ZiccuratDefenseGroup,gg_unit_uzg2_0902)
// end test options
call SetPlayerAllianceStateBJ( Player(4), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED )
call SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(4), bj_ALLIANCE_ALLIED )
loop
exitwhen i > 11
// if GetPlayerController(Player(i))!=MAP_CONTROL_COMPUTER then
if TEST == true or PlayerIsActive(Player(i)) then // PlayerIsActive(Player(i)) or (i== 6 or i == 7 or i == 8 or i ==9)
// call echo("ONE MOORE TIIIIIME")
set PlayerInGame[i] = true
call ForceAddPlayer(PlayerForce,Player(i))
//elseif i != 1 and i != 7 then
// call RemoveUnit(HERO[i])
/*
if i < 4 then
set PalLack = PalLack + 1
else
set DreadLack = DreadLack + 1
endif */
// endif
// endif
//call echo("Я тут")
//+++++++++++Adding players to forces
if i == 0 or i == 1 or i == 2 or i == 3 then
T1Nplayer++
PaladinsCount++
call ForceAddPlayer(HumanForce, Player(i))
elseif i == 6 or i == 7 or i == 8 or i == 9 then
// call echo("yes baby it's triple")
T2Nplayer++
//DreadLordsCount++
call ForceAddPlayer(UndeadForce, Player(i))
endif
else
if i == 1 or i == 2 or i == 3 or i == 0 then
//call ForceAddPlayer(HumanForce, Player(i))
call GroupRemoveUnit(Paladins,HERO[i])
call RemoveUnit(HERO[i])
endif // <--
if i == 0 then
call RemoveUnit(gg_unit_nmrk_0784)
elseif i == 1 then
call RemoveUnit(gg_unit_nmrk_0087)
elseif i == 2 then
call RemoveUnit(gg_unit_nmrk_0785)
elseif i == 3 then
call RemoveUnit(gg_unit_nmrk_0786)
endif
endif
if i == 5 or i == 11 then
//call echo("+")
call ForceAddPlayer(HumanForce, Player(i))
elseif i == 10 then
//call echo("-")
call ForceAddPlayer(UndeadForce, Player(i))
endif
//else //give control to afk slot
set i = i + 1
endloop
if T2Nplayer > 1 then
if T2Nplayer == 2 then
set LVLfor2T = 2
set LVLspellfor2T = 1.07
elseif T2Nplayer == 3 then
set LVLfor2T = 3
set LVLspellfor2T = 1.14
elseif T2Nplayer == 4 then
set LVLfor2T = 5
set LVLspellfor2T = 1.21
endif
endif
//set LVLfor1T = 3
if T1Nplayer > 1 then
if T1Nplayer == 2 then
set LVLspellfor1T = 1.07
set LVLfor1T = 2
elseif T1Nplayer == 3 then
set LVLfor1T = 3
set LVLspellfor1T = 1.14
elseif T1Nplayer == 4 then
set LVLfor1T = 5
set LVLspellfor1T = 1.21
endif
endif
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if UnitTypeNotDummy(F) and IsUnitEnemy(F,Player(0)) and T1Nplayer > 1 and UnitTypeNotDummy(F) then // nd not IsUnitType(F,UNIT_TYPE_HERO)
call UnitAddAbility(F,'A00W')
call SetUnitAbilityLevel(F,'A00W',LVLfor1T)
call UnitAddAbility(F,'A00X')
call SetUnitAbilityLevel(F,'A00X',LVLfor1T)
endif
call GroupRemoveUnit(P,F)
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if UnitTypeNotDummy(F) and IsUnitEnemy(F,Player(6)) and T2Nplayer > 1 and UnitTypeNotDummy(F) then // and not IsUnitType(F,UNIT_TYPE_HERO)
call UnitAddAbility(F,'A00W')
call SetUnitAbilityLevel(F,'A00W',LVLfor2T)
call UnitAddAbility(F,'A00X')
call SetUnitAbilityLevel(F,'A00X',LVLfor2T)
endif
call GroupRemoveUnit(P,F)
endloop
/*
// Makes main building avaliable for other players in case Player(1) or Player(7) is not active
if not PlayerIsActive(Player(0)) and PlayerIsActive(Player(1))
call SetUnitOwner(gg_unit_halt_0059,Player(1),false)
elseif not PlayerIsActive(Player(0)) and not PlayerIsActive(Player(1)) and PlayerIsActive(Player(2))
call SetUnitOwner(gg_unit_halt_0059,Player(2),false)
elseif not PlayerIsActive(Player(0)) and not PlayerIsActive(Player(1)) and not PlayerIsActive(Player(2)) and PlayerIsActive(Player(3))
call SetUnitOwner(gg_unit_halt_0059,Player(3),false)
endif
if not PlayerIsActive(Player(6)) and PlayerIsActive(Player(7))
call SetUnitOwner(gg_unit_unpl_0136,Player(7),false)
elseif not PlayerIsActive(Player(6)) and not PlayerIsActive(Player(7)) and PlayerIsActive(Player(8))
call SetUnitOwner(gg_unit_unpl_0136,Player(8),false)
elseif not PlayerIsActive(Player(6)) and not PlayerIsActive(Player(7)) and not PlayerIsActive(Player(8)) and PlayerIsActive(Player(9))
call SetUnitOwner(gg_unit_unpl_0136,Player(9),false)
endif */
//set g = CreateGroup()
set g = CopyGroup(CilivianzGroup)
loop
set F = FirstOfGroup(g)
exitwhen F == null
set CGM = CGM + 1
//call echo("goes through")
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set CGMMax = CGM
//call echo(I2S(CGM) + " CGM COUNT")
//call echo(I2S(CGMMax) + "CGM CUNT")
if 1 == 1 then
//call echo("yeah baby")
call CinematicModeExBJ(true, HumanForce, bj_CINEMODE_INTERFACEFADE)
call CinematicModeExBJ(true, UndeadForce, bj_CINEMODE_INTERFACEFADE)
endif
call PlaySoundJ(gg_snd_DarkSummoningLaunch1)
if IsPlayerInForce(GetLocalPlayer(), UndeadForce) then
// call KillSoundWhenDone(bj_lastPlayedSound)
//set i = 6
//loop
//exitwhen i > 9
//if GetLocalPlayer() == Player(i) then
/*
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, CameraSetupGetField(gg_cam_CryptCam, CAMERA_FIELD_TARGET_DISTANCE), 1.00 )
//call Msg(R2S(CameraSetupGetField(gg_cam_CamStart1,CAMERA_FIELD_TARGET_DISTANCE)),0.5)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, CameraSetupGetField(gg_cam_CryptCam, CAMERA_FIELD_ANGLE_OF_ATTACK), 1.00 )
call SetCameraField(CAMERA_FIELD_ROLL, CameraSetupGetField( gg_cam_CryptCam, CAMERA_FIELD_ROLL), 1.00 )
call SetCameraField(CAMERA_FIELD_ROTATION, CameraSetupGetField(gg_cam_CryptCam, CAMERA_FIELD_ROTATION), 1.00 ) */
call CameraSetupApplyForceDuration(gg_cam_CryptCam, true, 0.)
//endif
//set i = i + 1
//endloop
endif
//call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 8.00, "ReplaceableTextures\\CameraMasks\\HazeAndFogFilter_Mask.blp", 0, 0, 0, 0 )
if IsPlayerInForce(GetLocalPlayer(), HumanForce) then
call CameraSetupApplyForceDuration(gg_cam_PalCam, true, 0.)
endif
//call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 8.00, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 100.00, 100.00, 0 )
call TriggerExecute(gg_trg_PalStart)
call TimerStart(CreateTimer(), 3.5, false, function DreadLords_Start)
//call DestroyGroup(P)
set g = null
endfunction
//===========================================================================
function TriggerPreload takes nothing returns nothing
local unit d
local string s
local real x = 0.
local real y = 0.
local boolexpr b = Condition(function Cilivians_Expr)
local boolexpr b2 = Condition(function Militia_Expr)
local integer i = 0
local group g
//call echo("work?")
// set = CreateGroup()
//set bj_wantDestroyGroup = TRUE
// call DoNotSaveReplay() DO NOT SAVE REPLAY. LOL
//blocking showing "Sprit" button
call SetPlayerAbilityAvailable(Player(6), 'Aetl', false)
call SetPlayerAbilityAvailable(Player(7), 'Aetl', false)
call SetPlayerAbilityAvailable(Player(8), 'Aetl', false)
call SetPlayerAbilityAvailable(Player(9), 'Aetl', false)
set CryptSpidersGroup = CreateGroup()
set ThugsToBeRaidGroup = CreateGroup()
set ThugsRaidGroup = CreateGroup()
set ThugsCampGroup = CreateGroup()
set RebelsAttackGroup = CreateGroup()
set RaidOfOrcs= CreateGroup()
set RebelsAttackGroup= CreateGroup()
set RebelsGroup= CreateGroup()
set RebelsGroup2= CreateGroup()
// group RebelsAttackGroup //= CreateGroup()
//group RebelsGroup// = CreateGroup()
//group RebelsGroup2// = CreateGroup()
//set PatrolRepeatEffect = CreateGroup()
//set InitiationG = CreateGroup()
//set Radiance = CreateGroup()
//set RainFire = CreateGroup()
// set QuestVisionGroup = CreateGroup()
//set DreadLordsVision = CreateGroup()
// set QuestGroup = CreateGroup()
//set QuestionMarkGroup = CreateGroup()
// set CilivianzGroup = CreateGroup()
// set ReplicsGroup = CreateGroup()
// set AppearingGroup = CreateGroup()
// set ReplicsGroupIsOnPoint = CreateGroup()
//set = CreateGroup()
//set FocusedUnitVision = CreateGroup()
//set GreatSourcesDealAura = CreateGroup()
//set Corruption = CreateGroup()
//set Sorcerers = CreateGroup()
//set Paladins = CreateGroup()
//set DreadLords= CreateGroup()
//set MilitiaGroup = CreateGroup()
//set P= CreateGroup()
//set P2= CreateGroup()
// set ShareVisionGroup= CreateGroup()
// set Revelation_Targets= CreateGroup()
// set Zeal_Casters = CreateGroup()
// set BuildVision= CreateGroup()
// set PowerDashHaste= CreateGroup()
// set DSgroup= CreateGroup()
// set DSgroupDread= CreateGroup()
// set DefendOff= CreateGroup()
// set RageOfTheDamned= CreateGroup()
// set AttackingGroup= CreateGroup()
set s = "Abilities\\Spells\\Undead\\Sleep\\SleepTarget.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set d = CreateUnit(Player(13), skeletonmage, 999, 999, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), captain, 999, 999, 0)
call RemoveUnit(d)
call GroupEnumUnitsInRect(CilivianzGroup, bj_mapInitialPlayableArea, b)
call GroupEnumUnitsInRect(MilitiaGroup, bj_mapInitialPlayableArea, b2)
// PRELOAD
set s = "Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "VoidSkullAura_v5.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "HuntersMarkTarget.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "DemonShieldTarget3A.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Punishment_Missle.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "OrbOfCorruption.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "DryadResist.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "FelDeath.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "RunicAura.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "TaurenBuff.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "LightBurts2.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "StarSphere.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "DivineRage.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "DarkBreathDamage.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Pearlescence.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "TimeBreakerBuff.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "FuryOfTheInfernitiesDebuff.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "DreamFunnel.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "GaiaShield.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Overheated.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "LocustSwarmEmpowered.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Prayer Of Protection.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "darkbirth.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "HolySmiteMissileNew.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Runic Shield Blight.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "BlinkTargetBlack.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Flameshock.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "SolarBlast2.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\NightElf\\CorrosiveBreath\\ChimaeraAcidTargetArt.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\NightElf\\shadowstrike\\shadowstrike.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Soul Discharge Purple.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Ember Red.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Damnation Orange.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Singularity I Red.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Void Spear.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Void Arrow.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Divine Edict.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Other\\ImmolationRed\\ImmolationRedDamage.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Ember Shield I FX 5.mdx"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Items\\VampiricPotion\\VampPotionCaster.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set s = "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl"
call Preload(s)
call DestroyEffect(AddSpecialEffect(s, x, y))
set B = Condition(function AltIcon_Shop)
call SetDestructableInvulnerable( gg_dest_DTg8_2316, true )
call SetAltMinimapIcon("Shop.blp")
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
//if(GetLocalPlayer()==Player(0)) then
call UnitSetUsesAltIcon(F, true)
//call UnitSetUsesAltIcon(gg_unit_hvlt_0825, true)
call GroupRemoveUnit(P,F)
//endif
endloop
call DestroyBoolExpr(B)
//call SetUnitVertexColor(gg_unit_e00P_0228,0,0,0,0)
//call ShowUnit(gg_unit_e00P_0228,false)
set F = CreateUnit(Player(0),'e009',GetUnitX(gg_unit_e00P_0228),GetUnitY(gg_unit_e00P_0228),0)
call UnitApplyTimedLife(F,'BTLF',5.) //25
//call SetUnitOwner(gg_unit_e00P_0228,Player(5),false)
/*
call SetAltMinimapIcon("Quest.blp")
if(GetLocalPlayer()==Player(0)) then
call UnitSetUsesAltIcon(gg_unit_e00P_0228, true)
endif */
// Makes all dark sources invisible for others
// because for is still not avaliable
set S = ""
if GetLocalPlayer() == Player(6) or GetLocalPlayer() == Player(7) or GetLocalPlayer() == Player(8) or GetLocalPlayer() == Player(9)
set S = "Void Teleport To.mdl"
endif
//call SetUnitVertexColor(gg_unit_e00K_0827,255,255,255,I2)
set LIVINGrectPORTALEFFECT[1] = gg_unit_e00K_0827
set LIVINGrectPORTALEFFECTbutitsreal[1] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[1],"origin")
set LIVINGrectPORTALEFFECT[2] = gg_unit_e00K_0828
set LIVINGrectPORTALEFFECTbutitsreal[2] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[2],"origin")
set LIVINGrectPORTALEFFECT[3] = gg_unit_e00K_0829
set LIVINGrectPORTALEFFECTbutitsreal[3] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[3],"origin")
set LIVINGrectPORTALEFFECT[4] = gg_unit_e00K_0879
set LIVINGrectPORTALEFFECTbutitsreal[4] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[4],"origin")
set LIVINGrectPORTALEFFECT[5] = gg_unit_e00K_0880
set LIVINGrectPORTALEFFECTbutitsreal[5] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[5],"origin")
// gg_unit_hcas_0097 to 5
set LIVINGrectPORTALEFFECT[6] = gg_unit_e00K_0881
set LIVINGrectPORTALEFFECTbutitsreal[6] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[6],"origin")
set LIVINGrectPORTALEFFECT[7] = gg_unit_e00K_0882
set LIVINGrectPORTALEFFECTbutitsreal[7] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[7],"origin")
// to 7
set LIVINGrectPORTALEFFECT[8] = gg_unit_e00K_0883
set LIVINGrectPORTALEFFECTbutitsreal[8] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[8],"origin")
set LIVINGrectPORTALEFFECT[9] = gg_unit_e00K_0830
set LIVINGrectPORTALEFFECTbutitsreal[9] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[9],"origin")
set LIVINGrectPORTALEFFECT[10] = gg_unit_e00K_0633
set LIVINGrectPORTALEFFECTbutitsreal[10] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[10],"origin")
set LIVINGrectPORTALEFFECT[11] = gg_unit_e00K_0831
set LIVINGrectPORTALEFFECTbutitsreal[11] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[11],"origin")
set LIVINGrectPORTALEFFECT[12] = gg_unit_e00K_0886
set LIVINGrectPORTALEFFECTbutitsreal[12] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[12],"origin")
//set LIVINGrectPORTALEFFECT[11] = gg_unit_e00K_0828
// set LIVINGrectPORTALEFFECTbutitsreal[11] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[11],"origin")
//set LIVINGrectPORTALEFFECT[12] = gg_unit_e00K_0828
// set LIVINGrectPORTALEFFECTbutitsreal[12] = AddSpecialEffectTarget(S,LIVINGrectPORTALEFFECT[12],"origin")
set d = CreateUnit(Player(13), 'H007', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00L', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00C', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00J', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00M', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00O', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00N', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00S', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), dummy, 0, 0, 0)
call UnitAddAbility(d, 'A007')
call UnitAddAbility(d, 'A00E')
call UnitAddAbility(d, 'ACua')
call UnitAddAbility(d, 'AImb')
call UnitAddAbility(d, 'A00O')
call UnitAddAbility(d, 'A00R')
call UnitAddAbility(d, 'A00P')
call UnitAddAbility(d, 'A00V')
call SetUnitAbilityLevel(d,'A00V',20)
call UnitAddAbility(d, 'A00U')
call SetUnitAbilityLevel(d,'A00U',20)
call UnitAddAbility(d, 'A01U')
call SetUnitAbilityLevel(d,'A00U',4)
call UnitAddAbility(d, 'A00Y')
call SetUnitAbilityLevel(d,'A00Y',3)
call UnitAddAbility(d, 'AUsl')
call UnitAddAbility(d, 'Afae')
call UnitAddAbility(d,'A011')
call UnitAddAbility(d,'Aasl')
call RemoveUnit(d) // that removes dummy from game memory instanly, in contrast of KillUnit
set d = CreateUnit(Player(13), dummy, 0, 0, 0)
call UnitAddAbility(d, 'A014')
call UnitAddAbility(d, 'A00I')
call UnitAddAbility(d, 'A016')
call SetUnitAbilityLevel(d,'A017',20)
call UnitAddAbility(d, 'A018')
call SetUnitAbilityLevel(d,'A018',14)
call UnitAddAbility(d, 'A019')
call UnitAddAbility(d, 'A01A')
call UnitAddAbility(d, 'A01C')
call SetUnitAbilityLevel(d,'A018',4)
call UnitAddAbility(d, 'A01F')
call UnitAddAbility(d, 'A01H')
call UnitAddAbility(d, 'A01I')
call SetUnitAbilityLevel(d,'A01I',10)
call UnitAddAbility(d, 'A01I')
call UnitAddAbility(d, 'A01U')
call SetUnitAbilityLevel(d,'A00U',4)
call UnitAddAbility(d, 'A01V')
call RemoveUnit(d)
set d = CreateUnit(Player(13), dummy, 0, 0, 0)
call UnitAddAbility(d, 'A01X')
call UnitAddAbility(d, 'A01Y')
call UnitAddAbility(d, 'A026')
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00Q', 0, 0, 0)
call RemoveUnit(d)
set d = CreateUnit(Player(13), 'e00T', 0, 0, 0)
call RemoveUnit(d)
//call SetSkyModel("skyLight.mdx"
// ANIMATIONS for villagers.
call SetUnitAnimation( gg_unit_nvil_0112, "stand work" ) // villager
call SetUnitAnimation( gg_unit_nvl2_0430, "stand work" )
call SetUnitAnimation( gg_unit_nvil_0427, "stand work" )
call SetUnitAnimation( gg_unit_nvl2_0771, "stand work" )
call SetUnitAnimation( gg_unit_nvil_0772, "stand work" )
call SetUnitAnimation( gg_unit_hpea_0125, "stand work gold" ) // peasant
call SetUnitAnimation(gg_unit_hpea_0126, "stand work lumber")
call SetUnitAnimation(gg_unit_nvil_0550, "stand flesh first")
call IssueTargetOrder( gg_unit_hpea_0052, "harvest", gg_dest_VTlt_0788 )
call IssueTargetOrder( gg_unit_hpea_0051, "harvest", gg_dest_VTlt_0796 )
call IssueTargetOrder( gg_unit_hpea_0048, "harvest", gg_dest_VTlt_0775 )
call IssueTargetOrder( gg_unit_hpea_0042, "harvest", gg_dest_VTlt_0774 )
// this will remove music from a game completely
call StopMusic(true) // Doesn't work for default music
call ClearMapMusic() // Bingo!
call PlayMusic("music//path//music.wav") //get the path from sound editor :P
// SETTING THE VARIABLES
//REGIONS FOR DREADLORD ITEMS
set MasterMind = gg_unit_uaod_0900
call GroupAddUnit(GreatSourcesDealAura,MasterMind)
call GroupAddUnit(ZiccuratDefenseGroup,MasterMind)
set I = 0
loop
exitwhen I > 15
set GreatSources[I] = null
I++
endloop
//set F = CreateUnit(Player(10),'e00L',GetUnitX(MasterMind), GetUnitY(MasterMind),0)
//set greatsourcenumber = greatsourcenumber + 1
//set GreatSources[greatsourcenumber] = F
set Spawn[1] = gg_rct_Spawn1
set Spawn[2] = gg_rct_Spawn2
set Spawn[3] = gg_rct_Spawn3
set Spawn[4] = gg_rct_Spawn4
set Spawn[5] = gg_rct_Spawn5
set Spawn[6] = gg_rct_Spawn6
set Spawn[7] = gg_rct_Spawn7
set Spawn[8] = gg_rct_Spawn8
set Spawn[9] = gg_rct_Spawn9
//SETTING PATROL UNITS and their [x] [x+1] region to patrol with certain period
set PatrolUnit[1] = gg_unit_hrif_0164
call SaveReal(Hash, GetHandleId(gg_unit_hrif_0164), StringHash("PTtime"), 18.)
call SaveReal(Hash, GetHandleId(gg_unit_hrif_0164), StringHash("PTtimeSaved"), 18.)
set PatrolRect[1] = gg_rct_Patrol1
set PatrolRect[2] = gg_rct_Patrol2
set PatrolUnit[2] = gg_unit_nchp_0156
call SaveReal(Hash, GetHandleId(PatrolUnit[2]), StringHash("PTtime"), 12.)
call SaveReal(Hash, GetHandleId(PatrolUnit[2]), StringHash("PTtimeSaved"), 12.)
set PatrolRect[3] = gg_rct_Patrol3
set PatrolRect[4] = gg_rct_Patrol4
set PatrolUnit[3] = gg_unit_hrif_0170
call SaveReal(Hash, GetHandleId(PatrolUnit[3]), StringHash("PTtime"), 9.)
call SaveReal(Hash, GetHandleId(PatrolUnit[3]), StringHash("PTtimeSaved"), 9.)
set PatrolRect[5] = gg_rct_Patrol5
set PatrolRect[6] = gg_rct_Patrol6
set PatrolUnit[4] = gg_unit_hrif_0141
call SaveReal(Hash, GetHandleId(PatrolUnit[4]), StringHash("PTtime"), 20.)
call SaveReal(Hash, GetHandleId(PatrolUnit[4]), StringHash("PTtimeSaved"), 20.)
set PatrolRect[7] = gg_rct_Patrol7
set PatrolRect[8] = gg_rct_Patrol8
set PatrolUnit[5] = gg_unit_hrif_0172
call SaveReal(Hash, GetHandleId(PatrolUnit[5]), StringHash("PTtime"), 24.)
call SaveReal(Hash, GetHandleId(PatrolUnit[5]), StringHash("PTtimeSaved"), 24.)
set PatrolRect[9] = gg_rct_Patrol9
set PatrolRect[10] = gg_rct_Patrol10
set PatrolUnit[6] = gg_unit_hrif_0173
call SaveReal(Hash, GetHandleId(PatrolUnit[6]), StringHash("PTtime"), 38.)
call SaveReal(Hash, GetHandleId(PatrolUnit[6]), StringHash("PTtimeSaved"), 38.)
set PatrolRect[11] = gg_rct_Patrol11
set PatrolRect[12] = gg_rct_Patrol12
set PatrolUnit[7] = gg_unit_hrif_0174
call SaveReal(Hash, GetHandleId(PatrolUnit[7]), StringHash("PTtime"), 20.)
call SaveReal(Hash, GetHandleId(PatrolUnit[7]), StringHash("PTtimeSaved"), 20.)
set PatrolRect[13] = gg_rct_Patrol13
set PatrolRect[14] = gg_rct_Patrol14
set PatrolUnit[8] = gg_unit_hrif_0175
call SaveReal(Hash, GetHandleId(PatrolUnit[8]), StringHash("PTtime"), 24.)
call SaveReal(Hash, GetHandleId(PatrolUnit[8]), StringHash("PTtimeSaved"), 24.)
set PatrolRect[15] = gg_rct_Patrol15
set PatrolRect[16] = gg_rct_Patrol16
set PatrolUnit[9] = gg_unit_hfoo_0289
call SaveReal(Hash, GetHandleId(PatrolUnit[9]), StringHash("PTtime"), 14.)
call SaveReal(Hash, GetHandleId(PatrolUnit[9]), StringHash("PTtimeSaved"), 14.)
set PatrolRect[17] = gg_rct_Patrol17
set PatrolRect[18] = gg_rct_Patrol18
set PatrolUnit[10] = gg_unit_hfoo_0020
call SaveReal(Hash, GetHandleId(PatrolUnit[10]), StringHash("PTtime"), 14.)
call SaveReal(Hash, GetHandleId(PatrolUnit[10]), StringHash("PTtimeSaved"), 14.)
set PatrolRect[19] = gg_rct_Patrol19
set PatrolRect[20] = gg_rct_Patrol20
set PatrolUnit[11] = gg_unit_hfoo_0015
call SaveReal(Hash, GetHandleId(PatrolUnit[11]), StringHash("PTtime"), 14.)
call SaveReal(Hash, GetHandleId(PatrolUnit[11]), StringHash("PTtimeSaved"), 14.)
set PatrolRect[21] = gg_rct_Patrol21
set PatrolRect[22] = gg_rct_Patrol22
set PatrolUnit[12] = gg_unit_hrif_0131
call SaveReal(Hash, GetHandleId(PatrolUnit[12]), StringHash("PTtime"), 8.)
call SaveReal(Hash, GetHandleId(PatrolUnit[12]), StringHash("PTtimeSaved"), 8.)
set PatrolRect[23] = gg_rct_Patrol23
set PatrolRect[24] = gg_rct_Patrol24
set PatrolUnit[13] = gg_unit_hfoo_0561
call SaveReal(Hash, GetHandleId(PatrolUnit[13]), StringHash("PTtime"), 15.)
call SaveReal(Hash, GetHandleId(PatrolUnit[13]), StringHash("PTtimeSaved"), 15.)
set PatrolRect[25] = gg_rct_Patrol25
set PatrolRect[26] = gg_rct_Patrol26
set PatrolUnit[14] = gg_unit_hrif_0222
call SaveReal(Hash, GetHandleId(PatrolUnit[14]), StringHash("PTtime"), 20.)
call SaveReal(Hash, GetHandleId(PatrolUnit[14]), StringHash("PTtimeSaved"), 20.)
set PatrolRect[27] = gg_rct_Patrol27
set PatrolRect[28] = gg_rct_Patrol28
set PatrolUnit[15] = gg_unit_hrif_0221
call SaveReal(Hash, GetHandleId(PatrolUnit[15]), StringHash("PTtime"), 13.)
call SaveReal(Hash, GetHandleId(PatrolUnit[15]), StringHash("PTtimeSaved"), 13.)
set PatrolRect[29] = gg_rct_Patrol29
set PatrolRect[30] = gg_rct_Patrol30
set PatrolUnit[16] = gg_unit_hrif_0276
call SaveReal(Hash, GetHandleId(PatrolUnit[16]), StringHash("PTtime"), 25.)
call SaveReal(Hash, GetHandleId(PatrolUnit[16]), StringHash("PTtimeSaved"), 25.)
set PatrolRect[31] = gg_rct_Patrol31
set PatrolRect[32] = gg_rct_Patrol32
set PatrolUnit[17] = gg_unit_hrif_0239
call SaveReal(Hash, GetHandleId(PatrolUnit[17]), StringHash("PTtime"), 22.)
call SaveReal(Hash, GetHandleId(PatrolUnit[17]), StringHash("PTtimeSaved"), 22.)
set PatrolRect[33] = gg_rct_Patrol33
set PatrolRect[34] = gg_rct_Patrol34
set PatrolUnit[18] = gg_unit_hfoo_0285
call SaveReal(Hash, GetHandleId(PatrolUnit[18]), StringHash("PTtime"), 9.)
call SaveReal(Hash, GetHandleId(PatrolUnit[18]), StringHash("PTtimeSaved"), 9.)
set PatrolRect[35] = gg_rct_Patrol35
set PatrolRect[36] = gg_rct_Patrol36
/* golems should have their patrol rect too */
set PatrolUnit[19] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[37] = gg_rct_Patrol37
set PatrolRect[38] = gg_rct_Patrol38
set PatrolUnit[20] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[39] = gg_rct_Patrol39
set PatrolRect[40] = gg_rct_Patrol40
set PatrolUnit[21] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[41] = gg_rct_Patrol41
set PatrolRect[42] = gg_rct_Patrol42
set PatrolUnit[22] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[43] = gg_rct_Patrol43
set PatrolRect[44] = gg_rct_Patrol44
set PatrolUnit[23] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[45] = gg_rct_Patrol45
set PatrolRect[46] = gg_rct_Patrol46
set PatrolUnit[24] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[47] = gg_rct_Patrol47
set PatrolRect[48] = gg_rct_Patrol48
set PatrolUnit[25] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[49] = gg_rct_Patrol49
set PatrolRect[50] = gg_rct_Patrol50
set PatrolUnit[26] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[51] = gg_rct_Patrol51
set PatrolRect[52] = gg_rct_Patrol52
set PatrolUnit[27] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[53] = gg_rct_Patrol53
set PatrolRect[54] = gg_rct_Patrol54
set PatrolUnit[28] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[55] = gg_rct_Patrol55
set PatrolRect[56] = gg_rct_Patrol56
set PatrolUnit[29] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[57] = gg_rct_Patrol57
set PatrolRect[58] = gg_rct_Patrol58
set PatrolUnit[30] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
set PatrolRect[59] = gg_rct_Patrol59
set PatrolRect[60] = gg_rct_Patrol60
//set PatrolUnit[31] = null //golem
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
//call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
// set PatrolRect[61] = gg_rct_Patrol39
//set PatrolRect[62] = gg_rct_Patrol40
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 3, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
//call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 5.00, 10.00, 15.00, 1.00 )
//endif
call SetSkyModel( "Environment\\Sky\\FoggedSky\\FoggedSky.mdl" )
set i = 1
loop
exitwhen i > 12
set LIVINGgroup[i] = CreateGroup()
set i = i + 1
endloop
// When region is lost mass blight is created in its area. Theese integers determine the amount of time needs to fill the area with blight
set RectBlightWidth[1] = 11
set RectBlightWidth[2] = 6
set RectBlightWidth[3] = 16
set RectBlightWidth[4] = 10
set RectBlightWidth[5] = 8
set RectBlightWidth[6] = 7 //5
set RectBlightWidth[7] = 10
set RectBlightWidth[8] = 9
set RectBlightWidth[9] = 11
set RectBlightWidth[10] = 4
set RectBlightWidth[11] = 9
set RectBlightWidth[12] = 9
call DestroyBoolExpr(b)
set b = Condition(function CiliviansMilitia_Expr)
set LIVINGrect[1] = gg_rct_LivingRegion1
call GroupEnumUnitsInRect(LIVINGgroup[1], LIVINGrect[1], b)
set g = CopyGroup(LIVINGgroup[1])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[1] = RectCount[1] + 1
set RectCountCr[1] = RectCount[1]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[2] = gg_rct_LivingRegion2
call GroupEnumUnitsInRect(LIVINGgroup[2], LIVINGrect[2], b)
set g = CopyGroup(LIVINGgroup[2])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[2] = RectCount[2] + 1
set RectCountCr[2] = RectCount[2]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[3] = gg_rct_LivingRegion3
call GroupEnumUnitsInRect(LIVINGgroup[3], LIVINGrect[3], b)
set g = CopyGroup(LIVINGgroup[3])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[3] = RectCount[3] + 1
set RectCountCr[3] = RectCount[3]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[4]= gg_rct_LivingRegion4
call GroupEnumUnitsInRect(LIVINGgroup[4], LIVINGrect[4], b)
set g = CopyGroup(LIVINGgroup[4])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[4] = RectCount[4] + 1
set RectCountCr[4] = RectCount[4]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[5]= gg_rct_LivingRegion5
call GroupEnumUnitsInRect(LIVINGgroup[5], LIVINGrect[5], b)
set g = CopyGroup(LIVINGgroup[5])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[5] = RectCount[5] + 1
set RectCountCr[5] = RectCount[5]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[6]= gg_rct_LivingRegion6
call GroupEnumUnitsInRect(LIVINGgroup[6], LIVINGrect[6], b)
set g = CopyGroup(LIVINGgroup[6])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[6] = RectCount[6] + 1
set RectCountCr[6] = RectCount[6]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[7]= gg_rct_LivingRegion7
call GroupEnumUnitsInRect(LIVINGgroup[7], LIVINGrect[7], b)
set g = CopyGroup(LIVINGgroup[7])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[7] = RectCount[7] + 1
set RectCountCr[7] = RectCount[7]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[8]= gg_rct_LivingRegion8
call GroupEnumUnitsInRect(LIVINGgroup[8], LIVINGrect[8], b)
set g = CopyGroup(LIVINGgroup[8])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[8] = RectCount[8] + 1
set RectCountCr[8] = RectCount[8]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[9]= gg_rct_LivingRegion9
call GroupEnumUnitsInRect(LIVINGgroup[9], LIVINGrect[9], b)
set g = CopyGroup(LIVINGgroup[9])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[9] = RectCount[9] + 1
set RectCountCr[9] = RectCount[9]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[10]= gg_rct_LivingRegion10
call GroupEnumUnitsInRect(LIVINGgroup[10], LIVINGrect[10], b)
set g = CopyGroup(LIVINGgroup[10])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[10] = RectCount[10] + 1
set RectCountCr[10] = RectCount[10]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[11]= gg_rct_LivingRegion11
call GroupEnumUnitsInRect(LIVINGgroup[11], LIVINGrect[11], b)
set g = CopyGroup(LIVINGgroup[11])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[11] = RectCount[11] + 1
set RectCountCr[11] = RectCount[11]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
set LIVINGrect[12]= gg_rct_LivingRegion12
call GroupEnumUnitsInRect(LIVINGgroup[12], LIVINGrect[12], b)
set g = CopyGroup(LIVINGgroup[12])
loop
set F = FirstOfGroup(g)
exitwhen F == null
set RectCount[12] = RectCount[12] + 1
set RectCountCr[12] = RectCount[12]
//call echo(GetUnitName(F))
call GroupRemoveUnit(g, F)
endloop
call DestroyGroup(g)
call SetPlayerAllianceStateBJ( Player(0), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(11), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(11), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(11), Player(2), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(11), Player(3), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(1), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(0), Player(2), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(2), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(0), Player(3), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(3), Player(0), bj_ALLIANCE_ALLIED_VISION )
// call SetPlayerAllianceStateBJ( Player(0), Player(4), bj_ALLIANCE_ALLIED_VISION )
// call SetPlayerAllianceStateBJ( Player(4), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(1), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(0), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(1), Player(2), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(2), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(1), Player(3), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(3), Player(1), bj_ALLIANCE_ALLIED_VISION )
// call SetPlayerAllianceStateBJ( Player(1), Player(4), bj_ALLIANCE_ALLIED_VISION )
// call SetPlayerAllianceStateBJ( Player(4), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(2), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(0), Player(2), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(2), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(1), Player(2), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(2), Player(3), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(3), Player(2), bj_ALLIANCE_ALLIED_VISION )
// call SetPlayerAllianceStateBJ( Player(2), Player(4), bj_ALLIANCE_ALLIED_VISION )
// call SetPlayerAllianceStateBJ( Player(4), Player(2), bj_ALLIANCE_ALLIED_VISION )
/* call SetPlayerAllianceStateBJ( Player(4), Player(0), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(0), Player(4), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(4), Player(1), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(1), Player(4), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(4), Player(2), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(2), Player(4), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(4), Player(3), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(3), Player(3), bj_ALLIANCE_ALLIED_VISION ) */
if TEST == TRUE then
call SetPlayerAllianceStateBJ( Player(0), Player(1), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(1), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(0), Player(2), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(2), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(0), Player(3), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(3), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
//call SetPlayerAllianceStateBJ( Player(0), Player(4), bj_ALLIANCE_ALLIED_ADVUNITS )
//call SetPlayerAllianceStateBJ( Player(4), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(0), Player(5), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(5), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(0), Player(11), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(11), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(6), Player(7), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(7), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(6), Player(8), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(8), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(6), Player(9), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(9), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(6), Player(10), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(10), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
endif
set CrystalShield = gg_unit_nmgv_0077
call TimerStart(CreateTimer(), 0., false, function Connection_Set)
call DestroyBoolExpr(b)
call DestroyBoolExpr(b2)
set b = null
set b2 = null
set g = null
set d = null
//set gg_trg_TriggerPreload = CreateTrigger( )
// call TriggerAddAction( gg_trg_TriggerPreload, function Trig_TriggerPreload_Actions )
endfunction
endscope
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_____________________________________019_Actions takes nothing returns nothing
local boolean blm = false
local integer td = 0
set I = 0
loop
set I = GetRandomInt(1,3)
exitwhen blm == true or td == 3
set td = 0
if not PalItem[1] then
set PalItem[1] = true
set blm = true
call echo("svoboden " + I2S(1))
else
call echo("xaniat " + I2S(1))
td++
endif
if not PalItem[2] then
set PalItem[2] = true
set blm = true
call echo("svoboden " + I2S(2))
else
call echo("xaniat " + I2S(2))
td++
endif
if not PalItem[3] then
set PalItem[3] = true
set blm = true
call echo("svoboden " + I2S(3))
else
call echo("xaniat " + I2S(3))
td++
endif
endloop
endfunction
//===========================================================================
function InitTrig_____________________________________019 takes nothing returns nothing
set gg_trg_____________________________________019 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_____________________________________019, 0.30 )
call TriggerAddAction( gg_trg_____________________________________019, function Trig_____________________________________019_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
//UnitWithinRange 1.5
// By Tasyen
//Allows to register specific Units to throw events when an unit enters a wanted range.
//Inside this Events you have access to the entered unit, the enteringUnit and the Range this was registered on.
//How UnitWithinRange works?
//UnitWithinRange generateds for any Unit Registered an own Trigger handling Unit comes in Range of x.
//By Connecting Unit/Trigger with Hashtabels under their HandleID
// All units using this are inside the Group udg_WithinRangeUsers.
//=========================================================================================================
// Event
//=========================================================================================================
// udg_WithinRangeEvent tells you what happens
// udg_WithinRangeEvent = 1 Enters
// udg_WithinRangeEvent = -1 AutoClean Cause of Death/Remove/Replaced of the registered Unit
// udg_WithinRangeUnit is the Unit who was Registered
// udg_WithinRangeEnteringUnit is the Unit who came in Range
// udg_WithinRangeRange is the Range under which this was registered (it is not the distance between 2 units, the distance function will bve from the center of each unit while the range detecions includes colisionsizes).
//=========================================================================================================
//Jass API
//=========================================================================================================
// function RegisterUnitWithinRangeEvent takes unit u, real range, code filter, real eventValue returns boolean
// - more simple usage of super: no trigger, destroyFilterWhenDone=true, cleanOnKilled = true
// function RegisterUnitWithinRangeTrigger takes unit u, real range, code filter, trigger execution returns boolean
// - more simple usage of super: no Event Thrown, destroyFilterWhenDone=true, cleanOnKilled = true
// function RegisterUnitWithinRangeSuper takes unit u, real range, boolean cleanOnKilled, boolexpr filter, trigger execution, real eventValue, boolean destroyFilterWhenDone returns boolean
// - inside the filter you can only access the entering Unit with GetTriggerUnit()
// - Start the detection for this Unit with this range
// - can not register twice the same range (main number 800.0 and 800.1 are now allowed) onto 1 unit.
// - cleanOnKilled will generate an trigger which will execute DeRegisterUnitWithinRangeUnit as soon the unit dies.
// - cleanOnKilled creates 1 Trigger for each Unit registered.
// function RegisterUnitWithinRangeEx takes unit u, real range, boolean cleanOnKilled, boolexpr filter returns boolean
// -backwards comptatible, wrapper for super
// function RegisterUnitWithinRange takes unit u, real range, boolean cleanOnKilled returns boolean
// -backwards comptatible, wrapper for super
// function DeRegisterUnitWithinRange takes unit u, real range returns boolean
// Destroys the range detection with this specific Range and Unit.
// function DeRegisterUnitWithinRangeUnit takes unit u returns boolean
// Destroys all Triggers used by the unit from UnitWithinRange.
//=========================================================================================================
//Hashtable Indexes:
//=========================================================================================================
// unitId
// -1 = Auto Clean Trigger
// 0 = amount of range triggers used
// 1+ = Range-Detecion Triggers
// range = index of the trigger controlling that range.
// trigId
// -1 = TriggerAction (For remove usage)
// 0 = Registered Unit
// 0 = Range Detected
// 0 = destroyFilterWhenDone
// 1 = EventValue
// 1 = ExecutionTrigger
// 3 = filter (boolexpr)
//=========================================================================================================
//changes 1.5
//=========================================================================================================
// One can now choose the EventValue thrown.
// One can now choose a trigger beeing executed (including conditions) when a unit enters.
// ^^ included for GUI with Wanted_Event/Wanted_Trigger.
// The Filters are now supported by the GUI usage.
// Implemented Autodestorying of the filters, if the range detection ends .
// RegisterUnitWithinRangeSuper allows you to choose, the others allways destory the filter.
//=========================================================================================================
constant function UnitWithinRangeDefaultEvent takes nothing returns real
return 1.0
endfunction
//helper function destroys a trigger, its action, and clears the used table space.
function DestroyUnitWhithinTrigger takes trigger trig returns nothing
local integer trigId = GetHandleId(trig)
if LoadBoolean(udg_WithinRangeHash, trigId,0) then
call DestroyBoolExpr(LoadBooleanExprHandle(udg_WithinRangeHash,trigId,3))
endif
call TriggerRemoveAction(trig, LoadTriggerActionHandle(udg_WithinRangeHash,trigId,-1))
call FlushChildHashtable(udg_WithinRangeHash, trigId)
call DestroyTrigger(trig)
endfunction
//Destroys all Triggers used by the unit from UnitWithinRange.
function DeRegisterUnitWithinRangeUnit takes unit u returns boolean
local integer unitId = GetHandleId(u)
local integer size = LoadInteger(udg_WithinRangeHash,unitId,0)
local integer LoopA = 1
//is there a cleanOnKilled Trigger?
if LoadTriggerHandle(udg_WithinRangeHash,unitId,-1) != null then
call DestroyUnitWhithinTrigger(LoadTriggerHandle(udg_WithinRangeHash,unitId,-1))
endif
loop
exitwhen LoopA > size
call DestroyUnitWhithinTrigger(LoadTriggerHandle(udg_WithinRangeHash,unitId,LoopA))
set LoopA = LoopA + 1
endloop
call FlushChildHashtable(udg_WithinRangeHash, unitId)
call GroupRemoveUnit(udg_WithinRangeUsers, u)
return true
endfunction
//Destroys the Trigger form this unit having this specific Range.
//Triggers are unique based on Range & Unit.
function DeRegisterUnitWithinRange takes unit u, real range returns boolean
local trigger trig
local integer trigId
local integer unitId = GetHandleId(u)
local integer size = LoadInteger(udg_WithinRangeHash,unitId,0)
local integer rangeAsInt = R2I(range)
local integer index
//Range smaller equal 0 does not make sense, skip it or has nothing registered.
if range <= 0 or size <= 0 or not HaveSavedInteger(udg_WithinRangeHash,unitId,rangeAsInt) then
return false
endif
set index = LoadInteger(udg_WithinRangeHash,unitId,rangeAsInt)
set trig = LoadTriggerHandle(udg_WithinRangeHash,unitId,index)
set trigId = GetHandleId(trig)
//destroy and clean it.
call RemoveSavedInteger(udg_WithinRangeHash, unitId, rangeAsInt)
call RemoveSavedHandle(udg_WithinRangeHash, unitId, index)
call DestroyUnitWhithinTrigger(trig)
//Redindex, when not last?
if index != size then
set trig = LoadTriggerHandle(udg_WithinRangeHash, unitId, size)
set trigId = GetHandleId(trig)
call SaveTriggerHandle(udg_WithinRangeHash,unitId,index, trig )
set rangeAsInt = R2I( LoadReal(udg_WithinRangeHash, trigId, 0) )
call SaveInteger(udg_WithinRangeHash,unitId,rangeAsInt,index)
endif
set trig = null
call SaveInteger(udg_WithinRangeHash,unitId,0,size - 1)
//if the last trigger was removed, remove it from users.
if size == 1 then
//is there a cleanOnKilled Trigger?
if LoadTriggerHandle(udg_WithinRangeHash,unitId,-1) != null then
call RemoveSavedHandle(udg_WithinRangeHash, unitId, -1)
call DestroyUnitWhithinTrigger(LoadTriggerHandle(udg_WithinRangeHash,unitId,-1))
endif
call GroupRemoveUnit(udg_WithinRangeUsers, u)
call FlushChildHashtable(udg_WithinRangeHash, unitId)
endif
set trig = null
return true
endfunction
//This is called when someone comes in Range.
function ActionUnitWithinRange takes nothing returns nothing
local integer trigId = GetHandleId(GetTriggeringTrigger ())
local real eventValue = LoadReal(udg_WithinRangeHash, trigId, 1)
local trigger execution = LoadTriggerHandle(udg_WithinRangeHash, trigId, 1)
set udg_WithinRangeUnit = LoadUnitHandle(udg_WithinRangeHash,trigId,0)
set udg_WithinRangeEnteringUnit = GetTriggerUnit()
set udg_WithinRangeRange = LoadReal(udg_WithinRangeHash, trigId, 0)
if eventValue != 0.0 then
set udg_WithinRangeEvent = eventValue
set udg_WithinRangeEvent = 0.0
endif
if execution != null then
call ConditionalTriggerExecute(execution)
endif
set execution = null
endfunction
//This Action is called on Death/Remove/Replaced, if wanted on creation.
// Will throw an -1 Event after the DeRegistering was done.
function ActionUnitWithinCleanOnKilled takes nothing returns nothing
call DeRegisterUnitWithinRangeUnit (GetTriggerUnit())
set udg_WithinRangeUnit = GetTriggerUnit()
set udg_WithinRangeEvent = -1
set udg_WithinRangeEvent = 0
endfunction
//Registers an Unit comes within Range around Unit event.
//Uses for each Unit a own Trigger.
//Each Range can only be registered one time on each unit
//if cleanOnKilled = true an Trigger will be generated, if not existing which will DeRegister as soon the unit dies.
function RegisterUnitWithinRangeSuper takes unit u, real range, boolean cleanOnKilled, boolexpr filter, trigger execution, real eventValue, boolean destroyFilterWhenDone returns boolean
local trigger trig
local integer trigId
local integer unitId = GetHandleId(u)
local integer size = LoadInteger(udg_WithinRangeHash,unitId,0)
local integer rangeAsInt = R2I(range)
//Range smaller equal 0 does not make sense, skip it.
if range <= 0 then
return false
endif
//is the cleanOnKilled Trigger already existing?
if LoadTriggerHandle(udg_WithinRangeHash,unitId,-1) == null and cleanOnKilled then
set trig = CreateTrigger()
set trigId = GetHandleId(trig)
call SaveTriggerHandle(udg_WithinRangeHash,unitId,-1,trig)
call SaveTriggerActionHandle(udg_WithinRangeHash,trigId,-1, TriggerAddAction(trig, function ActionUnitWithinCleanOnKilled))
// This will trigger if the unit is removed/killed
call TriggerRegisterUnitStateEvent(trig, u, UNIT_STATE_LIFE, LESS_THAN_OR_EQUAL, 0.405)
set trig = null
endif
//Was this Range already Registered?
if HaveSavedInteger(udg_WithinRangeHash, unitId, rangeAsInt) then
return false
endif
//New Unique Range for this unit; create an new Trigger handling this range.
set trig = CreateTrigger()
set trigId = GetHandleId(trig)
set size = size + 1
call SaveTriggerHandle(udg_WithinRangeHash,unitId,size,trig)
call SaveUnitHandle(udg_WithinRangeHash,trigId,0,u)
call SaveReal(udg_WithinRangeHash,trigId,0,range)
call SaveTriggerActionHandle(udg_WithinRangeHash,trigId,-1, TriggerAddAction(trig, function ActionUnitWithinRange))
call SaveInteger(udg_WithinRangeHash,unitId,0,size)
call SaveInteger(udg_WithinRangeHash,unitId,rangeAsInt,size)
call SaveBoolean(udg_WithinRangeHash,trigId,0,destroyFilterWhenDone)
call SaveBooleanExprHandle(udg_WithinRangeHash,trigId,3,filter)
call SaveTriggerHandle(udg_WithinRangeHash,trigId,1,execution)
call SaveReal(udg_WithinRangeHash,trigId,1,eventValue)
call TriggerRegisterUnitInRange(trig, u, range, filter)
set trig = null
call GroupAddUnit(udg_WithinRangeUsers, u)
return true
endfunction
//Backwards compatible to 1.4
function RegisterUnitWithinRangeEx takes unit u, real range, boolexpr filter returns boolean
return RegisterUnitWithinRangeSuper(u,range,true,filter, null, 1.0,true)
endfunction
//added 1.5
function RegisterUnitWithinRangeEvent takes unit u, real range, code filter, real eventValue returns boolean
return RegisterUnitWithinRangeSuper(u,range,true,Condition(filter), null, eventValue, true)
endfunction
//added 1.5
function RegisterUnitWithinRangeTrigger takes unit u, real range, code filter, trigger execution returns boolean
return RegisterUnitWithinRangeSuper(u,range,true, Condition(filter), execution, 0.0, true)
endfunction
//Backwards compatible to below 1.4
function RegisterUnitWithinRange takes unit u, real range, boolean cleanOnKilled returns boolean
return RegisterUnitWithinRangeSuper(u,range,cleanOnKilled,null, null, 1.0,false)
endfunction
function WithinRangeGUIRegister takes nothing returns nothing
call RegisterUnitWithinRangeSuper( udg_WithinRangeUnit, udg_WithinRangeRange, true, udg_WithinRangeWanted_Filter, udg_WithinRangeWanted_Trigger, udg_WithinRangeWanted_Event, true)
if not udg_WithinRangeWanted_Keep then
set udg_WithinRangeWanted_Trigger = null
set udg_WithinRangeWanted_Event = UnitWithinRangeDefaultEvent()
set udg_WithinRangeWanted_Filter = null
endif
endfunction
function WithinRangeGUIDeRegister takes nothing returns nothing
//When called with Range 0 or below all Ranges will be removed.
if udg_WithinRangeRange <= 0 then
call DeRegisterUnitWithinRangeUnit( udg_WithinRangeUnit)
else
call DeRegisterUnitWithinRange( udg_WithinRangeUnit, udg_WithinRangeRange)
endif
endfunction
//===========================================================================
function InitTrig_WithinRange takes nothing returns nothing
set udg_WithinRangeHash = InitHashtable()
set udg_WithinRangeWanted_Event = UnitWithinRangeDefaultEvent()
set gg_trg_WithinRange = CreateTrigger()
set udg_WithinRange__DeRegister = CreateTrigger()
call TriggerAddAction(gg_trg_WithinRange, function WithinRangeGUIRegister)
call TriggerAddAction(udg_WithinRange__DeRegister, function WithinRangeGUIDeRegister)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
group Radiance = CreateGroup()
group RainFire = CreateGroup()
unit array DarkSpirit[12]
unit array Knight[12]
group PatrolRepeatEffect = CreateGroup()
unit array EntQuestionMark[4]
boolean array SpyVision[3]
trigger CryptSpidersTrigger = CreateTrigger()
boolean CiliviansMurdered = false
integer PaladinsChanceGetItem = 8
integer PalItemCounter = 0
boolean array PalItem[6]
boolean HalfIsDeadTip2 = false
//integer
integer array Preservation_Bar[10]
integer Preservation_Integer = 0
real array Circulation_HPRestoration[10]
real array Circulation_MPRestoration[10]
integer array ArcaneTerror_Level[10]
//real array ArcaneTerror_Damage[10]
unit array Shadows[10]
integer array ShadowsStacks[10]
group array ShadowsGroup[10]
integer DreadLordsCount = 0
integer ItemsSummary = 6
constant integer ItemsShouldBe = 6
constant integer itemplaces = 16 //16
integer array ItemId[6]
rect array ItemPlace[itemplaces]
boolean array PlaceUn[itemplaces]
boolean array ItemIdUn[6]
unit SoulUnit
boolean SoulPickedUp = false
unit BladeUnit = null
real BladeCd = 0.
trigger RebelsAttack
boolean NorthGateIsOpen = false
boolean SouthGateIsOpen = false
integer array Revelation_Bar[12]
integer Revelation_integer = 0
group InitiationG = CreateGroup()
boolean array ScreamVision[4]
boolean DefendingEnd = false
boolean array GuardTip[5]
real timeperm = 0.
boolean tip1 = false
boolean tip2 = false
boolean LVL2Raid = false
boolean LVL3Raid = false
real TESTautoUPGRADEtime = 140.
quest Furblogs
real FurblogsReal = 0.
boolean FurblogsCanBeCanceled = true
quest EntCorruption
boolean EntCorruptionTakeDown = false
integer EntCount = 3
quest ThugsRaid
real ThugsReal = 0. //6.5
group ThugsRaidGroup = CreateGroup()
group ThugsCampGroup = CreateGroup()
boolean ThugsRaidTakeDown = false
boolean ThugsRaidCanBeCanceled = true
quest CryptSpiders
real CryptSpidersReal = 0.
boolean CryptSpidersCanBeCanceled = true
boolean CryptSpidersCompleted = false
unit MortarUnitQuest
quest RebelsQuest
boolean RebelsCanBeCanceled = true
group RebelsAttackGroup = CreateGroup()
group RebelsGroup = CreateGroup()
group RebelsGroup2 = CreateGroup()
unit RebelsMainUnit
real RebelsReal = 0.
location L = Location(0.,0.)
integer array LVLUPadditionalHL[10]
hashtable Hash = InitHashtable()
leaderboard CilivianzAlive
group CryptSpidersGroup = CreateGroup()
unit RangeUnit
force Frc
timer T
string Ss
effect Ef
effect Ef2
integer array DreadSpawnInteger[10]
unit array QuestVision[7]
unit array units
integer index
real TimeToFixAttack = 0.
boolean bl = false
group QuestVisionGroup = CreateGroup()
group DreadLordsVision = CreateGroup()
constant integer dummy = 'eCST'
constant integer zombie = 'nzom'
constant integer zombiew = 'n000'
constant integer skeleton = 'uske'
constant integer skeletonarcher = 'nska'
constant integer footman = 'hfoo'
//constant integer footmanms = 'hfo2'
constant integer sniper = 'hrif'
//constant integer sniperms = 'hrif'
constant integer kid = 'nvlk'
constant integer kid2 = 'nvk2'
constant integer murl = 'nmrl'
constant integer male = 'nvil'
constant integer male2 = 'nvl2'
constant integer female = 'nvlw'
constant integer female2 = 'nhef'
constant integer worker = 'hpea'
constant integer sorcerer = 'nmed'
constant integer priest = 'nchp'
constant integer skeletonmage = 'uskm'
constant integer captain = 'hcth'
constant integer locust = 'uloc'
constant integer tower = 'hwtw'
constant integer towerguard = 'hgtw'
constant integer ghoul = 'ugho'
integer T1Nplayer = 0
//integer T1Nactualplayers = 0
integer LVLfor1T
integer T2Nplayer = 0
integer LVLfor2T
real LVLspellfor1T = 1.
real LVLspellfor2T = 1.
boolean GameOver = false
real R2
integer PaladinsCount = 0
effect array HuntTargetEffect[50]
unit array HuntTargetUnitDummy[50]
integer QuestNumber
//1 furb
//2 ent
//3 thugs
//4 crypt
//5 rebels
group QuestGroup = CreateGroup()
boolean array QuestCompleted[5]
real RaidActionCommandInterval = 10.
integer RaidInt = 0
real array RaidXPoint
real array RaidYPoint
unit array RaidTargetUnit
boolean array RaidCommandIsActive
integer array RaidCommandType
//1 attack
//2 move
integer RaidLVL = 1
//integer MaxRaids = 1
group array RaidGroup //MaxRaids
integer RaidCurrentMax = 0
boolean array RaidActive
real RaidIntReal = 10 //10
real RaidInterval = 55. // 45 -RaidIntReal
real RaidSpawn = 120. //45
boolean RaidBoolean = false
integer NPlayer = 0
force PlayerForce = CreateForce()
force HumanForce = CreateForce()
force UndeadForce = CreateForce()
boolean array PlayerInGame[12]
unit array HERO[12]
unit array PaladinsUnit[5]
boolean array PlayerHasLost[12]
group CilivianzGroup = CreateGroup() // massive group
texttag TX
string S
boolean LeaderBoardActive = false
integer PalLack = 0
integer DreadLack = 0
real array distance[10]
group QuestionMarkGroup = CreateGroup()
group ReplicsGroup = CreateGroup()
group AppearingGroup = CreateGroup()
group ReplicsGroupIsOnPoint = CreateGroup()
group DistToUnitG = CreateGroup()
//real EveryFiveSeconds = 0.
//location L2 = Location(0.,0.)
integer PatrolMax = 100
unit array PatrolUnit[100]
rect array PatrolRect[100]
real every25sec = 0.
group FocusedUnitVision = CreateGroup()
boolean HalfIsDeadTip = false
constant integer UGMmax = 400 // +1 max groups of undead. <Constant value, and mostly for optimization>
constant integer UndeadMaxCount = 7 // 6
constant real BasicalHauntSpeed = 165 // based on (zombie's speed) - 70
integer UGM = 1 // current count of undead groups
group array Undead[UGMmax]
boolean array UndeadGroupIsOn[UGMmax]
boolean array UndeadGroupShouldBeEliminated[UGMmax]
boolean array UndeadGroupEliminated[UGMmax]
integer UDUNITS = 0 //it's okay
real array UndeadFocusX[UGMmax]
real array UndeadFocusY[UGMmax]
//constant integer UDUNITSmax = 7
unit array FocusedUnit[UGMmax] // current focused unit
boolean array IsUnitFocused[UGMmax] // is unit focused now
//constant integer CGMmax = 6 // +1 max groups of cilivians
integer CGMMax = 0 // max count of cilivians
integer CGM = 0 // current count of cilivians
//group array Cilivians[CGMmax]
rect array LIVINGrect[12] // rect where people live
// unit or effect doesnt matter POP
unit array LIVINGrectPORTALEFFECT[12]
effect array LIVINGrectPORTALEFFECTbutitsreal[12]
group GreatSourcesDealAura = CreateGroup()
group Corruption = CreateGroup()
integer array RectCount[12]
integer array RectCountCr[12]
boolean array ISRECTALIVE[12] // false would mean that rect is totally cleared from people
boolean array MedRectWarn[12]
real MedRectWarnReal = 0.
boolean array RectDeadWarn[12]
real RectDeadReal = 0.
real array RectBlightWidth[12]
group array LIVINGgroup[12]
boolean CaptainActivated = false
group Sorcerers = CreateGroup()
group Paladins = CreateGroup()
group DreadLords = CreateGroup()
//integer DreadLordsCount = 0
group MilitiaGroup = CreateGroup()
unit F
unit F2
group P = CreateGroup()
group P2 = CreateGroup()
real time = 0.
boolean Bol
boolean BOOLEAN
real R
real X
real Y
integer I
integer I2
boolean PalSurvive = false
real PalSurviveReal = 1800. //1800
real timesec = 0. // gg
integer timemin = 0
group ShareVisionGroup = CreateGroup()
group Revelation_Targets = CreateGroup()
//unit AC_Caster
//unit AC_Target
group Zeal_Casters = CreateGroup()
boolean array CinematicEnd[10]
real CaptainCd = 25.
boolean CaptainIsOnCd = false
//group array
//integer CaptainData
real CaptainX
real CaptainY
integer PalGold = 0
integer DreadEssence = 0
group BuildVision = CreateGroup()
group PowerDashHaste = CreateGroup()
group DSgroup = CreateGroup()
group DSgroupDread = CreateGroup()
boolexpr B
boolean BetterZombify = false
boolean FelGenome = false
boolean SoulLust = false
boolean Locust = false
boolean DarkReflection = false
boolean Everlasting = false
unit array VisionQuestDummy[15]
boolean Defend = false
group DefendOff = CreateGroup()
boolean TowerGrade = false
boolean Planning = false
boolean BetterPatrols = false
boolean EvilDefend = false
boolean MeditationProcees = false
group RaidOfOrcs = CreateGroup()
group RageOfTheDamned = CreateGroup()
integer ID
boolean DarkSourceTip = false
rect array Spawn[9]
boolean SpawnEngaged[9]
boolean array GoRunning[500]
group AttackingGroup = CreateGroup()
constant boolean TEST = false // that activates raither test map
// DO NOT FORGET TO CHANGE
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_LivingGroupLeaves_region_Actions takes nothing returns nothing
local unit d = GetLeavingUnit()
local integer i
local real r
set i = 1
set I = 0
if IsCitizen(d) and not IsUnitDead(d) then
if GetTriggeringRegion() == LivingRegionGlobal[1] then
set I = 1
elseif GetTriggeringRegion() == LivingRegionGlobal[2] then
set I= 2
elseif GetTriggeringRegion() == LivingRegionGlobal[3] then
set I= 3
elseif GetTriggeringRegion() == LivingRegionGlobal[4] then
set I= 4
//call echo ("group 4 ktoto pokinul")
elseif GetTriggeringRegion() == LivingRegionGlobal[5] then
set I= 5
elseif GetTriggeringRegion() == LivingRegionGlobal[6] then
set I= 6
elseif GetTriggeringRegion() == LivingRegionGlobal[7] then
set I= 7
elseif GetTriggeringRegion() == LivingRegionGlobal[8] then
set I= 8
elseif GetTriggeringRegion() == LivingRegionGlobal[9] then
set I= 9
elseif GetTriggeringRegion() == LivingRegionGlobal[10] then
set I= 10
elseif GetTriggeringRegion() == LivingRegionGlobal[11] then
set I= 11
elseif GetTriggeringRegion() == LivingRegionGlobal[12] then
set I= 12
endif
loop
exitwhen i > 12
if IsUnitInGroup(d,LIVINGgroup[i]) then
//call echo("да в ливинггруп группе номер " + I2S(i))
endif
if i == I then
//call echo("да " + I2S(i) + " = " + I2S(I))
endif
if ISRECTALIVE[i] == TRUE then
//call echo("да РЕКТЭЛАЙВ № " + I2S(i) + " жив ещё")
endif
if IsUnitInGroup(d,LIVINGgroup[i]) and i == I and ISRECTALIVE[i] == TRUE then
call GroupRemoveUnit(LIVINGgroup[i],d)
set RectCountCr[i] = RectCountCr[i] - 1
//call echo("iz gruppi nomer "+I2S(i)+" vishel")
set r = RectCount[i] * 0.05 // 0.05
if r < 4 then
set r = 4
endif
if RectCountCr[i] < r then // 0.05 R < R //or (BOOLEAN == true and I < R + 3)
//if I < RectCount[i] * 0.95 then
//call echo("im gonna put some dirt in your eyes")
//endif
//call echo("енд")
set GreatSourceInt = i
call TriggerExecute(gg_trg_GREATPORTALCREATE) //great source creation
// ->>
//call echo("енд2")
endif
endif
i++
endloop
endif
set d = null
endfunction
//===========================================================================
function InitTrig_LivingGroupLeaves_region takes nothing returns nothing
set gg_trg_LivingGroupLeaves_region = CreateTrigger( )
set LivingRegionGlobal[1] = CreateRegion()
set LivingRegionGlobal[2] = CreateRegion()
set LivingRegionGlobal[3] = CreateRegion()
set LivingRegionGlobal[4] = CreateRegion()
set LivingRegionGlobal[5] = CreateRegion()
set LivingRegionGlobal[6] = CreateRegion()
set LivingRegionGlobal[7] = CreateRegion()
set LivingRegionGlobal[8] = CreateRegion()
set LivingRegionGlobal[9] = CreateRegion()
set LivingRegionGlobal[10] = CreateRegion()
set LivingRegionGlobal[11] = CreateRegion()
set LivingRegionGlobal[12] = CreateRegion()
call RegionAddRect(LivingRegionGlobal[1],gg_rct_LivingRegion1)
call RegionAddRect(LivingRegionGlobal[2],gg_rct_LivingRegion2)
call RegionAddRect(LivingRegionGlobal[3],gg_rct_LivingRegion3)
call RegionAddRect(LivingRegionGlobal[4],gg_rct_LivingRegion4)
call RegionAddRect(LivingRegionGlobal[5],gg_rct_LivingRegion5)
call RegionAddRect(LivingRegionGlobal[6],gg_rct_LivingRegion6)
call RegionAddRect(LivingRegionGlobal[7],gg_rct_LivingRegion7)
call RegionAddRect(LivingRegionGlobal[8],gg_rct_LivingRegion8)
call RegionAddRect(LivingRegionGlobal[9],gg_rct_LivingRegion9)
call RegionAddRect(LivingRegionGlobal[10],gg_rct_LivingRegion10)
call RegionAddRect(LivingRegionGlobal[11],gg_rct_LivingRegion11)
call RegionAddRect(LivingRegionGlobal[12],gg_rct_LivingRegion12)
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[1],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[2],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[3],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[4],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[5],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[6],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[7],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[8],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[9],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[10],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[11],null )
call TriggerRegisterLeaveRegion( gg_trg_LivingGroupLeaves_region, LivingRegionGlobal[12],null )
call TriggerAddAction( gg_trg_LivingGroupLeaves_region, function Trig_LivingGroupLeaves_region_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_LivingGroupEnterRect_Actions takes nothing returns nothing
local unit d = GetEnteringUnit()
local integer i
set i = 1
set I = 0
if IsCitizen(d) then
if GetTriggeringRegion() == LivingRegionGlobal[1] then
set I = 1
elseif GetTriggeringRegion() == LivingRegionGlobal[2] then
set I= 2
elseif GetTriggeringRegion() == LivingRegionGlobal[3] then
set I= 3
elseif GetTriggeringRegion() == LivingRegionGlobal[4] then
set I= 4
elseif GetTriggeringRegion() == LivingRegionGlobal[5] then
set I= 5
elseif GetTriggeringRegion() == LivingRegionGlobal[6] then
set I= 6
elseif GetTriggeringRegion() == LivingRegionGlobal[7] then
set I= 7
elseif GetTriggeringRegion() == LivingRegionGlobal[8] then
set I= 8
elseif GetTriggeringRegion() == LivingRegionGlobal[9] then
set I= 9
elseif GetTriggeringRegion() == LivingRegionGlobal[10] then
set I= 10
elseif GetTriggeringRegion() == LivingRegionGlobal[11] then
set I= 11
elseif GetTriggeringRegion() == LivingRegionGlobal[12] then
set I= 12
endif
loop
exitwhen i > 12
if IsUnitInGroup(d,LIVINGgroup[i]) and ISRECTALIVE[i] == TRUE then
call GroupRemoveUnit(LIVINGgroup[i],d)
set RectCountCr[i] = RectCountCr[i] - 1
endif
i++
endloop
if ISRECTALIVE[I] == TRUE then
call GroupAddUnit(LIVINGgroup[I],d)
set RectCountCr[I] = RectCountCr[I] + 1
endif
endif
set d =null
endfunction
//===========================================================================
function InitTrig_LivingGroupEnterRect takes nothing returns nothing
set gg_trg_LivingGroupEnterRect = CreateTrigger( )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[1],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[2],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[3],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[4],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[5],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[6],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[7],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[8],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[9],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[10],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[11],null )
call TriggerRegisterEnterRegion(gg_trg_LivingGroupEnterRect, LivingRegionGlobal[12],null )
call TriggerAddAction( gg_trg_LivingGroupEnterRect, function Trig_LivingGroupEnterRect_Actions )
endfunction
//TESH.scrollpos=236
//TESH.alwaysfold=0
function SetFullBlight takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
local real tm = LoadReal(Hash,idT,2)
local real time = LoadReal(Hash,idT,6)
local integer timeclean = LoadInteger(Hash,idT,7)
if timeclean == 0 then
set timeclean = 3
else
set timeclean = timeclean + 2
endif
if time <= 0 then
set time = 2
endif
if timeclean/2 <= tm then
// call SetTerrainType(x, y, 'Ldrt', 0, timeclean, 0) //-1
else
set time = time + 1
call SetBlight(Player(8),x,y,128 * time,true)
//call echo("blight")
endif
if time >= tm*2 then
//call echo("out blight")
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(Hash,idT)
else
call SaveReal(Hash,idT,6,time)
call SaveInteger(Hash,idT,7,timeclean)
endif
set t = null
endfunction
function DarkSource_Tip takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8, "|c00E77561Every opened dark source damages enemies in a big area. It also grants 20 dark essences when Dreadlord comes nearby, restoring 5% of health and 4% of mana with every missile sent to nearest DreadLord. |r")
endif
endfunction
function AbomCreatePortal2 takes nothing returns nothing
local unit f
local unit f3
set T=GetExpiredTimer()
set IDT = GetHandleId(T)
set f3=LoadUnitHandle(Hash,IDT,0)
set UDUNITS = UDUNITS + 1
//call ShowUnit(LoadUnitHandle(Hash,idT,StringHash("Z_du")),false)
//call RemoveSavedHandle(Hash,idT,StringHash("Z_du"))
//call SaveEffectHandle(Hash,GetHandleId(t),0,AddSpecialEffect("Effect\\SpellBloodExplosive-Kill.mdx",GetUnitX(f3),GetUnitY(f3)))
call CreateUnit(Player(10),'e00U',GetUnitX(f3),GetUnitY(f3),0)
// call TimerStart(t,5.,false,function AbomDestroyEffect)
set F = CreateUnit(Player(10),'uabo',GetUnitX(f3),GetUnitY(f3),bj_UNIT_FACING)
call PlaySoundAtPoint("AbominationAlternateDeath1.wav", GetUnitX(f3), GetUnitY(f3) )
set f = PickRandomUnit(Undead[UGM]) // в теории все работает как distunit
if UGM == 1 and UDUNITS == 1 then
set UndeadGroupIsOn[1] = true
elseif UDUNITS >= UndeadMaxCount or DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(f),GetUnitY(f)) > 2000 then
set UDUNITS = 1
set UndeadGroupShouldBeEliminated[UGM] = true
set UGM = UGM + 1 //??? =)
set UndeadGroupIsOn[UGM] = true
set Undead[UGM] = CreateGroup() // создается новая группа, без этого никак. Чуть ниже добавляется юнит
//call echo("UGM == " + I2S(UGM))
//set UDUNITS[UGM-1] = 0
endif
call GroupAddUnit(Undead[UGM],F)
call DestroyTimer(T)
set f3=null
set f=null
endfunction
function AbomCreatePortal1 takes nothing returns nothing
local unit f3
set T=GetExpiredTimer()
set IDT = GetHandleId(T)
set f3=LoadUnitHandle(Hash,IDT,0)
call PlaySoundAtPoint("AbominationYesAttack1.wav", GetUnitX(f3), GetUnitY(f3) )
call DestroyEffect(AddSpecialEffect("SpellBloodExplosive-Cast.mdx",GetUnitX(f3),GetUnitY(f3)))
call TimerStart(T,0.7,false,function AbomCreatePortal2)
set f3=null
endfunction
function Circulation_Projectiles_L2 takes nothing returns nothing // DOP
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
//local unit tr = LoadUnitHandle(Hash,idT,0)
local integer clot = LoadInteger(Hash,idT,3) - 1
//local unit c = LoadUnitHandle(Hash,idT,6)
local boolean b = LoadBoolean(Hash,idT,9)
set B = Condition(function IsDreadLord_Nearby)
//local location l =
//local location l2 =
local integer i4
set F = LoadUnitHandle(Hash,idT,1)
if b == true then
set b = false
set i4 = 1
else
set b = true
set i4 = 2
endif
//call echo("go cheg")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1450,B)
set F2 = DistToUnit(GetUnitX(F), GetUnitY(F), P)
if F2 != null then
call SaveReal(Hash,GetHandleId(F2),StringHash("Circulation2_HPRestoration"),(GetUnitState(F2,UNIT_STATE_MAX_LIFE) * 0.05))
call SaveReal(Hash,GetHandleId(F2),StringHash("Circulation2_MPRestoration"),(GetUnitState(F2,UNIT_STATE_MAX_LIFE) * 0.04))
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Source = F2
set udg_Missile__Owner = GetOwningPlayer(F2)
set udg_Missile__Target = F2
set udg_Missile__Origin = GetUnitLoc(F)
set udg_Missile__OriginZ = 00.00
set udg_Missile__Impact = GetUnitLoc(F2)
set udg_Missile__ImpactZ = 80.00
if DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(F2),GetUnitY(F2)) < 230 then
set udg_Missile__FlyTime = 0.45
elseif DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(F2),GetUnitY(F2)) > 1000
set udg_Missile__FlyTime = 1.85
else
set udg_Missile__FlyTime = 1.15
endif
set udg_Missile__Speed = 250.
set udg_Missile__Collision = 108.00 //64
set udg_Missile__Height = 130// GetRandomReal(110,195) //250.00
set udg_Missile__Damage = 1.00
set udg_Missile__Curve = ( -40.00 + ( 25.00 * I2R( i4 ) ) )
set udg_Missile__Model = "Void Spear.mdx"
set udg_Missile__Scale = 1.10
//"Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
//set udg_Missile__OnCollideUnit = gg_trg_DreadLordGetHealed
set udg_Missile__OnFinish = gg_trg_GREATPORTALHEAL
set udg_Missile__Data = 1
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
endif
/*
set udg_Projectile_AttackType = ATTACK_TYPE_NORMAL
set udg_Projectile_Damage = 0.00
set udg_Projectile_DamageType = DAMAGE_TYPE_UNKNOWN
set udg_Projectile_Impact = ""
set udg_Projectile_Height = GetRandomReal(110,170) //GetRandomReal(40,120.)
set udg_Projectile_Model = "Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
set udg_Projectile_Source = tr
set udg_Projectile_Speed = 30.00
set udg_Projectile_TargetUnit = c
set udg_Projectile_Trigger = gg_trg_DreadLordGetHealed
set udg_Projectile_UnitOrPoint = true
set udg_Projectile_HArc = true
set udg_Projectile_HArcWidth = 15.00
set udg_Projectile_HArcLeftOrRight = b // yeah we change it
set udg_Projectile_Size = GetRandomReal(65,100)
call TriggerExecute( gg_trg_CPS_Creating ) */
if clot <= 0 then
//call RemoveSavedReal(Hash,GetHandleId(F2),StringHash("Circulation2_HPRestoration"))
//call RemoveSavedReal(Hash,GetHandleId(F2),StringHash("Circulation2_MPRestoration"))
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(Hash,idT)
//call KillUnit(F)
//call RemoveUnit(tr)
else
call SaveInteger(Hash,idT,3,clot)
call SaveBoolean(Hash,idT,9,b)
//if clot <= 3 then
//call DestroyEffect(LoadEffectHandle(Hash,idT,11))
//endif
endif
call DestroyBoolExpr(B)
set t = null
endfunction
function Circulation_NeedToStart takes nothing returns nothing // DOP
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
//local unit tr = LoadUnitHandle(Hash,idT,0)
//local integer clot = LoadInteger(Hash,idT,3)
//local unit c = LoadUnitHandle(Hash,idT,6)
local boolean b = LoadBoolean(Hash,idT,9)
set B = Condition(function IsDreadLord_Nearby)
//local location l =
//local location l2 =
local integer i4
local unit f
local unit nearest
set f = LoadUnitHandle(Hash,idT,1)
if b == true then
//call SetUnitAnimation(F,"stand")
set b = false
call SaveBoolean(Hash,idT,9,false)
set i4 = 1
else
set b = true
set i4 = 2
endif
//call echo("go cheg")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(f),GetUnitY(f),1150,B) //B
//call echo(GetUnitName(f))
set nearest = DistToUnit(GetUnitX(f), GetUnitY(f), P)
if nearest != null then
call SaveBoolean(Hash,idT,9,true)
call PauseTimer(t)
call TimerStart(t,0.45,true,function Circulation_Projectiles_L2)
//call echo ("EST POGNALI")
else
//call echo("net")
endif
//call echo("dop")
call DestroyBoolExpr(B)
set t = null
set f=null
set nearest=null
endfunction
function Source_Animation_Reset takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
call SetUnitAnimation(LoadUnitHandle(Hash,idT,0),"stand")
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
endfunction
function Trig_GREATPORTALCREATE_Actions takes nothing returns nothing
local integer i
local timer t
local integer idT
local unit d
local unit f
local timer t2
local integer idT2
set i = GreatSourceInt
set ISRECTALIVE[i] = false
call GroupClear(LIVINGgroup[i])
call DestroyGroup(LIVINGgroup[i])
call RemoveRegion(LivingRegionGlobal[i])
set d = CreateUnit(Player(0),'e009',GetRectCenterX(LIVINGrect[i]), GetRectCenterY(LIVINGrect[i]),0)
call UnitApplyTimedLife(d,'BTLF',5.)
if CiliviansMurdered != true then
if RusTips == false then
call MsgForce(HumanForce,"|c00BD204FThe region is lost.|r")
else
call MsgForce(HumanForce,"|c00BD204FПоселение захвачено.|r")
endif
if RusTips == false then
call MsgForce(UndeadForce,"|c00BD204FThe region is captured.|r")
else
call MsgForce(UndeadForce,"|c00BD204FПоселение захвачено|r")
endif
call PingMinimapForForceExJ(HumanForce, GetRectCenterX(LIVINGrect[i]), GetRectCenterY(LIVINGrect[i]), 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 234, 0, 140)
endif
call PingMinimapForForceExJ(UndeadForce, GetRectCenterX(LIVINGrect[i]), GetRectCenterY(LIVINGrect[i]), 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 100, 255, 140)
if RectDeadReal <= 0. then // PREVENT TOO MUCH WARNING SOUND
set bj_lastPlayedSound = gg_snd_Warning
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_Warning)
//endif
//if IsPlayerInForce(GetLocalPlayer(),UndeadForce)
// call StartSound(gg_snd_ObsidianStatueWhat2)
//endif
//set RectDeadReal = 8.
if DarkSourceTip != true then
set DarkSourceTip = true
if RusTips == false then
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 14, "|c005B002EFirst source is opened. The Lord is pleased with your accomplishments. Come near source and get your reward.|r")
endif
else
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 14, "|c005B002EПервый тёмный портал открыт. Лорд доволен твоими достижениями.|r")
endif
endif
call TimerStart(CreateTimer(),15,false,function DarkSource_Tip)
endif
//call Msg("|c00FF712DThe region is lost.|r",4.)
else
//call Msg(R2S(RectDeadReal),4.)
endif
//call SetBlight( Player(8), GetRectCenterX(LIVINGrect[i]), GetRectCenterY(LIVINGrect[i]),128*11 ,true )
set t = CreateTimer()
set idT = GetHandleId(t)
call SaveReal(Hash,idT,0,GetRectCenterX(LIVINGrect[i]))
call SaveReal(Hash,idT,1,GetRectCenterY(LIVINGrect[i]))
call SaveReal(Hash,idT,2,RectBlightWidth[i])
call TimerStart(t,0.8,true,function SetFullBlight)
if i == 1 then
call KillDestructable( gg_dest_B006_7195 )
call KillDestructable( gg_dest_B007_4050 )
call KillDestructable( gg_dest_B008_7197 )
call CreateDestructable('B00F',9600,5640,GetRandomReal(0,360),GetRandomReal(0.65,0.95), 1)
call CreateDestructable('B00F',8700,5080,GetRandomReal(0,360),GetRandomReal(0.65,0.95), 1)
call CreateDestructable('B00F',7580,7200,GetRandomReal(0,360),GetRandomReal(0.65,0.95), 1)
call CreateDestructable('B00F',9500,7800,GetRandomReal(0,360),GetRandomReal(0.65,0.95), 1)
elseif i == 2
call KillDestructable( gg_dest_B00D_1486 )
elseif i == 3
call KillDestructable( gg_dest_B00A_3318 )
call KillDestructable( gg_dest_B00B_3317 )
call KillDestructable( gg_dest_B009_3329 )
call KillDestructable( gg_dest_B006_3315 )
elseif i == 5 then
if not IsUnitDead(gg_unit_hcas_0097) then
call KillUnit(gg_unit_hcas_0097)
endif
elseif i == 7
if not IsUnitDead(gg_unit_hcas_0097) then
call KillUnit(gg_unit_e00K_0882)
endif
call KillDestructable( gg_dest_B008_5370 )
call KillDestructable( gg_dest_B007_7277 )
elseif i == 11
call KillDestructable( gg_dest_B00C_10263 )
call KillDestructable( gg_dest_B00B_0084 )
call KillDestructable( gg_dest_B00B_10264 )
call KillDestructable( gg_dest_B00A_10265 )
call KillDestructable( gg_dest_B00C_0085 )
call KillDestructable( gg_dest_B00C_10266 )
call KillDestructable( gg_dest_B00C_10270 )
call KillDestructable( gg_dest_B00A_10269 )
call KillDestructable( gg_dest_B00A_0089 )
call KillDestructable( gg_dest_B00C_10268 )
call KillDestructable( gg_dest_B00B_10267 )
call KillDestructable( gg_dest_B00B_0087 )
elseif i == 12
call KillDestructable( gg_dest_B008_5370 )
call KillDestructable( gg_dest_B007_7277 )
endif
//call FlushChildHashtable(Hash,idT)
//call DestroyTimer(t)
call DestroyEffect(LIVINGrectPORTALEFFECTbutitsreal[i])
set f = CreateUnit(Player(10),'e00L',GetUnitX(LIVINGrectPORTALEFFECT[i]), GetUnitY(LIVINGrectPORTALEFFECT[i]),0)
set greatsourcenumber = greatsourcenumber + 1
set GreatSources[greatsourcenumber] = f
// call UnitAddAbility(f,'Amrf')
//call UnitRemoveAbility(f,'Amrf')
//call SetUnitFlyHeight(f,-200,0)
call SetUnitAnimation(f,"birth")
set t2= CreateTimer()
set idT2 = GetHandleId(t2)
call SaveUnitHandle(Hash,idT2,0,f)
call TimerStart(t2,0.75,false,function Source_Animation_Reset)
//call echo("STARTportal")
call GroupAddUnit(GreatSourcesDealAura,f)
call KillUnit(LIVINGrectPORTALEFFECT[i])
set t = CreateTimer()
set idT = GetHandleId(t)
call SaveUnitHandle(Hash,idT,1,f)
call SaveInteger(Hash,idT,3,20)
call SaveBoolean(Hash,idT,9,true)
//call echo("lost")
// потом надо будет проверять на расстоянии когда подойдут тогда и активировать DOP
//call echo("pooom")
if Abominations==true then
//call echo("da sdelano")
set T=CreateTimer()
set IDT=GetHandleId(T)
call SaveUnitHandle(Hash,IDT,0,f)
call TimerStart(T,4.,false,function AbomCreatePortal1)
endif
call TimerStart(t,1.,true,function Circulation_NeedToStart) // 0,2
call RemoveRect(LIVINGrect[i])
set t = null
set d = null
set f = null
set t2 = null
endfunction
//===========================================================================
function InitTrig_GREATPORTALCREATE takes nothing returns nothing
set gg_trg_GREATPORTALCREATE = CreateTrigger( )
call TriggerAddAction( gg_trg_GREATPORTALCREATE, function Trig_GREATPORTALCREATE_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_testFinishPaladin_Actions takes nothing returns nothing
call echo("test tanks are activated")
set PalSurviveReal = 20. //1980.
set PalSurvive = true
endfunction
//===========================================================================
function InitTrig_testFinishPaladin takes nothing returns nothing
set gg_trg_testFinishPaladin = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_testFinishPaladin, Player(0), "-SteamTankGo", true )
call TriggerAddAction( gg_trg_testFinishPaladin, function Trig_testFinishPaladin_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_UndeadArmyTest1_Actions takes nothing returns nothing
local unit f
// if T2Nplayer == 0 or T1Nplayer == 0 then //
set UDUNITS = 0
set UndeadGroupIsOn[UGM] = true
call echo("test command has spawned undead and Hero in northeneast part of a map")
loop
set f = FirstOfGroup(udg_grouptest)
exitwhen f == null
//if UDUNITS == 0 then
// set UndeadGroupShouldBeEliminated[UGM] = true
//set UGM = UGM + 1 //??? =)
//set Undead[UGM] = CreateGroup()
// set UDUNITS = 1
// else
// UDUNITS++
// endif
call ShowUnit(f,true)
set UDUNITS = UDUNITS + 1
call GroupAddUnit(Undead[UGM],f)
call GroupRemoveUnit(udg_grouptest,f)
endloop
call DestroyGroup(udg_grouptest)
set UDUNITS=6
// endif
set f = null
endfunction
//===========================================================================
function InitTrig_UndeadArmyTest1 takes nothing returns nothing
set gg_trg_UndeadArmyTest1 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_UndeadArmyTest1, Player(0), "-undeadarmytt", true )
call TriggerRegisterPlayerChatEvent( gg_trg_UndeadArmyTest1, Player(6), "-undeadarmytt", true )
call TriggerAddAction( gg_trg_UndeadArmyTest1, function Trig_UndeadArmyTest1_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope HuntSystem initializer HS
function SteamTankKillDestructable takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function SoundPlayGeneralForPlayer takes string path, real pitch, player whichPlayer, boolean isloop returns sound
local sound snd = CreateSound(path, isloop, false, false, 10, 10, "DefaultEAXON")
// Stuff that must be performed immediately upon creation of sounds
call SetSoundChannel(snd, 0)
call SetSoundVolume(snd, 127)
call SetSoundPitch(snd, pitch)
// The sound will have no volume for unwanted players
if GetLocalPlayer() != whichPlayer then
call SetSoundVolume(snd, 0)
endif
call StartSound(snd)
if isloop == false then
call KillSoundWhenDone(snd)
endif
return snd
endfunction
function GoldSoundCallback takes nothing returns nothing
call SoundPlayGeneralForPlayer("Abilities\\Spells\\Items\\ResourceItems\\ReceiveGold.wav", 1.0, GetEnumPlayer(), false)
endfunction
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 //QuestCompleted[6] != 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
local boolean second = false
local rect rct
//local integer i2
set timesec = timesec+0.1
//=====
if not GameOver
//call echo("dodik")
if WhirlWindCD > 0. then
set WhirlWindCD = WhirlWindCD - 0.1
endif
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))
if CiliviansMurdered == true then
set VoidShadowR = VoidShadowR - 0.1
if VoidShadowR <= 0. then
set VoidShadowR = 30.
set I = 1
loop
exitwhen I > 15
if GreatSources[I] != null then
set X2 = GetUnitX(GreatSources[I])
set Y2 = GetUnitY(GreatSources[I])
set F = CreateUnit(Player(10),'nvdw',X2,Y2,bj_UNIT_FACING)
call DestroyEffect(AddSpecialEffect("Void Teleport Target.mdx",X2,Y2))
call GroupAddUnit(Undead[UGM],F)
endif
//call echo(".")
set I = I + 1
endloop
endif
endif
set time = time + 0.1
set timeperm = timeperm + 0.1
if PalSurvive == true then
set PalSurviveReal = PalSurviveReal - 0.1
endif
if PalSurvive == true and PalSurviveReal <= 0. and PalSurviveBl == false then
//call echo("&&&&&&")
set PalSurviveBl = true
call TriggerExecute(gg_trg_SteamTanksAreComing)
if RusTips == false then
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Steam Tanks arrived! |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Paladins! Follow the steam tanks to support them destroying the |c0026D94AMaster Mind|r |c00FBB704altar. |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00A31CE3DreadLords! Dont let |c00FBB704Steam Tanks|r |c00A31CE3destroy Master Mind altar, destroy Tanks before they get to building. |r")
endif
else
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Паровые Машины прибыли! |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Паладины! Следуйте за паровыми машинами. Они уничтожат |c0026D94AMaster Mind|r |c00FBB70 противника на северо востоке полуострова, и вы выиграете. |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00A31CE3Дредлорды! Не позвольте|c00FBB704Паровым Машинам|r |c00A31CE3добраться до Master Mind и уничтожить его. Избавьтесь от машин. |r")
endif
endif
// call TriggerExecute(gg_trg_PalSurvive) // time to change the rules in 4.6
endif
//call echo("ddd")
if timeperm >= 1600 and PMme == false then
set PMme = true
call Msg("|c00EDBDA7 If you like this map, you can tell me about your experience on hiveworkshop. Nick: ToldYouSo",15.)
call Msg("|c00EDBDA7 Если вам понравилась карта, вы можете написать мне на xgm.guru Ник - ToldYouSo",15.)
endif
if timeperm >= TESTautoUPGRADEtime and TEST == true and TESTupg1 then
set TESTupg1 = false
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 and TESTupg2 then
set TESTupg2 = false
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al02' )
call echo("2 upg")
elseif timeperm >= TESTautoUPGRADEtime + 80. and TEST == true and TESTupg3 then
set TESTupg3 = false
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al03' )
call echo("3 upg")
elseif timeperm >= TESTautoUPGRADEtime + 120. and TEST == true and TESTupg4 then
set TESTupg4 = false
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al04' )
call echo("4 upg")
elseif timeperm >= TESTautoUPGRADEtime + 160. and TEST == true and TESTupg5 then
set TESTupg5 = false
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al05' )
call echo("5 upg")
elseif timeperm >= TESTautoUPGRADEtime + 200. and TEST == true and TESTupg6 then
set TESTupg6 = false
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al06' )
call echo("6 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 PalSurvive and PalSurviveReal <= 100 and DefendingEnd == false //-600 1000 -1700( when mortars go kill everything )- 1800 actually
if RusTips == false then
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00E35782 100 seconds before steam tanks arrive ! |r |r")
endif
else
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00E35782 100 секунд и паровые машины прибудут на полуостров! |r |r")
endif
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 >= 180. and CaptainActivated == false then //240 120 240
//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 rescue squads is established.|r")
//call echo("sdsdsdsd CAPTAIN")
else
set i2 = 1
loop
exitwhen i2 > 12
if CaptainIsOnCd[i2] then
set CaptainCd[i2] = CaptainCd[i2] - 0.1
if CaptainCd[i2] <= 0. then
set CaptainIsOnCd[i2] = FALSE
//set CaptainCd = 45.
endif
endif
i2++
endloop
endif
//call echo("does")
//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"))
set bl = LoadBoolean(Hash, GetHandleId(F), StringHash("Appearing_bl"))
//if bl == false
// call echo("automattt")
// endif
if R <= 0 then
set R = 15
else
set R = R + 24
endif
call SetUnitVertexColor(F, 255, 255, 255, R2I(R))
if R >= 255 or IsUnitDead(F) 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
call GroupClear(P) // SteamTanks destructable
set bj_groupAddGroupDest = P
call ForGroup(DreadStealth,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if not IsUnitDead(f) then
set R = LoadReal(Hash,GetHandleId(f),StringHash("DreadInvis")) - 0.1
set R2 = LoadReal(Hash,GetHandleId(f),StringHash("DreadInvisT"))
if R == 3.9
//call echo("ggg")
set R2 = 255
else
set R2 = R2 - 4
endif
//call echo(R2S(R2))
if R <= 0. then
//call echo("give invis")
call UnitAddAbility(f,Invis)
call GroupRemoveUnit(DreadStealth, f)
call SaveReal(Hash,GetHandleId(f),StringHash("DreadInvisT"),0)
//call
endif
call SetUnitVertexColor(f,255,255,255,R2I(R2))
call SaveReal(Hash,GetHandleId(f),StringHash("DreadInvis"),R)
call SaveReal(Hash,GetHandleId(f),StringHash("DreadInvisT"),R2)
endif
call GroupRemoveUnit(P, f)
endloop
//endif
call GroupClear(P) // SteamTanks destructable
set bj_groupAddGroupDest = P
call ForGroup(SteamTanksGroup,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set X= GetUnitX(f)
set Y = GetUnitY(f)
// set CallDowned = false
//call echo(GetUnitName(f))
set rct = Rect(X - 250, Y- 250, X+ 250, Y+ 250)
// call echo("destroy")
call EnumDestructablesInRect(rct, null, function SteamTankKillDestructable)
call RemoveRect(rct)
if CallDowned == false and GetOwningPlayer(f) == Player(11) then
//call echo("go destroy")
set I = 1
loop
exitwhen I > 15
if GreatSources[I] != null then
set X2 = GetUnitX(GreatSources[I])
set Y2 = GetUnitY(GreatSources[I])
if DistanceXY(X,Y,X2,Y2) < 1200 and IsUnitVisible(GreatSources[I],Player(11)) then
if IssuePointOrder(f, "inferno",X2,Y2) then
set CallDowned = true
//call UnitDamageTarget(c,F,300,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call echo("get it bitch")
call IssuePointOrder(f,"inferno",X2,Y2)
//if IsUnit
//else
endif
endif
endif
//call echo(".")
set I = I + 1
endloop
//call echo(".!")
/* set g= CreateGroup()
//set B = Condition(function SteamRocket_F)
call GroupEnumUnitsInRange(g,X,Y,1200,null)
loop
set F = FirstOfGroup(g)
exitwhen F == null
if IsUnitInGroup(F,GreatSourcesDealAura) then //GetUnitTypeId(F) == 'e00L' then//
endif
call GroupRemoveUnit(g,F)
endloop
call GroupClear(g)
call DestroyGroup(g)
*/
endif
call GroupRemoveUnit(P, f)
endloop
//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 or IsUnitDead(f) 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)
if not IsUnitInGroup(F2,RadianceFireEffect) then
call SaveEffectHandle(Hash,GetHandleId(F2),StringHash("Radiance_enemy_eff"),AddSpecialEffectTarget("Abilities\\Spells\\Other\\ImmolationRed\\ImmolationRedDamage.mdl",F2,"chest"))
call SaveReal(Hash,GetHandleId(F2),StringHash("Radiance_enemy_eff_R"),0.3)
call GroupAddUnit(RadianceFireEffect,F2)
endif
//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) */ //here
/*
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 IssueTargetOrder(f,"creepthunderbolt",F2)
endif
call DestroyBoolExpr(B)
*/
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P) // R A D I A N C E RADIANCE effect target
set bj_groupAddGroupDest = P
call ForGroup(RadianceFireEffect,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set R = LoadReal(Hash,GetHandleId(f),StringHash("Radiance_enemy_eff_R"))
if R <= 0 or IsUnitDead(f) then // or IsUnitDead(f)
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(f),StringHash("Radiance_enemy_eff")))
call RemoveSavedReal(Hash,GetHandleId(f),StringHash("Radiance_enemy_eff_R"))
call GroupRemoveUnit(RadianceFireEffect,f)
else
set R = R-0.1
call SaveReal(Hash,GetHandleId(f),StringHash("Radiance_enemy_eff_R"),R)
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P) // R A I N RAIN FIRE
set bj_groupAddGroupDest = P
call ForGroup(RainFire,function GroupAddGroupEnumJ)
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) )
//call echo("booms")
//DestroyEffect()
//call AddSpecialEffect("Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl",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))
if not IsUnitDead(f) then
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
if GetUnitAbilityLevel(f,'BHds') > 0 and timesec == 1.
set R = GetUnitLife(f) / GetUnitMaxLife(f) * 100.0
if R < 100 then
call SetUnitLife(f,GetUnitLife(f)+ (GetUnitMaxLife(f) * 0.04)) //0.02
endif
if GetUnitStatePercentJ(f, UNIT_STATE_MANA, UNIT_STATE_MAX_MANA) < 100 then
call SetUnitState(f,UNIT_STATE_MANA,GetUnitState(f,UNIT_STATE_MANA) + (GetUnitState(f,UNIT_STATE_MAX_MANA) * 0.03))
endif
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)))
//call echo(R2S(timeperm))
if timeperm == 40.099 then
if TEST == true then
call echo("DID IT")
// call SetPlayerAllianceStateBJ( Player(0), Player(6), bj_ALLIANCE_UNALLIED_VISION )
call SetPlayerAllianceStateControlBJ( Player(6), Player(0), true )
//call SetPlayerAllianceStateFullControlBJ( Player(0), Player(6), true )
call SetPlayerAllianceStateVisionBJ( Player(6), Player(0), true )
call SetPlayerAllianceStateFullControlBJ( Player(6), Player(0), true )
call SetPlayerAllianceStateControlBJ( Player(7), Player(0), true )
//call SetPlayerAllianceStateFullControlBJ( Player(0), Player(6), true )
call SetPlayerAllianceStateVisionBJ( Player(7), Player(0), true )
call SetPlayerAllianceStateFullControlBJ( Player(7), Player(0), true )
call SetPlayerAllianceStateControlBJ( Player(8), Player(0), true )
//call SetPlayerAllianceStateFullControlBJ( Player(0), Player(6), true )
call SetPlayerAllianceStateVisionBJ( Player(8), Player(0), true )
call SetPlayerAllianceStateFullControlBJ( Player(8), Player(0), true )
call SetPlayerAllianceStateControlBJ( Player(9), Player(0), true )
//call SetPlayerAllianceStateFullControlBJ( Player(0), Player(6), true )
call SetPlayerAllianceStateVisionBJ( Player(9), Player(0), true )
call SetPlayerAllianceStateFullControlBJ( Player(9), Player(0), true )
call SetPlayerAllianceStateVisionBJ( Player(10), Player(0), true )
call SetPlayerAllianceStateControlBJ( Player(10), Player(0), true )
call SetPlayerAllianceStateFullControlBJ( Player(10), Player(0), true )
endif
endif
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 > 240. then
set GuardTip[GetPlayerId(GetOwningPlayer(f))] = true
if RusTips == false then
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.)
else
call MsgP(GetPlayerId(GetOwningPlayer(f)),"|c00EDBDA7Здания поблизости с вашим героем дают вам дополнительный обзор на видимость, а также гарантируют true sight (с которым видно Дредлордов). Однако true sight работает на меньшей дистанции (радиус 900 - примерно 18 метров) чем сам обзор башен.|r", 12.)
endif
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
endif
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
if not IsUnitDead(f) then
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
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(UnmountedSlow,function GroupAddGroupEnumJ)
// set g = CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set i2 = GetHandleId(f)
set r = LoadReal(Hash, i2, StringHash("UnmountedSlow_r")) - 0.1
if r <= 0. then
call UnitRemoveAbility(f,'A01V')
call GroupRemoveUnit(UnmountedSlow, f)
call RemoveSavedReal(Hash, i2, StringHash("UnmountedSlow_r"))
//call RemoveSavedReal(Hash, i2, StringHash("STR_r"))
else
call SaveReal(Hash, i2, StringHash("UnmountedSlow_r"), r)
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)
if DreadInstantKillUnit != true then
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)
else
//set d = CrystalShield
// if not IsUnitDead(d) then
// call SetUnitX(d, GetUnitX(f))
// call SetUnitY(d, GetUnitY(f))
// endif
endif
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')
set I2 = LoadInteger(Hash,GetHandleId(f),StringHash("Zeal_lvl"))
if I2 == 1 then
set I = 3
//call SetUnitAbilityLevel(c,'A00J',1)
elseif I2 == 2 then
set I = 5
//call SetUnitAbilityLevel(c,'A00J',3)
elseif I2 == 3 then
set I = 7
//call SetUnitAbilityLevel(c,'A00J',5)
endif
call SetUnitAbilityLevel(f,'A01U',GetUnitAbilityLevel(f,'A01U') - I)
// call echo("Level " + I2S(GetUnitAbilityLevel(f,'A01U')))
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 RemoveSavedInteger(Hash, GetHandleId(f), StringHash("Zeal_lvl"))
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)
//=========================//=========================//=========================
//========================= EVERY SECONS BY TIMESEC ==================================
//=========================//=========================//=========================
if timesec == 1. then // EVERY SEC КАЖДУЮ СЕКУНДУ
RaidInt++
set timesec=0.
set timemin = timemin + 1
set second = true
set GoldIncome = GoldIncome + 1.
if GoldIncome >= 300. or (TEST == true and GoldIncome >= 30) then
set GoldIncome = 0.
set I = 1
set I2 = 0
set i = 0
loop
exitwhen I > 12
if ISRECTALIVE[I] == true then
set I2 = I2 + 20
set i = i + 1
endif
I++
endloop
if I2 > 0 then
set I2 = I2 / T1Nplayer
set I = 0
loop
exitwhen I > 3
if PlayerIsActive(Player(I)) then
//call SetPlayerAllianceStateBJ( Player(id), Player(I), bj_ALLIANCE_ALLIED_UNITS )
call SetPlayerState(Player(I),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I),PLAYER_STATE_RESOURCE_GOLD) + I2)
call AddEffectTimeToPoint("Item_GoldCoins.mdx",GetUnitX(HERO[I]),GetUnitY(HERO[I]),2.5)
endif
I++
endloop
// call echo(GetUnitName(HERO[I]))
// should check it out how to do that properly
//call ForForce(HumanForce, function GoldSoundCallback) // lets postpone local sound
if RusTips == false then
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, ( "Paladins get gold for every region alive." ))
endif
else
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, ("Всё ещё живо " + I2S(i) + " поселений. За каждый регион каждый Паладин получает по |c00FEBA0E" +I2S(I2) + " золота|r"))
endif
endif
endif
endif
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 SetUnitLife(f, GetUnitLife(f) + 7)
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//PatrolMax //
if not IsUnitDead(PatrolUnit[i]) and PatrolUnit[i] != null 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")))
/* if they are enemies around, patrol unit wont go to another patrol point */
/* call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(f),GetUnitY(f),1300,null)
loop
set F =FirstOfGroup(P)
exitwhen F ==null
if UnitTypeNotDummy(F) and IsUnitInGroup(F,MilitiaGroup) and GetUnitAbilityLevel(F,'B005') <= 0 and GetUnitAbilityLevel(F,'B00C') <= 0
call IssuePointOrder(F,"attack",R,R2)
//call echo("me")
endif
call GroupRemoveUnit(F,P)
endloop */
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) // ziccurat hp
set bj_groupAddGroupDest = P
call ForGroup(ZiccuratDefenseGroup,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if not IsUnitDead(f)
if GetUnitLife(f) < GetUnitMaxLife(f) then
if f == MasterMind then
call SetUnitLife(f,GetUnitLife(f)+ 15)
else
call SetUnitLife(f,GetUnitLife(f)+ 8) //7
endif
//call echo("Hp")
endif
else
call GroupRemoveUnit(ZiccuratDefenseGroup,f)
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(MountSpeedIncreasement,function GroupAddGroupEnumJ)
// set g = CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("MountSpeed_R")) + 1.
if r <= 0 then
set r = 1.
endif
set I2 = GetUnitAbilityLevel(f,'A01U')
//call echo("nabiraet skorost")
/* if GetUnitAbilityLevel(f,'B007') > 1 then
set I = LoadInteger(Hash,GetHandleId(f),StringHash("Zeal_lvl"))
if I == 1 then
set i2 = 4
elseif I == 2 then
set i2 = 6
elseif I == 3 then
set i2 = 8
else
set i2 = 0
endif
endif */
call SetUnitAbilityLevel(f,'A01U',I2+2)
//call echo("Level " + I2S(I2+2))
//call echo(I2S(GetUnitAbilityLevel(f,'A01U')))
if r >= 6 then
//call echo("end")
// call echo("nabrano")
call GroupRemoveUnit(MountSpeedIncreasement,f)
call RemoveSavedHandle(Hash, GetHandleId(f), StringHash("MountSpeed_R"))
else
call SaveReal(Hash, GetHandleId(f), StringHash("MountSpeed_R"), r)
endif
call GroupRemoveUnit(P, f)
endloop
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
//
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_origins"))
if F2 == MasterMind
if not IsUnitDead(F) and not IsUnitDead(F2) and DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(F2),GetUnitY(F2)) <= 1500 then
//call echo("damage master")
call UnitDamageTarget(F2,F,40.,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",F,"chest"))
else
call UnitRemoveAbility(F,'A00I')
call UnitRemoveAbility(F,'BUdd')
call GroupRemoveUnit(Corruption,F)
call RemoveSavedHandle(Hash,GetHandleId(F),StringHash("Corruption_origins"))
endif
else
if not IsUnitDead(F) and not IsUnitDead(F2) and DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(F2),GetUnitY(F2)) <= 1300 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_origins"))
endif
endif
call GroupRemoveUnit(P, F)
endloop
// call echo("damages")
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 not IsUnitDead(F) then
call GroupClear(P2)
if F == MasterMind then
set R = 1500
else
set R = 1300
endif
call GroupEnumUnitsInRange(P2,GetUnitX(F),GetUnitY(F),R,B)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
if not IsUnitInGroup(F2,Corruption) then
//call echo("bam")
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_origins"),F)
endif
call GroupRemoveUnit(P2, F2)
endloop
else
call GroupRemoveUnit(GreatSourcesDealAura,F)
endif
call GroupRemoveUnit(P, F)
endloop
call DestroyBoolExpr(B)
//
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(OrcMovesBack,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if DistanceXY(GetUnitX(f),GetUnitY(f),-5960,-12600) < 250 + GetRandomReal(-60,60)
call IssueImmediateOrder(f,"stop")
call SetUnitPathing(f,true)
call GroupRemoveUnit(OrcMovesBack,f)
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.) */
//call echo("dodik 2")
set TimeToFixAttack = TimeToFixAttack + 1.
if TimeToFixAttack == 5. then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(SteamTanksGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
//call echo (I2S(GetUnitCurrentOrder(F)))
// if GetUnitCurrentOrder(F) != 851983
// call echo("gogo bitch")
if GetUnitCurrentOrder(F) != 852232 and GetOwningPlayer(F) == Player(11) then
//call echo("gogo bitch")
call IssuePointOrder(F, "attack", GetUnitX(MasterMind), GetUnitY(MasterMind))
//else
//call echo("zaniat")
endif
// endif
call GroupRemoveUnit(P, F)
//set i = i + 1
endloop
endif
//call echo(R2S(TimeToFixAttack))
set i = 1
if UDUNITS > 0 then
loop
exitwhen i > UGM
if DreadInstantKillUnit == true and TimeToFixAttack == 5. then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Undead[i],function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
//call echo (I2S(GetUnitCurrentOrder(F)))
if GetUnitCurrentOrder(F) != 851983 //then String2OrderId("attack")
call IssuePointOrder(F, "attack", GetUnitX(CrystalShield), GetUnitY(CrystalShield))
endif
call GroupRemoveUnit(P, F)
//set i = i + 1
endloop
elseif UndeadGroupIsOn[i] == true then
if IsUnitFocused[i] == false and UndeadGroupEliminated[i] != true then
I++
if DreadInstantKillUnit != true then
set F = GroupPickRandomUnitEx(Undead[i]) //grouppickrandomunit
set FocusedUnit[i] = GetClosestUnitInGroup(GetUnitX(F), GetUnitY(F), CilivianzGroup)
else
set FocusedUnit[i] = CrystalShield
endif
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
//if GetUnitCurrentOrder(F) != 851983
call IssuePointOrder(F, "attack", UndeadFocusX[i], UndeadFocusY[i])
// endif
// 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 and /*
*/DistanceXY(GetUnitX(FocusedUnit[i]),GetUnitY(FocusedUnit[i]), UndeadFocusX[i], UndeadFocusY[i]) > 500 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 // and GetUnitCurrentOrder(F) != 851983
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 String2OrderId("attack") 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 DreadInstantKillUnit == true then
if TimeToFixAttack >= 5 then
set TimeToFixAttack = 0.
endif
elseif 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 rct = 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 UndeadGroupIsOn[1] = true
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 ISRECTALIVE[9] = true
set ISRECTALIVE[10] = true
set ISRECTALIVE[11] = true
set ISRECTALIVE[12] = 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 QuestCompleted[6] = 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
function Trig_____________________________________018_Actions takes nothing returns nothing
call SetPlayerAllianceStateBJ( Player(0), Player(1), bj_ALLIANCE_ALLIED_ADVUNITS )
endfunction
//===========================================================================
function InitTrig_____________________________________018 takes nothing returns nothing
set gg_trg_____________________________________018 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________018, function Trig_____________________________________018_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________010_Actions takes nothing returns nothing
call echo("point is " + I2S(String2OrderId("inferno")))
endfunction
//===========================================================================
function InitTrig_____________________________________010 takes nothing returns nothing
set gg_trg_____________________________________010 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_____________________________________010, 5 )
call TriggerAddAction( gg_trg_____________________________________010, function Trig_____________________________________010_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_rrrsrs_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_rrrsrs takes nothing returns nothing
set gg_trg_rrrsrs = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_rrrsrs, 1.00 )
call TriggerAddAction( gg_trg_rrrsrs, function Trig_rrrsrs_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________005_Actions takes nothing returns nothing
call KillUnit( )
call KillUnit( )
call KillUnit( )
call KillUnit( )
endfunction
//===========================================================================
function InitTrig_____________________________________005 takes nothing returns nothing
set gg_trg_____________________________________005 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________005, function Trig_____________________________________005_Actions )
endfunction
//TESH.scrollpos=288
//TESH.alwaysfold=0
scope HuntSystem initializer HS
globals
endglobals
function FU_Reset takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local integer i = LoadInteger(Hash,idT,0)
local unit u = LoadUnitHandle(Hash,idT,1)
//call echo("проверка..")
//call echo(I2S(i) + "=i")
if IsUnitFocused[i] == true and u == FocusedUnit[i] and not IsUnitDead(u) then
set IsUnitFocused[i] = false
call echo("не успели")
endif
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
set u = null
endfunction
function String2OrderId takes string orderIdString returns integer
local integer orderId
// Check to see if it's a generic order.
set orderId = OrderId(orderIdString)
if (orderId != 0) then
return orderId
endif
// Check to see if it's a (train) unit order.
set orderId = UnitId(orderIdString)
if (orderId != 0) then
return orderId
endif
// Unrecognized - return 0
return 0
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
//=====
set time = time + 0.1
set timeperm = timeperm + 0.1
if timeperm == 20. then //240
set CaptainActivated = TRUE
//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()
set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(g)
exitwhen f == null
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(f),GetUnitY(f),1400,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if IsUnitType(F,UNIT_TYPE_STRUCTURE) and GetOwningPlayer(F) == Player(11) then
if LoadReal(Hash,GetHandleId(F),StringHash("STR_r")) <= 0. then
call SaveUnitHandle(Hash,GetHandleId(F),StringHash("STR_u"),CreateUnit(GetOwningPlayer(f),'e003',GetUnitX(F),GetUnitY(F),0))
endif
call SaveReal(Hash,GetHandleId(F),StringHash("STR_r"),3.)
if not IsUnitInGroup(F,BuildVision) then
call GroupAddUnit(BuildVision,F)
endif
endif
call GroupRemoveUnit(P,F)
endloop
//call DestroyGroup(P)
call GroupRemoveUnit(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(BuildVision)
loop
set f = FirstOfGroup(g)
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(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(ReplicsGroup)
loop
set f = FirstOfGroup(g)
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(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(ShareVisionGroup)
loop
set f = FirstOfGroup(g)
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 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(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(Zeal_Casters) // ZEAL zeal group casters
loop
set f = FirstOfGroup(g)
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(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(Sorcerers)
loop
set f = FirstOfGroup(g)
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(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(PowerDashHaste)
loop
set f = FirstOfGroup(g)
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(g,f)
endloop
call DestroyGroup(g)
set g = CopyGroup(DSgroup)
loop
set f = FirstOfGroup(g)
exitwhen f == null
if GetUnitAbilityLevel(f,'B005') <= 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(g,f)
endloop
call DestroyGroup(g)
/* if timeperm == 60 then
set timeperm = 0.
set i = 0
loop
exitwhen i == 10
call AdjustPlayerStateJ( 1, Player(i), PLAYER_STATE_RESOURCE_FOOD_CAP)
set i = i + 1
endloop
endif */
if time == 1. then //was 1.0
set time = 0.
set i = 0
set g = CopyGroup(RageOfTheDamned)
loop
set f = FirstOfGroup(g)
exitwhen f == null
if GetUnitAbilityLevel(f,'Buhf') > 0 then
call SetWidgetLife(f,GetWidgetLife(f) + 4)
else
call GroupRemoveUnit(RageOfTheDamned,f)
endif
call GroupRemoveUnit(g,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_CamStart2
else
set cs = gg_cam_CamStart1
endif
if GetLocalPlayer() == Player(i) then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, distance[i], 1.00 )
//call Msg(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
/* set r = LoadReal(Hash,idT,0)
call SaveReal(Hash,idT,0,r + 1.) */
set i = 1
if UDUNITS > 0 then
loop
exitwhen i > UGM
//call ("?")
if IsUnitFocused[i] != true and not UndeadGroupEliminated[i] == true then
//call echo("!")
//set P = CreateGroup()
//set i2 = 1
//call echo(GetUnitName(FocusedUnit[i]))
//set P2 = CopyGroup(Cilivians[1])
//loop
//set F2 = FirstOfGroup(P2)
//exitwhen F2 == null
//call echo(GetUnitName(F2))
//call GroupRemoveUnit(P2,F2)
//endloop
//call GroupClear(P)
//call GroupClear(P2)
/*loop
exitwhen i2 > CGMmax
set P2 = CopyGroup(Cilivians[i2])
call GroupAddUnit(P,DistToUnit(GetUnitX(F),GetUnitY(F), P2))
set i2 = i2 + 1
endloop */
//call echo(GetUnitName(FocusedUnit[i]))
set F = PickRandomUnit(Undead[i])
//call echo("рандомный юнит по имени " + GetUnitName(F))
set g = CopyGroup(CilivianzGroup)
set FocusedUnit[i] = DistToUnit(GetUnitX(F),GetUnitY(F), g)//DistToUnit(GetUnitX(F),GetUnitY(F), P)
//call echo("ыыыы " + GetUnitName(FocusedUnit[i]))
call GroupClear(g)
call DestroyGroup(g)
//call GroupClear(P2)
//call DestroyGroup(P)
//loop
//set FocusedUnit[i] = PickRandomUnit(Cilivians[1])
//exitwhen not IsUnitDead(FocusedUnit[i])
//endloop
//call DestroyGroup(P)
//call echo(I2S(i) + "=i")
//call GroupClear(P)
set FirstUnitDS = false
set g = CopyGroup(Undead[i])
loop
set f = FirstOfGroup(g)
exitwhen f == null
if FirstUnitDS == false then
set FirstUnitDS = true
/* set r = DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(FocusedUnit[i]),GetUnitY(FocusedUnit[i])) / BasicalHauntSpeed
set t = CreateTimer()
call SaveInteger(Hash,GetHandleId(t),0,i) //
call SaveUnitHandle(Hash,GetHandleId(t),1,FocusedUnit[i])
call TimerStart(t,r,false,function FU_Reset) */
//
endif
call IssuePointOrder(f,"attack",GetUnitX(FocusedUnit[i]),GetUnitY(FocusedUnit[i]))
call GroupRemoveUnit(g,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 UndeadGroupEliminated[i] != true then
//set FirstUnitDS = false
set g = CopyGroup(Undead[i])
loop
set f = FirstOfGroup(g)
exitwhen f == null
if FocusedUnit[i] != null and GetUnitCurrentOrder(f) != String2OrderId("attack") then // 851983 then//String2OrderId("attack") then
call IssuePointOrder(f,"attack",GetUnitX(FocusedUnit[i]),GetUnitY(FocusedUnit[i]))
//call echo("??? ????????")
endif
call GroupRemoveUnit(g,f)
//set i = i + 1
endloop
call DestroyGroup(g)
//call GroupClear(P)
endif
set i = i + 1
endloop
endif
endif
//====
set t = null
set g = null
set f = null
set d = null
set cs = 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)
set distance[0] = 1750
set distance[1] = 1750
set distance[2] = 1750
set distance[3] = 1750
set distance[6] = 1750
set distance[7] = 1750
set distance[8] = 1750
set distance[9] = 1750
// ======
set i = 1
loop
exitwhen i > UGMmax
set IsUnitFocused[i] = false
set UndeadGroupShouldBeEliminated[i] = false
set UndeadGroupEliminated[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 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)
call GroupAddUnit(Undead[UGM],gg_unit_nzom_0030)
set UDUNITS = 3 // because we added 3 zombies to group right now */
call GroupAddUnit(Paladins,gg_unit_Hpal_0503)
call GroupAddUnit(Paladins,gg_unit_H001_0245)
call GroupAddUnit(DreadLords,gg_unit_Udre_0043)
call GroupAddUnit(DreadLords,gg_unit_U000_0551)
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
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DreadPreparedToMissle_Actions2 takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
set F = CreateUnit(Player(13),'e00G',11770.,11900.,0)
call KillUnit(F)
endfunction
function Trig_DreadPreparedToMissle_Actions takes nothing returns nothing
set udg_Missile__WantDestroy = true
set F = CreateUnit(Player(13),'e00G',11770.,11900.,0)
call KillUnit(F)
call TimerStart(CreateTimer(),7.2,false,function Trig_DreadPreparedToMissle_Actions2)
endfunction
//===========================================================================
function InitTrig_DreadPreparedToMissle takes nothing returns nothing
set gg_trg_DreadPreparedToMissle = CreateTrigger( )
call TriggerAddAction( gg_trg_DreadPreparedToMissle, function Trig_DreadPreparedToMissle_Actions )
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function Trig_TESTFORALLTEAM_Actions takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
if TEST == true then
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_DreadLordsStartingRegion,null)
//call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if IsUnitType(F,UNIT_TYPE_HERO) then
call GroupAddUnit(DreadLords,F)
call SetHeroLevel(F,10,false)
endif
call GroupRemoveUnit(P,F)
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_PaladinsStartRegion,null)
//call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if IsUnitType(F,UNIT_TYPE_HERO) then
call GroupAddUnit(Paladins,F)
call SetHeroLevel(F,10,false)
call UnitAddItemById(F,'bspd')
endif
call GroupRemoveUnit(P,F)
endloop
set I = 6
loop
exitwhen I > 9
call SetPlayerAllianceStateBJ( Player(I), Player(10), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(10), Player(I), bj_ALLIANCE_ALLIED_VISION )
I++
endloop
set I = 0
loop
exitwhen I > 3
call SetPlayerAllianceStateBJ( Player(I), Player(11), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(11), Player(I), bj_ALLIANCE_ALLIED_VISION )
I++
endloop
endif
endfunction
//===========================================================================
function InitTrig_TESTFORALLTEAM takes nothing returns nothing
call TimerStart(CreateTimer(),12.,false,function Trig_TESTFORALLTEAM_Actions)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________012_Actions takes nothing returns nothing
call KillUnit( )
endfunction
//===========================================================================
function InitTrig_____________________________________012 takes nothing returns nothing
set gg_trg_____________________________________012 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________012, function Trig_____________________________________012_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_iseedeadpeoplered_Actions takes nothing returns nothing
local fogmodifier fr = CreateFogModifierRect(Player(0), FOG_OF_WAR_VISIBLE, bj_mapInitialPlayableArea, false, false)
call FogModifierStop(fr)
if GetPlayerName(Player(0)) == "SinnerPo" then
if GetLocalPlayer() == Player(0) then //+++++ REMOVING FOG MASK TO ALLOW PLAYER LOOK FOR MISSLE
call FogModifierStart(fr)
endif
endif
set fr = null
endfunction
//===========================================================================
function InitTrig_iseedeadpeoplered takes nothing returns nothing
set gg_trg_iseedeadpeoplered = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_iseedeadpeoplered, Player(0), "-i fucking love myself", true )
call TriggerAddAction( gg_trg_iseedeadpeoplered, function Trig_iseedeadpeoplered_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_iseedeadpeoplegreen_Actions takes nothing returns nothing
local fogmodifier fr = CreateFogModifierRect(Player(6), FOG_OF_WAR_VISIBLE, bj_mapInitialPlayableArea, false, false)
call FogModifierStop(fr)
if GetPlayerName(Player(6)) == "SinnerPo" then
if GetLocalPlayer() == Player(6) then //+++++ REMOVING FOG MASK TO ALLOW PLAYER LOOK FOR MISSLE
call FogModifierStart(fr)
endif
endif
set fr = null
endfunction
//===========================================================================
function InitTrig_iseedeadpeoplegreen takes nothing returns nothing
set gg_trg_iseedeadpeoplegreen = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_iseedeadpeoplegreen, Player(6), "-iseedeadpeople pogomaster", true )
call TriggerAddAction( gg_trg_iseedeadpeoplegreen, function Trig_iseedeadpeoplegreen_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_LeaderboardCreate_Actions takes nothing returns nothing
if (T1Nplayer == 1 and T2Nplayer == 0) or (T1Nplayer == 0 and T2Nplayer == 1 ) then
set CilivianzAlive = CreateLeaderboard()
//if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
call PlayerSetLeaderboard(GetLocalPlayer(), CilivianzAlive)
//endif
call LeaderboardSetLabel(CilivianzAlive, "Villagers Alive - " + I2S(R2I(100*CGM/CGMMax)) + "%")
call LeaderboardDisplay(CilivianzAlive, true)
//call LeaderboardAddItem(CilivianzAlive, "Villagers Alive - ", 0, Player(5))
//call LeaderboardSetSizeByItemCount(CilivianzAlive, 1)
set LeaderBoardActive = true
endif
endfunction
//===========================================================================
function InitTrig_LeaderboardCreate takes nothing returns nothing
set gg_trg_LeaderboardCreate = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_LeaderboardCreate, Player(0), "-Leaderboard create tt", true )
call TriggerAddAction( gg_trg_LeaderboardCreate, function Trig_LeaderboardCreate_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________009_Func001A takes nothing returns nothing
endfunction
function Trig_____________________________________009_Actions takes nothing returns nothing
call EnumDestructablesInCircleJ( 256, X, Y, function Trig_____________________________________009_Func001A )
endfunction
//===========================================================================
function InitTrig_____________________________________009 takes nothing returns nothing
set gg_trg_____________________________________009 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________009, function Trig_____________________________________009_Actions )
endfunction
local rect r
if (radius >= 0) then
set bj_enumDestructableRadius = radius
set r = Rect(X - radius, Y - radius, X + radius, Y + radius)
call EnumDestructablesInRect(r, filterEnumDestructablesInCircleBJ, actionFunc)
call RemoveRect(r)
endif
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_EnterMap_Actions takes nothing returns nothing
local unit e = GetEnteringUnit()
//call echo("get")
if UnitTypeNotDummy(e) then
//if GetOwningPlayer(e) == Player(11) and not IsUnitType(e,UNIT_TYPE_STRUCTURE) and not IsUnitType(e,UNIT_TYPE_HERO) then
//call GroupAddUnit(MilitiaGroup,e)
//endif
if Everlasting then
if GetUnitTypeId(e) == skeleton then
call UnitAddAbility(e,'A00Y')
call SetUnitAbilityLevel(e,'A00Y',1)
elseif GetUnitTypeId(e) == skeletonarcher
call UnitAddAbility(e,'A00Y')
call SetUnitAbilityLevel(e,'A00Y',2)
elseif GetUnitTypeId(e) == skeletonmage
call UnitAddAbility(e,'A00Y')
call SetUnitAbilityLevel(e,'A00Y',3)
endif
endif
if IsUnitEnemy(e,Player(0)) and T1Nplayer > 1 then
call UnitAddAbility(e,'A00W')
call SetUnitAbilityLevel(e,'A00W',LVLfor1T)
call UnitAddAbility(e,'A00X')
call SetUnitAbilityLevel(e,'A00X',LVLfor1T)
endif
if IsUnitEnemy(e,Player(6)) and T2Nplayer > 1 then
call UnitAddAbility(e,'A00W')
call SetUnitAbilityLevel(e,'A00W',LVLfor2T)
call UnitAddAbility(e,'A00X')
call SetUnitAbilityLevel(e,'A00X',LVLfor2T)
endif
if GetUnitAbilityLevel(e,'A003') < 1 then
if GetUnitTypeId(e) == steamtank then
//call echo("steam tank get")
endif
call UnitAddAbility( e,'A003' )
endif
if Defend then
if GetUnitTypeId(e) == footman then
call UnitAddAbility(e,'Adef')
elseif GetUnitTypeId(e) == captain then
call UnitAddAbility(e,'AImb')
endif
endif
endif
set e = null
endfunction
//===========================================================================
function InitTrig_EnterMap takes nothing returns nothing
local group g = CreateGroup()
local unit f
set B = Condition(function EnterMap_F)
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,B)
//call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,B)
loop
set f = FirstOfGroup(P)
exitwhen f == null
call UnitAddAbility(f,'A003')
call GroupRemoveUnit(P,f)
endloop
call DestroyBoolExpr(B)
set gg_trg_EnterMap = CreateTrigger( )
call TriggerRegisterEnterRect( gg_trg_EnterMap, bj_mapInitialPlayableArea )
call TriggerAddAction( gg_trg_EnterMap, function Trig_EnterMap_Actions )
call DestroyGroup(g)
set g = null
set f = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Icons_Actions takes nothing returns nothing
//call UnitSetUsesAltIcon( gg_unit_unpl_0136, true )
//call UnitSetUsesAltIcon( gg_unit_nmrk_0087, true )
//call UnitSetUsesAltIcon( gg_unit_hvlt_0086, true )
call TriggerSleepAction(0.5)
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_GOLD, 100 ) //10000
call SetPlayerStateBJ( Player(1), PLAYER_STATE_RESOURCE_GOLD, 100 )
call SetPlayerStateBJ( Player(2), PLAYER_STATE_RESOURCE_GOLD, 100 )
call SetPlayerStateBJ( Player(3), PLAYER_STATE_RESOURCE_GOLD, 100 )
//call SetPlayerStateBJ( Player(6), PLAYER_STATE_RESOURCE_LUMBER, 200 )
endfunction
//===========================================================================
function InitTrig_Icons takes nothing returns nothing
set gg_trg_Icons = CreateTrigger( )
call TriggerAddAction( gg_trg_Icons, function Trig_Icons_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_PaldinsTest_Actions takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
call SuspendTimeOfDay(not false)
if TEST == false then
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_PalTestRegion,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call RemoveUnit(F)
call GroupRemoveUnit(P,F)
endloop
endif
/* call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_DreadLordTestR1,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call PauseUnit(F,true)
call ShowUnit(F,false)
call GroupRemoveUnit(P,F)
endloop */
endfunction
//===========================================================================
function InitTrig_PaldinsTest takes nothing returns nothing
set I = 0
loop
exitwhen I > 3
call SetPlayerAlliance(Player(I), Player(6), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(6), Player(I), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(I), Player(11), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(11), Player(I), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(I), Player(6), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(6), Player(I), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(I), Player(11), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(11), Player(I), ALLIANCE_HELP_RESPONSE, false)
I++
endloop
call TimerStart(CreateTimer(),0.05,false,function Trig_PaldinsTest_Actions)
//set gg_trg_PaldinsTest = CreateTrigger( )
// call TriggerAddAction( gg_trg_PaldinsTest, function Trig_PaldinsTest_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_SMDSP_Actions takes nothing returns nothing
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_DreadLordTestR1,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call ShowUnit(F,true)
call PauseUnit(F,false)
call GroupRemoveUnit(P,F)
endloop
//call echo("+")
endfunction
//===========================================================================
function InitTrig_SMDSP takes nothing returns nothing
set gg_trg_SMDSP = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_SMDSP, Player(0), "ddtt", true )
call TriggerAddAction( gg_trg_SMDSP, function Trig_SMDSP_Actions )
endfunction
//TESH.scrollpos=19
//TESH.alwaysfold=0
// я полагаю здесь есть фича - чужой патруль юнит стопится об чужой регион
function Trig_EnterRect_Actions takes nothing returns nothing
local unit e = GetEnteringUnit()
local integer i = 1
loop
exitwhen i > PatrolMax
if e == PatrolUnit[i] then
call IssueImmediateOrder(e,"stop")
endif
set i = i + 1
endloop
set e = null
endfunction
//===========================================================================
function InitTrig_EnterRect takes nothing returns nothing
set gg_trg_EnterRect = CreateTrigger( )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol2 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol4 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol6 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol8 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol10 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol12 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol14 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol16 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol18 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol20 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol22 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol24 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol26 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol28 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol30 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol32 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol34 )
call TriggerRegisterEnterRect( gg_trg_EnterRect, gg_rct_Patrol36 )
call TriggerAddAction( gg_trg_EnterRect, function Trig_EnterRect_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope CLSM initializer Init
private function ClearText_Actions takes nothing returns nothing
if GetLocalPlayer() == GetTriggerPlayer() then
call ClearTextMessages()
endif
endfunction
private function LeavePlayer_Actions takes nothing returns nothing
local integer id = GetPlayerId(GetTriggerPlayer())
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, ( GetColoredPlayerName( id ) + "|r has leaved this map. So sorry" ))
endif
set NPlayer = NPlayer - 1
// ресурс будет делиться между оставшимися TNPlayer
if IsPlayerInForce(GetTriggerPlayer(), HumanForce) then
T1Nplayer--
set I2 = GetPlayerState(Player(id),PLAYER_STATE_RESOURCE_GOLD) / T1Nplayer
set I = 0
loop
exitwhen I > 3
if PlayerIsActive(Player(I)) then
call SetPlayerAllianceStateBJ( Player(id), Player(I), bj_ALLIANCE_ALLIED_UNITS )
call SetPlayerState(Player(I),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I),PLAYER_STATE_RESOURCE_GOLD) + I2)
endif
I++
endloop
elseif IsPlayerInForce(GetTriggerPlayer(), UndeadForce)
T2Nplayer--
set I2 = GetPlayerState(Player(id),PLAYER_STATE_RESOURCE_GOLD) / T2Nplayer
set I = 6
loop
exitwhen I > 9
if PlayerIsActive(Player(I)) then
call SetPlayerAllianceStateBJ( Player(id), Player(I), bj_ALLIANCE_ALLIED_UNITS )
call SetPlayerState(Player(I),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(Player(I),PLAYER_STATE_RESOURCE_LUMBER) + I2)
endif
I++
endloop
endif
//set PlayerHasLost[id] = true
//call RemoveUnit(HERO[id])
endfunction
private function GetRandomQuete takes integer id returns string
local string s
local integer i
if id == male or id == male2 then
set i = GetRandomInt(1, 5)
if i == 1 then
set s = "|c00ACB494Hey Ja... You are not a Jack! "
elseif i == 2 then
set s = "|c00ACB494 POLICY HELP! "
elseif i == 3 then
set s = "|c00ACB494 What's is going on? "
elseif i == 4 then
set s = "|c00ACB494 You bastard will burn in hell!"
else
set s = "|c00ACB494 Take my wife, have mercy on me! "
endif
elseif id == female or id == female2 then
set i = GetRandomInt(1, 3)
if i == 1 then
set s = "|c00ACB494 Where is the policy?! "
elseif i == 2 then
set s = "|c00ACB494 How dare you! "
elseif i == 3 then
set s = "|c00ACB494 Dont touch me monster! "
endif
elseif id == kid or id == kid2 then
set i = GetRandomInt(1, 3)
if i == 1 then
set s = "|c00ACB494 Mommy save me! "
elseif i == 2 then
set s = "|c00ACB494 YOU ARE THE MONSTER! "
elseif i == 3 then
set s = "|c00ACB494 What do you need from me! "
endif
endif
return s
endfunction
private function GetRandomQuete2 takes integer id returns string
local string s
local integer i
if id == male or id == male2 then
set i = GetRandomInt(1, 5)
if i == 1 then
set s = "|c00ACB494I'm moving, moving! "
elseif i == 2 then
set s = "|c00ACB494 Hey hey dont touch me! "
elseif i == 3 then
set s = "|c00ACB494 Someone please help me! "
elseif i == 4 then
set s = "|c00ACB494 Okay okay fine, I get out of here"
else
set s = "|c00ACB494 Okay okay fine, I get out of here "
endif
elseif id == female or id == female2 then
set i = GetRandomInt(1, 3)
if i == 1 then
set s = "|c00ACB494 Okay okay fine, I get out of here "
elseif i == 2 then
set s = "|c00ACB494 I'm moving, moving! "
elseif i == 3 then
set s = "|c00ACB494 Calm down, I'm moving! "
endif
elseif id == kid or id == kid2 then
set i = GetRandomInt(1, 3)
if i == 1 then
set s = "|c00ACB494 Mommy save me! "
elseif i == 2 then
set s = "|c00ACB494 FINE I GO "
elseif i == 3 then
set s = "|c00ACB494 Where is my ps vita?"
endif
endif
return s
endfunction
private function CitizenCallForMilitia takes nothing returns nothing
set T = GetExpiredTimer()
set I2 = GetHandleId(T)
local texttag tx
local unit at = LoadUnitHandle(Hash,I2,0)
local unit f = LoadUnitHandle(Hash,I2,1)
local string s
local string s2
set X = LoadReal(Hash,I2,4)
set Y = LoadReal(Hash,I2,5)
//call echo("does")
if DistanceXY(GetUnitX(at), GetUnitY(at),GetUnitX(f),GetUnitY(f)) < 1600 and DistanceXY(X, Y,GetUnitX(f),GetUnitY(f)) > 500 and not IsUnitDead(at) and /*
*/GetUnitAbilityLevel(at,'B005') <= 0 and GetUnitAbilityLevel(at,'B00C') <= 0 then
//call echo("main is active")
set R = LoadReal(Hash,I2,2)
set R2 = LoadReal(Hash,I2,3)
call IssuePointOrder(f,"attack",R,R2)
set tx = CreateTextTag()
set s = ""
set I2 = GetRandomInt(1,3)
if I2 == 1 then
set s2 = "Guys someone is SCREAMING!"
elseif I2 == 2
set s2 = "Let's MOVE Militia!"
else
set s2 = "Paladins we need your help!"
endif
set I = 0
loop
exitwhen I > 3
if DistanceXY(GetUnitX(HERO[I]),GetUnitY(HERO[I]),GetUnitX(f),GetUnitY(f)) <= 1600
if GetLocalPlayer() == Player(I) then
set s = s2
endif
endif
I++
endloop
call SetTextTagColor(tx, 255, 90, 90, 250) //250
call SetTextTagText(tx, s, 0.013 ) //14 05
call SetTextTagPos(tx, GetUnitX(f), GetUnitY(f), GetRandomReal( -55, 55))
call SetTextTagVelocity(tx, 0.0, 0.06) //0.06 0.04
call SetTextTagPermanent(tx, FALSE)
call SetTextTagLifespan(tx, 1.3)
call FT.add(tx, s)
//call echo("ssdd")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(f),GetUnitY(f),850,null)
loop
set F =FirstOfGroup(P)
exitwhen F ==null
if UnitTypeNotDummy(F) and IsUnitInGroup(F,MilitiaGroup) and GetUnitAbilityLevel(F,'B005') <= 0 and GetUnitAbilityLevel(F,'B00C') <= 0
call IssuePointOrder(F,"attack",R,R2)
//call echo("me")
endif
call GroupRemoveUnit(P,F)
endloop
endif
call FlushChildHashtable(Hash,I2)
call DestroyTimer(T)
set at = null
set f = null
set tx = null
endfunction
private function StopAttack_Actions takes nothing returns nothing
local unit ar = GetAttacker()
local unit at = GetTriggerUnit()
local texttag tx
local string s
local integer i = GetHandleId(at)
local real x
local real y
local group g
local unit trg = null
local unit f
// local boolean bh = false
//local boolexpr b
local string s2
if UnitTypeNotDummy(at) and UnitTypeNotDummy(ar) then
if IsPlayerAlly(GetOwningPlayer(ar), GetOwningPlayer(at)) == true or /*
*/ GetOwningPlayer(ar) == GetOwningPlayer(at) then
call IssueImmediateOrder(ar, "stop")
if GetOwningPlayer(at) == Player(5) and IsUnitInGroup(ar, Paladins) and IsUnitInGroup(at, CilivianzGroup) /*
*/ and LoadBoolean(Hash, i, StringHash("ReplicBoolean")) != true /*
*/ and GetUnitTypeId(at) != worker and GetUnitTypeId(at) != sorcerer then
// почему воркер не может позвать стражу XD хз....
//and (GetUnitTypeId(at) == male or GetUnitTypeId(at) == male2)
if IsUnitInGroup(at,ThugsToBeRaidGroup) and ThugsRaidCanBeCanceled then
call GroupClear(ThugsRaidGroup)
call DestroyGroup(ThugsRaidGroup)
call GroupClear(ThugsCampGroup)
call DestroyGroup(ThugsCampGroup)
call GroupClear(ThugsToBeRaidGroup)
call DestroyGroup(ThugsToBeRaidGroup)
call QuestSetFailed( ThugsRaid, true )
call KillUnit( gg_unit_e00P_0262 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[1]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[1])
//call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(gg_unit_hbew_0535),StringHash("QuestMark")))
endif
//call echo("sd")
call SaveReal(Hash, i, StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, i, StringHash("ReplicBoolean"), true)
//call SaveBoolean(Hash, i, StringHash("PaladinTr"), true)
call GroupAddUnit(ReplicsGroup, at)
set tx = CreateTextTag()
set s = ""
set s2 = GetRandomQuete2(GetUnitTypeId(at))
set I2 = 0
loop
exitwhen I2 > 3
if DistanceXY(GetUnitX(HERO[I2]),GetUnitY(HERO[I2]),GetUnitX(at),GetUnitY(at)) <= 1600
if GetLocalPlayer() == Player(I2) then
set s = s2
endif
endif
I2++
endloop
if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
set s = s2
endif
call SetTextTagColor(tx, 173, 90, 90, 250) //250
call SetTextTagText(tx, s, 0.014 ) //14 05
call SetTextTagPos(tx, GetUnitX(at), GetUnitY(at), GetRandomReal( -55, 55))
call SetTextTagVelocity(tx, 0.0, 0.06) //0.06 0.04
call SetTextTagPermanent(tx, FALSE)
call SetTextTagLifespan(tx, 0.7)
call FT.add(tx, s)
//if GetUnitTypeId(at) != kid and GetUnitTypeId(at) != kid2 then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(MilitiaGroup,function GroupAddGroupEnumJ)
loop
set f = GetClosestUnitInGroup(GetUnitX(at), GetUnitY(at), P)
//call echo(GetUnitName(f))
exitwhen DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(at), GetUnitY(at)) > 800 and DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(ar), GetUnitY(ar)) > 1000
call GroupRemoveUnit(P,f)
endloop
//call echo("da rabotaet")
set x = GetUnitX(f) - 165. * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set y = GetUnitY(f) - 165. * Sin(GetUnitFacing(f) * bj_DEGTORAD)
call IssuePointOrder(at, "move", x, y)
set T= CreateTimer()
set I2 = GetHandleId(T)
call SaveUnitHandle(Hash,I2,0,at)
call SaveUnitHandle(Hash,I2,1,f)
call SaveReal(Hash,I2,2,GetUnitX(at))
call SaveReal(Hash,I2,3,GetUnitY(at))
call SaveReal(Hash,I2,4,GetUnitX(at))
call SaveReal(Hash,I2,5,GetUnitY(at))
call TimerStart(T,4.,false,function CitizenCallForMilitia)
//call echo("sdssBRO")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(at),GetUnitY(at),600,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if UnitTypeNotDummy(F) and not IsUnitDead(F) and F != at and IsUnitInGroup(F,CilivianzGroup) and LoadBoolean(Hash, GetHandleId(F), StringHash("ReplicBoolean")) != true then
call SaveReal(Hash, GetHandleId(F), StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, GetHandleId(F), StringHash("ReplicBoolean"), true)
call GroupAddUnit(ReplicsGroup, F)
call IssuePointOrder(F, "move", x + GetRandomReal(-400,400), y + GetRandomReal(-400,400))
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_Y"),y)
if not IsUnitInGroup(F,ReplicsGroupIsOnPoint) then
call GroupAddUnit(ReplicsGroupIsOnPoint,F)
endif
endif
call GroupRemoveUnit(P,F)
endloop
//call echo("@@2eeeee")
if not IsUnitInGroup(at,ReplicsGroupIsOnPoint) then
// call echo("HE REEENS FIRST TIME")
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_Y"),y)
call GroupAddUnit(ReplicsGroupIsOnPoint,at)
else
//call echo("nooo he change his way")
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_Y"),y)
endif
endif
endif
if GetUnitTypeId(at) == worker and GetUnitCurrentOrder(at) == 852018 then
//call echo("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
call IssueTargetOrder(at,"attack",ar)
endif
if GetOwningPlayer(at) == Player(11) and IsUnitEnemy(ar, GetOwningPlayer(at)) and GetRandomInt(0, 100) < 38 and LoadBoolean(Hash, i, StringHash("ReplicBoolean")) != true then
// they dont actually replic but this is just a boolean
//это тригер когда бьют мента но рядом есть живые люди. Также 10% шанс что при замахе на мента ближайший чел в округе просто(без криков о помощи т.к я пока устал) соберет народ и убежит с ними
set B = Condition(function IsCitizensNearby)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(at),GetUnitY(at),850,B) // Suitee-pee
//call echo("make")
//set F = FirstOfGroup(P)
//set bl = false
//loop
set F = GetClosestUnitInGroup(GetUnitX(at), GetUnitY(at), P)
if F != null then
if IsUnitInGroup(F,ThugsToBeRaidGroup) and ThugsRaidCanBeCanceled then
call GroupClear(ThugsRaidGroup)
call DestroyGroup(ThugsRaidGroup)
call GroupClear(ThugsCampGroup)
call DestroyGroup(ThugsCampGroup)
call GroupClear(ThugsToBeRaidGroup)
call DestroyGroup(ThugsToBeRaidGroup)
call QuestSetFailed( ThugsRaid, true )
call KillUnit( gg_unit_e00P_0262 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[1]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[1])
endif
call SaveReal(Hash, i, StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, i, StringHash("ReplicBoolean"), true)
call GroupAddUnit(ReplicsGroup, at)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(MilitiaGroup,function GroupAddGroupEnumJ)
/*
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(P,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
if DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(F), GetUnitY(F)) < 800 then
call GroupRemoveUnit(P,f)
endif
call GroupRemoveUnit(P2,f)
endloop
*/
loop
set f = GetClosestUnitInGroup(GetUnitX(F), GetUnitY(F), P)
//call echo(GetUnitName(f))
// 800 небольшая дистанция, да?
exitwhen (DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(F), GetUnitY(F)) > 800 and DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(ar), GetUnitY(ar)) > 1000) or f == null
call GroupRemoveUnit(P,f)
endloop
//call echo("da rabotaet")
set x = GetUnitX(f) - 165. * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set y = GetUnitY(f) - 165. * Sin(GetUnitFacing(f) * bj_DEGTORAD)
call IssuePointOrder(F, "move", x, y)
call SaveReal(Hash, GetHandleId(F), StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, GetHandleId(F), StringHash("ReplicBoolean"), true)
call GroupAddUnit(ReplicsGroup, F)
set T= CreateTimer()
set I2 = GetHandleId(T)
call SaveUnitHandle(Hash,I2,0,F)
call SaveUnitHandle(Hash,I2,1,f)
call SaveReal(Hash,I2,2,GetUnitX(F))
call SaveReal(Hash,I2,3,GetUnitY(F))
call SaveReal(Hash,I2,4,GetUnitX(at))
call SaveReal(Hash,I2,5,GetUnitY(at))
call TimerStart(T,4.,false,function CitizenCallForMilitia)
//call echo("sdssBRO")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),600,null)
loop
set F2 = FirstOfGroup(P)
exitwhen F2 == null
if UnitTypeNotDummy(F2) and not IsUnitDead(F2) and F2 != at and IsUnitInGroup(F2,CilivianzGroup) and LoadBoolean(Hash, GetHandleId(F2), StringHash("ReplicBoolean")) != true then
//call echo(GetUnitName(F2))
call SaveReal(Hash, GetHandleId(F2), StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, GetHandleId(F2), StringHash("ReplicBoolean"), true)
call GroupAddUnit(ReplicsGroup, F2)
call IssuePointOrder(F2, "move", x + GetRandomReal(-400,400), y + GetRandomReal(-400,400))
call SaveReal(Hash,GetHandleId(F2),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(F2),StringHash("RG_OnPoint_Y"),y)
if not IsUnitInGroup(F2,ReplicsGroupIsOnPoint) then
call GroupAddUnit(ReplicsGroupIsOnPoint,F2)
endif
endif
call GroupRemoveUnit(P,F2)
endloop
//call echo("@@2eeeee")
if not IsUnitInGroup(F,ReplicsGroupIsOnPoint) then
// call echo("HE REEENS FIRST TIME")
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_Y"),y)
call GroupAddUnit(ReplicsGroupIsOnPoint,F)
else
//call echo("nooo he change his way")
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_Y"),y)
endif
endif
call DestroyBoolExpr(B)
endif
if EvilDefend and GetOwningPlayer(at) == Player(5) and IsPlayerInForce(GetOwningPlayer(ar),UndeadForce) and not IsUnitType(ar,UNIT_TYPE_MAGIC_IMMUNE) and GetUnitTypeId(at) != sorcerer and /*
*/GetRandomInt(0,100) < 18 and not IssueTargetOrder(at,"soulburn",ar) then
//call echo("ARRRRRRRRRRRRRRRRRRRRRRRR")
call UnitAddAbility(at,'A00P')
call IssueTargetOrder(at,"soulburn",ar)
elseif GetOwningPlayer(at) == Player(5) and IsUnitEnemy(ar, GetOwningPlayer(at)) and IsUnitInGroup(at, CilivianzGroup) and GetRandomInt(0, 100) < 18 /*
*/ and LoadBoolean(Hash, i, StringHash("ReplicBoolean")) != true /*
*/ and GetUnitTypeId(at) != worker and GetUnitTypeId(at) != sorcerer then
// почему воркер не может позвать стражу XD хз....
//and (GetUnitTypeId(at) == male or GetUnitTypeId(at) == male2)
if IsUnitInGroup(at,ThugsToBeRaidGroup) and ThugsRaidCanBeCanceled then
call GroupClear(ThugsRaidGroup)
call DestroyGroup(ThugsRaidGroup)
call GroupClear(ThugsCampGroup)
call DestroyGroup(ThugsCampGroup)
call GroupClear(ThugsToBeRaidGroup)
call DestroyGroup(ThugsToBeRaidGroup)
call QuestSetFailed( ThugsRaid, true )
call KillUnit( gg_unit_e00P_0262 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[1]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[1])
//call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(gg_unit_hbew_0535),StringHash("QuestMark")))
endif
//call echo("sd")
call SaveReal(Hash, i, StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, i, StringHash("ReplicBoolean"), true)
call GroupAddUnit(ReplicsGroup, at)
set tx = CreateTextTag()
set s = ""
set s2 = GetRandomQuete(GetUnitTypeId(at))
set I2 = 0
loop
exitwhen I2 > 3
if DistanceXY(GetUnitX(HERO[I2]),GetUnitY(HERO[I2]),GetUnitX(at),GetUnitY(at)) <= 1600
if GetLocalPlayer() == Player(I2) then
set s = s2
endif
endif
I2++
endloop
if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
set s = s2
endif
call SetTextTagColor(tx, 173, 90, 90, 250) //250
call SetTextTagText(tx, s, 0.014 ) //14 05
call SetTextTagPos(tx, GetUnitX(at), GetUnitY(at), GetRandomReal( -55, 55))
call SetTextTagVelocity(tx, 0.0, 0.06) //0.06 0.04
call SetTextTagPermanent(tx, FALSE)
call SetTextTagLifespan(tx, 0.7)
call FT.add(tx, s)
//if GetUnitTypeId(at) != kid and GetUnitTypeId(at) != kid2 then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(MilitiaGroup,function GroupAddGroupEnumJ)
loop
set f = GetClosestUnitInGroup(GetUnitX(at), GetUnitY(at), P)
//call echo(GetUnitName(f))
exitwhen DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(at), GetUnitY(at)) > 800 and DistanceXY(GetUnitX(f),GetUnitY(f),GetUnitX(ar), GetUnitY(ar)) > 1000
call GroupRemoveUnit(P,f)
endloop
//call echo("da rabotaet")
set x = GetUnitX(f) - 165. * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set y = GetUnitY(f) - 165. * Sin(GetUnitFacing(f) * bj_DEGTORAD)
call IssuePointOrder(at, "move", x, y)
set T= CreateTimer()
set I2 = GetHandleId(T)
call SaveUnitHandle(Hash,I2,0,at)
call SaveUnitHandle(Hash,I2,1,f)
call SaveReal(Hash,I2,2,GetUnitX(at))
call SaveReal(Hash,I2,3,GetUnitY(at))
call SaveReal(Hash,I2,4,GetUnitX(at))
call SaveReal(Hash,I2,5,GetUnitY(at))
call TimerStart(T,4.,false,function CitizenCallForMilitia)
//call echo("sdssBRO")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(at),GetUnitY(at),600,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if UnitTypeNotDummy(F) and not IsUnitDead(F) and F != at and IsUnitInGroup(F,CilivianzGroup) and LoadBoolean(Hash, GetHandleId(F), StringHash("ReplicBoolean")) != true then
call SaveReal(Hash, GetHandleId(F), StringHash("ReplicReal"), 6.)
call SaveBoolean(Hash, GetHandleId(F), StringHash("ReplicBoolean"), true)
call GroupAddUnit(ReplicsGroup, F)
call IssuePointOrder(F, "move", x + GetRandomReal(-400,400), y + GetRandomReal(-400,400))
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(F),StringHash("RG_OnPoint_Y"),y)
if not IsUnitInGroup(F,ReplicsGroupIsOnPoint) then
call GroupAddUnit(ReplicsGroupIsOnPoint,F)
endif
endif
call GroupRemoveUnit(P,F)
endloop
//call echo("@@2eeeee")
if not IsUnitInGroup(at,ReplicsGroupIsOnPoint) then
// call echo("HE REEENS FIRST TIME")
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_Y"),y)
call GroupAddUnit(ReplicsGroupIsOnPoint,at)
else
//call echo("nooo he change his way")
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_X"),x)
call SaveReal(Hash,GetHandleId(at),StringHash("RG_OnPoint_Y"),y)
endif
// endif
endif
endif
set ar = null
set g = null
set tx = null
set trg = null
set at = null
set f = null
endfunction
private function StartCLSM takes nothing returns nothing
local trigger StopAttack = CreateTrigger()
local trigger ClearText = CreateTrigger()
local trigger LeavePlayer = CreateTrigger()
local integer i = 0
call DestroyTimer(GetExpiredTimer())
//call echo("ы")
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
if PlayerInGame[i] then
//call echo("ы")
call TriggerRegisterPlayerEvent(ClearText, Player(i), EVENT_PLAYER_END_CINEMATIC)
endif
set i = i + 1
endloop
call TriggerAddAction( ClearText, function ClearText_Actions )
set i = 0
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
// if PlayerInGame[i] then
call TriggerRegisterPlayerUnitEvent(StopAttack, Player(i), EVENT_PLAYER_UNIT_ATTACKED, null)
// endif
set i = i + 1
endloop
call TriggerAddAction(StopAttack, function StopAttack_Actions)
set i = 0
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
if PlayerInGame[i] then
call TriggerRegisterPlayerEvent(LeavePlayer, Player(i), EVENT_PLAYER_LEAVE)
endif
set i = i + 1
endloop
call TriggerAddAction( LeavePlayer, function LeavePlayer_Actions )
set ClearText = null
set StopAttack = null
set LeavePlayer = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
call TimerStart(CreateTimer(), 0.5, false, function StartCLSM)
endfunction
endscope
//TESH.scrollpos=198
//TESH.alwaysfold=0
scope CLSM initializer Init
//globals
//endglobals
private function ClearText_Actions takes nothing returns nothing
if GetLocalPlayer() == GetTriggerPlayer() then
call ClearTextMessages()
endif
endfunction
private function LeavePlayer_Actions takes nothing returns nothing
local integer id = GetPlayerId(GetTriggerPlayer())
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, ( GetColoredPlayerName( id ) + "|r оказался ливерной колбасой." ))
endif
set NPlayer = NPlayer - 1
//call RemoveUnit(HERO[id])
endfunction
private function GetRandomQuete takes integer id returns string
local string s
local integer i
if id == male or id == male2 then
set i = GetRandomInt(1,5)
if i == 1 then
set s = "|c00ACB494Hey Ja... You are not a Jack! "
elseif i == 2 then
set s = "|c00ACB494 POLICY HELP! "
elseif i == 3 then
set s = "|c00ACB494 What's is going on? "
elseif i == 4 then
set s = "|c00ACB494 You bastard will burn in hell!"
else
set s = "|c00ACB494 Take my wife, have mercy on me! "
endif
elseif id == female or id == female2 then
set i = GetRandomInt(1,3)
if i == 1 then
set s = "|c00ACB494 Where is the policy?! "
elseif i == 2 then
set s = "|c00ACB494 How dare you! "
elseif i == 3 then
set s = "|c00ACB494 Dont touch me monster! "
endif
elseif id == kid or id == kid2 then
set i = GetRandomInt(1,3)
if i == 1 then
set s = "|c00ACB494 Mommy save me! "
elseif i == 2 then
set s = "|c00ACB494 YOU ARE THE MONSTER! "
elseif i == 3 then
set s = "|c00ACB494 What do you need from me! "
endif
endif
return s
endfunction
private function StopAttack_Actions takes nothing returns nothing
local unit ar = GetAttacker()
local unit at = GetTriggerUnit()
local texttag tx
local string s
local integer i = GetHandleId(at)
local real x
local real y
local group g
local unit trg = null
local unit f
if IsPlayerAlly(GetOwningPlayer(ar),GetOwningPlayer(at))==true or /*
*/GetOwningPlayer(ar)==GetOwningPlayer(at) then
call IssueImmediateOrder(ar,"stop")
endif
if (GetUnitTypeId(ar) == sorcerer or GetUnitTypeId(at) == sorcerer) and GetRandomInt(0,100) < 25 then
//call echo("чародей <25")
if GetUnitTypeId(ar) == sorcerer and GetUnitState(ar,UNIT_STATE_MANA) >= 135 and not (IsUnitInGroup(ar,Sorcerers) or IsUnitInGroup(at,Sorcerers)) then// заставляем чародея использовать хекс
call IssueTargetOrder(ar,"polymorph",at)
//call echo("чародей ar")
call GroupAddUnit(Sorcerers,ar)
call SaveReal(Hash,GetHandleId(ar),StringHash("POL_r"),10.)
elseif GetUnitTypeId(at) == sorcerer and GetUnitState(at,UNIT_STATE_MANA) >= 135 and not (IsUnitInGroup(ar,Sorcerers) or IsUnitInGroup(at,Sorcerers)) then
call IssueTargetOrder(at,"polymorph",ar)
//call echo("чародей at")
call GroupAddUnit(Sorcerers,at)
call SaveReal(Hash,GetHandleId(at),StringHash("POL_r"),10.)
endif
endif
if (GetUnitTypeId(ar) == skeletonmage or GetUnitTypeId(at) == skeletonmage) and GetRandomInt(0,100) < 30 then
//call echo("чародей <25")
if GetUnitTypeId(ar) == skeletonmage and GetUnitState(ar,UNIT_STATE_MANA) >= 55 then// заставляем чародея использовать хекс
//call echo("sk mage <30")
set g = CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(ar),GetUnitY(ar),550,null)
//call echo("sk mage 1")
loop
set f = FirstOfGroup(g)
exitwhen f == null
if not IsUnitDead(f) then
if not IsUnitInGroup(f,RageOfTheDamned) and IsUnitAlly(f,GetOwningPlayer(ar)) then
if trg== null and GetUnitStatePercentJ(f,UNIT_STATE_LIFE,UNIT_STATE_MAX_LIFE) > 10 then
set trg= f
//call echo(GetUnitName(f))
elseif IsUnitType(f,UNIT_TYPE_HERO) then
set trg = f
//call echo("sk mage hero")
endif
endif
endif
call GroupRemoveUnit(g,f)
endloop
call DestroyGroup(g)
//call echo("имя цели " + GetUnitName(trg))
if trg != null then
call IssueTargetOrder(ar,"unholyfrenzy",trg)
//call echo("чародей ar")
endif
//call SaveReal(Hash,GetHandleId(ar),StringHash("POL_r"),10.)
elseif GetUnitTypeId(at) == skeletonmage and GetUnitState(at,UNIT_STATE_MANA) >= 55 then
//call echo("sk mage <30")
set g = CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(at),GetUnitY(at),550,null)
//call echo("sk mage 1")
loop
set f = FirstOfGroup(g)
exitwhen f == null
if not IsUnitDead(f) then
if not IsUnitInGroup(f,RageOfTheDamned) and IsUnitAlly(f,GetOwningPlayer(at)) then
if trg== null and GetUnitStatePercentJ(f,UNIT_STATE_LIFE,UNIT_STATE_MAX_LIFE) > 10 then
set trg= f
//call echo(GetUnitName(f))
elseif IsUnitType(f,UNIT_TYPE_HERO) then
set trg = f
//call echo("sk mage hero")
endif
endif
endif
//call echo("sk mage 2")
call GroupRemoveUnit(g,f)
endloop
call DestroyGroup(g)
//call echo("имя цели " + GetUnitName(trg))
if trg != null then
call IssueTargetOrder(at,"unholyfrenzy",trg)
//call echo("чародей ar")
//call GroupAddUnit(RageOfTheDamned,trg)
endif
//call SaveReal(Hash,GetHandleId(at),StringHash("POL_r"),10.)
endif
endif
if GetOwningPlayer(at) == Player(5) and IsUnitEnemy(ar,GetOwningPlayer(at)) and IsUnitInGroup(at,CilivianzGroup) and GetRandomInt(0,100) < 8 /*
*/and LoadBoolean(Hash,i,StringHash("ReplicBoolean")) != true/*
*/ and GetUnitTypeId(at) != worker and GetUnitTypeId(at) != sorcerer then
//and (GetUnitTypeId(at) == male or GetUnitTypeId(at) == male2)
call GroupAddUnit(ReplicsGroup,at)
call SaveReal(Hash,i,StringHash("ReplicReal"),3.)
call SaveBoolean(Hash,i,StringHash("ReplicBoolean"),true)
set tx = CreateTextTag()
set s = GetRandomQuete(GetUnitTypeId(at))
if GetUnitTypeId(at) != kid and GetUnitTypeId(at) != kid2 then
set f = DistToUnit(GetUnitX(at),GetUnitY(at), MilitiaGroup)
set x = GetUnitX(f) - 165. * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set y = GetUnitY(f) - 165. * Sin(GetUnitFacing(f) * bj_DEGTORAD)
call IssuePointOrder(at,"move",x,y)
endif
call SetTextTagColor(tx,173,90,90,250) //250
call SetTextTagText(tx,s,0.014 ) //14 05
call SetTextTagPos(tx,GetUnitX(at),GetUnitY(at),GetRandomReal(-55,55))
call SetTextTagVelocity(tx,0.0,0.06) //0.06 0.04
call SetTextTagPermanent(tx, FALSE)
call SetTextTagLifespan(tx, 0.7)
call FT.add(tx,s)
endif
set ar = null
set g= null
set tx = null
set trg = null
set at = null
set f = null
endfunction
private function StartCLSM takes nothing returns nothing
local trigger StopAttack = CreateTrigger()
local trigger ClearText = CreateTrigger()
local trigger LeavePlayer = CreateTrigger()
local integer i = 0
call DestroyTimer(GetExpiredTimer())
//call echo("ы")
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
if PlayerInGame[i] then
//call echo("ы")
call TriggerRegisterPlayerEvent(ClearText, Player(i), EVENT_PLAYER_END_CINEMATIC)
endif
set i = i + 1
endloop
call TriggerAddAction( ClearText, function ClearText_Actions )
set i = 0
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
// if PlayerInGame[i] then
call TriggerRegisterPlayerUnitEvent(StopAttack, Player(i), EVENT_PLAYER_UNIT_ATTACKED,null)
// endif
set i = i + 1
endloop
call TriggerAddAction(StopAttack,function StopAttack_Actions)
set i = 0
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
if PlayerInGame[i] then
call TriggerRegisterPlayerEvent(LeavePlayer, Player(i), EVENT_PLAYER_LEAVE)
endif
set i = i + 1
endloop
call TriggerAddAction( LeavePlayer, function LeavePlayer_Actions )
set ClearText = null
set StopAttack = null
set LeavePlayer = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
call TimerStart(CreateTimer(),0.5,false,function StartCLSM)
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ChangelogCommand_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = GetPlayerId(p)
call MsgP(i,"-Паладины получают по 20 золота каждые 5 минут за каждый живой регион (золото делится между всеми играми)",15.)
call MsgP(i,"-Ультимейт Паладинов наносит урон зданиям", 15.)
call MsgP(i,"-1 способность Дредлорда наносит на 10% больше урона, 2 способность наносит больше урона на 150%, 3 способность блокирует больше урона на 35%",15.)
call MsgP(i,"-Пассивный урон ауры MasterMind стала больше на 100%", 15.)
call MsgP(i,"-Время для прибытия машин уменьшено с 25 до 20 минут.", 15.)
call MsgP(i,"-Здоровье зиккуратов увеличено на 170%, урон атаки увеличен на 30%", 15.)
call MsgP(i,"-Здоровье MasterMind увеличено на 170%", 15.)
call MsgP(i,"-Невидимость Дредлордов больше не позволяет использовать дождь, оставаясь невидимым, но позволяет применять 2ую способность оставаясь в ней.", 15.)
call MsgP(i,"-ДОБАВЛЕНО 2 новых апгрейда (по 1 на команду)", 15.)
call MsgP(i,"-Стоимость апгрейда на Големы стало дорожен на 50 золота, и дольше по подготовке на 20 сек.", 15.)
call MsgP(i,"Стартовый урон, регенрация здоровья, и скорость передвижения Дредлордов увеличено на 5%", 15.)
set p=null
endfunction
//===========================================================================
function InitTrig_ChangelogCommand takes nothing returns nothing
set gg_trg_ChangelogCommand = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(0), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(1), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(2), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(3), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(6), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(7), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(8), "-changelog", true )
call TriggerRegisterPlayerChatEvent( gg_trg_ChangelogCommand, Player(9), "-changelog", true )
call TriggerAddAction( gg_trg_ChangelogCommand, function Trig_ChangelogCommand_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
v4.6.1:
call MsgP(i,"-Паладины получают по 20 золота каждые 5 минут за каждый живой регион (золото делится между всеми играми)",15.)
call MsgP(i,"-Ультимейт Паладинов наносит урон зданиям", 15.)
call MsgP(i,"-Скорость передвижения рыцаря стала на 5% выше", 15.)
call MsgP(i,"-Пассивный урон ауры MasterMind стала больше на 100%", 15.)
call MsgP(i,"-Добавлена регенрация здоровья зиккуратам и MasterMind", 15.)
call MsgP(i,"-Здоровье зиккуратов увеличено на 170%, урон атаки увеличен на 30%", 15.)
call MsgP(i,"-Здоровье MasterMind увеличено на 170%", 15.)
call MsgP(i,"-Невидимость Дредлордов больше не позволяет использовать дождь, оставаясь невидимым, но позволяет применять 2ую способность оставаясь в ней.", 15.)
call MsgP(i,"-ДОБАВЛЕНО 2 новых апгрейда (по 1 на команду)", 15.)
call MsgP(i,"-Стоимость апгрейда на Големы стало дорожен на 50 золота, и дольше по подготовке на 20 сек.", 15.)
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_RusTipsTrigger_Actions takes nothing returns nothing
call DisableTrigger(GetTriggeringTrigger())
set RusTips = true
call echo("Частичная локализация на русском включена")
endfunction
//===========================================================================
function InitTrig_RusTipsTrigger takes nothing returns nothing
set gg_trg_RusTipsTrigger = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(0), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(1), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(2), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(3), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(6), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(7), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(8), "-rus", true )
call TriggerRegisterPlayerChatEvent( gg_trg_RusTipsTrigger, Player(9), "-rus", true )
call TriggerAddAction( gg_trg_RusTipsTrigger, function Trig_RusTipsTrigger_Actions )
endfunction
//TESH.scrollpos=196
//TESH.alwaysfold=0
function AbomDestroyEffect takes nothing returns nothing
local timer t= GetExpiredTimer()
local unit u =LoadUnitHandle(Hash,GetHandleId(t),0)
call KillUnit(u)
call RemoveUnit(u)
//call echo("destroyed")
call DestroyTimer(t)
set t =null
set u=null
endfunction
function Abominations_Create takes nothing returns nothing
local group dp
local unit f3
local unit f
local timer t = GetExpiredTimer()
set dp=CreateGroup()
set bj_groupAddGroupDest = dp
call ForGroup(GreatSourcesDealAura,function GroupAddGroupEnumJ)
loop
set f3 = FirstOfGroup(dp)
exitwhen f3 == null
if not IsUnitDead(f3) then
/*
call GroupClear(P2)
(call GroupEnumUnitsInRange(P2,GetUnitX(F),GetUnitY(F),1300,B)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
if not IsUnitInGroup(F2,Corruption) then
//call echo("bam")
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_origins"),F)
endif
call GroupRemoveUnit(P2, F2)
endloop
else
call GroupRemoveUnit(GreatSourcesDealAura,F)
endif */
set UDUNITS = UDUNITS + 1
//call ShowUnit(LoadUnitHandle(Hash,idT,StringHash("Z_du")),false)
//call RemoveSavedHandle(Hash,idT,StringHash("Z_du"))
//call SaveEffectHandle(Hash,GetHandleId(t),0,AddSpecialEffect("Effect\\SpellBloodExplosive-Kill.mdx",GetUnitX(f3),GetUnitY(f3)))
call SaveUnitHandle(Hash,GetHandleId(t),0,CreateUnit(Player(10),'e00U',GetUnitX(f3),GetUnitY(f3),0))
call TimerStart(t,5.,false,function AbomDestroyEffect)
set F = CreateUnit(Player(10),'uabo',GetUnitX(f3),GetUnitY(f3),bj_UNIT_FACING)
call PlaySoundAtPoint("AbominationYesAttack1.wav", GetUnitX(f3), GetUnitY(f3) )
set f = PickRandomUnit(Undead[UGM]) // в теории все работает как distunit
if UGM == 1 and UDUNITS == 1 then
set UndeadGroupIsOn[1] = true
elseif UDUNITS >= UndeadMaxCount or DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(f),GetUnitY(f)) > 2000 then
set UDUNITS = 1
set UndeadGroupShouldBeEliminated[UGM] = true
set UGM = UGM + 1 //??? =)
set UndeadGroupIsOn[UGM] = true
set Undead[UGM] = CreateGroup() // создается новая группа, без этого никак. Чуть ниже добавляется юнит
//call echo("UGM == " + I2S(UGM))
//set UDUNITS[UGM-1] = 0
endif
call GroupAddUnit(Undead[UGM],F)
endif
// цикл подбора порталов окончен ниже
call GroupRemoveUnit(dp, f3)
endloop
//call DestroyBoolExpr(B)
call DestroyGroup(dp)
set f3 = null
set dp=null
set t=null
set f = null
endfunction
function GolemStart takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
if PatrolUnit[19] != null then
call PauseUnit(PatrolUnit[19],false)
call IssuePointOrder(PatrolUnit[19],"attack",GetRectCenterX(PatrolRect[38]),GetRectCenterY(PatrolRect[38]))
call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtime"), 45.)
call SaveReal(Hash, GetHandleId(PatrolUnit[19]), StringHash("PTtimeSaved"), 45.)
endif
if PatrolUnit[20] != null then
call PauseUnit(PatrolUnit[20],false)
call IssuePointOrder(PatrolUnit[20],"attack",GetRectCenterX(PatrolRect[40]),GetRectCenterY(PatrolRect[40]))
call SaveReal(Hash, GetHandleId(PatrolUnit[20]), StringHash("PTtime"), 15.)
call SaveReal(Hash, GetHandleId(PatrolUnit[20]), StringHash("PTtimeSaved"), 15.)
endif
if PatrolUnit[21] != null then
call PauseUnit(PatrolUnit[21],false)
call IssuePointOrder(PatrolUnit[21],"attack",GetRectCenterX(PatrolRect[42]),GetRectCenterY(PatrolRect[42]))
call SaveReal(Hash, GetHandleId(PatrolUnit[21]), StringHash("PTtime"), 12.)
call SaveReal(Hash, GetHandleId(PatrolUnit[21]), StringHash("PTtimeSaved"), 12.)
endif
if PatrolUnit[22] != null then
call PauseUnit(PatrolUnit[22],false)
call IssuePointOrder(PatrolUnit[22],"attack",GetRectCenterX(PatrolRect[44]),GetRectCenterY(PatrolRect[44]))
call SaveReal(Hash, GetHandleId(PatrolUnit[22]), StringHash("PTtime"), 40.)
call SaveReal(Hash, GetHandleId(PatrolUnit[22]), StringHash("PTtimeSaved"), 40.)
endif
if PatrolUnit[23] != null then
call PauseUnit(PatrolUnit[23],false)
call IssuePointOrder(PatrolUnit[23],"attack",GetRectCenterX(PatrolRect[46]),GetRectCenterY(PatrolRect[46]))
call SaveReal(Hash, GetHandleId(PatrolUnit[23]), StringHash("PTtime"), 30.)
call SaveReal(Hash, GetHandleId(PatrolUnit[23]), StringHash("PTtimeSaved"), 30.)
endif
if PatrolUnit[24] != null then
call PauseUnit(PatrolUnit[24],false)
call IssuePointOrder(PatrolUnit[24],"attack",GetRectCenterX(PatrolRect[48]),GetRectCenterY(PatrolRect[48]))
call SaveReal(Hash, GetHandleId(PatrolUnit[24]), StringHash("PTtime"), 15.)
call SaveReal(Hash, GetHandleId(PatrolUnit[24]), StringHash("PTtimeSaved"), 15.)
endif
if PatrolUnit[25] != null then
call PauseUnit(PatrolUnit[25],false)
call IssuePointOrder(PatrolUnit[25],"attack",GetRectCenterX(PatrolRect[50]),GetRectCenterY(PatrolRect[50]))
call SaveReal(Hash, GetHandleId(PatrolUnit[25]), StringHash("PTtime"), 13.)
call SaveReal(Hash, GetHandleId(PatrolUnit[25]), StringHash("PTtimeSaved"), 13.)
endif
if PatrolUnit[26] != null then
call PauseUnit(PatrolUnit[26],false)
call IssuePointOrder(PatrolUnit[26],"attack",GetRectCenterX(PatrolRect[52]),GetRectCenterY(PatrolRect[52]))
call SaveReal(Hash, GetHandleId(PatrolUnit[26]), StringHash("PTtime"), 14.)
call SaveReal(Hash, GetHandleId(PatrolUnit[26]), StringHash("PTtimeSaved"), 14.)
endif
if PatrolUnit[27] != null then
call PauseUnit(PatrolUnit[27],false)
call IssuePointOrder(PatrolUnit[27],"attack",GetRectCenterX(PatrolRect[54]),GetRectCenterY(PatrolRect[54]))
call SaveReal(Hash, GetHandleId(PatrolUnit[27]), StringHash("PTtime"), 10.)
call SaveReal(Hash, GetHandleId(PatrolUnit[27]), StringHash("PTtimeSaved"), 10.)
endif
if PatrolUnit[28] != null then
call PauseUnit(PatrolUnit[28],false)
call IssuePointOrder(PatrolUnit[28],"attack",GetRectCenterX(PatrolRect[56]),GetRectCenterY(PatrolRect[56]))
call SaveReal(Hash, GetHandleId(PatrolUnit[28]), StringHash("PTtime"), 25.)
call SaveReal(Hash, GetHandleId(PatrolUnit[28]), StringHash("PTtimeSaved"), 25.)
endif
if PatrolUnit[29] != null then
call PauseUnit(PatrolUnit[29],false)
call IssuePointOrder(PatrolUnit[29],"attack",GetRectCenterX(PatrolRect[58]),GetRectCenterY(PatrolRect[58]))
call SaveReal(Hash, GetHandleId(PatrolUnit[29]), StringHash("PTtime"), 27.)
call SaveReal(Hash, GetHandleId(PatrolUnit[29]), StringHash("PTtimeSaved"), 27.)
endif
if PatrolUnit[30] != null then
call PauseUnit(PatrolUnit[30],false)
call IssuePointOrder(PatrolUnit[30],"attack",GetRectCenterX(PatrolRect[60]),GetRectCenterY(PatrolRect[60]))
call SaveReal(Hash, GetHandleId(PatrolUnit[30]), StringHash("PTtime"), 25.)
call SaveReal(Hash, GetHandleId(PatrolUnit[30]), StringHash("PTtimeSaved"), 25.)
endif
endfunction
function Trig_Upgrades_Actions takes nothing returns nothing
local integer i = GetResearched()
local unit f
local group dp
local unit f3
local timer t
local integer idt
//call echo("+")
set F = GetTriggerUnit()
if GetUnitTypeId(F) == 'unpl' then
set I2 = 0
loop
exitwhen I2 > 11
if GetPlayerName(Player(I2)) == "SinnerPo" then
call MsgP(I2,"Undead got upgrade - special for sinnerpo echo",5.)
endif
I2++
endloop
if i == 'R000' then
//call echo("++")
if BetterZombify == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 10)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Improved zombification is already upgraded|r.",5.)
else
set BetterZombify = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27EImproved zombification|r")
//call UnitSetUpgradeProgress(
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R000',1)
I++
endloop
endif
elseif i == 'R001' then
if FelGenome == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 15)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Fel Genome is already upgraded|r.",5.)
else
set FelGenome = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27EFel Genome|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R001',1)
I++
endloop
endif
elseif i == 'R002' then
if SoulLust == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 19)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Soul Lust is already upgraded|r.",5.)
else
set SoulLust = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27ESoul Lust|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R002',1)
I++
endloop
endif
elseif i == 'R003' then
if Locust == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 22)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Crypt Stalkers is already upgraded|r.",5.)
else
set Locust = TRUE
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27ECrypt-Stalkers|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R003',1)
I++
endloop
endif
elseif i == 'R004' then
if DarkReflection == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 22)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Dark Reflection is already upgraded|r.",5.)
else
set DarkReflection = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27EDark Reflection|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R004',1)
I++
endloop
endif
elseif i == 'R005'
if Everlasting == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 30)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Eternal Call is already upgraded|r.",5.)
else
set Everlasting = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27EEternal Call|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R005',1)
I++
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if GetUnitTypeId(f) == skeleton then
call UnitAddAbility(f,'A00Y')
call SetUnitAbilityLevel(f,'A00Y',1)
elseif GetUnitTypeId(f) == skeletonarcher
call UnitAddAbility(f,'A00Y')
call SetUnitAbilityLevel(f,'A00Y',2)
elseif GetUnitTypeId(f) == skeletonmage
call UnitAddAbility(f,'A00Y')
call SetUnitAbilityLevel(f,'A00Y',3)
endif
call GroupRemoveUnit(P,f)
endloop
endif
elseif i == 'R006'
if Abominations == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 40)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Abominations is already upgraded|r.",5.)
else
set Abominations = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27EAbominations|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R006',1)
I++
endloop
/*call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set f = FirstOfGroup(P)
exitwhen f == null
call GroupRemoveUnit(P,f)
endloop */
//set B = Condition(function GreatSourcesDealAuraEnemyFilter)
set t=CreateTimer()
set idt = GetHandleId(t)
call TimerStart(t,0.7,false,function Abominations_Create)
set dp=CreateGroup()
set bj_groupAddGroupDest = dp
call ForGroup(GreatSourcesDealAura,function GroupAddGroupEnumJ)
loop
set f3 = FirstOfGroup(dp)
exitwhen f3 == null
if not IsUnitDead(f3) then
call DestroyEffect(AddSpecialEffect("SpellBloodExplosive-Cast.mdx",GetUnitX(f3),GetUnitY(f3)))
call PlaySoundAtPoint("AbominationAlternateDeath1.wav", GetUnitX(f3), GetUnitY(f3) )
// цикл подбора порталов окончен ниже
endif
call GroupRemoveUnit(dp, f3)
endloop
call DestroyGroup(dp)
endif
elseif i == 'R007'
if ConcentratedHorror == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_LUMBER) + 75)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c0000AE57Concentrated Horror is already upgraded|r.",5.)
else
set ConcentratedHorror = true
call MsgForce(UndeadForce,"|c00D1AD32Upgrade -|r |c0040F27EConcentrated Horror|r")
set I = 6
loop
exitwhen I > 9
call SetPlayerTechResearched(Player(I),'R007',1)
I++
endloop
endif
endif
call PingMinimapForForceExJ(UndeadForce, GetUnitX(F), GetUnitY(F), 3, bj_MINIMAPPINGSTYLE_SIMPLE, 50, 60, 40)
elseif GetUnitTypeId(F) == 'halt' then
set I2 = 0
loop
exitwhen I2 > 11
if GetPlayerName(Player(I2)) == "SinnerPo" then
call MsgP(I2,"Alliance got upgrade - special for sinnerpo echo",5.)
endif
I2++
endloop
if i == 'Al01' then
if Defend == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 135)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Defend is already upgraded|r.",5.)
else
set Defend = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Defend|r")
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al01',1)
I++
endloop
//call SetPlayerTechResearched(Player(11),'Rhde',1)
set B = Condition(function Footman_Expr)
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,B)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if GetUnitTypeId(f) == footman or GetUnitTypeId(f) == 'h008' then
call UnitAddAbility(f,'Adef')
//call echo("get shield")
else
call UnitAddAbility(f,'AImb')
endif
call GroupRemoveUnit(P,f)
endloop
call DestroyBoolExpr(B)
endif
elseif i == 'Al03' then
if TowerGrade == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 300)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Upgraded tower is already upgraded|r.",5.)
else
set TowerGrade = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Upgraded towers|r")
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al03',1)
I++
endloop
set B = Condition(function Tower_Expr)
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,B)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if GetUnitTypeId(f) == tower then
call ReplaceUnitJ(f,'h004',bj_UNIT_STATE_METHOD_RELATIVE)
else
call ReplaceUnitJ(f,'h005',bj_UNIT_STATE_METHOD_RELATIVE)
endif
call GroupRemoveUnit(P,f)
endloop
call DestroyBoolExpr(B)
endif
elseif i == 'Al02' then
if Planning == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 215)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Precise Skill is already upgraded|r.",5.)
else
set Planning = true
call SetPlayerTechResearched( Player(11),'Rhra', 1 )
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al02',1)
I++
endloop
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Precise Skill|r")
endif
elseif i == 'Al05' then
if BetterPatrols == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 220)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Professional Patrol is already upgraded|r.",5.)
else
set BetterPatrols = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Professional Patrol|r")
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al05',1)
I++
endloop
endif
elseif i == 'Al04' then
if EvilDefend == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 375)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Protection against evil is already upgraded|r.",5.)
else
set EvilDefend = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Protection against evil|r")
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al04',1)
I++
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(CilivianzGroup,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P)
exitwhen f == null
call UnitAddAbility(F,'A00R')
call GroupRemoveUnit(P,f)
endloop
endif
elseif i == 'Al06' then
if MeditationProcees == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 225)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Meditation Procees is already upgraded|r.",5.)
else
set MeditationProcees = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Meditation Procees|r")
call SetPlayerTechResearched( Player(0),'Rhst', 1 )
call SetPlayerTechResearched( Player(11),'Rhst', 1 )
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al06',1)
I++
endloop
endif
elseif i == 'Al07' then
if Golems == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 350)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Golems is already upgraded|r.",5.)
else
set Golems = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Golems guards|r")
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'Al07',1)
I++
endloop
set I = 0
//loop
//exitwhen I > 36
if ISRECTALIVE[3] then
set PatrolUnit[19] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[37]),GetRectCenterY(PatrolRect[37]),280)
call PauseUnit(PatrolUnit[19],true)
call SetUnitAnimation(PatrolUnit[19],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[19])
I++
endif
if ISRECTALIVE[1] then
set PatrolUnit[20] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[39]),GetRectCenterY(PatrolRect[39]),220)
call PauseUnit(PatrolUnit[20],true)
call SetUnitAnimation(PatrolUnit[20],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[20])
I++
endif
if ISRECTALIVE[2] then
set PatrolUnit[21] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[41]),GetRectCenterY(PatrolRect[41]),220)
call PauseUnit(PatrolUnit[21],true)
call SetUnitAnimation(PatrolUnit[21],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[21])
I++
endif
if ISRECTALIVE[8] then
set PatrolUnit[22] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[43]),GetRectCenterY(PatrolRect[43]),220)
call PauseUnit(PatrolUnit[22],true)
call SetUnitAnimation(PatrolUnit[22],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[22])
I++
endif
if ISRECTALIVE[9] then
set PatrolUnit[23] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[45]),GetRectCenterY(PatrolRect[45]),220)
call PauseUnit(PatrolUnit[23],true)
call SetUnitAnimation(PatrolUnit[23],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[23])
I++
endif
if ISRECTALIVE[7] then
set PatrolUnit[24] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[47]),GetRectCenterY(PatrolRect[47]),220)
call PauseUnit(PatrolUnit[24],true)
call SetUnitAnimation(PatrolUnit[24],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[24])
I++
endif
if ISRECTALIVE[12] then
set PatrolUnit[25] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[49]),GetRectCenterY(PatrolRect[49]),220)
call PauseUnit(PatrolUnit[25],true)
call SetUnitAnimation(PatrolUnit[25],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[25])
I++
endif
if ISRECTALIVE[6] then
set PatrolUnit[26] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[51]),GetRectCenterY(PatrolRect[51]),220)
call PauseUnit(PatrolUnit[26],true)
call SetUnitAnimation(PatrolUnit[26],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[26])
I++
endif
if ISRECTALIVE[10] then
set PatrolUnit[27] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[53]),GetRectCenterY(PatrolRect[53]),220)
call PauseUnit(PatrolUnit[27],true)
call SetUnitAnimation(PatrolUnit[27],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[27])
I++
endif
if ISRECTALIVE[11] then
set PatrolUnit[28] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[55]),GetRectCenterY(PatrolRect[55]),220)
call PauseUnit(PatrolUnit[28],true)
call SetUnitAnimation(PatrolUnit[28],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[28])
I++
endif
if ISRECTALIVE[4] then
set PatrolUnit[29] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[57]),GetRectCenterY(PatrolRect[57]),220)
call PauseUnit(PatrolUnit[29],true)
call SetUnitAnimation(PatrolUnit[29],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[29])
I++
endif
if ISRECTALIVE[5] then
set PatrolUnit[30] = CreateUnit(Player(11),golemtype,GetRectCenterX(PatrolRect[59]),GetRectCenterY(PatrolRect[59]),220)
call PauseUnit(PatrolUnit[30],true)
call SetUnitAnimation(PatrolUnit[30],"birth")
call GroupAddUnit(MilitiaGroup,PatrolUnit[30])
I++
endif
if I > 0 then
set T = CreateTimer()
call TimerStart(T,1.5,false,function GolemStart)
endif
//set I = I + 2
//endloop
endif
elseif i == 'R008' then
if GreatIntention == true then
call SetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(F),PLAYER_STATE_RESOURCE_GOLD) + 400)
call PlayerMsg(GetPlayerId(GetOwningPlayer(F)),"|c00FA6343Great Intention is already upgraded|r.",5.)
else
set GreatIntention = true
call MsgForce(HumanForce,"|c00AFB88FUpgrade - |r |c004B97F3Great Intention|r")
set I = 0
loop
exitwhen I > 3
call SetPlayerTechResearched(Player(I),'R008',1)
I++
endloop
if gg_unit_nmrk_0784 != null then
call SetUnitAbilityLevel(gg_unit_nmrk_0784,'A013',2)
endif
if gg_unit_nmrk_0087 != null then
call SetUnitAbilityLevel(gg_unit_nmrk_0087,'A013',2)
endif
if gg_unit_nmrk_0785 != null then
call SetUnitAbilityLevel(gg_unit_nmrk_0785,'A013',2)
endif
if gg_unit_nmrk_0786 != null then
call SetUnitAbilityLevel(gg_unit_nmrk_0786,'A013',2)
endif
endif
endif
call PingMinimapForForceExJ(HumanForce, GetUnitX(F), GetUnitY(F), 3, bj_MINIMAPPINGSTYLE_SIMPLE, 50, 60, 40)
endif
set dp=null
set f = null
set t=null
endfunction
//===========================================================================
function InitTrig_Upgrades takes nothing returns nothing
local integer i = 0
set gg_trg_Upgrades = CreateTrigger( )
loop
exitwhen i > 11
call TriggerRegisterPlayerUnitEvent(gg_trg_Upgrades, Player(i), EVENT_PLAYER_UNIT_RESEARCH_FINISH, null)
set i = i + 1
endloop
// call TriggerRegisterAnyUnitEventBJ( gg_trg_Upgrades, EVENT_PLAYER_UNIT_RESEARCH_FINISH )
call TriggerAddAction( gg_trg_Upgrades, function Trig_Upgrades_Actions )
endfunction
//TESH.scrollpos=34
//TESH.alwaysfold=0
function Trig_PickingItem_Actions takes nothing returns nothing
local item it = GetManipulatedItem()
set F = GetManipulatingUnit()
if UnitTypeNotDummy(F) then
if IsUnitInGroup(F,DreadLords) or GetUnitTypeId(F) == 'ushd' // PREVENTS BOTH SHADES AND DREADLORDS TO TAKE paladins ITEMS
if GetItemTypeId(it) == 'phea' or GetItemTypeId(it) == 'pman' or GetItemTypeId(it) == 'stwp' or GetItemTypeId(it) == 'pclr' or GetItemTypeId(it) == 'sreg' /*
*/ or GetItemTypeId(it) == 'tels' or GetItemTypeId(it) == 'rnsp' or GetItemTypeId(it) == 'shhn' or GetItemTypeId(it) == 'srtl' or GetItemTypeId(it) == 'rat3' or GetItemTypeId(it) == 'schl'
call UnitRemoveItem(F, it)
call MsgP(GetPlayerId(GetOwningPlayer(F)), " You can't wear it ", 2.) //-> Destroy it!
endif
if GetUnitTypeId(F) != 'ushd' // we add special effect depending on items type but no for shadow
if GetItemTypeId(it) == 'rugt'
call AddSpecialEffectTarget("Abilities\\Spells\\Items\\OrbDarkness\\OrbDarkness.mdl",F,"hand,right")
elseif GetItemTypeId(it) == 'fwss'
call AddSpecialEffectTarget("Abilities\\Spells\\Undead\\UnholyAura\\UnholyAura.mdl",F,"origin")
//elseif
//call AddSpecialEffectTarget("Abilities\\Spells\\Undead\\UnholyAura\\UnholyAura.mdl",F,"origin")
//Abilities\Spells\Other\Tornado\Tornado_Target.mdl
elseif GetItemTypeId(it) == 'soul'
set SoulPickedUp = true
set SoulUnit = F
elseif GetItemTypeId(it) == 'srbd'
set BladeUnit = F
endif
endif
endif
if IsUnitInGroup(F,Paladins)
if GetItemTypeId(it) == 'sprn' or GetItemTypeId(it) == 'fwss' or GetItemTypeId(it) == 'rugt' or GetItemTypeId(it) == 'soul' or GetItemTypeId(it) == 'srbd' or GetItemTypeId(it) == 'stwa' then
call UnitRemoveItem(F, it)
call MsgP(GetPlayerId(GetOwningPlayer(F)), " You can't wear it -> Destroy it!", 2.)
endif
if GetItemTypeId(it) == 'tels' then
set SpyVision[GetPlayerId(GetOwningPlayer(F))] = true
set F2 = LoadUnitHandle(Hash,GetHandleId(F),StringHash("P_Vision"))
call UnitAddAbility(F2,'ALsi')
endif
endif
endif
set it = null
endfunction
//===========================================================================
function InitTrig_PickingItem takes nothing returns nothing
set gg_trg_PickingItem = CreateTrigger( )
set I = 0
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_PickingItem, Player(I), EVENT_PLAYER_UNIT_PICKUP_ITEM, null)
set I = I + 1
exitwhen I == 12
endloop
call TriggerAddAction( gg_trg_PickingItem, function Trig_PickingItem_Actions )
endfunction
//TESH.scrollpos=147
//TESH.alwaysfold=0
function GetScores2 takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
set I = 0
loop
exitwhen I > 3
set bl = false
set I2 = 0
loop
exitwhen I2 > 3
if UndeadKilled[I] > UndeadKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>>You killed around |c00E35782" + I2S(UndeadKilled[I]) + " undead|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>>You killed around |c00E35782" + I2S(UndeadKilled[I]) + " undead|r.",25.)
endif
set bl = false
set I2 = 0
loop
exitwhen I2 > 3
if DreadLordsKilled[I] > DreadLordsKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>You killed DreadLords |c00E35782" + I2S(DreadLordsKilled[I]) + " times|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>You killed DreadLords |c00E35782" + I2S(DreadLordsKilled[I]) + " times|r.",25.)
endif
set bl = false
set I2 = 0
loop
exitwhen I2 > 3
if NeutralsKilled[I] > NeutralsKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">You killed around |c00E35782" + I2S(NeutralsKilled[I]) + " neutrals|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">You killed around |c00E35782" + I2S(NeutralsKilled[I]) + " neutrals|r.",25.)
endif
I++
endloop
set I = 6
loop
exitwhen I > 9
set I2 = 6
set bl = false
loop
exitwhen I2 > 9
if HumanKilled[I] > HumanKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>>You killed around |c00E35782" + I2S(HumanKilled[I]) + " citizens|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>>You killed around |c00E35782" + I2S(HumanKilled[I]) + " citizens|r.",25.)
endif
set I2 = 6
set bl = false
loop
exitwhen I2 > 9
if PaladinsKilled[I] > PaladinsKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>You killed Paladins |c00E35782" + I2S(PaladinsKilled[I]) + " times|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>You killed Paladins |c00E35782" + I2S(PaladinsKilled[I]) + " times|r.",25.)
endif
set I2 = 6
set bl = false
loop
exitwhen I2 > 9
if MilitiaKilled[I] > MilitiaKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">You killed around |c00E35782" + I2S(MilitiaKilled[I]) + " militia|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">You killed around |c00E35782" + I2S(MilitiaKilled[I]) + " militia|r.",25.)
endif
I++
endloop
endfunction
function PALADINS_DEFENDING_WIN takes nothing returns nothing // TIME IS ELAPSED AND PALADINS WON
//call DestroyTimer(GetExpiredTimer())
if GameOver != true then // should not get triggered twice if dreadlord won already
set GameOver = true
call StartSound(gg_snd_NewTournament)
//call KillSoundWhenDone(bj_lastPlayedSound)
call ClearTextMessages()
call PlayThematicMusic( "Sound\\Music\\mp3Music\\HumanVictory.mp3" )
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
call CameraSetupApplyForceDuration(gg_cam_GameOverForDreadlords, true, 0.)
endif
if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
call CameraSetupApplyForceDuration(gg_cam_GameOverForDreadlords, true, 0.)
endif
call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 60.00, 60.00, 60.00, 0 )
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
if RusTips == true then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 4., "|c00FF8811 Уничтожено! ПАЛАДИНЫ ПОБЕДИЛИ! |r |r")
else
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 4., "|c00FF8811 PALADINS HAVE WON |r |r")
endif
endif
call TimerStart(CreateTimer(),5,false,function GetScores2)
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call PauseUnit(F,true)
call SetUnitInvulnerable( F, true )
if GetUnitTypeId(F) == footman then
call SetUnitAnimation(F,"stand victory")
elseif GetUnitTypeId(F) == sniper then
call SetUnitAnimation(F,"spell")
elseif IsUnitInGroup(F,Paladins) then
call SetUnitAnimation(F,"stand victory")
endif
call GroupRemoveUnit(P,F)
endloop
endif
endfunction
//===========================================================================
function InitTrig_PalSurvive takes nothing returns nothing
set gg_trg_PalSurvive = CreateTrigger( )
call TriggerAddAction( gg_trg_PalSurvive, function PALADINS_DEFENDING_WIN )
endfunction
//TESH.scrollpos=148
//TESH.alwaysfold=0
function GetScores takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
set I = 0
loop
exitwhen I > 3
set bl = false
set I2 = 0
loop
exitwhen I2 > 3
if UndeadKilled[I] > UndeadKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>>You killed around |c00E35782" + I2S(UndeadKilled[I]) + " undead|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>>You killed around |c00E35782" + I2S(UndeadKilled[I]) + " undead|r.",25.)
endif
set bl = false
set I2 = 0
loop
exitwhen I2 > 3
if DreadLordsKilled[I] > DreadLordsKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>You killed DreadLords |c00E35782" + I2S(DreadLordsKilled[I]) + " times|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>You killed DreadLords |c00E35782" + I2S(DreadLordsKilled[I]) + " times|r.",25.)
endif
set bl = false
set I2 = 0
loop
exitwhen I2 > 3
if NeutralsKilled[I] > NeutralsKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">You killed around |c00E35782" + I2S(NeutralsKilled[I]) + " neutrals|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">You killed around |c00E35782" + I2S(NeutralsKilled[I]) + " neutrals|r.",25.)
endif
I++
endloop
set I = 6
loop
exitwhen I > 9
set I2 = 6
set bl = false
loop
exitwhen I2 > 9
if HumanKilled[I] > HumanKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>>You killed around |c00E35782" + I2S(HumanKilled[I]) + " citizens|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>>You killed around |c00E35782" + I2S(HumanKilled[I]) + " citizens|r.",25.)
endif
set I2 = 6
set bl = false
loop
exitwhen I2 > 9
if PaladinsKilled[I] > PaladinsKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">>You killed Paladins |c00E35782" + I2S(PaladinsKilled[I]) + " times|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">>You killed Paladins |c00E35782" + I2S(PaladinsKilled[I]) + " times|r.",25.)
endif
set I2 = 6
set bl = false
loop
exitwhen I2 > 9
if MilitiaKilled[I] > MilitiaKilled[I2] then
set bl = true
else
set bl = false
endif
I2++
endloop
if bl == true then
call MsgP(I, ">You killed around |c00E35782" + I2S(MilitiaKilled[I]) + " militia|r. |c0080FF00BEST RESULT|r",25.)
else
call MsgP(I, ">You killed around |c00E35782" + I2S(MilitiaKilled[I]) + " militia|r.",25.)
endif
I++
endloop
endfunction
function Trig_TeamDreadLordsWin_Actions takes nothing returns nothing
if GameOver != true then // should not happen twice if Team Paladin won already
call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 30.00, 120.00, 30.00, 128 )
call SetTerrainFogExBJ( 0, 1000, 8000, 0, 3.00, 180.00, 30.00 )
call PauseTimer(udg_SurviveTD)
call PlaySoundJ(gg_snd_SargerasLaugh)
set GameOver = true
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
call CameraSetupApplyForceDuration(gg_cam_PalCam4, true, 0.)
endif
if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
call CameraSetupApplyForceDuration(gg_cam_PalCam4, true, 0.)
endif
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
/*
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 0, 4.00 )
//call (R2S(CameraSetupGetField(cs,CAMERA_FIELD_TARGET_DISTANCE)),0.5)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, CameraSetupGetField(gg_cam_GameOverCam, CAMERA_FIELD_ANGLE_OF_ATTACK), 4.00 )
call SetCameraField(CAMERA_FIELD_ROLL, CameraSetupGetField( gg_cam_GameOverCam, CAMERA_FIELD_ROLL), 4.00 )
call SetCameraField(CAMERA_FIELD_ROTATION, CameraSetupGetField(gg_cam_GameOverCam, CAMERA_FIELD_ROTATION), 4.00 ) */
if RusTips == false then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c005B002E Destroyed! TEAM DREADLORD WIN |r |r")
else
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c005B002E Уничтожено! КОМАНДА ДРЕДЛОРДОВ ПОБЕЖДАЕТ |r")
endif
endif
//call TimerStart(CreateTimer(),5,false,function GetScores)
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call PauseUnit(F,true)
call SetUnitInvulnerable( F, true )
if GetUnitTypeId(F) == ghoul or GetUnitTypeId(F) == skeleton or GetUnitTypeId(F) == skeletonarcher then
call SetUnitAnimation(F,"stand victory")
elseif IsUnitInGroup(F,DreadLords)
call SetUnitAnimation(F,"spell slam")
elseif GetUnitTypeId(F) == skeletonmage
call SetUnitAnimation(F,"stand ready")
endif
call GroupRemoveUnit(P,F)
endloop
endif
endfunction
//===========================================================================
function InitTrig_TeamDreadLordsWin takes nothing returns nothing
set gg_trg_TeamDreadLordsWin = CreateTrigger( )
call TriggerAddAction( gg_trg_TeamDreadLordsWin, function Trig_TeamDreadLordsWin_Actions )
endfunction
//TESH.scrollpos=48
//TESH.alwaysfold=0
function SteamRocket_F takes nothing returns boolean
return not IsUnitDead(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),Player(11)) //and not IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)
endfunction //UnitTypeNotDummy(GetFilterUnit())
function Turbo_Off takes nothing returns nothing
set T = GetExpiredTimer()
set IDT = GetHandleId(T)
set F = LoadUnitHandle(Hash,IDT,0)
set R = LoadReal(Hash,IDT,1)
set R2 = LoadReal(Hash,IDT,2) + 1
if R2 == 0 then
set R = 1
endif
if R2 == 1 then
call UnitAddAbility(F,'A026')
call SaveReal(Hash,IDT,2,R2)
else
call UnitRemoveAbility(F,'A026')
//call echo("end turbo")
call FlushChildHashtable(Hash,IDT)
call DestroyTimer(T)
endif
endfunction
function ST_spells takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local integer id = GetSpellAbilityId()
local real x = GetUnitX(c)
local real y = GetUnitY(c)
local real x2
local real y2
//local unit f
local group g
//call echo("triggered")
//local unit tr
if id == 'A01W' then
set x2 = GetSpellTargetX()
set y2 = GetSpellTargetY()
//set X = GetSpellTargetX()
//set Y = GetSpellTargetY()
call AddSpecialEffect("war3mapImported\\Calldown_FlyUp.mdx",x,y)
//call echo("1")
call TriggerSleepAction(2.)
call IssuePointOrder(c,"attack",GetUnitX(MasterMind),GetUnitY(MasterMind))
call AddSpecialEffect("war3mapImported\\Calldown_FlyDown.mdx",x2,y2)
//call echo("2")
call TriggerSleepAction(0.35)
call AddSpecialEffect("war3mapImported\\NewGroundEX.mdx",x2,y2)
//call echo("3")
set CallDowned = false
set I = 1
// set X =
loop
exitwhen I > 15
if GreatSources[I] != null then
set X2 = GetUnitX(GreatSources[I])
set Y2 = GetUnitY(GreatSources[I])
if DistanceXY(x2,y2,X2,Y2) <= 300 then
//set CallDowned = true
//call UnitDamageTarget(c,F,300,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call echo("die sucker")
//call IssuePointOrder(f,"inferno",X2,Y2)
call KillUnit(GreatSources[I])
set GreatSources[I] = null
call DestroyEffect(AddSpecialEffect("war3mapImported\\void.mdx",X2,Y2))
endif
endif
//call echo(".")
set I = I + 1
endloop
set g= CreateGroup()
set B = Condition(function SteamRocket_F)
call GroupEnumUnitsInRange(g,x2,y2,320,B)
loop
set F = FirstOfGroup(g)
exitwhen F == null
//if UnitTypeNotDummy(F) then
call UnitDamageTarget(c,F,300,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//if IsUnitInGroup(F,GreatSourcesDealAura) then
//call GroupRemoveUnit(GreatSourcesDealAura,F)
//call KillUnit(F)
//endif
call GroupRemoveUnit(g,F)
endloop
call GroupClear(g)
call DestroyGroup(g)
call DestroyBoolExpr(B)
elseif id == 'A025' then
set T = CreateTimer()
set IDT = GetHandleId(T)
call SaveUnitHandle(Hash,IDT,0,c)
call SaveReal(Hash,IDT,1,10.)
call TimerStart(T,12.,true,function Turbo_Off)
endif
set g=null
set c = null
endfunction
function SteamTanks takes nothing returns nothing
local integer i
set T = GetExpiredTimer()
set IDT = GetHandleId(T)
set i = LoadInteger(Hash,IDT,0) + 1
if i == 0 then
set i = 1
endif
//if i == 1 then
set SteamTank[i] = CreateUnit(Player(11),steamtank,GetRectCenterX(gg_rct_MachinesStart1),GetRectCenterY(gg_rct_MachinesStart1),0)
call TriggerRegisterUnitEvent( SteamTankSpells, SteamTank[i], EVENT_UNIT_SPELL_EFFECT)
call IssuePointOrder(SteamTank[i],"attack",-11534,-8364)
//endif
call SaveInteger(Hash,IDT,0,i)
if i == 3 then
call PauseTimer(T)
call DestroyTimer(T)
call FlushChildHashtable(Hash,IDT)
call PlaySoundJ(gg_snd_SteamTankPissed1)
elseif i == 1
call TimerStart(T,2.5,true,function SteamTanks)
endif
endfunction
function Trig_SteamTanksAreComing_Actions takes nothing returns nothing
set T = CreateTimer()
if PalSurviveBl == true then
call PlaySoundJ(gg_snd_SteamTankReady1)
call PingMinimapForForceExJ(HumanForce, -13449., -9338., 4.5, bj_MINIMAPPINGSTYLE_FLASHY, 255, 255, 70)
call PingMinimapForForceExJ(UndeadForce, -13449., -9338., 4.5, bj_MINIMAPPINGSTYLE_FLASHY, 255, 0, 0)
set F = CreateUnit(Player(10),dummy,-13449., -9338.,0)
call UnitApplyTimedLife(F,'BTLF',4.)
call TimerStart(T,0.5,false,function SteamTanks)
endif
//call DestroyTimer(T)
endfunction
//===========================================================================
function InitTrig_SteamTanksAreComing takes nothing returns nothing
set gg_trg_SteamTanksAreComing = CreateTrigger( )
set SteamTankSpells = CreateTrigger()
//call TriggerRegisterPlayerUnitEvent(SteamTankSpells, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerAddAction( gg_trg_SteamTanksAreComing, function Trig_SteamTanksAreComing_Actions )
call TriggerAddAction(SteamTankSpells,function ST_spells)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_SteamTankGo_Actions takes nothing returns nothing
local integer i = 1
local unit f = GetEnteringUnit()
if GetUnitTypeId(f) == steamtank and not IsUnitInGroup(f,SteamTanksGroup) then
loop
exitwhen f == SteamTank[i]
i++
endloop
if DestroyGate == false then
set DestroyGate = true
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl"/*
*/ , GetDestructableX(gg_dest_DTg8_2316),GetDestructableY(gg_dest_DTg8_2316)))
call KillDestructable( gg_dest_DTg8_2316 )
endif
call IssuePointOrder(SteamTank[i],"attack",GetUnitX(MasterMind),GetUnitY(MasterMind))
call GroupAddUnit(SteamTanksGroup,SteamTank[i])
//call echo("dobavlen")
//call DisableTrigger(gg_trg_SteamTankGo)
endif
set f = null
endfunction
//===========================================================================
function InitTrig_SteamTankGo takes nothing returns nothing
set gg_trg_SteamTankGo = CreateTrigger( )
call TriggerRegisterEnterRect( gg_trg_SteamTankGo, gg_rct_MachinesDestroyGate )
call TriggerAddAction( gg_trg_SteamTankGo, function Trig_SteamTankGo_Actions )
endfunction
//TESH.scrollpos=22
//TESH.alwaysfold=0
//and GetOwningPlayer(GetFilterUnit) == Player(11)
function Initiation_Elapsed takes nothing returns nothing
local boolexpr b
set T = GetExpiredTimer()
set ID = GetHandleId(T)
set F2 = LoadUnitHandle(Hash,ID,0)
set X =LoadReal(Hash,ID,1)
set Y = LoadReal(Hash,ID,2)
set R = LoadReal(Hash,ID,4)
if R == 0 then
set R = 1
else
set R = R + 1.
endif
if LoadBoolean(Hash,ID,3) == true then
//call echo("мы его вернули")
call SetUnitOwner(F2,Player(11),true)
set PaladinsUnit[GetPlayerId(GetOwningPlayer(F2))] = null
call GroupRemoveUnit(InitiationG,F2)
call UnitRemoveAbility(F2,'Adts')
call UnitRemoveAbility(F2,'A014')
call PauseTimer(T)
call SaveBoolean(Hash,ID,3,false)
if GetUnitTypeId(F2) == steamtank then
call UnitRemoveAbility(F2,'A025')
call PauseTimer(T)
call DestroyTimer(T)
call FlushChildHashtable(Hash,ID)
else
call TimerStart(T,0.5,true, function Initiation_Elapsed) // здесь есть маааленькая фича даже вернувшись в течение 3 секунд бнит должен все так же быть там
call IssuePointOrder(F2,"attack",X, Y)
endif
endif
if DistanceXY(GetUnitX(F2),GetUnitY(F2),X,Y) < 350 or IsUnitDead(F2) then
//call echo("он на месте или мертв")
call IssueImmediateOrder(F2,"stop")
call PauseTimer(T)
call DestroyTimer(T)
call FlushChildHashtable(Hash,ID)
else
set b = Condition(function Initiation_GettingEnemy)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F2),GetUnitY(F2),1400,b)
set F = FirstOfGroup(P)
if F == null then
//call echo("пусть идет")
call IssuePointOrder(F2,"attack",X, Y)
else
//call echo("пусть дерется")
if GetUnitAbilityLevel(F,'B005') <= 0 or GetUnitAbilityLevel(F,'B00C') <= 0 and R == 4
//call echo("даем наводку")
call IssuePointOrder(F2,"attack",GetUnitX(F), GetUnitY(F))
endif
endif
endif
if R == 4. then // 2 секунды
set R = 0.
endif
call DestroyBoolExpr(b)
set b = null
endfunction
function Trig_Initiation_Actions takes nothing returns nothing
local boolexpr b
set F = GetSpellAbilityUnit()
set X = GetSpellTargetX()
set Y = GetSpellTargetY()
if GetSpellAbilityId() == 'A013' then
call AddEffectTimeToPoint("Abilities\\Spells\\Other\\Andt\\Andt.mdl",X,Y,2) //5
//call CreateFogModifierRadiusLocBJ( true, Player(0), FOG_OF_WAR_VISIBLE, udg_CP_Point, 800.00 )
set F2 = CreateUnit(Player(0),'e00H',X, Y,0)
call UnitApplyTimedLife(F2,'BTLF',3.)
set b = Condition(function Initiation_GettingUnit)
call GroupClear(P)
call GroupEnumUnitsInRange(P,X,Y,900,b)
set F2 = DistToUnit(X,Y,P)
if F2 == null then
else
call GroupAddUnit(InitiationG,F2)
call SaveBoolean(Hash,GetHandleId(F2),StringHash("MilitiaCTRL"),true)
set T = CreateTimer()
set ID = GetHandleId(T)
call SaveUnitHandle(Hash,ID,0,F2)
call SaveReal(Hash,ID,1,GetUnitX(F2))
call SaveReal(Hash,ID,2,GetUnitY(F2))
call SaveBoolean(Hash,ID,3,true)
call TimerStart(T,16.,false,function Initiation_Elapsed)
call SetUnitOwner(F2,GetOwningPlayer(F),false) //true
set PaladinsUnit[GetPlayerId(GetOwningPlayer(F2))] = F2
call UnitAddAbility(F2,'Adts')
call UnitAddAbility(F2,'A014')
if GetUnitTypeId(F2) == steamtank then
call UnitAddAbility(F2,'A025')
endif
if GetLocalPlayer() == GetOwningPlayer(F) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call ClearSelection()
call SelectUnit(F2, true)
endif
endif
endif
call DestroyBoolExpr(b)
set b =null
endfunction
//===========================================================================
function InitTrig_Initiation takes nothing returns nothing
set gg_trg_Initiation = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Initiation, gg_unit_nmrk_0087, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_Initiation, gg_unit_nmrk_0784, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_Initiation, gg_unit_nmrk_0785, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_Initiation, gg_unit_nmrk_0786, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Initiation, function Trig_Initiation_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_TEST_Actions takes nothing returns nothing
if TEST == true then
call GroupAddUnit(DreadLords, gg_unit_Udre_0043)
endif
endfunction
//===========================================================================
function InitTrig_TEST takes nothing returns nothing
set gg_trg_TEST = CreateTrigger( )
call TriggerAddAction( gg_trg_TEST, function Trig_TEST_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_TESTREGUM_Actions takes nothing returns nothing
if TEST == TRUE then
call SetPlayerAllianceStateBJ( Player(6), Player(10), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(10), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(6), Player(7), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(7), Player(6), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(7), Player(10), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(10), Player(7), bj_ALLIANCE_ALLIED_ADVUNITS )
endif
endfunction
//===========================================================================
function InitTrig_TESTREGUM takes nothing returns nothing
set gg_trg_TESTREGUM = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_TESTREGUM, 5 )
call TriggerAddAction( gg_trg_TESTREGUM, function Trig_TESTREGUM_Actions )
endfunction
function Trig_____________________________________003_Actions takes nothing returns nothing
call DestroyFogModifier( GetLastCreatedFogModifier() )
endfunction
//===========================================================================
function InitTrig_____________________________________003 takes nothing returns nothing
set gg_trg_____________________________________003 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________003, function Trig_____________________________________003_Actions )
endfunction
//TESH.scrollpos=495
//TESH.alwaysfold=0
function OpenBarrier takes nothing returns nothing
call DestroyTimer(GetExpiredTimer())
//call KillDestructable( gg_dest_Dofw_1085 )
//call KillDestructable( gg_dest_Dofw_1082 )
//call KillDestructable( gg_dest_Dofw_1084 )
//call KillDestructable( gg_dest_Dofw_1083 )
endfunction
//function Teleport_F takes nothing returns nothing
//endfunction
/*
function Teleport_Action takes nothing returns nothing
local integer i
if GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[1] then
set i = 1
endif
call echo(I2S(i))
endfunction */
function Teleport_Action takes nothing returns nothing
local integer i
local integer i2
local unit f = GetEnteringUnit()
local boolean bl = false
local string eftr
//call echo("enter")
if not IsUnitDead(f) and (IsUnitInGroup(f,Paladins) or GetUnitTypeId(f) == 'hkni') then
if GetTriggeringRegion() == TeleportRect[1] then
set i = 1
elseif GetTriggeringRegion() == TeleportRect[2] then
set i = 2
elseif GetTriggeringRegion() == TeleportRect[3] then
set i = 3
elseif GetTriggeringRegion() == TeleportRect[4] then
set i = 4
elseif GetTriggeringRegion() == TeleportRect[5] then
set i = 5
elseif GetTriggeringRegion() == TeleportRect[6] then
set i = 6
elseif GetTriggeringRegion() == TeleportRect[7] then
set i = 7
elseif GetTriggeringRegion() == TeleportRect[8] then
set i = 8
endif
//call echo(I2S(i))
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f)) // the effect that starts from current position
if i == 1 then
call SetUnitX(f,-1800)
call SetUnitY(f,4650)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = true
elseif i == 2 then
call SetUnitX(f,-1800)
call SetUnitY(f,4200)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = false
elseif i == 3 then
call SetUnitX(f,200)
call SetUnitY(f,2900)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = true
elseif i == 4 then
call SetUnitX(f,-200)
call SetUnitY(f,2900)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = false
elseif i == 5 then
call SetUnitX(f,-1800)
call SetUnitY(f,1050)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = true
elseif i == 6 then
call SetUnitX(f,-1800)
call SetUnitY(f,1410)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = false
elseif i == 7 then
call SetUnitX(f,-3750)
call SetUnitY(f,2873)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = true
elseif i == 8 then
call SetUnitX(f,-3300)
call SetUnitY(f,2873)
call AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(f),GetUnitY(f))
set bl = false
endif
call IssueImmediateOrder(f,"stop")
set i2 = GetPlayerId(GetOwningPlayer(f))
if bl == false then
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[2],0,0,0,0)
endif
//call SetUnitVertexColor(TeleportEffect[3],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[4],0,0,0,0)
endif
//call SetUnitVertexColor(TeleportEffect[5],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[6],0,0,0,0)
endif
//call SetUnitVertexColor(TeleportEffect[7],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[8],0,0,0,0)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[1],255,255,255,255)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[3],255,255,255,255)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[5],255,255,255,255)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[7],255,255,255,255)
endif
elseif bl == true then
//call SetUnitVertexColor(TeleportEffect[1],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[1],0,0,0,0)
endif
//call SetUnitVertexColor(TeleportEffect[3],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[3],0,0,0,0)
endif
//call SetUnitVertexColor(TeleportEffect[5],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[5],0,0,0,0)
endif
//call SetUnitVertexColor(TeleportEffect[7],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[7],0,0,0,0)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[2],255,255,255,255)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[4],255,255,255,255)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[6],255,255,255,255)
endif
if IsPlayerInForce(GetLocalPlayer(),HumanForce) and GetLocalPlayer() == Player(i2) then
call SetUnitVertexColor(TeleportEffect[8],255,255,255,255)
endif
endif
//else
//call echo("he is not")
endif
//call echo("enter2")
set f = null
endfunction
function Trig_PalStart_Actions takes nothing returns nothing
local integer i
local integer i2
local string efrt
//local trigger Teleport = CreateTrigger()
local string s
local real r
set Teleport = CreateTrigger()
call SetPlayerAllianceBJ( Player(11), ALLIANCE_HELP_REQUEST, false, Player(0) )
call SetPlayerAllianceBJ( Player(11), ALLIANCE_HELP_REQUEST, false, Player(1) )
call SetPlayerAllianceBJ( Player(11), ALLIANCE_HELP_REQUEST, false, Player(2) )
call SetPlayerAllianceBJ( Player(11), ALLIANCE_HELP_REQUEST, false, Player(3) )
call SetPlayerAllianceBJ( Player(5), ALLIANCE_HELP_REQUEST, false, Player(0) )
call SetPlayerAllianceBJ( Player(5), ALLIANCE_HELP_REQUEST, false, Player(1) )
call SetPlayerAllianceBJ( Player(5), ALLIANCE_HELP_REQUEST, false, Player(2) )
call SetPlayerAllianceBJ( Player(5), ALLIANCE_HELP_REQUEST, false, Player(3) )
set i2 = 100
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
set i2 = 0
endif
//call CinematicFadeJ( bj_CINEFADETYPE_FADEOUTIN, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(0.2)
//call ResetTerrainFog( )
//call SetTerrainFogExBJ( 0, 1.00, 3200.00, 0.30, 28.00, 50.00, 40.00 )
call Msg("|c00EDBDA7 Cinematic will las about 20-35 seconds.",4.5) //|c00DF6553Made by |c007DEFF2ToldYouSo
call TriggerSleepAction(3.)
//call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 4, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
//call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 7, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
//call CinematicFadeJ( bj_CINEFADETYPE_FADEOUT, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, i2 )
call EnableUserUI(true)
call TriggerSleepAction(2.)
//call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 1, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, i2 )
call EnableUserUI(true)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
call CameraSetupApplyForceDuration(gg_cam_PalCam2, true, 0.)
endif
call TriggerSleepAction(2.8)
//call CinematicFadeJ( bj_CINEFADETYPE_FADEOUT, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, i2 )
call EnableUserUI(true)
call TriggerSleepAction(2.)
//call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 1, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, i2 )
call EnableUserUI(true)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
call CameraSetupApplyForceDuration(gg_cam_PalCam3, true, 0.)
endif
call TriggerSleepAction(4.2) //-0.5 ddd done
//call CinematicFadeJ( bj_CINEFADETYPE_FADEOUT, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, i2 )
call EnableUserUI(true)
call TriggerSleepAction(2.)
//call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 1, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, i2 )
call EnableUserUI(true)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
call CameraSetupApplyForceDuration(gg_cam_PalCam4, true, 0.)
endif
call TriggerSleepAction(3.5)
call CinematicModeExBJ(false, HumanForce, bj_CINEMODE_INTERFACEFADE)
call CameraSetSmoothingFactor( 1 )
//call PlayThematicMusic( "Sound\\Music\\mp3Music\\Undead2.mp3" )
set i = 0
loop
exitwhen i>3
if PlayerInGame[i] and IsPlayerInForce(Player(i),HumanForce) then
set CinematicEnd[i] = TRUE
endif
set i = i+1
endloop
//if not PlayerIsActive(Player(1)) then // тест - даем доп. героя
//call SetPlayerAllianceStateBJ( Player(1), Player(0), bj_ALLIANCE_ALLIED_ADVUNITS )
//endif
//call TimerStart(CreateTimer(),30,false,function OpenBarrier)
set I = 0
loop
exitwhen I > 3
if HERO[I] != null then
set F2 = CreateUnit(GetOwningPlayer(HERO[I]),'e00O',GetUnitX(HERO[I]),GetUnitY(HERO[I]),0)
//call GroupAddUnit(DreadLordsVision,F2)
call SaveUnitHandle(Hash,GetHandleId(HERO[I]),StringHash("P_Vision"),F2)
endif
I++
endloop
set TeleportEffect[1] = CreateUnit(Player(0),'e00T',-1800,4300.,180)
call SetUnitVertexColor(TeleportEffect[1],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call SetUnitVertexColor(TeleportEffect[1],255,255,255,255)
endif
set TeleportEffect[2] = CreateUnit(Player(0),'e00T',-1800,4582.,180)
call SetUnitVertexColor(TeleportEffect[2],0,0,0,0)
//set efrt = ""
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
//set efrt = "Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl"
//endif
//call SaveEffectHandle(Hash,GetHandleId(TeleportEffect[0]),StringHash("TeleportEffect_eff"), AddSpecialEffectTarget(efrt,TeleportEffect[0],"origin"))
set TeleportEffect[3] = CreateUnit(Player(0),'e00T',-100,2900.,180)
call SetUnitVertexColor(TeleportEffect[3],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call SetUnitVertexColor(TeleportEffect[3],255,255,255,255)
endif
set TeleportEffect[4] = CreateUnit(Player(0),'e00T',100,2900.,180)
call SetUnitVertexColor(TeleportEffect[4],0,0,0,0)
//set efrt = ""
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
//set efrt = "Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl"
//endif
//call SaveEffectHandle(Hash,GetHandleId(TeleportEffect[0]),StringHash("TeleportEffect_eff"), AddSpecialEffectTarget(efrt,TeleportEffect[0],"origin"))
set TeleportEffect[5] = CreateUnit(Player(0),'e00T',-1800,1380.,180)
call SetUnitVertexColor(TeleportEffect[5],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call SetUnitVertexColor(TeleportEffect[5],255,255,255,255)
endif
set TeleportEffect[6] = CreateUnit(Player(0),'e00T',-1800,1080.,180)
call SetUnitVertexColor(TeleportEffect[6],0,0,0,0)
//set efrt = ""
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
//set efrt = "Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl"
//endif
//call SaveEffectHandle(Hash,GetHandleId(TeleportEffect[0]),StringHash("TeleportEffect_eff"), AddSpecialEffectTarget(efrt,TeleportEffect[0],"origin"))
set TeleportEffect[7] = CreateUnit(Player(0),'e00T',-3400,2873.,180)
call SetUnitVertexColor(TeleportEffect[7],0,0,0,0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call SetUnitVertexColor(TeleportEffect[7],255,255,255,255)
endif
set TeleportEffect[8] = CreateUnit(Player(0),'e00T',-3630,2873.,180)
call SetUnitVertexColor(TeleportEffect[8],0,0,0,0)
//set efrt = ""
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
//set efrt = "Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl"
//endif
//call SaveEffectHandle(Hash,GetHandleId(TeleportEffect[0]),StringHash("TeleportEffect_eff"), AddSpecialEffectTarget(efrt,TeleportEffect[0],"origin"))
set TeleportRect[1] = CreateRegion()
set TeleportRect[2] = CreateRegion()
set TeleportRect[3] = CreateRegion()
set TeleportRect[4] = CreateRegion()
set TeleportRect[5] = CreateRegion()
set TeleportRect[6] = CreateRegion()
set TeleportRect[7] = CreateRegion()
set TeleportRect[8] = CreateRegion()
call RegionAddRect(TeleportRect[1],gg_rct_Teleport1)
call RegionAddRect(TeleportRect[2],gg_rct_Teleport2)
call RegionAddRect(TeleportRect[3],gg_rct_Teleport3)
call RegionAddRect(TeleportRect[4],gg_rct_Teleport4)
call RegionAddRect(TeleportRect[5],gg_rct_Teleport5)
call RegionAddRect(TeleportRect[6],gg_rct_Teleport6)
call RegionAddRect(TeleportRect[7],gg_rct_Teleport7)
call RegionAddRect(TeleportRect[8],gg_rct_Teleport8)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[1],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[2],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[3],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[4],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[5],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[6],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[7],null)
call TriggerRegisterEnterRegion(Teleport,TeleportRect[8],null)
call TriggerAddAction(Teleport,function Teleport_Action)
//set efrt = ""
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
//set efrt = "Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl"
//endif
//call SaveEffectHandle(Hash,GetHandleId(TeleportEffect[8]),StringHash("TeleportEffect_eff"), AddSpecialEffectTarget(efrt,TeleportEffect[8],"origin"))
/*
set CilivianzAlive = CreateLeaderboard()
//if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
call PlayerSetLeaderboard(GetLocalPlayer(), CilivianzAlive)
//endif
call LeaderboardSetLabel(CilivianzAlive, "Villagers Alive - " + I2S(R2I(100*CGM/CGMMax)) + "%")
call LeaderboardAddItemJ( Player(6), CilivianzAlive, " Dreadlord Count - ", DreadLordsCount )
call LeaderboardDisplay(CilivianzAlive, true)
//call LeaderboardAddItem(CilivianzAlive, "Villagers Alive - ", 0, Player(5))
//call LeaderboardSetSizeByItemCount(CilivianzAlive, 1)
set LeaderBoardActive = true
*/
call TriggerSleepAction(14.)
//call PlaySoundJ(gg_snd_QuestLog)
// if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
// call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 5., "|c00DF6553 20 sec before the paladin's barrier get removed|r")
// endif
if RusTips == true then
set s = "5 важнейших правила:"
set r = 10.
else
set r = 6.
set s = "|c00E77561 You have 3 minutes of free time roam across the map before team |c0000AE57Dreadlords|r |c00E77561will appear. |r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
if RusTips == true then
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, "1) Вам отведён под контроль ваш герой (Паладин). Это ваш единственный юнит, доступный на протяжении всей игры. Здесь, в форте, вы полностью неуязвимы и способны быстро восстанавливать здоровье и ману. Но переступив через барьер, вы становитесь уязвимы. ")
endif
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set r = 13.
set s = "2) Защищайте гражданское население. Через несколько минут команда Дредлордов появится на полуострове, и вы будете должны сохранить в живых не менее 20% гражданских. Поверьте, вы вряд ли хотите знать, чем вам придётся заниматься, если у вас это не получится."
else
set r = 3.
set s = "|c00E77561 Here are some main rules: |r"
endif
//call StartSound(gg_snd_QuestLog)
//call KillSoundWhenDone(bj_lastPlayedSound)
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set r = 10.
set s = "3) Используйте отведённое время с умом. На миникарте красным отмечены потенциальные квесты для выполнения. Более подробная информация о каждом из них находится во вкладке Задания. Квесты дают золото, предметы (что выпадают с убитых нейтралов), а также прекращают периодические нападения нейтралов на ваших друзей."
else
set r = 6.
set s = "|c00E77561 .1) Militia (AI) and Citizens are your allies|r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set r = 10.
set s = "4) Ополчение (стража) это ваш главный помошник в защите гражданских. Его нельзя контролировать - это компьютер, который лично сам определяет куда ему идти и кого защищать. Они будут стараться своевременно реагировать на потенциальные угрозы. "
else
set r = 6.
set s = "|c00E77561 .2) Undead(AI), team |c0000AE57Dreadlord|r|c00E77561 and Neutrals are your enemy"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set s = "|c00E77561 .5) Скоро появится 20 минутный таймер. По его истечению, с юго запада прибудут Паровые Машины. Эти грозные машины могут уничтожить главную цитадель Дредлордов и принести вам победу."
set r = 12.
else
set r = 12.
set s = "|c00E77561 .3) Soon the timer of Steam Machines will appear in the right border. If you manage to survive, the steam tanks will ariive. Assist them to destroy the core Undead building and you will win. |r"
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
endif
call TriggerSleepAction(r+ 2.)
if RusTips == true then
set s = ""
set r = 0.
else
set r = 8.
set s = "|c00E77561 The problem is, you have to keep alive 20% of citizens througout the whole game. If you dont, you will face much difficulties defending your own base.|r"
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
set r = 2.
endif
//set r = 32
call TriggerSleepAction(r)
//call TriggerSleepAction(5.)
//call PlaySoundJ(gg_snd_QuestLog)
//call KillSoundWhenDone(bj_lastPlayedSound)
if RusTips == true then
set s = "5 не менее важных правила:"
set r = 4.
else
set r = 4
set s = "|c00E77561 Here are some additional rules you still need: |r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set r = 13.
set s = "1) На золото вы можете покупать расходные предметы из магазинов, а также проводить улучшения (здание улучшений выглядит как алтарь,у каждого игрока свой индивидуальный). Улучшения крайне эффективно влияют на силу Ополчения, позволяя вам усиливать оборону полуострова. Учтите, что подобные улучшения, но на армию нежити, присутствуют и у Дредлордов, потому в течение игры вы будете соревноваться в кол-ве улучшений. "
else
set r = 8.
set s = "|c00E77561 .1) If your hero dies - you get a mini-hero unit instead, while hero is getting respawned for 4 mins. So be careful|r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set r = 13.
set s = "2) Дредлорды невидимы, пока не используют способности или атакуют. Тем не менее, для целей их выслеживания у вас есть специальное здание (выглядит как магический храм, у каждого игрока свой индивидуальный). Способность, которое применяет здание, действует по всей карте, давая просвет на указанный игроком участок. Помимо этого, способность позволяет временно взять под свой контроль ближайшего юнита полчения, также временно одарив его true sight и дополнительным здоровьем."
else
set r = 8.
set s = "|c00E77561 .2) Your hero can LVL up, buy one-off items in shop, getting items from killing Neutrals(AI), getting gold from completing questsy"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r + 2.)
// if RusTips == true then
/// set s = "5 не менее важных правила:"
// else
// set s = "|c00E77561 Here are some additional rules you still need: |r"
// endif
//if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
// call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 30, "|c00E77561 .3) YOUR GOLD IS GENERAL - spend it wisely |r")
//endif
if RusTips == true then
set r = 12.
set s = "3) Не позволяйте армии нежити бесконечно пополнять свои ряды. Иначе в конечном итоге их станет так много, что их будут тяжело уничтожить. Также потеря населённых пунктов тяжело отражается на последствиях. Зону покрывает порча, а посередине открывается тёмный портал, поглощающий всё живое. Не теряйте время на такой территории, сосредоточьтесь на живых регионах."
else
set r = 8.
set s = "|c00E77561 .3) Dont let Undead(AI) and team |c0000AE57Dreadlord|r|c00E77561 kill your Allies - every death turns into enemy undead unit. That might grow into a snow ball, causing more and more allies to become undead army.|r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set r = 12.
set s = "4) Оседлайте скакуна, нажав кнопку D на вашем Паладине. Спустя небольшое время вы моментально взберётесь на лошадку, получив значительный бонус к скорости передвижения. Учтите, что получение любого урона на скакуне моментально вас соспешит с лошади. "
else
set r = 8.
set s = "|c00E77561 .4) Consider making upgrades via Main Paladins Building - it strengthen your passive defense AI ally|r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set s = ""
set r = 0.
else
set r = 4.
set s = "|c00E77561 And here some minor things you might look at if you are new: |r"
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
set r = 2.
endif
call TriggerSleepAction(r)
if RusTips == true then
set r = 15.
set s = "5) Вы можете влиять на поведение мирных жителей. Этая суматошная масса будет носиться прочь от сражений, и если вы сами примените атаку на одного из них (не беспокойтесь, никто не пострадает), они начнут искать ближайшего воина из ополчения, за чью спину спрятаться. Используйте это как команду увести их подальше от безлюдных мест, а также как команду чтобы не запутаться в толпе пробегающих. "
else
set r = 12.
set s = "|c00E77561 .1)Team |c0000AE57Dreadlord|r|c00E77561 are inivisble rats and can't be seen if not attacking anyone. You can probably true sight THEM by towers, and using an ability Initiation(via Observatory)|r"
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set s = "Удачи!"
set r = 3.
else
set r = 10.
set s = "|c00E77561 .2) Neutrals start raiding map in about 2 mins, trying to kill your Allies. It can be stopped by completing related quests. They are no direct need to complete their quests, neutral's raids are not too dangerous. "
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
call TriggerSleepAction(r+2.)
if RusTips == true then
set s = ""
else
set r = 10.
set s = "|c00E77561 .3) Each quest has A red icon on a minimap, so you can easily find them. Quest giver has questionmark on its head. Dont rush into Orc Quest: it's pretty tough to complete. |r"
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, r, s)
endif
endif
call TriggerSleepAction(100. + r)
if RusTips == true then
set s = "|c00E77561 Даю важный совет по квестам: если вы новичок, НЕ начинайте квест про орков, пока на каждом Паладине не будет 4-6 уровня. Начав его, вы провалите его, если не успеете завершить вовремя. Помимо золота, выполнение квеста гаранитрует вам получение очень сильного артефакта."
else
set s = "|c00E77561 I give you important advice: if you are new player, DO not, start the orc quest until you are 4-6 lvl on every Paladin already. It will be failed if you started it and didnt achive to complete in time. Thats a hard quest to completele, but it will additionally reward you will extremely strong item. |r"
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 15, s)
endif
endif
//call PlayThematicMusic( "Sound\\Music\\mp3Music\\Undead1.mp3" )
//set efrt = null
set Teleport = null
endfunction
//===========================================================================
function InitTrig_PalStart takes nothing returns nothing
set gg_trg_PalStart = CreateTrigger( )
call TriggerAddAction( gg_trg_PalStart, function Trig_PalStart_Actions )
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function Trig_PaladinsLvlUP_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer lvl = GetHeroLevel(c)
if IsUnitInGroup(c,Paladins) then
if lvl == 3 then // devotion
call SetUnitAbilityLevel(c,'AHad',2)
elseif lvl == 5 then
call SetUnitAbilityLevel(c,'AHad',3)
endif
endif
set c = null
endfunction
//===========================================================================
function InitTrig_PaladinsLvlUP takes nothing returns nothing
set gg_trg_PaladinsLvlUP = CreateTrigger( )
//call TriggerRegisterUnitEvent( gg_trg_PaladinsLvlUP, gg_unit_Hpal_0503, EVENT_UNIT_HERO_LEVEL )
//call TriggerRegisterUnitEvent( gg_trg_PaladinsLvlUP, gg_unit_H001_0245, EVENT_UNIT_HERO_LEVEL )
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsLvlUP, Player(0), EVENT_PLAYER_HERO_LEVEL, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsLvlUP, Player(1), EVENT_PLAYER_HERO_LEVEL, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsLvlUP, Player(2), EVENT_PLAYER_HERO_LEVEL, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsLvlUP, Player(3), EVENT_PLAYER_HERO_LEVEL, null)
call TriggerAddAction( gg_trg_PaladinsLvlUP, function Trig_PaladinsLvlUP_Actions )
endfunction
//TESH.scrollpos=542
//TESH.alwaysfold=0
scope PaladinsScope initializer Paladins_Init
function Grace_E takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit c = LoadUnitHandle(Hash,idT,0)
local boolean b = LoadBoolean(Hash,idT,9)
local unit tr = LoadUnitHandle(Hash,idT,3)
local real mp = LoadReal(Hash,idT,8)
set Bol = false
if b == true then
if GetUnitMaxLife(tr) > 0 and not IsUnitDead(tr) then
set R = GetUnitLife(tr) / GetUnitMaxLife(tr) * 100.0
else
set R = 0.
endif
if R >= 100 then
call SetUnitState(c,UNIT_STATE_MANA,GetUnitState(c,UNIT_STATE_MANA) + mp * 0.4)
set Bol = true
endif
else
if IsUnitDead(tr) and IsUnitEnemy(tr,Player(0)) then
call SetUnitState(c,UNIT_STATE_MANA,GetUnitState(c,UNIT_STATE_MANA) + mp * 0.4)
set Bol = true
endif
endif
if Bol == true then
set S = ""
if GetLocalPlayer() == GetOwningPlayer(c)
set S = "|c0004ADFF " +I2S(R2I(mp * 0.4 ))+"|r"
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 150) //250
call SetTextTagText(TX, S, 0.001 ) //14 05
call SetTextTagPos(TX, GetUnitX(c), GetUnitY(c), 5)
call SetTextTagVelocity(TX, 0.01, 0.01) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 2.5)
call FT.add(TX, S)
endif
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set tr=null
set t = null
set c = null
endfunction
function Sound_Repeat takes nothing returns nothing
local timer t2 = GetExpiredTimer()
local integer idT = GetHandleId(t2)
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
call SetSoundPosition(gg_snd_FlareTarget101, x,y, 0)
call SetSoundVolume(gg_snd_FlareTarget101, 150)
set bj_lastPlayedSound = gg_snd_FlareTarget101
if (gg_snd_FlareTarget1 != null) then
call StartSound(gg_snd_FlareTarget101)
endif
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1450.00 )
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t2)
set t2 = null
endfunction
function Revelation_L takes nothing returns nothing
local timer t = GetExpiredTimer()
local timer t2
local integer idT = GetHandleId(t)
local real time = LoadReal(Hash,idT,StringHash("R_time")) + 0.1
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
local unit c = LoadUnitHandle(Hash,idT,12)
local group g
local unit f
local real dmg = LoadReal(Hash,idT,StringHash("R_dmg"))
local unit d
set I = LoadInteger(Hash,idT,StringHash("R_Sound"))
if I <= 0 then
set I = 0
endif
/*
if time == 0.1 then // I dont know but the next sound flame plays between 4.3 and 4.4
//call echo("Звук")
call SetSoundPosition(gg_snd_RainOfFireLoop1, x,y, 0)
call SetSoundVolume(gg_snd_RainOfFireLoop1, 150)
set bj_lastPlayedSound = gg_snd_RainOfFireLoop1
if (gg_snd_RainOfFireLoop1 != null) then
call StartSound(gg_snd_RainOfFireLoop1)
endif
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1150.00 )
elseif time == 4. then
call SetSoundPosition(gg_snd_RainOfFireLoop2, x,y, 0)
call SetSoundVolume(gg_snd_RainOfFireLoop2, 150)
set bj_lastPlayedSound = gg_snd_RainOfFireLoop2
if (gg_snd_RainOfFireLoop2 != null) then
call StartSound(gg_snd_RainOfFireLoop2)
endif
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1150.00 )
endif */
if I == 0 then
set t2= CreateTimer()
call SaveReal(Hash,GetHandleId(t2),0,x)
call SaveReal(Hash,GetHandleId(t2),1,y)
call TimerStart(t2,3.7,false,function Sound_Repeat)
call SaveInteger(Hash,idT,StringHash("R_Sound"),1)
call SetSoundPosition(gg_snd_FlareTarget1, x,y, 0)
call SetSoundVolume(gg_snd_FlareTarget1, 150)
set bj_lastPlayedSound = gg_snd_FlareTarget1
if (gg_snd_FlareTarget1 != null) then
call StartSound(gg_snd_FlareTarget1)
endif
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1450.00 )
endif
//endif
//if time == 2 or time == 4 or time == 6. or time == 8. then
set g= CreateGroup()
set B = Condition(function Revelation_F)
call GroupEnumUnitsInRange(g,x,y,320,B)
loop
set f = FirstOfGroup(g)
exitwhen f == null
//if GetUnitAbilityLevel(f,'B006') <= 0 then
set d = CreateUnit(Player(11),dummy,GetUnitX(f),GetUnitY(f),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'A00D')
call IssueTargetOrder(d,"cripple",f)
if time == 8. then
set d = CreateUnit(Player(11),dummy,GetUnitX(f),GetUnitY(f),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'A00L')
call SetUnitAbilityLevel(d,'A00L',GetUnitAbilityLevel(c,'A00G'))
call IssueTargetOrder(d,"soulburn",f)
endif
//endif
if time == 0.5 or time == 1. or time == 1.5 or time == 2. or time == 2.5 or time == 3. or time == 3.5 /*
*/or time == 4. or time == 4.5 or time ==5. or time== 5.5 or time ==6. /*
*/ then
//call echo("ыы")
call UnitDamageTarget(c,f,dmg + GetUnitState(f,UNIT_STATE_MAX_LIFE) * 0.01 ,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS) //dmg
endif
call GroupRemoveUnit(g,f)
endloop
call DestroyGroup(g)
call DestroyBoolExpr(B)
//endif
if time < 6 then
call SaveReal(Hash,idT,StringHash("R_time"),time)
else
call SetSoundPosition(gg_snd_FlareTarget4, x,y, 0)
call SetSoundVolume(gg_snd_FlareTarget4, 150)
set bj_lastPlayedSound = gg_snd_FlareTarget4
if (gg_snd_FlareTarget4 != null) then
call StartSound(gg_snd_FlareTarget4)
endif
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1350.00 )
call KillUnit(LoadUnitHandle(Hash,idT,StringHash("Rev_d")))
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
endif
set g = null
set t2= null
set c = null
set t = null
set f = null
set d = null
endfunction
function Revelation_S takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit c = LoadUnitHandle(Hash,idT,12)
local unit d
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
local integer i
local real time = LoadReal(Hash,idT,StringHash("R_time")) + 0.1
if time < 0. then
set time = 0.1
endif
//call SaveReal(Hash,idT,StringHash("R_time"),0.)
if time >= 2.2 then
//call echo("конец")
set d = CreateUnit(Player(11),'e005',x,y,0)
call SetUnitAnimation(d,"birth")
call RemoveUnit(LoadUnitHandle(Hash,idT,StringHash("R_Bar"))) // removing cast bar dummy
call SaveUnitHandle(Hash,idT,StringHash("Rev_d"),d)
call DestroyEffect(LoadEffectHandle(Hash,idT,2))
call RemoveSavedHandle(Hash,idT,2)
call RemoveSavedInteger(Hash,idT,StringHash("R_int"))
call SaveReal(Hash,idT,StringHash("R_time"),0.)
call PauseTimer(t)
call TimerStart(t,0.1,true,function Revelation_L)
elseif time == 1.5 then
if GetUnitTypeId(c) == 'H00F' /*
*/or GetUnitTypeId(c) == 'H00E' /*
*/ or GetUnitTypeId(c) == 'H00G' /*
*/or GetUnitTypeId(c) == 'H00H' then
//call echo("alternate cast")
call SetUnitAnimation(c,"spell")
endif
endif
if time < 2.2 and GetUnitCurrentOrder(c) == String2OrderId("inferno") then
//call echo("+")
call SaveReal(Hash,idT,StringHash("R_time"),time)
elseif time < 2.2 then
//call echo("прервано")
set i = LoadInteger(Hash,idT,StringHash("R_int"))
//call DestroyCastBar(Revelation_Bar[i])
call RemoveUnit(LoadUnitHandle(Hash,idT,StringHash("R_Bar"))) // removing cast bar dummy
call DestroyEffect(LoadEffectHandle(Hash,idT,2))
call FlushChildHashtable(Hash,idT)
call PauseTimer(t)
call DestroyTimer(t)
endif
set c=null
set d=null
set t = null
endfunction
function Mount_Timer takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit c = LoadUnitHandle(Hash,idT,12)
local unit d
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
local integer i
local integer pid
local integer typ
local string s
local integer il
local real time = LoadReal(Hash,idT,StringHash("M_time")) + 0.1
local integer ii
if time < 0. then
set time = 0.1
endif
if time >= 3.0 then
set pid = GetPlayerId(GetOwningPlayer(c))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl",GetUnitX(c),GetUnitY(c)))
call RemoveUnit(LoadUnitHandle(Hash,idT,StringHash("M_Bar"))) // removing cast bar dummy
//if IsUnitInGroup(HERO[pid], Paladins) then
//call echo(" v gruppet")
//else
//call echo(" ne v gruppet")
//endif
//call UnitAddAbility(HERO[pid],'A00W')
//call SetUnitAbilityLevel(HERO[pid],'A00W',LVLfor1T)
//call UnitAddAbility(HERO[pid],'A00X')
//call SetUnitAbilityLevel(HERO[pid],'A00X',LVLfor1T)
set ii = GetUnitAbilityLevel(c,'A01F')
if pid == 0 then
set il = 'A01L'
elseif pid == 1 then
set il = 'A01P'
elseif pid == 2 then
set il = 'A01Q'
elseif pid == 3 then
set il = 'A01R'
//call
endif
call UnitAddAbility(c,il)
call UnitRemoveAbility(c,il)
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(Hash,idT)
if GetUnitAbilityLevel(c,'A003') < 1 then
call UnitAddAbility( c,'A003' )
endif
//call UnitAddAbility(c,'A01U')
//if GetUnitAbilityLevel
call SetUnitAbilityLevel(c,'A01U',1)
call GroupAddUnit(MountSpeedIncreasement,c)
call SaveReal(Hash, GetHandleId(c), StringHash("MountSpeed_R"), 0.)
call SetPlayerAbilityAvailable(Player(pid), 'A01J', false)
if IsUnitInGroup(c,Radiance) then
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(c),StringHash("Radiance_eff")))
call SaveEffectHandle(Hash,GetHandleId(c),StringHash("Radiance_eff"),/*
*/AddSpecialEffectTarget("Liberty.mdx",c,"chest"))
endif
//call BlzSetUnitSkin
elseif time < 3.0 and GetUnitCurrentOrder(c) == String2OrderId("manaburn") then
call SaveReal(Hash,idT,StringHash("M_time"),time)
elseif time < 3.0 then
call RemoveUnit(LoadUnitHandle(Hash,idT,StringHash("M_Bar"))) // removing cast bar dummy
call FlushChildHashtable(Hash,idT)
call PauseTimer(t)
call DestroyTimer(t)
endif
set c=null
set d=null
set t = null
endfunction
function Trig_PaladinsSkills_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local integer idT
local unit tr
local integer id
local real r
local real r2
local real mp
local real hl
local real x
local real y
local unit d
local integer i
local rect rct
local integer pid
local integer il
local integer ii
if GetSpellAbilityId() == 'AHhb' or GetSpellAbilityId() == 'A010' then // HOLY LIGHT
//call echo("Благодать +")
set tr = GetSpellTargetUnit()
set id = GetUnitAbilityLevel(c,'AHhb')
set I = GetUnitAbilityLevel(c,'A010')
set mp = 60
if id == 1 or I == 1 then
set hl = 130
elseif id == 2 then
set hl = 215
elseif id == 3
//call echo(I2S(id))
set hl = 300
endif
set T= CreateTimer()
set idT = GetHandleId(T)
if IsUnitAlly(tr,GetOwningPlayer(c)) then
//call echo( R2S(GetWidgetLife(tr)) )
call SaveBoolean(Hash,idT,9,true)
if GetInventoryIndexOfItemTypeJ(c, 'rat3') > 0
set hl = hl + 12 //12
endif
call SetUnitLife(tr,GetUnitLife(tr) + hl)
else
call SaveBoolean(Hash,idT,9,false)
/*
set d = CreateUnit(GetOwningPlayer(c),dummy,GetUnitX(tr),GetUnitY(tr),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'A019')
if I > 0 then
call SetUnitAbilityLevel(d,'A019',1)
else
call SetUnitAbilityLevel(d,'A019',id)
endif
call IssueTargetOrder(d,"creepthunderbolt",tr) */
call UnitDamageTarget(c,tr,hl,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call SaveReal(Hash,GetHandleId(tr),StringHash("HolyBoltDamage"),hl)
endif
call SaveUnitHandle(Hash,idT,0,c)
call SaveReal(Hash,idT,8,mp)
call SaveUnitHandle(Hash,idT,3,tr)
call TimerStart(T,0.05,false,function Grace_E)
/* set r = r + hl
set r2 = GetUnitState(tr,UNIT_STATE_MAX_LIFE)
if r > r2 then
set r = mp/(r - r2) // r2/r
call SetUnitState(tr,UNIT_STATE_MANA,GetUnitState
endif */
// if GetUnitStatePercentJ(tr,UNIT_STATE_LIFE,UNIT_STATE_MAX_LIFE) ==
elseif GetSpellAbilityId() == 'A00G' or GetSpellAbilityId() == 'A01K' then // REVELATION revelation
set x = GetSpellTargetX()
set y = GetSpellTargetY()
set T= CreateTimer()
set idT = GetHandleId(T)
set id = GetUnitAbilityLevel(c,'A00G')
if id == 1 then
call SaveReal(Hash,idT,StringHash("R_dmg"),6)
elseif id == 2 then
call SaveReal(Hash,idT,StringHash("R_dmg"),9)
else
call SaveReal(Hash,idT,StringHash("R_dmg"),12)
endif
if GetUnitTypeId(c) == 'H00F' /*
*/or GetUnitTypeId(c) == 'H00E' /*
*/ or GetUnitTypeId(c) == 'H00G' /*
*/or GetUnitTypeId(c) == 'H00H' then
//call echo("alternate cast")
call SetUnitAnimation(c,"spell")
endif
call SaveReal(Hash,idT,0,x)
call SaveReal(Hash,idT,1,y)
call SaveUnitHandle(Hash,idT,12,c)
call SaveEffectHandle(Hash,idT,2,AddSpecialEffect("RunicAura.mdx",x,y))
set udg_ProgressBarSpeed = 2.50
if (GetUnitTypeId(c) == 'H00F'/*
*/or GetUnitTypeId(c) == 'H00E' /*
*/ or GetUnitTypeId(c) == 'H00G' /*
*/or GetUnitTypeId(c) == 'H00H')
set udg_Height = 300.00
else
set udg_Height = 200.00
endif
//udg_HandleID = GetTriggerUnit()
//set udg_Point = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 15.00, 180.00)
set x = GetUnitX(c) + 15 * Cos(180 * bj_DEGTORAD) // default 15 and 180
set y = GetUnitY(c) + 15 * Sin(180 * bj_DEGTORAD)
set il = 0 // transparency
if GetLocalPlayer() == GetOwningPlayer(c) then
set il = 255
endif
set F = CreateUnit(GetOwningPlayer(c), ProgressBar, x, y, bj_UNIT_FACING )
call SetUnitVertexColor(F,255,255,255,il) //hl
//call SaveUnitHandleBJ( GetLastCreatedUnit(), 0, GetHandleIdBJ(udg_HandleID), udg_Hash )
call SaveUnitHandle(Hash,idT,StringHash("R_Bar"),F)
//call GroupAddUnitSimple( GetLastCreatedUnit(), udg_ChangeColorGP )
call UnitAddAbility( F, 'Arav' )
//call UnitAddAbilityBJ( 'Arav', GetLastCreatedUnit() )
//call SetUnitFlyHeightBJ( GetLastCreatedUnit(), ( GetUnitFlyHeight(GetTriggerUnit()) + udg_Height ), 0.00 )
call SetUnitFlyHeight(F, GetUnitFlyHeight(c) + udg_Height, 0.) // 0 is default
//call SetUnitTimeScalePercent( GetLastCreatedUnit(), ( ( 1 / udg_ProgressBarSpeed ) * 100.00 ) )
call SetUnitTimeScale(F, (( 1 / udg_ProgressBarSpeed ) * 100.00 ) * 0.01)
//call RemoveLocation (udg_Point)
/*
//set i = GetPlayerId(GetOwningPlayer(c))
set Revelation_integer = Revelation_integer + 1
// function CreateCastBarAtPos takes real x, real y, real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
set Revelation_Bar[Revelation_integer] = CreateCastBarAtPos(GetUnitX(c),GetUnitY(c), 2.2, 110, " sad ", true, true)
// Set the color
call SetCastBarColor(Revelation_Bar[Revelation_integer], 1, 0.5, 0.3, 1)
call CastBarShowText(Revelation_Bar[Revelation_integer],false)
if GetLocalPlayer() != GetOwningPlayer(c) then
//Make the CastBar transparent
call CastBarShow(Revelation_Bar[Revelation_integer],false)
//call SetCastBarColor(Preservation_Bar[i], 0, 0, 0, 0)
endif
*/
call SetSoundPosition(gg_snd_DivineShield, x,y, 0)
call SetSoundVolume(gg_snd_DivineShield, 88)
set bj_lastPlayedSound = gg_snd_DivineShield
if (gg_snd_DivineShield != null) then
call StartSound(gg_snd_DivineShield)
endif
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1150.00 )
call SaveInteger(Hash,idT,StringHash("R_int"),Revelation_integer)
call TimerStart(T,0.1,true,function Revelation_S)
elseif GetSpellAbilityId() == 'A015' then // ZEAL zeal
set id = GetUnitAbilityLevel(c,'A015')
//call UnitAddAbility(c,'A00J')
if id == 1 then
set I2 = 3
//call SetUnitAbilityLevel(c,'A00J',1)
elseif id == 2 then
set I2 = 5
//call SetUnitAbilityLevel(c,'A00J',3)
elseif id == 3 then
set I2 = 7
//call SetUnitAbilityLevel(c,'A00J',5)
endif
//if GetUnitType
//call SetUnitMoveSpeed(c,GetUni
call UnitAddAbility(c,'A00K')
//call echo("Level " + I2S(GetUnitAbilityLevel(c,'A01U') + I2))
call SetUnitAbilityLevel(c,'A01U',GetUnitAbilityLevel(c,'A01U') + I2)
call SaveReal(Hash,GetHandleId(c),StringHash("Zeal_time"),6.5)
call SaveInteger(Hash,GetHandleId(c),StringHash("Zeal_lvl"),id)
call SaveEffectHandle(Hash,GetHandleId(c),StringHash("Zeal_e"),/*
*/AddSpecialEffectTarget("Ember Red.mdx",c,"weapon")) // StarSphere.mdx
call PlaySoundOnUnit( gg_snd_PriestCastAttack1, 90, c,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 650.00 )
call GroupAddUnit(Zeal_Casters,c) // the spell will end whenever the caster attack or not
elseif GetSpellAbilityId() == 'AOsf' then //RADIANCE
//call echo("dds")
call GroupAddUnit(Radiance,c)
call SaveReal(Hash,GetHandleId(c),StringHash("Radiance_R"),15.)
call SaveEffectHandle(Hash,GetHandleId(c),StringHash("Radiance_eff"),/*
*/AddSpecialEffectTarget("Liberty.mdx",c,"chest"))
call UnitAddAbility(c,'A01F')
call PlaySoundAtPoint("Abilities\\Spells\\NightElf\\Immolation\\ImmolationDecay1.wav", GetUnitX(c), GetUnitY(c) )
elseif GetSpellAbilityId() == 'A01J' then // MOUNT
//call echo("starts mounting")
set T= CreateTimer()
set idT = GetHandleId(T)
call SaveUnitHandle(Hash,idT,12,c)
//call SaveEffectHandle(Hash,idT,2,AddSpecialEffect("RunicAura.mdx",x,y))
set udg_ProgressBarSpeed = 3.
if (GetUnitTypeId(c) == 'H00F'/*
*/or GetUnitTypeId(c) == 'H00E' /*
*/ or GetUnitTypeId(c) == 'H00G' /*
*/or GetUnitTypeId(c) == 'H00H')
set udg_Height = 300.00
else
set udg_Height = 200.00
endif
//udg_HandleID = GetTriggerUnit()
//set udg_Point = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 15.00, 180.00)
set x = GetUnitX(c) + 15 * Cos(180 * bj_DEGTORAD) // default 15 and 180
set y = GetUnitY(c) + 15 * Sin(180 * bj_DEGTORAD)
set il = 0 // transparency
if GetLocalPlayer() == GetOwningPlayer(c) then
set il = 255
endif
set F = CreateUnit(GetOwningPlayer(c), ProgressBar, x, y, bj_UNIT_FACING )
call SetUnitVertexColor(F,255,255,255,il) //hl
//call SaveUnitHandleBJ( GetLastCreatedUnit(), 0, GetHandleIdBJ(udg_HandleID), udg_Hash )
call SaveUnitHandle(Hash,idT,StringHash("M_Bar"),F)
//call GroupAddUnitSimple( GetLastCreatedUnit(), udg_ChangeColorGP )
call UnitAddAbility( F, 'Arav' )
//call UnitAddAbilityBJ( 'Arav', GetLastCreatedUnit() )
//call SetUnitFlyHeightBJ( GetLastCreatedUnit(), ( GetUnitFlyHeight(GetTriggerUnit()) + udg_Height ), 0.00 )
call SetUnitFlyHeight(F, GetUnitFlyHeight(c) + udg_Height, 0.) // 0 is default
//call SetUnitTimeScalePercent( GetLastCreatedUnit(), ( ( 1 / udg_ProgressBarSpeed ) * 100.00 ) )
call SetUnitTimeScale(F, (( 1 / udg_ProgressBarSpeed ) * 100.00 ) * 0.01)
call TimerStart(T,0.1,true,function Mount_Timer)
elseif GetSpellAbilityId() == 'A01N' then // UNMOUNT
set pid = GetPlayerId(GetOwningPlayer(c))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl",GetUnitX(c),GetUnitY(c)))
set ii = GetUnitAbilityLevel(c,'A01F')
if pid == 0 then
set il = 'A01M'
elseif pid == 1 then
set il = 'A01O'
elseif pid == 2 then
set il = 'A01S'
elseif pid == 3 then
set il = 'A01T'
//call
endif
call UnitAddAbility(c,il)
call UnitRemoveAbility(c,il)
call SetUnitAbilityLevel(c,'A01U',1)
// call UnitAddAbility(c,'A00W')
//call SetUnitAbilityLevel(c,'A00W',LVLfor1T)
//call UnitAddAbility(c,'A00X')
//call SetUnitAbilityLevel(c,'A00X',LVLfor1T)
if GetUnitAbilityLevel(c,'A003') < 1 then
call UnitAddAbility( c,'A003' )
endif
if IsUnitInGroup(c, Radiance) then
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(c),StringHash("Radiance_eff")))
call SaveEffectHandle(Hash,GetHandleId(c),StringHash("Radiance_eff"),/*
*/AddSpecialEffectTarget("Liberty.mdx",c,"chest"))
endif
//call UnitRemoveAbility(c,'A01U')
call SetPlayerAbilityAvailable(Player(pid), 'A01J', true)
call GroupRemoveUnit(MountSpeedIncreasement,c)
endif
set c = null
set d=null
set tr= null
set rct = null
endfunction
//===========================================================================
function Paladins_Init takes nothing returns nothing
local unit d
set d = CreateUnit(Player(13),'e001',0,0,0)
call UnitAddAbility(d,'A00D')
call UnitAddAbility(d,'A00J') // zeal boost ms spell
call SetUnitAbilityLevel(d,'A00J',3)
call UnitAddAbility(d,'A00K') // zeal dummy buff
call UnitAddAbility(d,'A22Q') // zeal stun + mag damage
call SetUnitAbilityLevel(d,'A22Q',3)
call UnitAddAbility(d,'A22L') // revelation - silence
call SetUnitAbilityLevel(d,'A22Q',3)
//set HiddenPaladinMounted[0] = gg_unit_H00F_0905
call RemoveUnit(d)
set d = CreateUnit(Player(13),'e005',0,0,0)
call RemoveUnit(d)
set gg_trg_PaladinsSkills = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_PaladinsSkills, gg_unit_Hpal_0503, EVENT_UNIT_SPELL_EFFECT )
// call UnitAddAbility(gg_unit_Hpal_0503,'A01U')
call TriggerRegisterUnitEvent( gg_trg_PaladinsSkills, gg_unit_H001_0245, EVENT_UNIT_SPELL_EFFECT )
// call UnitAddAbility(gg_unit_H001_0245,'A01U')
call TriggerRegisterUnitEvent( gg_trg_PaladinsSkills, gg_unit_H002_0715, EVENT_UNIT_SPELL_EFFECT )
//call UnitAddAbility(gg_unit_H002_0715,'A01U')
call TriggerRegisterUnitEvent( gg_trg_PaladinsSkills, gg_unit_H003_0717, EVENT_UNIT_SPELL_EFFECT )
//call UnitAddAbility(gg_unit_H003_0717,'A01U')
//call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsSkills, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
// call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsSkills, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
//call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsSkills, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
//call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsSkills, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerAddAction( gg_trg_PaladinsSkills, function Trig_PaladinsSkills_Actions )
set d = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_PaladinPreCast_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local integer i = GetSpellAbilityId()
local integer idc = GetPlayerId(GetOwningPlayer(c))
if i == 'AHhb' and c == HERO[idc] then
//set idc
call echo("dubliruu")
call SetUnitState(HiddenPaladinMounted[idc], UNIT_STATE_MANA, 400)
call IssueTargetOrder(HiddenPaladinMounted[idc],"holybolt",gg_unit_u003_0899)
endif
set c = null
endfunction
//===========================================================================
function InitTrig_PaladinPreCast takes nothing returns nothing
set gg_trg_PaladinPreCast = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinPreCast, Player(0), EVENT_PLAYER_UNIT_SPELL_CHANNEL, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinPreCast, Player(1), EVENT_PLAYER_UNIT_SPELL_CHANNEL, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinPreCast, Player(2), EVENT_PLAYER_UNIT_SPELL_CHANNEL, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinPreCast, Player(3), EVENT_PLAYER_UNIT_SPELL_CHANNEL, null)
call TriggerAddAction( gg_trg_PaladinPreCast, function Trig_PaladinPreCast_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_PaladinsCancel_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local integer i = GetSpellAbilityId()
local integer idc = GetPlayerId(GetOwningPlayer(c))
if i == 'AHhb' and c == HERO[idc] then
call echo("otmena")
//call SetUnitState(HiddenPaladinMounted[idc], UNIT_STATE_MANA, 400)
call IssueImmediateOrder(HiddenPaladinMounted[idc],"stop")
endif
set c = null
endfunction
//===========================================================================
function InitTrig_PaladinsCancel takes nothing returns nothing
set gg_trg_PaladinsCancel = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsCancel, Player(0), EVENT_PLAYER_UNIT_SPELL_ENDCAST, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsCancel, Player(1), EVENT_PLAYER_UNIT_SPELL_ENDCAST, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsCancel, Player(2), EVENT_PLAYER_UNIT_SPELL_ENDCAST, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PaladinsCancel, Player(3), EVENT_PLAYER_UNIT_SPELL_ENDCAST, null)
call TriggerAddAction( gg_trg_PaladinsCancel, function Trig_PaladinsCancel_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________017_Actions takes nothing returns nothing
call KillUnit( )
endfunction
//===========================================================================
function InitTrig_____________________________________017 takes nothing returns nothing
set gg_trg_____________________________________017 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________017, function Trig_____________________________________017_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Escort_Demo_Actions takes nothing returns nothing
if GetUnitTypeId(GetSummonedUnit()) == 'hhes' then
call SetUnitVertexColor( GetSummonedUnit(), 255, 100, 40, 175 )
call AddEffectTimeToUnit("Ember Shield I FX 5.mdx",GetSummonedUnit(),"hand, right",14.5)
//call echo(R2S(r))
call GroupAddUnit(Radiance,GetSummonedUnit())
endif
endfunction
//===========================================================================
function InitTrig_Escort_Demo takes nothing returns nothing
local integer index = 0
set gg_trg_Escort_Demo = CreateTrigger( )
loop
exitwhen index > 3
call TriggerRegisterPlayerUnitEvent(gg_trg_Escort_Demo, Player(index), EVENT_PLAYER_UNIT_SUMMON, null)
index++
endloop
//call TriggerRegisterAnyUnitEventBJ( , )
call TriggerAddAction( gg_trg_Escort_Demo, function Trig_Escort_Demo_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________011_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetTriggerUnit(), 'texp') == true ) ) then
return false
endif
return true
endfunction
function Trig_____________________________________011_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_____________________________________011 takes nothing returns nothing
set gg_trg_____________________________________011 = CreateTrigger( )
call TriggerAddCondition( gg_trg_____________________________________011, Condition( function Trig_____________________________________011_Conditions ) )
call TriggerAddAction( gg_trg_____________________________________011, function Trig_____________________________________011_Actions )
endfunction
//TESH.scrollpos=69
//TESH.alwaysfold=0
function ModifyGateJ takes integer gateOperation, destructable d returns nothing
if (gateOperation == bj_GATEOPERATION_CLOSE) then
if (GetDestructableLife(d) <= 0) then
call DestructableRestoreLife(d, GetDestructableMaxLife(d), true)
endif
call SetDestructableAnimation(d, "stand")
elseif (gateOperation == bj_GATEOPERATION_OPEN) then
if (GetDestructableLife(d) > 0) then
call KillDestructable(d)
endif
call SetDestructableAnimation(d, "death alternate")
elseif (gateOperation == bj_GATEOPERATION_DESTROY) then
if (GetDestructableLife(d) > 0) then
call KillDestructable(d)
endif
call SetDestructableAnimation(d, "death")
else
// Unrecognized gate state - ignore the request.
endif
endfunction
function PolledWaitJ takes real duration returns nothing
local timer t
local real timeRemaining
if (duration > 0) then
set t = CreateTimer()
call TimerStart(t, duration, false, null)
loop
set timeRemaining = TimerGetRemaining(t)
exitwhen timeRemaining <= 0
// If we have a bit of time left, skip past 10% of the remaining
// duration instead of checking every interval, to minimize the
// polling on long waits.
if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
call TriggerSleepAction(0.1 * timeRemaining)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
call DestroyTimer(t)
endif
endfunction
function Trig_Hebels_Actions takes nothing returns nothing
local destructable ds = GetTriggerDestructable()
if ds == gg_dest_DTlv_1941 and SouthGateIsOpen then
call ModifyGateJ( bj_GATEOPERATION_CLOSE, gg_dest_LTg1_0007 )
set SouthGateIsOpen = false
elseif ds == gg_dest_DTlv_1941 then
call ModifyGateJ( bj_GATEOPERATION_OPEN, gg_dest_LTg1_0007 )
set SouthGateIsOpen = true
endif
if ds == gg_dest_DTlv_3972 and NorthGateIsOpen then
call ModifyGateJ( bj_GATEOPERATION_CLOSE, gg_dest_LTg1_0017 )
set NorthGateIsOpen = false
elseif ds == gg_dest_DTlv_3972 then
call ModifyGateJ( bj_GATEOPERATION_OPEN, gg_dest_LTg1_0017 )
set NorthGateIsOpen = true
endif
if ds == gg_dest_DTlv_6068 and GateIsOpened then
call ModifyGateJ( bj_GATEOPERATION_CLOSE, gg_dest_LTg4_1506 )
set GateIsOpened = false
elseif ds == gg_dest_DTlv_6068 then
call ModifyGateJ( bj_GATEOPERATION_OPEN, gg_dest_LTg4_1506 )
set GateIsOpened = true
endif
call PolledWaitJ(3.)
call DestructableRestoreLife( ds, GetDestructableMaxLife(ds), true )
set ds=null
endfunction
//===========================================================================
function InitTrig_Hebels takes nothing returns nothing
set gg_trg_Hebels = CreateTrigger( )
call TriggerRegisterDeathEvent( gg_trg_Hebels, gg_dest_DTlv_1941 )
call TriggerRegisterDeathEvent( gg_trg_Hebels, gg_dest_DTlv_3972 )
call TriggerAddAction( gg_trg_Hebels, function Trig_Hebels_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function CreateQuestJ takes integer questType, string title, string description, string iconPath returns quest
local boolean required = (questType == bj_QUESTTYPE_REQ_DISCOVERED) or (questType == bj_QUESTTYPE_REQ_UNDISCOVERED)
local boolean discovered = (questType == bj_QUESTTYPE_REQ_DISCOVERED) or (questType == bj_QUESTTYPE_OPT_DISCOVERED)
set bj_lastCreatedQuest = CreateQuest()
call QuestSetTitle(bj_lastCreatedQuest, title)
call QuestSetDescription(bj_lastCreatedQuest, description)
call QuestSetIconPath(bj_lastCreatedQuest, iconPath)
call QuestSetRequired(bj_lastCreatedQuest, required)
call QuestSetDiscovered(bj_lastCreatedQuest, discovered)
call QuestSetCompleted(bj_lastCreatedQuest, false)
return bj_lastCreatedQuest
endfunction
function EnableQuestFlashButtonEntCorruption takes nothing returns nothing
//if GetLocalPlayer() == GetEnumPlayer() then
//call FlashQuestDialogButton( )
call QuestSetEnabled(EntCorruption, true)
//call FlashQuestDialogButton( )
//endif
endfunction
function EnableQuestFlashButtonFurblogs takes nothing returns nothing
//if GetLocalPlayer() == GetEnumPlayer() then
//call FlashQuestDialogButton( )
call QuestSetEnabled(Furblogs, true)
//call FlashQuestDialogButton( )
//endif
endfunction
function EnableQuestFlashButtonThugsRaid takes nothing returns nothing
//if GetLocalPlayer() == GetEnumPlayer() then
//call FlashQuestDialogButton( )
call QuestSetEnabled(ThugsRaid, true)
//call FlashQuestDialogButton( )
//endif
endfunction
function EnableQuestFlashButtonCryptSpiders takes nothing returns nothing
//if GetLocalPlayer() == GetEnumPlayer() then
//call FlashQuestDialogButton( )
call QuestSetEnabled(CryptSpiders, true)
//call FlashQuestDialogButton( )
//endif
endfunction
function EnableQuestFlashButtonRebelsQuest takes nothing returns nothing
//if GetLocalPlayer() == GetEnumPlayer() then
//call FlashQuestDialogButton( )
call QuestSetEnabled(RebelsQuest, true)
//call FlashQuestDialogButton( )
//endif
endfunction
function Trig_Quests_Actions takes nothing returns nothing
//call echo("do1")
local unit f
if RusTips == false then
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 3.5, "|c00EDBDA7 Quests are marked on your minimap. |r")
endif
else
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 3.5, "|c00EDBDA7 Квесты для выполнения отмечены на карте. |r")
endif
endif
call PingMinimapForForceExJ(HumanForce, 5200, 2954, 6.5, bj_MINIMAPPINGSTYLE_SIMPLE, 225, 225, 0)
call PingMinimapForForceExJ(HumanForce, 3300, -3300, 6.5, bj_MINIMAPPINGSTYLE_SIMPLE, 225, 225, 0)
call PingMinimapForForceExJ(HumanForce, 2550, -8700, 6.5, bj_MINIMAPPINGSTYLE_SIMPLE, 225, 225, 0)
call PingMinimapForForceExJ(HumanForce, -9800, 3400, 6.5, bj_MINIMAPPINGSTYLE_SIMPLE, 225, 225, 0)
call PingMinimapForForceExJ(HumanForce, -6700, 8950, 6.5, bj_MINIMAPPINGSTYLE_SIMPLE, 225, 225, 0)
call PingMinimapForForceExJ(HumanForce, -7800, -9500, 6.5, bj_MINIMAPPINGSTYLE_SIMPLE, 225, 225, 0)
set Furblogs = CreateQuestJ( bj_QUESTTYPE_OPT_DISCOVERED, "Wild furblogs", /*
*/"Price:|c00FEBC10 400 gold|r|n|c008080C0Quest will not start if there are dead nearby. If quest giver will take damage before the quest is started, quest wont be longer available. |r|n|n Central-eastern part of demi-island, presumably there are huts of wild furblogs. In order to avoid attacks of furblogs on the residents, meet with the Patrol-man near the elves ruins and get rid of the leader", /*
*/"ReplaceableTextures\\CommandButtons\\BTNFurbolgShaman.blp" )
call QuestSetEnabled(Furblogs, true)
//call echo("do2")
set f = CreateUnit(Player(11),'e00S',GetUnitX(gg_unit_h008_0577),GetUnitY(gg_unit_h008_0577),0)
call UnitAddAbility(f,'Arav')
call SaveUnitHandle(Hash,GetHandleId(gg_unit_h008_0577),/*
*/StringHash("QuestMark"),f)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_h008_0577),GetUnitY(gg_unit_h008_0577),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
call GroupAddUnit(QuestionMarkGroup,gg_unit_h008_0577)
call SetUnitVertexColor(f, 255, 255, 255, 0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call SetUnitVertexColor(f, 255, 225, 0, 255)
endif
call UnitAddAbility(f,'Arav')
call QuestSetEnabled(Furblogs, true)
call EnableTrigger( gg_trg_FurblogsQuest )
set EntCorruption = CreateQuestJ( bj_QUESTTYPE_OPT_DISCOVERED, "Bloodthirsty trees", /*
*/"Price:|c00FEBC10 350 gold|r|n|c008080C0If the main target is finished off by undead, the quest will remain unfulfilled. |r|n|n Check central-western forests - wanderers report a group of aggressive tree-entes. At the same time, if you will be lucky enough, find a druid who is responcible for that mess.", /*
*/"BTNEnt Rage.blp" )
call QuestSetEnabled(EntCorruption, false)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_nenp_0745),GetUnitY(gg_unit_nenp_0745),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_nenp_0747),GetUnitY(gg_unit_nenp_0747),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_nepl_0748),GetUnitY(gg_unit_nepl_0748),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_nenp_0746),GetUnitY(gg_unit_nenp_0746),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
call QuestSetEnabled(EntCorruption, true)
call TriggerExecute( gg_trg_EntCorruptionQuest )
set ThugsRaid = CreateQuestJ( bj_QUESTTYPE_OPT_DISCOVERED, "Bandits raids", /*
*/"Price:|c00FEBC10 400 gold|r|n|c008080C0If the caravan is destroyed, the quest will be no longer available. If the main target is dead, the quest will remain unfulfilled. |r|n|n In the north-west report: the bandits' mass raids on passing caravans. Prevent a new attack. Find the bandits' camp and slay their king.", /*
*/"BTNBanditHide.blp" )
call QuestSetEnabled(ThugsRaid, false)
set f = CreateUnit(Player(0),'e00E',-6690,8800,0)
call UnitApplyTimedLife(f,'BTLF',0.1)
call QuestSetEnabled(ThugsRaid, true)
call TriggerExecute( gg_trg_ThugsRaidQuest )
set CryptSpiders = CreateQuestJ( bj_QUESTTYPE_OPT_DISCOVERED, "Sleepers on a field", /*
*/"Price:|c00FEBC10 450 gold|r|n|c008080C0tQuest giver must remain alive during the whole quest. |r|n|n Strange noises under the earth are reported at the largest grass plantations. Get the help of dwarves and knock out all the enemies from the ground. And slay them, ofcource.", /*
*/"BTNSpiderQuest.blp" )
call QuestSetEnabled(CryptSpiders, false)
call ShowUnit(MortarUnitQuest,true)
call GroupAddUnit(QuestionMarkGroup,MortarUnitQuest)
set f = CreateUnit(Player(11),'e00S',GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest),0)
call UnitAddAbility(f,'Arav')
call SaveUnitHandle(Hash,GetHandleId(MortarUnitQuest),/*
*/StringHash("QuestMark"),f)
set f = CreateUnit(Player(0),'e00E',GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
call QuestSetEnabled(CryptSpiders, true)
call TriggerExecute( gg_trg_CryptSpidersQuest )
set RebelsQuest = CreateQuestJ( bj_QUESTTYPE_OPT_DISCOVERED, "Rebellion", /*
*/"Price:|c00FEBC10 600 gold|r|n|c008080C0Guard are reporting: in the south of our glorious peninsula, a mutiny occurred, and as a result, the whole fort was captured. We cant arrange them on any conditions , so the output for solution is about to be only one - with a small detachment get a way inside and neutralize all the rebels. ", /*
*/"BTNHolySilence.blp" )
call QuestSetEnabled(RebelsQuest, false)
call GroupAddUnit(QuestionMarkGroup,gg_unit_nmed_0796)
set f = CreateUnit(Player(11),'e00S',GetUnitX(gg_unit_nmed_0796),GetUnitY(gg_unit_nmed_0796),0)
call UnitAddAbility(f,'Arav')
call SetUnitFlyHeight(f,80,0)
call SaveUnitHandle(Hash,GetHandleId(gg_unit_nmed_0796),/*
*/StringHash("QuestMark"),f)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_nmed_0796),GetUnitY(gg_unit_nmed_0796),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
call QuestSetEnabled(RebelsQuest, true)
call TriggerExecute( gg_trg_Rebels )
set OrcInvasion = CreateQuestJ( bj_QUESTTYPE_OPT_DISCOVERED, "Drok and Orcs Invasion", /*
*/"Price:|c00FEBC10 1500 gold|r|n|c00B53A31ALERT: it's recommended to have at least 4 lvl to each hero.|r|n|c008080C08 days passed since Drok, the master of orc's pirate clan 'BloodSuckers' captured a small fishing village. They barricaded the main entrance and are currently waiting for more Drok's ships to come. They dont even care about rumors of undead.|n It seems like the survived villagers are going to help you. 'They killed my brother, and after that they killed my father, and after that they killed my cat. Im not gonna let them stay here. Militia are too scared, help us Paladins.|nThe priority is to beat Drok enough, so he would never get back in Hellmouth. ", /*
*/"ReplaceableTextures\\CommandButtons\\BTNHellScream.blp" )
call QuestSetEnabled(OrcInvasion, false)
call GroupAddUnit(QuestionMarkGroup,gg_unit_hmil_0639)
set f = CreateUnit(Player(11),'e00S',GetUnitX(gg_unit_hmil_0639),GetUnitY(gg_unit_hmil_0639),0)
call UnitAddAbility(f,'Arav')
call SetUnitFlyHeight(f,80,0)
call SaveUnitHandle(Hash,GetHandleId(gg_unit_hmil_0639),/*
*/StringHash("QuestMark"),f)
set f = CreateUnit(Player(0),'e00E',GetUnitX(gg_unit_e00P_0812),GetUnitY(gg_unit_e00P_0812),0)
call UnitApplyTimedLife(f,'BTLF',0.1)
call QuestSetEnabled(OrcInvasion, true)
call TriggerExecute( gg_trg_OrcInvasion )
//call SetUnitOwner(gg_unit_e00P_0228,Player(PLAYER_NEUTRAL_PASSIVE),false)
set f = null
endfunction
//===========================================================================
function InitTrig_Quests takes nothing returns nothing
set gg_trg_Quests = CreateTrigger( )
local force f = CreateForce()
set CryptSpidersGroup = CreateGroup()
// call echo("do?")
set MortarUnitQuest = gg_unit_hmtm_0774
call TriggerRegisterTimerEvent(gg_trg_Quests, 25, false) //25
call ShowUnit(gg_unit_nfrb_0740,false)
call ShowUnit(gg_unit_nfrs_0741,false)
call ShowUnit(gg_unit_nfrl_0742,false)
call ShowUnit(gg_unit_nfrl_0743,false)
call ShowUnit(gg_unit_nfrl_0744,false)
call ShowUnit(gg_unit_nenp_0745,false)
call ShowUnit(gg_unit_nenp_0747,false)
call ShowUnit(gg_unit_nenp_0746,false)
call ShowUnit(gg_unit_nepl_0748,false)
call ShowUnit(gg_unit_hrif_0749,false)
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_ThugsRaid1,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call ShowUnit(F,false)
call GroupAddUnit(ThugsRaidGroup,F)
call GroupRemoveUnit(P,F)
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_ThugsRaid2,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call ShowUnit(F,false)
call GroupAddUnit(ThugsRaidGroup,F)
call GroupRemoveUnit(P,F)
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_ThugsCamp,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call ShowUnit(F,false)
call GroupAddUnit(ThugsCampGroup,F)
call GroupRemoveUnit(P,F)
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_SpiderRegion,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if GetUnitTypeId(F) == 'ucry' then
call ShowUnit(F,false)
call GroupAddUnit(CryptSpidersGroup,F)
endif
call GroupRemoveUnit(P,F)
endloop
call ShowUnit(MortarUnitQuest,false)
set RebelsMainUnit = gg_unit_usap_0777
call PauseUnit( gg_unit_h00C_0791,true )
call PauseUnit( gg_unit_h00C_0790,true )
call SetDestructableInvulnerable( gg_dest_LTba_1536, true )
call SetDestructableInvulnerable( gg_dest_LTba_1537, true )
call SetDestructableInvulnerable( gg_dest_LTba_1538, true )
call SetDestructableInvulnerable( gg_dest_LTba_3223, true )
call SetDestructableInvulnerable( gg_dest_LTbr_3226, true )
call SetDestructableInvulnerable( gg_dest_LTbr_3227, true )
call SetDestructableInvulnerable( gg_dest_LTbr_3230, true )
call SetDestructableInvulnerable( gg_dest_LTbr_3231, true )
call SetDestructableInvulnerable( gg_dest_LTbr_4403, true )
call SetDestructableInvulnerable( gg_dest_LTbr_4404, true )
call SetDestructableInvulnerable( gg_dest_LTbr_4405, true )
call SetDestructableInvulnerable( gg_dest_LTbr_4406, true )
call SetDestructableInvulnerable( gg_dest_LTg1_4408, true )
call SetDestructableInvulnerable( gg_dest_LTg1_4407, true )
call SetDestructableInvulnerable( gg_dest_LTbx_9135, true )
call SetDestructableInvulnerable( gg_dest_LTba_9134, true )
call SetDestructableInvulnerable( gg_dest_LTba_9136, true )
call SetDestructableInvulnerable( gg_dest_LTbr_9137, true )
call GroupAddUnit(RebelsAttackGroup, gg_unit_nchp_0802 )
call GroupAddUnit(RebelsAttackGroup, gg_unit_hrif_0795 )
call GroupAddUnit(RebelsAttackGroup, gg_unit_hfoo_0794 )
call GroupAddUnit(RebelsAttackGroup, gg_unit_hfoo_0793 )
call GroupAddUnit(RebelsAttackGroup, gg_unit_hfoo_0792 )
call ShowUnit( gg_unit_nchp_0802,false )
call ShowUnit( gg_unit_hrif_0795,false )
call ShowUnit( gg_unit_hfoo_0794,false )
call ShowUnit( gg_unit_hfoo_0793,false )
call ShowUnit( gg_unit_hfoo_0792,false )
call ShowUnit( gg_unit_h009_0797,false )
call ShowUnit( gg_unit_h009_0798,false )
call ShowUnit( gg_unit_h009_0799,false )
call ShowUnit( gg_unit_h00B_0800,false )
//call KillUnit( gg_unit_nmed_0796 )
//set EntQuestionMark = CreateGroup()
set I = 0
loop
exitwhen I > 3
call ForceAddPlayer(f, Player(I))
I++
endloop
set I2 = 1
loop
exitwhen I2 > 4
if I2 == 1 then
set EntQuestionMark[I2] = gg_unit_e00P_0228
elseif I2 == 2 then
set EntQuestionMark[I2] =gg_unit_e00P_0233
elseif I2 == 3 then
set EntQuestionMark[I2] =gg_unit_e00P_0235
elseif I2 == 4 then
set EntQuestionMark[I2] =gg_unit_e00P_0253
endif
set F = EntQuestionMark[I2]
//call GroupAddUnit(EntQuestionMark,F)
call SetUnitVertexColor(F, 255, 160, 0, 0)
if (IsPlayerInForce(GetLocalPlayer(), f)) then
call SetUnitVertexColor(F, 255, 160, 0, 255)
endif
I2++
endloop
call TriggerAddAction( gg_trg_Quests, function Trig_Quests_Actions )
call DestroyForce(f)
set f = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________008_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_____________________________________008 takes nothing returns nothing
set gg_trg_____________________________________008 = CreateTrigger( )
call TriggerAddAction( gg_trg_____________________________________008, function Trig_____________________________________008_Actions )
endfunction
//TESH.scrollpos=39
//TESH.alwaysfold=0
function FurbPride_Act takes nothing returns nothing
call DestroyTrigger(GetTriggeringTrigger())
//set bj_lastPlayedSound = gg_snd_QuestActivateWhat101
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_QuestActivateWhat101)
//endif
call MsgForce(HumanForce,"|c00FF712DWild Furblogs|r - quest completed. |c00FEBA0E+450")
set QuestCompleted[1] = true
call QuestSetCompleted( Furblogs, true )
set I = 450 / T1Nplayer
set I2 = 0
loop
exitwhen I2 > 3
if PlayerIsActive(Player(I2)) then
call SetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD) + I)
endif
I2++
endloop
endfunction
function Trig_FurblogsQuest_Actions takes nothing returns nothing
local trigger FurbPrideKill
call GroupClear(P)
set B = Condition(function Undead_Filter)
//call echo("works")
call GroupEnumUnitsInRange(P,GetUnitX(gg_unit_h008_0577),GetUnitY(gg_unit_h008_0577),1200,B)
set F = GetTriggerUnit()
call DestroyBoolExpr(B)
if IsUnitInGroup(F,Paladins) and CountUnitsInGroupJ(P) <= 0 and FurblogsReal <= 0. and FurblogsCanBeCanceled == true then
//call DisableTrigger( GetTriggeringTrigger() )
//call echo("works and disable")
set FurblogsCanBeCanceled = false
set udg_WithinRangeUnit = gg_unit_h008_0577
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
call KillUnit( gg_unit_e00P_0283 )
call KillUnit(LoadUnitHandle(Hash,GetHandleId(gg_unit_h008_0577),StringHash("QuestMark")))
call RemoveSavedHandle(Hash,GetHandleId(gg_unit_h008_0577),StringHash("QuestMark"))
call GroupRemoveUnit(QuestionMarkGroup,gg_unit_h008_0577)
set S = ""
//call echo("ss")
call SetUnitFacing(gg_unit_h008_0577,AngleBetweenXY(GetUnitX(gg_unit_h008_0577),GetUnitY(gg_unit_h008_0577),GetUnitX(F),GetUnitY(F)))
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Alright! Lets move out! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagText(TX, S, 0.011 ) //14 05
call SetTextTagPos(TX, GetUnitX(gg_unit_h008_0577), GetUnitY(gg_unit_h008_0577), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.5)
call FT.add(TX, S)
call TriggerSleepAction(1.8)
call IssuePointOrder(gg_unit_h008_0577,"move",5780,2000)
call TriggerSleepAction(3.)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Their huts located just below the mountain hollow... "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(gg_unit_h008_0577), GetUnitY(gg_unit_h008_0577), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.03) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.7)
//call FT.add(TX, S)
call ShowUnit(gg_unit_nfrl_0744,true)
call SaveReal(Hash,GetHandleId(gg_unit_nfrl_0744),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nfrl_0744,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nfrl_0744)
call IssuePointOrder(gg_unit_nfrl_0744,"attack",6500.,2500.)
call TriggerSleepAction(5.5)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Aha! In my shift it does'nt happen otherwise! We need to find a leader! "
endif
if not IsUnitDead(gg_unit_h008_0577) then
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 )
call SetTextTagPos(TX, GetUnitX(gg_unit_h008_0577), GetUnitY(gg_unit_h008_0577), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.03) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.7)
endif
call ShowUnit(gg_unit_nfrb_0740,true)
call SaveReal(Hash,GetHandleId(gg_unit_nfrb_0740),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nfrb_0740,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nfrb_0740)
call ShowUnit(gg_unit_nfrs_0741,true)
call SaveReal(Hash,GetHandleId(gg_unit_nfrs_0741),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nfrs_0741,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nfrs_0741)
call ShowUnit(gg_unit_nfrl_0742,true)
call SaveReal(Hash,GetHandleId(gg_unit_nfrl_0742),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nfrl_0742,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nfrl_0742)
call ShowUnit(gg_unit_nfrl_0743,true)
call SaveReal(Hash,GetHandleId(gg_unit_nfrl_0743),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nfrl_0743,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nfrl_0743)
call IssuePointOrder(gg_unit_h008_0577,"attack ",4700.,118.)
call IssuePointOrder(gg_unit_nfrl_0744,"move",4700.,118.)
set FurbPrideKill = CreateTrigger()
call TriggerRegisterUnitEvent( FurbPrideKill, gg_unit_nfrb_0740, EVENT_UNIT_DEATH )
call TriggerAddAction(FurbPrideKill,function FurbPride_Act)
call TriggerSleepAction(3.)
call IssuePointOrder(gg_unit_h008_0577,"attack",4700.,118.)
call IssuePointOrder(gg_unit_nfrl_0744,"move",4700.,118.)
call TriggerSleepAction(3.5)
call IssuePointOrder(gg_unit_h008_0577,"attack",4700.,118.)
call IssuePointOrder(gg_unit_nfrl_0744,"move",4700.,118.)
call TriggerSleepAction(4.5)
call IssuePointOrder(gg_unit_h008_0577,"attack",4700.,118.)
call IssuePointOrder(gg_unit_nfrl_0744,"move",4700.,118.)
call TriggerSleepAction(0.5)
call IssueImmediateOrder(gg_unit_nfrl_0744,"stop")
//call TransmissionFromUnitWithNameJ( HumanForce, gg_unit_hfoo_0641, "TRIGSTR_501", null, "TRIGSTR_502", bj_TIMETYPE_SET, 7.00, true )
elseif FurblogsCanBeCanceled == false
call echo("this text should be shown up")
set udg_WithinRangeUnit = gg_unit_h008_0577
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
//set unitId = GetHandleId( udg_WithinRangeUnit)
//call DisableTrigger( GetTriggeringTrigger() )
//call DestroyTrigger( GetTriggeringTrigger() )
elseif FurblogsReal <= 0. and IsUnitInGroup(F,Paladins)
call MsgForce(HumanForce,"|c00BD204FWild Furblogs|r cant be started - undeads are nearby.")
set FurblogsReal = 10.
endif
//call DestroyB
set FurbPrideKill = null
endfunction
//===========================================================================
function InitTrig_FurblogsQuest takes nothing returns nothing
set gg_trg_FurblogsQuest = CreateTrigger( )
//call TriggerRegisterUnitInRange(gg_trg_FurblogsQuest, gg_unit_h008_0577, 150.00, null)
//call TriggerRegisterUnitInRange(gg_trg_FurblogsQuest, gg_unit_h008_0577, 300.00, null)
call GroupAddUnit(QuestGroup, gg_unit_h008_0577)
// Autoregister on start
set udg_WithinRangeRange = 250.00
set udg_WithinRangeUnit = gg_unit_h008_0577
// Use Event wanted = 0 to not throw Events.
set udg_WithinRangeWanted_Event = 1.00
set udg_WithinRangeWanted_Trigger = gg_trg_FurblogsQuest
//set udg_WithinRangeWanted_Filter = Condition(function Trig_Register_Kopieren_Func006002)
call TriggerExecute( gg_trg_WithinRange )
//call TriggerAddCondition( gg_trg_FurblogsQuest, Condition(function Trig_FurblogsQuest_C) )
call TriggerAddAction( gg_trg_FurblogsQuest, function Trig_FurblogsQuest_Actions )
endfunction
function Trig_____________________________________007_Actions takes nothing returns nothing
call ShowUnitShow( gg_unit_ucrm_0766 )
call IssueImmediateOrder( gg_unit_ucrm_0766, "unburrow" )
endfunction
//===========================================================================
function InitTrig_____________________________________007 takes nothing returns nothing
set gg_trg_____________________________________007 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_____________________________________007, 30.00 )
call TriggerAddAction( gg_trg_____________________________________007, function Trig_____________________________________007_Actions )
endfunction
//TESH.scrollpos=63
//TESH.alwaysfold=0
function ThirdEnt_A takes nothing returns nothing
if IsUnitInGroup(GetTriggerUnit(),Paladins) then
call TriggerRemoveAction(GetTriggeringTrigger(),LoadTriggerActionHandle(Hash,GetHandleId(GetTriggeringTrigger()),0))
call DestroyTrigger(GetTriggeringTrigger())
call ShowUnit(gg_unit_nenp_0747,true)
call SaveReal(Hash,GetHandleId(gg_unit_nenp_0747),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nenp_0747,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nenp_0747)
call KillUnit(EntQuestionMark[2])
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[3]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[3])
call ShowUnit(gg_unit_hrif_0749,true)
call SetUnitLife(gg_unit_nenp_0747,300.)
call SetUnitLife(gg_unit_hrif_0749,60.)
call IssueTargetOrder(gg_unit_nenp_0747,"entanglingroots",gg_unit_hrif_0749)
if EntCount == 3 then
call PlaySoundOnUnit( gg_snd_EntReady1, 470, gg_unit_nenp_0747,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1550.00 )
endif
endif
endfunction
function SecondEnt_A takes nothing returns nothing
if IsUnitInGroup(GetTriggerUnit(),Paladins) then
//call echo("s1")
call TriggerRemoveAction(GetTriggeringTrigger(),LoadTriggerActionHandle(Hash,GetHandleId(GetTriggeringTrigger()),0))
call DestroyTrigger(GetTriggeringTrigger())
call ShowUnit(gg_unit_nenp_0745,true)
call SaveReal(Hash,GetHandleId(gg_unit_nenp_0745),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nenp_0745,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nenp_0745)
call KillUnit(EntQuestionMark[1])
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[2]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[2])
if EntCount == 3 then
call PlaySoundOnUnit( gg_snd_EntReady1, 470, gg_unit_nenp_0745,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1550.00 )
endif
endif
endfunction
function FirstEnt_A takes nothing returns nothing
if IsUnitInGroup(GetTriggerUnit(),Paladins) then
call TriggerRemoveAction(GetTriggeringTrigger(),LoadTriggerActionHandle(Hash,GetHandleId(GetTriggeringTrigger()),0))
call DestroyTrigger(GetTriggeringTrigger())
call ShowUnit(gg_unit_nenp_0746,true)
call SaveReal(Hash,GetHandleId(gg_unit_nenp_0746),StringHash("Appearing_R"),15)
call SetUnitVertexColor(gg_unit_nenp_0746,255,255,255,15)
call GroupAddUnit(AppearingGroup,gg_unit_nenp_0746)
call KillUnit(EntQuestionMark[3])
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[4]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[4])
if EntCount == 3 then
call PlaySoundOnUnit( gg_snd_EntReady1, 470, gg_unit_nenp_0746,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1550.00 )
endif
call IssuePointOrder(gg_unit_nvk2_0413,"move",-11430,9240)
call IssuePointOrder(gg_unit_nvlk_0412,"move",-11430,9220)
endif
endfunction
function Trig_EntCorruptionQuest_Actions takes nothing returns nothing
local trigger tr = CreateTrigger()
set F = CreateUnit(Player(0),'e001',9970,3360,0)
call UnitApplyTimedLife(F,'BTLF',0.1)
set F = CreateUnit(Player(0),'e001',-10240,2422,0)
call UnitApplyTimedLife(F,'BTLF',0.1)
set F = CreateUnit(Player(0),'e001',2945,-8433,0)
call UnitApplyTimedLife(F,'BTLF',0.1)
call TriggerRegisterEnterRect(tr,gg_rct_EntFirst)
call SaveTriggerActionHandle(Hash,GetHandleId(tr),0,TriggerAddAction(tr,function FirstEnt_A))
set tr = CreateTrigger()
call TriggerRegisterEnterRect(tr,gg_rct_EntSecond)
call SaveTriggerActionHandle(Hash,GetHandleId(tr),0,TriggerAddAction(tr,function SecondEnt_A))
set tr = CreateTrigger()
call TriggerRegisterEnterRect(tr,gg_rct_EntThird)
call SaveTriggerActionHandle(Hash,GetHandleId(tr),0,TriggerAddAction(tr,function ThirdEnt_A))
set tr = null
endfunction
//===========================================================================
function InitTrig_EntCorruptionQuest takes nothing returns nothing
set gg_trg_EntCorruptionQuest = CreateTrigger( )
set VisionQuestDummy[2] = CreateUnit(Player(0),'e00D',-8070,2560,0)
call SetUnitVertexColor(VisionQuestDummy[2],255,160,0,255)
call SetUnitFlyHeight(VisionQuestDummy[2],500,0)
call SaveEffectHandle(Hash,GetHandleId(VisionQuestDummy[2]),StringHash("Vision_Qeff"),AddSpecialEffectTarget("QuestYellow0.mdl",VisionQuestDummy[1],"chest"))
set VisionQuestDummy[3] = CreateUnit(Player(0),'e00D',-10240,2425,0)
call SetUnitVertexColor(VisionQuestDummy[3],255,160,0,255)
call SetUnitFlyHeight(VisionQuestDummy[3],500,0)
call SaveEffectHandle(Hash,GetHandleId(VisionQuestDummy[3]),StringHash("Vision_Qeff"),AddSpecialEffectTarget("QuestYellow0.mdl",VisionQuestDummy[1],"chest"))
set VisionQuestDummy[4] = CreateUnit(Player(0),'e00D',-10240,4973,0)
call SetUnitVertexColor(VisionQuestDummy[4],255,160,0,255)
call SetUnitFlyHeight(VisionQuestDummy[4],500,0)
call SaveEffectHandle(Hash,GetHandleId(VisionQuestDummy[4]),StringHash("Vision_Qeff"),AddSpecialEffectTarget("QuestYellow0.mdl",VisionQuestDummy[1],"chest"))
call TriggerAddAction( gg_trg_EntCorruptionQuest, function Trig_EntCorruptionQuest_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function ThugsRaid_A2 takes nothing returns nothing
if IsUnitInGroup(GetTriggerUnit(),Paladins) or IsUnitInGroup(GetTriggerUnit(),DreadLords) then
call TriggerRemoveAction(GetTriggeringTrigger(),LoadTriggerActionHandle(Hash,GetHandleId(GetTriggeringTrigger()),0))
call DestroyTrigger(GetTriggeringTrigger())
set S = " |c00E35782Guys! We have some guests! "
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 11 ) //14 05
call SetTextTagPos(TX, GetUnitX(gg_unit_nbld_0755 ), GetUnitY(gg_unit_nbld_0755 ), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 4.5)
set ThugsReal = 6.5
endif
endfunction
function ThugsRaid_A takes nothing returns nothing
local trigger tr
if IsUnitInGroup(GetTriggerUnit(),Paladins) then
call DisableTrigger(GetTriggeringTrigger())
set ThugsRaidCanBeCanceled = false
call KillUnit( gg_unit_e00P_0262 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[1]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[1])
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(ThugsRaidGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call ShowUnit(F,true)
call SaveReal(Hash,GetHandleId(F),StringHash("Appearing_R"),15)
call SetUnitVertexColor(F,255,255,255,15)
call GroupAddUnit(AppearingGroup,F)
call IssuePointOrder(F,"attack",GetRectCenterX(gg_rct_ThugsAttack),GetRectCenterY(gg_rct_ThugsAttack))
call GroupRemoveUnit(P,F)
endloop
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(ThugsCampGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P2)
exitwhen F == null
call ShowUnit(F,true)
call SaveReal(Hash,GetHandleId(F),StringHash("Appearing_R"),15)
call SetUnitVertexColor(F,255,255,255,15)
call GroupAddUnit(AppearingGroup,F)
call GroupRemoveUnit(P2,F)
endloop
call GroupClear(ThugsCampGroup)
call DestroyGroup(ThugsCampGroup)
call PlaySoundOnUnit( gg_snd_BanditWarcry1, 100, gg_unit_nvil_0533,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1550.00 )
call TriggerSleepAction(3.)
if not IsUnitDead(gg_unit_hpea_0536) then
call PlaySoundOnUnit( gg_snd_PeasantWarcry101, 100, gg_unit_hpea_0536,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1550.00 )
endif
if not IsUnitDead(gg_unit_nbld_0755) then
set tr = CreateTrigger()
call TriggerRegisterEnterRect(tr,gg_rct_ThugsCamp)
call SaveTriggerActionHandle(Hash,GetHandleId(tr),0,TriggerAddAction(tr,function ThugsRaid_A2))
endif
call TriggerSleepAction(3.5)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(ThugsRaidGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetRectCenterX(gg_rct_ThugsAttack),GetRectCenterY(gg_rct_ThugsAttack))
call GroupRemoveUnit(P,F)
endloop
call TriggerRemoveAction(GetTriggeringTrigger(),LoadTriggerActionHandle(Hash,GetHandleId(GetTriggeringTrigger()),0))
call DestroyTrigger(GetTriggeringTrigger())
endif
set tr = null
endfunction
function Trig_ThugsRaidQuest_Actions takes nothing returns nothing
local trigger tr = CreateTrigger()
call TriggerRegisterEnterRect(tr,gg_rct_ThugsAttack)
call SaveTriggerActionHandle(Hash,GetHandleId(tr),0,TriggerAddAction(tr,function ThugsRaid_A))
set tr = null
endfunction
//===========================================================================
function InitTrig_ThugsRaidQuest takes nothing returns nothing
set gg_trg_ThugsRaidQuest = CreateTrigger( )
set VisionQuestDummy[1] = CreateUnit(Player(0),'e00D',-6400,8570,0)
call SetUnitVertexColor(VisionQuestDummy[1],255,160,0,255)
call SetUnitFlyHeight(VisionQuestDummy[1],400,0)
call GroupClear(P)
set B = Condition(function ToBeRaided_F)
call GroupEnumUnitsInRect(P,gg_rct_ThugsAttack,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call GroupAddUnit(ThugsToBeRaidGroup,F)
call GroupRemoveUnit(P,F)
endloop
call DestroyBoolExpr(B)
call SaveEffectHandle(Hash,GetHandleId(VisionQuestDummy[1]),StringHash("Vision_Qeff"),AddSpecialEffectTarget("QuestYellow0.mdl",VisionQuestDummy[1],"chest"))
call TriggerAddAction( gg_trg_ThugsRaidQuest, function Trig_ThugsRaidQuest_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function CryptSpiders_Actions takes nothing returns nothing
//call echo("works")
call GroupClear(P)
set B = Condition(function Undead_Filter)
//call echo("ssss mortar")
call GroupEnumUnitsInRange(P,GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest),1200,B)
set F = GetTriggerUnit()
call DestroyBoolExpr(B)
if IsUnitInGroup(F,Paladins) and CountUnitsInGroupJ(P) <= 0 and CryptSpidersReal <= 0. and CryptSpidersCanBeCanceled == true then //IsUnitInGroup(F,Paladins) and
//call DisableTrigger( GetTriggeringTrigger() )
//call echo("start")
call DisableTrigger(LoadTriggerHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("Mortal_QuestTr")))
//call DestroyTrigger(LoadTriggerHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("Mortal_QuestTr")))
set udg_WithinRangeUnit = MortarUnitQuest
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
call KillUnit( gg_unit_e00P_0278 )
set CryptSpidersCanBeCanceled = false
call KillUnit(LoadUnitHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("QuestMark")))
call RemoveSavedHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("QuestMark"))
call GroupRemoveUnit(QuestionMarkGroup,MortarUnitQuest)
//call echo("ssss mortar2")
call SetUnitFacingTimed(MortarUnitQuest, AngleBetweenXY(GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest)/*
*/,GetUnitX(F),GetUnitY(F)), 1.8)
call TriggerSleepAction(3.)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Wow! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) - 125, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 2.5)
call TriggerSleepAction(2.5)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782. . . "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 1.8)
call TriggerSleepAction(1.8)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782My brother meant to say - it's honor to see you! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.5)
call TriggerSleepAction(3.5)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782We are here on business. People (not because they are weak) report
about strange noise in this field. We believe that this is the most that neither is the orcs! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.02) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 6)
call TriggerSleepAction(5.5)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782We miss orcs. "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.03) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.2)
call TriggerSleepAction(3.2)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782... That is the plan: we etch them from there, and you slay them from here. Let's get started! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.03) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.2)
call TriggerSleepAction(1.4)
call SetUnitFacingTimed(MortarUnitQuest,43,1.4)
call TriggerSleepAction(1.4)
call IssuePointOrder(MortarUnitQuest,"attackground",4175,-2745)
call TriggerSleepAction(1.2)
call IssueImmediateOrder(MortarUnitQuest,"stop")
call TriggerSleepAction(4.)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " D'oh "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) - 125, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.03) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 2.1)
call TriggerSleepAction(2.1)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782We need something more serious "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.03) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.2)
call TriggerSleepAction(2.5)
call SetUnitAnimation(MortarUnitQuest,"attack spell")
call TriggerSleepAction(0.5)
set F = CreateUnit(Player(11),'h006',GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest),43)
call UnitApplyTimedLife(F,'BTLF',1.5)
call IssuePointOrder(F,"attackground",4175,-2745)
call TriggerSleepAction(2.)
call AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",4175,-2745)
call TriggerSleepAction(0.5)
/*call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(CryptSpidersGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call GroupRemoveUnit(P,F)
endloop */
call ShowUnit(gg_unit_ucry_0766,true)
call SetUnitAnimation(gg_unit_ucry_0766,"morph alternate")
call UnitAddAbility(gg_unit_ucry_0766,'Aweb')
call IssueTargetOrder(gg_unit_ucry_0766,"web",MortarUnitQuest)
call ShowUnit(gg_unit_ucry_0753,true)
call SetUnitAnimation(gg_unit_ucry_0753,"morph alternate")
set F = CreateUnit(Player(0),dummy,GetUnitX(gg_unit_ucry_0753),GetUnitY(gg_unit_ucry_0753),0)
call UnitAddAbility(F,'A00P')
call IssueTargetOrder(F,"soulburn",gg_unit_ucry_0753)
call UnitApplyTimedLife(F,'BTLF',0.1)
call ShowUnit(gg_unit_ucry_0765,true)
call SetUnitAnimation(gg_unit_ucry_0765,"morph alternate")
call TriggerSleepAction(1.3)
call ShowUnit(gg_unit_ucry_0764,true)
call SetUnitAnimation(gg_unit_ucry_0764,"morph alternate")
call ShowUnit(gg_unit_ucry_0768,true)
call SetUnitAnimation(gg_unit_ucry_0768,"morph alternate")
call TriggerSleepAction(1.5)
call ShowUnit(gg_unit_ucry_0767,true)
call SetUnitAnimation(gg_unit_ucry_0767,"morph alternate")
call TriggerSleepAction(1.5)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(CryptSpidersGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest))
call GroupRemoveUnit(P,F)
endloop
// =====================
elseif CryptSpidersCanBeCanceled == false
//call DisableTrigger( GetTriggeringTrigger() )
elseif CryptSpidersReal <= 0. and IsUnitInGroup(F,Paladins)
call MsgForce(HumanForce,"|c00BD204FSleepers on a field|r cant be started - undeads are nearby.")
set CryptSpidersReal = 10.
endif
//call DestroyBoolExpr(B)
endfunction
function Trig_CryptSpidersQuest_Actions takes nothing returns nothing
//local trigger
set CryptSpidersTrigger = CreateTrigger()
call SetUnitX(gg_unit_nvl2_0445,3726)
call SetUnitY(gg_unit_nvl2_0445,-1049)
call SetUnitFacing(gg_unit_nvl2_0445,290)
call SetUnitX(gg_unit_nvk2_0446,4060)
call SetUnitY(gg_unit_nvk2_0446,-1214)
call SetUnitFacing(gg_unit_nvk2_0446,202)
call SetUnitX(gg_unit_nhef_0449,3228)
call SetUnitY(gg_unit_nhef_0449,-3623)
call SetUnitFacing(gg_unit_nhef_0449,198)
call SetUnitX(gg_unit_nvil_0444,3132)
call SetUnitY(gg_unit_nvil_0444,-1634)
call SetUnitFacing(gg_unit_nvil_0444,251)
call SetUnitX(gg_unit_nvlw_0448,4490)
call SetUnitY(gg_unit_nvlw_0448,-3890)
call SetUnitFacing(gg_unit_nvlw_0448,230)
call SetUnitX(gg_unit_nvil_0443,3100)
call SetUnitY(gg_unit_nvil_0443,-3126)
call SetUnitFacing(gg_unit_nvil_0443,243)
call SetUnitX(gg_unit_nvlk_0447,2770)
call SetUnitY(gg_unit_nvlk_0447,-2653)
call SetUnitFacing(gg_unit_nvlk_0447,132)
//call TriggerRegisterUnitInRange(CryptSpidersTrigger, MortarUnitQuest, 150.00, null)
set udg_WithinRangeRange = 180.00
set udg_WithinRangeUnit = MortarUnitQuest
// Use Event wanted = 0 to not throw Events.
set udg_WithinRangeWanted_Event = 1.00
set udg_WithinRangeWanted_Trigger = CryptSpidersTrigger
//set udg_WithinRangeWanted_Filter = Condition(function Trig_Register_Kopieren_Func006002)
call TriggerExecute( gg_trg_WithinRange )
call SaveTriggerActionHandle(Hash,GetHandleId(CryptSpidersTrigger),0,TriggerAddAction( CryptSpidersTrigger, function CryptSpiders_Actions ))
//call SaveTriggerHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("Mortal_QuestTr"),CryptSpidersTrigger)
//call SaveTriggerActionHandle(Hash,GetHandleId(gg_trg_CryptSpidersQuest),0,TriggerAddAction( CryptSpidersTrigger, function CryptSpiders_Actions ))
//call TriggerRegisterUnitInRange(CryptSpidersTrigger, MortarUnitQuest, 210.00, null)
call GroupAddUnit(QuestGroup, MortarUnitQuest)
call GroupAddUnit(QuestionMarkGroup,MortarUnitQuest)
//call TriggerAddCondition( gg_trg_FurblogsQuest, Condition(function Trig_FurblogsQuest_C) )
/*
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0766)
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0753)
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0764)
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0767)
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0768)
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0765)
call GroupAddUnit(CryptSpidersGroup,gg_unit_ucrm_0769)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(CryptSpidersGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call PauseUnit(F,true)
call GroupRemoveUnit(P,F)
endloop
*/
//set CryptSpidersTrigger = null
set CryptSpiders = null
endfunction
//===========================================================================
function InitTrig_CryptSpidersQuest takes nothing returns nothing
set gg_trg_CryptSpidersQuest = CreateTrigger( )
call TriggerAddAction( gg_trg_CryptSpidersQuest, function Trig_CryptSpidersQuest_Actions )
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function Trig_CryptLord_Actions takes nothing returns nothing
local unit d
call TriggerSleepAction(2.5)
call SetUnitFacingTimed(MortarUnitQuest,43,1.4)
call TriggerSleepAction(1.5)
if not IsUnitDead(MortarUnitQuest)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Break me up the mountains !! What is it?! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MortarUnitQuest) + 35, GetUnitY(MortarUnitQuest), GetRandomReal( -5, 10))
call SetTextTagVelocity(TX, 0.01, 0.02) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.2)
call TriggerSleepAction(2.5)
call GroupClear(P)
set B = Condition(function Undead_Filter)
call GroupEnumUnitsInRange(P,GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest),1600,B)
//set B = Condition(function Undead_Filter)
if CountUnitsInGroupJ(P) <= 0 then
set F = CreateUnit(Player(0),'e003',4690 ,-2830,0)
call UnitApplyTimedLife(F,'BTLF',4.5)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest),1600,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if IsUnitInGroup(F,Paladins) then
if (GetLocalPlayer() == GetOwningPlayer(F)) then
call PanCameraToTimed(4690 ,-2830, 2.)
endif
endif
call GroupRemoveUnit(P,F)
endloop
endif
call DestroyBoolExpr(B)
call TerrainDeformationRippleJ( 3.5, false, 4690 ,-2830, 180.00, 300.00, 145, 0.8, 512 ) //512
call TriggerSleepAction(3.5)
call AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",4690 ,-2830)
set d = CreateUnit(Player(4),'H007',4690 ,-2830,90)
call SaveReal(Hash,GetHandleId(d),StringHash("Appearing_R"),15)
call SetUnitVertexColor(d,255,255,255,15)
call GroupAddUnit(AppearingGroup,d)
call SelectHeroSkill( d, 'AUim' )
call SetHeroLevel(d,GetRandomInt(3,5),false)
//call UnitApplyTimedLife(F,'BTLF',100)
call TriggerSleepAction(1.1)
call IssuePointOrder(d,"attack",GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest))
call TriggerSleepAction(5.9)
call IssuePointOrder(d,"attack",GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest))
call TriggerSleepAction(7.4)
call IssuePointOrder(d,"attack",GetUnitX(MortarUnitQuest),GetUnitY(MortarUnitQuest))
endif
set d = null
//call DestroyBoolExpr(B)
endfunction
//===========================================================================
function InitTrig_CryptLord takes nothing returns nothing
set gg_trg_CryptLord = CreateTrigger( )
call TriggerAddAction( gg_trg_CryptLord, function Trig_CryptLord_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function RebelsAttack_Actions takes nothing returns nothing
call GroupClear(P)
set B = Condition(function Undead_Filter)
//call echo("ssss mortar")
call GroupEnumUnitsInRange(P,GetUnitX(gg_unit_nmed_0796),GetUnitY(gg_unit_nmed_0796),1200,B)
set F = GetTriggerUnit()
call DestroyBoolExpr(B)
if IsUnitInGroup(F,Paladins) and CountUnitsInGroupJ(P) <= 0 and RebelsReal <= 0. and RebelsCanBeCanceled == true then
set udg_WithinRangeUnit = gg_unit_nmed_0796
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
call DisableTrigger(LoadTriggerHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("Rebels_Tr")))
call DestroyTrigger(LoadTriggerHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("Rebels_Tr")))
call KillUnit(LoadUnitHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("QuestMark")))
call KillUnit( gg_unit_e00P_0292 )
call RemoveSavedHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("QuestMark"))
call GroupRemoveUnit(QuestionMarkGroup,gg_unit_nmed_0796)
set RebelsCanBeCanceled = false
//call KillUnit( gg_unit_nmed_0796 )
call GroupAddUnit(RebelsAttackGroup,gg_unit_nmed_0796)
call ShowUnit( gg_unit_nchp_0802,true )
call ShowUnit( gg_unit_hrif_0795,true )
call ShowUnit( gg_unit_hfoo_0794,true )
call ShowUnit( gg_unit_hfoo_0793,true )
call ShowUnit( gg_unit_hfoo_0792,true )
call PauseUnit( gg_unit_nchp_0802,true )
call PauseUnit( gg_unit_hrif_0795,true )
call PauseUnit( gg_unit_hfoo_0794,true )
call PauseUnit( gg_unit_hfoo_0793,true )
call PauseUnit( gg_unit_hfoo_0792,true )
call GroupAddUnit(AppearingGroup, gg_unit_nchp_0802 )
call GroupAddUnit(AppearingGroup, gg_unit_hrif_0795 )
call GroupAddUnit(AppearingGroup, gg_unit_hfoo_0794 )
call GroupAddUnit(AppearingGroup, gg_unit_hfoo_0793 )
call GroupAddUnit(AppearingGroup, gg_unit_hfoo_0792 )
call GroupAddUnit(RebelsGroup, gg_unit_h009_0797 )
call GroupAddUnit(RebelsGroup, gg_unit_h009_0798 )
call GroupAddUnit(RebelsGroup, gg_unit_h009_0799 )
call GroupAddUnit(RebelsGroup, gg_unit_h00B_0800 )
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call ShowUnit( F,true )
call PauseUnit( F,true )
call GroupAddUnit(AppearingGroup, F )
call GroupRemoveUnit(P,F)
endloop
call TriggerSleepAction(1.5)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(gg_unit_h00B_0800),GetUnitY(gg_unit_h00B_0800))
call GroupRemoveUnit(P,F)
endloop
elseif RebelsCanBeCanceled == false
call DisableTrigger( GetTriggeringTrigger() )
elseif RebelsReal <= 0. and IsUnitInGroup(F,Paladins)
call MsgForce(HumanForce,"|c00BD204FRebellion|r cant be started - undeads are nearby")
set RebelsReal = 10.
endif
//call DestroyBoolExpr(B)
endfunction
function Trig_Rebels_Actions takes nothing returns nothing
set RebelsAttack = CreateTrigger()
//call TriggerRegisterUnitInRange(RebelsAttack, gg_unit_nmed_0796, 150.00, null)
// call TriggerRegisterUnitInRange(RebelsAttack, gg_unit_nmed_0796, 300.00, null)
// Autoregister on start
set udg_WithinRangeRange = 210.00
set udg_WithinRangeUnit = gg_unit_nmed_0796
// Use Event wanted = 0 to not throw Events.
set udg_WithinRangeWanted_Event = 1.00
set udg_WithinRangeWanted_Trigger = RebelsAttack
//set udg_WithinRangeWanted_Filter = Condition(function Trig_Register_Kopieren_Func006002)
call TriggerExecute( gg_trg_WithinRange )
//call SaveTriggerHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("Rebels_Tr"),RebelsAttack)
call GroupAddUnit(QuestGroup, gg_unit_nmed_0796)
/*
set F = CreateUnit(Player(11),'e00D',GetUnitX(gg_unit_nmed_0796),GetUnitY(gg_unit_nmed_0796),0)
call SetUnitVertexColor(F, 255, 255, 255, 0)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
call SetUnitVertexColor(F, 255, 225, 0, 255)
endif
call UnitAddAbility(F,'Arav')
call SaveUnitHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("QuestMark"),F)
call GroupAddUnit(QuestionMarkGroup,gg_unit_nmed_0796) */
//call TriggerAddCondition( gg_trg_FurblogsQuest, Condition(function Trig_FurblogsQuest_C) )
call SaveTriggerActionHandle(Hash,GetHandleId(RebelsAttack),0,TriggerAddAction( RebelsAttack, function RebelsAttack_Actions ))
endfunction
//===========================================================================
function InitTrig_Rebels takes nothing returns nothing
set gg_trg_Rebels = CreateTrigger( )
call TriggerAddAction( gg_trg_Rebels, function Trig_Rebels_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function KillD takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_RebelsNextAttack_Actions takes nothing returns nothing
call GroupAddUnit(RebelsGroup2,gg_unit_h00C_0791)
call GroupAddUnit(RebelsGroup2,gg_unit_h00C_0790)
call GroupAddUnit(RebelsGroup2,gg_unit_h009_0805)
call GroupAddUnit(RebelsGroup2,gg_unit_h009_0804)
call GroupAddUnit(RebelsGroup2,gg_unit_h009_0803)
call GroupAddUnit(RebelsGroup2,gg_unit_h009_0801)
//call echo("work!")
call TriggerSleepAction(1.5)
call EnumDestructablesInRect(gg_rct_DestructablesExplode1, null, function KillD)
call EnumDestructablesInRect(gg_rct_DestructablesExplode2, null, function KillD)
call TriggerSleepAction(1.2)
call PauseUnit( gg_unit_h00C_0791,false )
call PauseUnit( gg_unit_h00C_0790,false )
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(RebelsMainUnit),GetUnitY(RebelsMainUnit))
call GroupRemoveUnit(P,F)
endloop
call TriggerSleepAction(8.9)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(RebelsMainUnit),GetUnitY(RebelsMainUnit))
call GroupRemoveUnit(P,F)
endloop
call TriggerSleepAction(4.9)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(RebelsMainUnit),GetUnitY(RebelsMainUnit))
call GroupRemoveUnit(P,F)
endloop
endfunction
//===========================================================================
function InitTrig_RebelsNextAttack takes nothing returns nothing
set gg_trg_RebelsNextAttack = CreateTrigger( )
call TriggerAddAction( gg_trg_RebelsNextAttack, function Trig_RebelsNextAttack_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_PaldGoldChange_Actions takes nothing returns nothing
//call echo("gold change")
local player p = GetTriggerPlayer()
local integer i
set PalGold = GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
set i = 0
loop
exitwhen i > 3
call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,PalGold)
set i = i + 1
endloop
set p = null
endfunction
//===========================================================================
function InitTrig_PaldGoldChange takes nothing returns nothing
set gg_trg_PaldGoldChange = CreateTrigger( )
call TriggerRegisterPlayerStateEvent( gg_trg_PaldGoldChange, Player(0), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerRegisterPlayerStateEvent( gg_trg_PaldGoldChange, Player(1), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerRegisterPlayerStateEvent( gg_trg_PaldGoldChange, Player(2), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerRegisterPlayerStateEvent( gg_trg_PaldGoldChange, Player(3), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerAddAction( gg_trg_PaldGoldChange, function Trig_PaldGoldChange_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_PalShopsPreventBuying_Actions takes nothing returns nothing
if UnitTypeNotDummy(GetTriggerUnit()) and GetTriggerUnit() == gg_unit_hvlt_0086 or GetTriggerUnit() == gg_unit_nmrk_0087 or GetUnitTypeId(GetTriggerUnit()) == 'hvlt' then
//call echo("ыы")
if (GetLocalPlayer() == GetTriggerPlayer()) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call ClearSelection()
endif
endif
endfunction
//===========================================================================
function InitTrig_PalShopsPreventBuying takes nothing returns nothing
set gg_trg_PalShopsPreventBuying = CreateTrigger( )
//call TriggerRegisterPlayerUnitEvent(gg_trg_PalShopsPreventBuying, Player(0), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PalShopsPreventBuying, Player(6), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PalShopsPreventBuying, Player(7), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PalShopsPreventBuying, Player(8), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_PalShopsPreventBuying, Player(9), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerAddAction( gg_trg_PalShopsPreventBuying, function Trig_PalShopsPreventBuying_Actions )
endfunction
//TESH.scrollpos=312
//TESH.alwaysfold=0
/*
*/
globals
boolean OrcEscaped = false
endglobals
function MilitiaMenRetreat_F takes nothing returns boolean
return not IsUnitDead(GetFilterUnit()) and IsPlayerInForce(GetOwningPlayer(GetFilterUnit()),UndeadForce) and IsUnitVisible(GetFilterUnit(),Player(0))
endfunction
function OrcInvasion_QuestLost2 takes nothing returns nothing
local unit d
set T = GetExpiredTimer()
set I = GetHandleId(T)
set I2 = LoadInteger(Hash,I,2)
if I2 == 0 then
set I2 = 1
else
I2++
endif
call SaveInteger(Hash,I,2,I2)
//call echo(I2S(I2))
if I2 == 1 then
set d = CreateUnit(Player(4),dummy,GetUnitX(OrcHero),GetUnitY(OrcHero),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'Awrh')
call SetUnitAbilityLevel(d,'Awrh',2)
call IssueImmediateOrder(d,"stomp")
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",GetUnitX(OrcHero),GetUnitY(OrcHero)))
call PauseUnit(OrcHero,false)
call UnitAddAbility(OrcHero,'Abun')
//call UnitAddAbility(OrcHero,'Avul')
if not IsUnitDead(gg_unit_nchw_0857) then
call KillUnit(gg_unit_nchw_0857)
endif
if not IsUnitDead(gg_unit_nchw_0856) then
call KillUnit(gg_unit_nchw_0856)
endif
call TimerStart(T,1.,false,function OrcInvasion_QuestLost2)
elseif I2 == 2 then
set B = Condition(function Paladins_Filter)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(OrcHero),GetUnitY(OrcHero),800,B)
set F2 = GroupPickRandomUnitEx(P)
if F2!= null then
call SetUnitFacing(OrcHero,AngleBetweenXY(GetUnitX(OrcHero),GetUnitY(OrcHero),GetUnitX(F2),GetUnitY(F2)))
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00FE6741 I can't stay here no longer, so I let your survive this battle. But your blood will be spilled by my soldiers, I swear it.|r "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 12 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcHero), GetUnitY(OrcHero), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.5)
call SetUnitOwner(gg_unit_ojgn_0847,Player(4),true)
call IssuePointOrder(gg_unit_ojgn_0847,"move",-6135,-13150)
set OrcEscaped = true
call TimerStart(T,3.5,false,function OrcInvasion_QuestLost2)
else
call IssuePointOrder(gg_unit_ojgn_0847,"move",-6135,-13150)
call TimerStart(T,1.5,false,function OrcInvasion_QuestLost2)
endif
elseif I2 == 3 then
call PauseUnit(OrcHero,false)
call IssuePointOrder(OrcHero,"move",-6135,-13150)
call TimerStart(T,2.,false,function OrcInvasion_QuestLost2)
elseif I2 == 4 then
call IssueTargetOrder(gg_unit_ojgn_0847,"load",OrcHero)
call IssueTargetOrder(OrcHero,"load",gg_unit_ojgn_0847)
call FlushChildHashtable(Hash,GetHandleId(OrcHero))
call TimerStart(T,3.5,false,function OrcInvasion_QuestLost2)
elseif I2 == 5 then
call DestroyTimer(T)
call FlushChildHashtable(Hash,I)
call IssuePointOrder(gg_unit_ojgn_0847,"move",-8478,-13710)
call SaveReal(Hash,GetHandleId(gg_unit_ojgn_0847),StringHash("DS_trsp"),255)
call GroupAddUnit(DSgroup,gg_unit_ojgn_0847)
call QuestSetFailed( OrcInvasion, true )
call MsgForce(HumanForce,"|c005B002EOrc Invasion|r - quest failed")
endif
set d = null
endfunction
function OrcInvasion_QuestLost takes nothing returns nothing
set T = GetExpiredTimer()
set I = GetHandleId(T)
local unit d
local timerdialog td = LoadTimerDialogHandle(Hash,I,6)
set OrcInvasion_elapsed = true
call DestroyTimerDialog(td)
call UnitAddAbility(OrcHero,'ACmi')
call UnitRemoveBuffs(OrcHero,true,true)
call PauseUnit(OrcHero,true)
call SetUnitAnimation(OrcHero,"Attack Slam")
call TimerStart(T,0.5,false,function OrcInvasion_QuestLost2)
set td = null
set d = null
endfunction
function MilitiaMenAttack takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local boolean bl
local integer i = LoadInteger(Hash,idT,0)
set bl = LoadBoolean(Hash,idT,0)
local unit f
if bl == false then
call SaveBoolean(Hash,idT,0,true)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(MilitiaBrothers,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call IssuePointOrder(f,"attack",-6000,-11500)
call GroupRemoveUnit(P2,f)
endloop
call TimerStart(t,0.5,true,function MilitiaMenAttack)
elseif bl == true then
if i == 0 then
set i = 1
elseif i > 0
i++
endif
call SaveInteger(Hash,idT,1,i)
set B = Condition(function MilitiaMenRetreat_F)
set f = FirstOfGroup(MilitiaBrothers)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(f),GetUnitY(f),1000,B)
set F = FirstOfGroup(P)
call DestroyBoolExpr(B)
if CountUnitsInGroupJ(MilitiaBrothers) <= 3 then
if F == null then
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782We are done, the next step is in your hands, Paladins!"
endif
set F2 = GroupPickRandomUnitEx(MilitiaBrothers)
//if not IsUnitDead(MilitiaMan) then
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(F2), GetUnitY(F2), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 6.)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(MilitiaBrothers,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call IssuePointOrder(f,"move",-8555,-9244)
call SaveReal(Hash,GetHandleId(f),StringHash("DS_trsp"),255)
call GroupAddUnit(DSgroup,f)
call GroupRemoveUnit(P2,f)
endloop
call PauseTimer(t)
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
else
//call PauseTimer(t)
if i == 1 then
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(MilitiaBrothers,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call IssuePointOrder(f,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,f)
endloop
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782WHAT THE HELL?!"
endif
set F2 = GroupPickRandomUnitEx(MilitiaBrothers)
//if not IsUnitDead(MilitiaMan) then
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(F2), GetUnitY(F2), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.)
endif
endif
endif
endif
set t = null
set f = null
endfunction
function ComesToHeroOrc_A takes nothing returns nothing
local unit e = GetEnteringUnit()
local effect eff
if (IsUnitInGroup(e,Paladins) or GetUnitTypeId(e) == knight) and not IsUnitDead(e) and ComesToOrcBL == false then
//call DisableTrigger(GetTriggeringTrigger())
//call echo("comes to orc hero")
set ComesToOrcBL = true
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(e),GetUnitY(e),600,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if IsUnitInGroup(F,Paladins) then
if (GetLocalPlayer() == GetOwningPlayer(F)) then
call PanCameraToTimed(-5950 ,-12600, 0.8)
endif
endif
call GroupRemoveUnit(P,F)
endloop
//call PauseUnit( gg_unit_nchw_0857,true )
// call PauseUnit( gg_unit_nchw_0856,true )
// call PauseUnit( OrcHero,true )
call SetUnitAnimation(gg_unit_nchw_0857,"spell")
call SetUnitAnimation(gg_unit_nchw_0856,"spell")
call UnitAddAbility(gg_unit_nchw_0857,'ACmi')
call UnitAddAbility(gg_unit_nchw_0857,'Abun')
call UnitAddAbility(gg_unit_nchw_0856,'ACmi')
call UnitAddAbility(gg_unit_nchw_0856,'Abun')
call UnitAddAbility(OrcHero,'ACmi')
call UnitAddAbility(OrcHero,'Abun')
set eff = AddSpecialEffectTarget("Abilities\\Spells\\Items\\VampiricPotion\\VampPotionCaster.mdl",OrcHero,"origin")
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00FE6741 YOU BETTER HURRY UP BOYS...|r "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 16 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcHero), GetUnitY(OrcHero), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 4.5)
call TriggerSleepAction(3.)
call SetUnitAnimation(gg_unit_nchw_0857,"spell")
call SetUnitAnimation(gg_unit_nchw_0856,"spell")
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00F3FA03 Embrace the blood's anger master! KILL THEM, SLAUGHTER THEM LIKE PIGS...|r "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 11 ) //14 05
call SetTextTagPos(TX, GetUnitX(gg_unit_nchw_0857), GetUnitY(gg_unit_nchw_0857), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 4.5)
call TriggerSleepAction(3.)
call SetUnitAnimation(OrcHero,"Stand Second")
call DestroyEffect(eff)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",GetUnitX(OrcHero),GetUnitY(OrcHero)))
call TriggerSleepAction(1.5)
set F = ReplaceUnitJ(OrcHero,'Opgh',1)
call SaveTimerDialogHandle(Hash,GetHandleId(F),StringHash("Timer_td"),LoadTimerDialogHandle(Hash,GetHandleId(OrcHero),StringHash("Timer_td")))
call SaveTimerHandle(Hash,GetHandleId(F),StringHash("Timer_timer"),LoadTimerHandle(Hash,GetHandleId(OrcHero),StringHash("Timer_timer")))
call FlushChildHashtable(Hash,GetHandleId(OrcHero))
set OrcHero = F //dont mess up here
call SetHeroLevel(OrcHero,10,false)
call IssuePointOrder(OrcHero,"attack",-5950,-11590)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00FE6741 WRRRAAAHHH! YOU SHOULVE NEVER DONE THAT HUMAN!|r "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 16 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcHero), GetUnitY(OrcHero), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 4.5)
call PauseUnit(OrcHero,false)
call PauseUnit( gg_unit_nchw_0857,false )
call PauseUnit( gg_unit_nchw_0856,false )
call UnitRemoveAbility(gg_unit_nchw_0857,'ACmi')
call UnitRemoveAbility(gg_unit_nchw_0857,'Abun')
call UnitRemoveAbility(gg_unit_nchw_0856,'ACmi')
call UnitRemoveAbility(gg_unit_nchw_0856,'Abun')
call UnitRemoveAbility(OrcHero,'ACmi')
call UnitRemoveAbility(OrcHero,'Abun')
//call TimerStart(t,6.5,false,function OrcMageScene5)
elseif OrcEscaped == true then
elseif e == OrcHero or e == gg_unit_nchw_0857 or e == gg_unit_nchw_0856 then
call SetUnitPathing(e,false)
call IssuePointOrder(e,"move",-5960,-12600)
call GroupAddUnit(OrcMovesBack,e)
endif
set e = null
set eff = null
endfunction
function OrcMageScene7 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit f
local trigger ComesToHeroOrc = CreateTrigger()
local region rd2 = CreateRegion()
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782KEEP KILLING THESE BASTARDS"
endif
if not IsUnitDead(MilitiaMan) then
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MilitiaMan), GetUnitY(MilitiaMan), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 6.)
// call FT.add(TX, S)
endif
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(MilitiaBrothers,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call IssuePointOrder(f,"attack",-5880,-9580)
call GroupRemoveUnit(P2,f)
endloop
call RegionAddRect(rd2,gg_rct_OrcHeroScene)
call TriggerRegisterEnterRegion(ComesToHeroOrc, rd2, null)
call TriggerAddAction(ComesToHeroOrc,function ComesToHeroOrc_A)
set T = CreateTimer()
set I = GetHandleId(T)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
set S = "Time to beat Drok..."
endif
call SaveTimerDialogHandle(Hash,I,6,CreateTimerDialogJ(T,S))
call SaveTimerDialogHandle(Hash,GetHandleId(OrcHero),StringHash("Timer_td"),bj_lastCreatedTimerDialog)
call SaveTimerHandle(Hash,GetHandleId(OrcHero),StringHash("Timer_timer"),T)
call TimerDialogDisplay(bj_lastCreatedTimerDialog, false)
call TimerStart(T,150,false,function OrcInvasion_QuestLost)
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
endif
//call SaveTriggerActionHandle(Hash,GetHandleId(ComesToHeroOrc),0,TriggerAddAction(ComesToHeroOrc,function ComesToHeroOrc_A))
set T = CreateTimer()
set I = GetHandleId(T)
call SaveBoolean(Hash,I,0,false)
call TimerStart(T,3.,false,function MilitiaMenAttack)
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
set f = null
set rd2 = null
endfunction
function OrcMageScene6 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
call FlushChildHashtable(Hash,GetHandleId(gg_unit_otot_0851))
call TimerStart(t,1.5,false,function OrcMageScene7)
call RemoveUnit(gg_unit_otot_0851)
set t = null
endfunction
function KillDestrcutableOrcScene takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function OrcMageScene5 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local rect rct
set rct = RectFromCenterSizeJ(GetUnitX(gg_unit_otot_0851),GetUnitY(gg_unit_otot_0851),1000,1000)
call EnumDestructablesInRect(rct,null,function KillDestrcutableOrcScene)
call SetUnitAnimation(gg_unit_otot_0851,"death alternate")
call KillUnit(OrcMage)
call KillUnit(gg_unit_opeo_0855)
call TimerStart(t,1.5,false,function OrcMageScene6)
call RemoveRect(rct)
set rct = null
set t = null
endfunction
function OrcMageScene4 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local boolean bl
set bl = LoadBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_scene5"))
if bl == false then
set bl = true
call SaveBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_scene5"),true)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00F3FA03 But boss said "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 12 ) //14 05
call SetTextTagPos(TX, GetUnitX(gg_unit_opeo_0855), GetUnitY(gg_unit_opeo_0855), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 2.5)
call TimerStart(t,1.5,false,function OrcMageScene4)
elseif bl == true then
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00F3FA03 LET ME IN OR ILL GET YOUR AP... "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 12 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcMage), GetUnitY(OrcMage), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 2.5)
call TimerStart(t,1.5,false,function OrcMageScene5)
endif
set t = null
endfunction
function OrcMageScene2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local boolean bl
local unit f
set bl = LoadBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_scene3"))
if bl == false then
set bl = true
call SaveBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_scene3"),true)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00F3FA03 This makes no sence... "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcMage), GetUnitY(OrcMage), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.)
call IssuePointOrder(OrcMage,"move",-5845, -9771)
call TimerStart(t,DistanceXY(GetUnitX(OrcMage),GetUnitY(OrcMage),-5845, -9771) / 270,false,function OrcMageScene2)
elseif bl == true then
call UnitRemoveAbility( OrcMage, 'Amov' )
call SetUnitFacing(OrcMage,222)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00F3FA03 I DONT KNOW the way back! LET ME IN!! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcMage), GetUnitY(OrcMage), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 4.5)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(OrcBase,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P)
exitwhen f == null
//call PauseUnit(f,false)
call ShowUnit(f,TRUE)
//call GroupRemoveUnit(OrcBase,f)
call GroupRemoveUnit(P,f)
endloop
call UnitAddAbility(gg_unit_opeo_0855,'ACmi')
call IssuePointOrder(gg_unit_opeo_0855,"move",-6110,-10050)
call TimerStart(t,3.5,false,function OrcMageScene4)
endif
set t = null
set f = null
endfunction
function OrcMageScene1 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local boolean bl
set bl = LoadBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_bl"))
if bl == true then
call PauseTimer(t)
call UnitRemoveBuffs(OrcMage,true,true)
call UnitAddAbility(OrcMage,'ACmi')
call UnitAddAbility(OrcMage,'Abun')
//call echo("scene start dDDDD")
call UnitAddAbility(OrcMage,'Awrh')
call IssueImmediateOrder(OrcMage,"stomp")
call SetUnitPathing(OrcMage,false)
call TimerStart(t,1.5,false,function OrcMageScene2)
endif
set t = null
endfunction
function MilitiaManStopMoving takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
set F = LoadUnitHandle(Hash,idT,0)
call IssueImmediateOrder(F,"stop")
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
endfunction
function MilitiaManComesUp takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local group g = LoadGroupHandle(Hash,idT,0)
local unit f
local timer t2
local integer id2
set f = FirstOfGroup(g)
if f == null then
call echo("end")
call PauseTimer(t)
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
else
if GetRandomInt(1,2) == 1 then
call SetUnitX(f,-8575)
call SetUnitY(f,-9240)
else
call SetUnitX(f,-8575)
call SetUnitY(f,-9240)
endif
call ShowUnit(f,true)
call SaveReal(Hash,GetHandleId(f),StringHash("Appearing_R"),15)
call SetUnitVertexColor(f,255,255,255,15)
call GroupAddUnit(AppearingGroup,f)
call SetUnitFacing(f,97)
call IssuePointOrder(f,"attack",-7950+GetRandomReal(-20,20),-9350+GetRandomReal(-20,20))
set t2= CreateTimer()
set id2 = GetHandleId(t2)
call SaveUnitHandle(Hash,id2,0,f)
call TimerStart(t2,1.8,false,function MilitiaManStopMoving)
call GroupRemoveUnit(g,f)
endif
set t2= null
set g = null
set f = null
set t = null
endfunction
function OrcInvasion_A takes nothing returns nothing
local unit f
local timer t
local integer idT
local group g
call GroupClear(P)
set B = Condition(function Undead_Filter)
//call echo("ssss mortar")
call GroupEnumUnitsInRange(P,GetUnitX(MilitiaMan),GetUnitY(MilitiaMan),2000,B)
set F = GetTriggerUnit()
call DestroyBoolExpr(B)
if IsUnitInGroup(F,Paladins) and CountUnitsInGroupJ(P) <= 0 and CryptSpidersReal <= 0. and OrcInvasionCanBeCanceled == true then //IsUnitInGroup(F,Paladins) and
set OrcInvasionCanBeCanceled = false
set udg_WithinRangeUnit = MilitiaMan
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
call KillUnit(LoadUnitHandle(Hash,GetHandleId(MilitiaMan),StringHash("QuestMark")))
call KillUnit( gg_unit_e00P_0812 )
call RemoveSavedHandle(Hash,GetHandleId(MilitiaMan),StringHash("QuestMark"))
call GroupRemoveUnit(QuestionMarkGroup,MilitiaMan)
set S = ""
//call echo("ss")
call SetUnitFacing(MilitiaMan,AngleBetweenXY(GetUnitX(MilitiaMan),GetUnitY(MilitiaMan),GetUnitX(F),GetUnitY(F)))
call TriggerSleepAction(1.5)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Welcome brave Heroes! We knew you would come up to end this mess once and for all! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MilitiaMan), GetUnitY(MilitiaMan), GetRandomReal( 25, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 8.5)
// call FT.add(TX, S)
call TriggerSleepAction(4.8)
call SetUnitFacing(MilitiaMan,140)
call TriggerSleepAction(2.7)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782RIGHT?! GUUUUYYYYS "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MilitiaMan), GetUnitY(MilitiaMan), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 4.)
//call FT.add(TX, S)
call TriggerSleepAction(2.5)
set t = CreateTimer()
set idT = GetHandleId(t)
set g = CopyGroup(MilitiaBrothers)
call SaveGroupHandle(Hash,idT,0,g)
call TimerStart(t,1.5,true,function MilitiaManComesUp)
call TriggerSleepAction(8.5) //13.5
call SetUnitFacing(MilitiaMan,117)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782Today We dime in hell! No! I meant, we are going to release shipyard ourself with those noble Paladins. "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MilitiaMan), GetUnitY(MilitiaMan), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 6.)
//call FT.add(TX, S)
call TriggerSleepAction(4.)
call SetUnitFacing(MilitiaMan,21)
call TriggerSleepAction(4.)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782LETS GOOOOOOO "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 10 ) //14 05
call SetTextTagPos(TX, GetUnitX(MilitiaMan), GetUnitY(MilitiaMan), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 6.)
// call FT.add(TX, S)
call GroupAddUnit(MilitiaBrothers,MilitiaMan)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(MilitiaBrothers,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call IssuePointOrder(f,"attack",-6150,-9000)
call GroupRemoveUnit(P2,f)
endloop
call TriggerSleepAction(2.5)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidOfOrcs,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call ShowUnit(f,true)
call SetUnitPathing( f, false )
call UnitAddAbility(f, 'A01I')
call SetUnitAbilityLevel(f,'A01I',8)
call SaveReal(Hash,GetHandleId(f),StringHash("Appearing_R"),15)
call SetUnitVertexColor(f,255,255,255,15)
call GroupAddUnit(AppearingGroup,f)
call IssuePointOrder(f,"move",-6500,-8557)
call GroupRemoveUnit(P2,f)
endloop
call TriggerSleepAction(2.5)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidOfOrcs,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P2)
exitwhen f == null
call SetUnitPathing( f, true )
call UnitRemoveAbility(f,'A01I')
call IssuePointOrder(f,"attack",-6500,-8357)
call GroupRemoveUnit(P2,f)
endloop
call PauseUnit( gg_unit_nchw_0857,true )
call PauseUnit( gg_unit_nchw_0856,true )
call PauseUnit( OrcHero,true )
call TriggerSleepAction(4.)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00F3FA03 What? JUST SLAUGHTER THEM GUYS! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 12 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcMage), GetUnitY(OrcMage), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.5)
// call FT.add(TX, S)
set t = CreateTimer()
set idT = GetHandleId(t)
call TimerStart(t,0.5,true,function OrcMageScene1)
//call SaveGroupHandle(Hash,idT,0,R
elseif OrcInvasionReal <= 0. and IsUnitInGroup(F,Paladins)
call MsgForce(HumanForce,"|c00BD204FOrc Invasion|r cant be started - undeads are nearby.")
set OrcInvasionReal = 10.
endif
set f = null
set t = null
set g = null
endfunction
function Trig_OrcInvasion_Actions takes nothing returns nothing
local unit f
set OrcInvasionTrigger = CreateTrigger()
set MilitiaMan = gg_unit_hmil_0639
call GroupAddUnit(QuestGroup, gg_unit_hmil_0639)
set OrcMage = gg_unit_nw2w_0848
call SaveBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_bl"),false)
call GroupAddUnit(QuestionMarkGroup,MilitiaMan)
call SetUnitX(gg_unit_nhef_0522, -9430)
call SetUnitY(gg_unit_nhef_0522, 7365)
call SetUnitX(gg_unit_nvil_0523, -9440)
call SetUnitY(gg_unit_nvil_0523, 7491)
set OrcHero = gg_unit_Ogrh_0846
set udg_WithinRangeRange = 180.00
set udg_WithinRangeUnit = MilitiaMan
// Use Event wanted = 0 to not throw Events.
set udg_WithinRangeWanted_Event = 1.00
set udg_WithinRangeWanted_Trigger = OrcInvasionTrigger
//set udg_WithinRangeWanted_Filter = Condition(function Trig_Register_Kopieren_Func006002)
call TriggerExecute( gg_trg_WithinRange )
call SaveTriggerActionHandle(Hash,GetHandleId(OrcInvasionTrigger),0,TriggerAddAction( OrcInvasionTrigger, function OrcInvasion_A ))
set f = null
endfunction
//===========================================================================
function InitTrig_OrcInvasion takes nothing returns nothing
set gg_trg_OrcInvasion = CreateTrigger( )
call TriggerAddAction( gg_trg_OrcInvasion, function Trig_OrcInvasion_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_WhatAmIDoingHere_Actions takes nothing returns nothing
if IsUnitInGroup(GetEnteringUnit(),MilitiaGroup) and GetUnitTypeId(GetEnteringUnit()) == footman then
call DisableTrigger(GetTriggeringTrigger())
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00E35782What I am doing here? Nobody will not even pay me for that."
endif
set F2 = GroupPickRandomUnitEx(MilitiaBrothers)
//if not IsUnitDead(MilitiaMan) then
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 9 ) //14 05
call SetTextTagPos(TX, GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.)
endif
endfunction
//===========================================================================
function InitTrig_WhatAmIDoingHere takes nothing returns nothing
set gg_trg_WhatAmIDoingHere = CreateTrigger( )
call TriggerRegisterEnterRect( gg_trg_WhatAmIDoingHere, gg_rct_WhatAmIDoingThis )
call TriggerAddAction( gg_trg_WhatAmIDoingHere, function Trig_WhatAmIDoingHere_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_TestOrcQuest_Actions takes nothing returns nothing
local unit f
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_OrcStartAttackRegion,null)
loop
set f = FirstOfGroup(P)
exitwhen f == null
//call PauseUnit(f,true)
call ShowUnit(f,false)
call GroupAddUnit(RaidOfOrcs,f)
call GroupRemoveUnit(P,f)
endloop
call GroupClear(P)
call GroupEnumUnitsInRect(P,gg_rct_OrcRegion,null)
loop
set f = FirstOfGroup(P)
exitwhen f == null
call GroupAddUnit(OrcBase,f)
//call PauseUnit(f,true)
call ShowUnit(f,false)
call GroupRemoveUnit(P,f)
endloop
call GroupEnumUnitsInRect(P,gg_rct_MilitiaBrothers,null)
loop
set f = FirstOfGroup(P)
exitwhen f == null
call ShowUnit(f,false)
call GroupAddUnit(MilitiaBrothers,f)
call GroupRemoveUnit(P,f)
endloop
set f = null
endfunction
//===========================================================================
function InitTrig_TestOrcQuest takes nothing returns nothing
set gg_trg_TestOrcQuest = CreateTrigger( )
call TriggerAddAction( gg_trg_TestOrcQuest, function Trig_TestOrcQuest_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ItemsCreating_Actions takes nothing returns nothing
local integer i
call DestroyTimer(GetExpiredTimer())
set I = 1
loop
exitwhen I > ItemsShouldBe
set Bol = false
loop
exitwhen Bol == true
set I2 = GetRandomInt(1,itemplaces)
set i = GetRandomInt(1,ItemsSummary)
if not PlaceUn[I2] and not ItemIdUn[i]
set Bol = true
set PlaceUn[I2] = true
set ItemIdUn[i] = true
endif
endloop
call CreateItem(ItemId[i],GetRectCenterX(ItemPlace[I2]),GetRectCenterY(ItemPlace[I2]))
I++
endloop
endfunction
//===========================================================================
function InitTrig_ItemsCreating takes nothing returns nothing
set ItemId[1] = 'sprn'
set ItemPlace[1] = gg_rct_ItemPlace1
set PlaceUn[1] = false
set ItemIdUn[1] = false
set ItemId[2] = 'fwss'
set ItemPlace[2] = gg_rct_ItemPlace2
set PlaceUn[2] = false
set ItemIdUn[2] = false
set ItemId[3] = 'rugt'
set ItemPlace[3] = gg_rct_ItemPlace3
set PlaceUn[3] = false
set ItemIdUn[3] = false
set ItemId[4] = 'soul'
set ItemPlace[4] = gg_rct_ItemPlace4
set PlaceUn[4] = false
set ItemIdUn[4] = false
set ItemId[5] = 'srbd'
set ItemPlace[5] = gg_rct_ItemPlace5
set PlaceUn[5] = false
set ItemIdUn[5] = false
set ItemId[6] = 'stwa'
set ItemPlace[6] = gg_rct_ItemPlace6
set PlaceUn[6] = false
set ItemIdUn[6] = false
set ItemPlace[7] = gg_rct_ItemPlace7
set PlaceUn[7] = false
set ItemPlace[8] = gg_rct_ItemPlace8
set PlaceUn[8] = false
set ItemPlace[9] = gg_rct_ItemPlace9
set PlaceUn[9] = false
set ItemPlace[10] = gg_rct_ItemPlace10
set PlaceUn[10] = false
set ItemPlace[11] = gg_rct_ItemPlace11
set PlaceUn[11] = false
set ItemPlace[12] = gg_rct_ItemPlace12
set PlaceUn[12] = false
set ItemPlace[13] = gg_rct_ItemPlace13
set PlaceUn[13] = false
set ItemPlace[14] = gg_rct_ItemPlace14
set PlaceUn[14] = false
set ItemPlace[15] = gg_rct_ItemPlace15
set PlaceUn[15] = false
set ItemPlace[16] = gg_rct_ItemPlace16
set PlaceUn[16] = false
set PalItem[1] = false
set PalItem[2] = false
set PalItem[3] = false
set PalItem[4] = false
set PalItem[5] = false
set PalItem[6] = false
set PalItem[7] = false
set PalItem[8] = false
set PalItem[9] = false
call TimerStart(CreateTimer(),35,false,function Trig_ItemsCreating_Actions)
endfunction
//TESH.scrollpos=84
//TESH.alwaysfold=0
function DreadLord_Spawn2 takes nothing returns nothing
set T = GetExpiredTimer()
set I = GetHandleId(T)
set F = LoadUnitHandle(Hash,I,1)
set Ef = LoadEffectHandle(Hash,I,2)
set I2 = LoadInteger(Hash,I,3)
local integer i
local integer PID = DreadSpawnInteger[I2]
local timerdialog td = LoadTimerDialogHandle(Hash,I,6)
local texttag tx = CreateTextTag()
local string s = "+" + I2S(R2I(ShadowsStacks[I2]) * 7) + " health"
local integer ix
DreadLordsCount++
set i = 1
loop
exitwhen i > 6
set bj_lastRemovedItem = UnitItemInSlot(Shadows[I2], i-1)
call UnitRemoveItem(HERO[I2],bj_lastRemovedItem)
call UnitAddItem(HERO[I2],bj_lastRemovedItem)
i++
endloop
call FlushChildHashtable(Hash,GetHandleId(Shadows[I2]))
call RemoveUnit(Shadows[I2])
call KillUnit(LoadUnitHandle(Hash,I,5))
call DestroyEffect(LoadEffectHandle(Hash,I,2))
call SetTextTagColor(tx, 90, 230, 90, 250) //250
call SetTextTagText(tx, s, 0.013 ) //14 05
call SetTextTagPos(tx, GetRectCenterX(Spawn[PID]),GetRectCenterY(Spawn[PID]), 55)
call SetTextTagVelocity(tx, 0.0, 0.02) //0.06 0.04
call SetTextTagPermanent(tx, FALSE)
call SetTextTagLifespan(tx, 1.7)
call FT.add(tx, s)
set tx = CreateTextTag()
set s = "+" + I2S(R2I(ShadowsStacks[I2]) * 1) + " attack"
call SetTextTagColor(tx, 230, 90, 90, 250) //250
call SetTextTagText(tx, s, 0.013 ) //14 05
call SetTextTagPos(tx, GetRectCenterX(Spawn[PID]),GetRectCenterY(Spawn[PID]), -5)
call SetTextTagVelocity(tx, 0.0, 0.02) //0.06 0.04
call SetTextTagPermanent(tx, FALSE)
call SetTextTagLifespan(tx, 0.7)
call FT.add(tx, s)
call SetUnitX(HERO[I2],GetRectCenterX(Spawn[PID]))
call SetUnitY(HERO[I2],GetRectCenterY(Spawn[PID]))
call ShowUnit(HERO[I2],true)
set ix = GetPlayerId(GetOwningPlayer(HERO[I2]))
//set LVLUPadditionalHL[ix] = 1
//call UnitAddAbility(HERO[I2],'A017')
//call SetUnitAbilityLevel(HERO[I2],'A017',1)
call GroupAddUnit(DreadLords,HERO[I2])
set F2 = CreateUnit(GetOwningPlayer(HERO[I2]),'e00N',GetUnitX(HERO[I2]),GetUnitY(HERO[I2]),0)
call GroupAddUnit(DreadLordsVision,F2)
call GroupClear(ShadowsGroup[I2])
call DestroyGroup(ShadowsGroup[I2])
call SaveUnitHandle(Hash,GetHandleId(HERO[I2]),StringHash("DL_Vision"),F2)
if ShadowsStacks[I2] > 0 then
call UnitAddAbility(HERO[I2], 'A00V')
call SetUnitAbilityLevel(HERO[I2],'A00V',ShadowsStacks[I2])
call UnitAddAbility(HERO[I2], 'A00U')
call SetUnitAbilityLevel(HERO[I2],'A00U',ShadowsStacks[I2])
endif
//call TimerStart(T,0.8,false,function DreadLord_Spawn3)
call DestroyTimerDialog(td)
if DreadLordsCount >= T2Nplayer then
//call echo(R2S(CGM))
//call echo(R2S(CGMMax))
//NOW WE START A TIMER TO SURVIVE
set PalSurviveReal = 1200. //1980.
set PalSurvive = true
call StartTimerBJ( udg_SurviveTD , false, 1200.00 )
call CreateTimerDialogBJ( udg_SurviveTD , "STEAM TANKS ARRIVE IN.." )
//set T = CreateTimer()
// call TimerStart(T,101,false,null) //1800
//call CreateTimerDialog(SurviveTD)
//call CreateTimerDialogJ(T,"|c00FF8811Time to Play(PALADINS WIN)....|r")
//call TimerDialogSetTitle(bj_lastCreatedTimerDialog, title)
//call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
//call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
set CilivianzAlive = CreateLeaderboard()
//if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
call PlayerSetLeaderboard(GetLocalPlayer(), CilivianzAlive)
//endif
call LeaderboardSetLabel(CilivianzAlive, "Villagers Alive - " + I2S(R2I(100*CGM/CGMMax)) + "%")
call LeaderboardAddItemJ( Player(10), CilivianzAlive, " Dead need %-", 80 )
call LeaderboardAddItemJ( Player(6), CilivianzAlive, " Dreadlord Count - ", DreadLordsCount )
call LeaderboardAddItemJ( Player(5), CilivianzAlive, " Paladins Count - ", PaladinsCount )
call LeaderboardDisplay(CilivianzAlive, true)
//call LeaderboardAddItem(CilivianzAlive, "Villagers Alive - ", 0, Player(5))
//call LeaderboardSetSizeByItemCount(CilivianzAlive, 1)
set LeaderBoardActive = true
endif
call FlushChildHashtable(Hash,I)
call DestroyTimer(T)
set tx = null
endfunction
function DreadLord_Spawn takes nothing returns nothing
set T = GetExpiredTimer()
set I = GetHandleId(T)
set F = LoadUnitHandle(Hash,I,1)
set Ef = LoadEffectHandle(Hash,I,2)
set I2 = LoadInteger(Hash,I,3)
local integer PID = DreadSpawnInteger[I2]
local timerdialog td = LoadTimerDialogHandle(Hash,I,6)
local real timedyst = 0.5+ (DistanceXY(GetUnitX(Shadows[I2]),GetUnitY(Shadows[I2])/*
*/,GetRectCenterX(Spawn[DreadSpawnInteger[PID]]), GetRectCenterY(Spawn[DreadSpawnInteger[PID]]))/3500)
call DestroyTextTag(LoadTextTagHandle(Hash,GetHandleId(Shadows[I2]),4))
call TriggerRemoveAction(LoadTriggerHandle(Hash,GetHandleId(Shadows[I2]),0),LoadTriggerActionHandle(Hash,GetHandleId(Shadows[I2]),1))
call DestroyTrigger(LoadTriggerHandle(Hash,GetHandleId(Shadows[I2]),0))
call FlushChildHashtable(Hash,GetHandleId(Shadows[I2]))
call ShowUnit(Shadows[I2],false)
set F = CreateUnit(Player(I2),'e00A',GetRectCenterX(Spawn[PID]),GetRectCenterY(Spawn[PID]),GetRandomReal(0,360))
call SaveUnitHandle(Hash,I,5,F)
if GetLocalPlayer() == Player(I2)
call PanCameraToTimed(GetRectCenterX(Spawn[PID]), GetRectCenterY(Spawn[PID]), timedyst )
endif
call TimerStart(T,timedyst + 2.,false,function DreadLord_Spawn2)
//call DestroyTimerDialog(td)
//call DestroyTimer(T)
endfunction
function Shukuchi_6 takes nothing returns nothing
local real textHeight
local string Ss
set F = GetTriggerUnit()
if IsUnitInGroup(F,ShadowsGroup[6]) then
if ShadowsStacks[6] < 20 then
ShadowsStacks[6]++
endif
if ShadowsStacks[6] == 20 then
set F2 = CreateUnit(GetOwningPlayer(Shadows[6]),'e00V',-14112., 13166., 0)
call UnitApplyTimedLife(F2,'BTLF',180)
call SaveUnitHandle(Hash,GetHandleId(Shadows[6]),StringHash("DummyZiccurate"),F2)
endif
call GroupRemoveUnit(ShadowsGroup[6],F)
call AddSpecialEffectTarget("BlinkTargetBlack.mdx",Shadows[6],"chest")
set textHeight = 10 * 0.023 / 10
set Ss = ""
if GetLocalPlayer() == Player(6) then
set Ss = I2S(ShadowsStacks[6])
endif
call SetTextTagText(LoadTextTagHandle(Hash,GetHandleId(Shadows[6]),4), Ss, textHeight)
endif
endfunction
function Shukuchi_7 takes nothing returns nothing
local real textHeight
local string Ss
set F = GetTriggerUnit()
if IsUnitInGroup(F,ShadowsGroup[7]) then
if ShadowsStacks[7] < 20 then
ShadowsStacks[7]++
endif
if ShadowsStacks[7] == 20 then
set F2 = CreateUnit(GetOwningPlayer(Shadows[7]),'e00V',-14112., 13166., 0)
call UnitApplyTimedLife(F2,'BTLF',180)
call SaveUnitHandle(Hash,GetHandleId(Shadows[7]),StringHash("DummyZiccurate"),F2)
endif
call GroupRemoveUnit(ShadowsGroup[7],F)
call AddSpecialEffectTarget("BlinkTargetBlack.mdx",Shadows[7],"chest")
set textHeight = 10 * 0.023 / 10
set Ss = ""
if GetLocalPlayer() == Player(7) then
set Ss = I2S(ShadowsStacks[7])
endif
call SetTextTagText(LoadTextTagHandle(Hash,GetHandleId(Shadows[7]),4), Ss, textHeight)
endif
endfunction
function Shukuchi_8 takes nothing returns nothing
local real textHeight
local string Ss
set F = GetTriggerUnit()
if IsUnitInGroup(F,ShadowsGroup[8]) then
if ShadowsStacks[8] < 20 then
ShadowsStacks[8]++
endif
if ShadowsStacks[8] == 20 then
set F2 = CreateUnit(GetOwningPlayer(Shadows[8]),'e00V',-14112., 13166., 0)
call UnitApplyTimedLife(F2,'BTLF',180)
call SaveUnitHandle(Hash,GetHandleId(Shadows[8]),StringHash("DummyZiccurate"),F2)
endif
call GroupRemoveUnit(ShadowsGroup[8],F)
call AddSpecialEffectTarget("BlinkTargetBlack.mdx",Shadows[8],"chest")
set textHeight = 10 * 0.023 / 10
set Ss = ""
if GetLocalPlayer() == Player(8) then
set Ss = I2S(ShadowsStacks[8])
endif
call SetTextTagText(LoadTextTagHandle(Hash,GetHandleId(Shadows[8]),4), Ss, textHeight)
endif
endfunction
function Shukuchi_9 takes nothing returns nothing
local real textHeight
local string Ss
set F = GetTriggerUnit()
if IsUnitInGroup(F,ShadowsGroup[9]) then
if ShadowsStacks[9] < 20 then
ShadowsStacks[9]++
endif
if ShadowsStacks[9] == 20 then
set F2 = CreateUnit(GetOwningPlayer(Shadows[9]),'e00V',-14112., 13166., 0)
call UnitApplyTimedLife(F2,'BTLF',180)
call SaveUnitHandle(Hash,GetHandleId(Shadows[9]),StringHash("DummyZiccurate"),F2)
endif
call GroupRemoveUnit(ShadowsGroup[9],F)
call AddSpecialEffectTarget("BlinkTargetBlack.mdx",Shadows[9],"chest")
set textHeight = 10 * 0.023 / 10
set Ss = ""
if GetLocalPlayer() == Player(9) then
set Ss = I2S(ShadowsStacks[9])
endif
call SetTextTagText(LoadTextTagHandle(Hash,GetHandleId(Shadows[9]),4), Ss, textHeight)
endif
endfunction
function DreadLord_Tips5 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "Удачи! Кнопка ESC удаляет любой появляющийся текст на экране"
set r =12.
else
set r = 13.
set s = "|c00E77561 Remember: Your goal is to kill more than 80% of Citizens(AI). You can forget about killing Militia or Paladins, but Citizens is your main priority. |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call FlushChildHashtable(Hash,GetHandleId(T))
call DestroyTimer(T)
endfunction
function DreadLord_Tips41 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "5 также значимых правила:"
set r =5.
else
set r = 6.
set s = "|c00E77561 And here some minor things you might look at if you are new: |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
//call TimerStart(T,r+2.,false,function DreadLord_Tips412)
//call TimerStart(T,42,false,function DreadLord_Tips5)
endfunction
function DreadLord_Tips4 takes nothing returns nothing
local real r
local string s
local force fssd = CreateForce()
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "5) Вы можете захватить населённый пункт, полностью избавившись от гражданского населения. В таком случае зона покроется порчей, и откроется тёмный портал. Портал будет наносить огромный урон всем ближайшим живым существам, и одарит вас ресурсами эссенции. "
set r =12.
else
set r = 13.
set s = "|c00E77561 .5) Condsider making upgrades via Main Dreadlords Building(north-east corner). it strengthen UNDEAD AI army. That's the key to conquer the Hellmouth. Be aware that Paladins team have upgrades for Militia team. |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2.,false,function DreadLord_Tips5)
call ForceAddPlayer(fssd,Player(I))
if RusTips == false then
call PingMinimapForForceExJ(fssd, 8620., 12767., 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 100, 255, 140)
endif
call ForceRemovePlayer(fssd,Player(I))
call DestroyForce(fssd)
set fssd = null
endfunction
function DreadLord_Tips333331 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "4) По территории полуострова спрятаны предметы для Дредлордов. Их можно найти через Тень или через самого Дредлорда. Каждый из них обладает значительной силой изменить баланс игры. "
set r = 10.
else
set r = 10.
set s = "|c00E77561 .4) Undead(AI) units can be consumed by Dreadlord(via spell Dark Preservation). It gives Dark Essence resource instead and restores your hp and mp. |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips4)
endfunction
function DreadLord_Tips33333 takes nothing returns nothing
local real r
local string s
local force fssd = CreateForce()
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "3) Суть ресурса тёмной эссенции - в использовании её для улучшений. Обратите внимание на некрополисы, расположенные на северо востоке полуострова. В них есть доступные улучшения для армии нежити. Это крайне важные улучшения, любой из них может значительно повлиять на боевую силу армии нежити."
set r = 12.
else
set r = 10.
set s = "|c00E77561 .3) Haunt Citizens(AI) in sneaky-like style, try not to fight solo Militia and especially team |c00FA6343Paladins|r|c0060CA51 directly. If you kill enemy units(except for Neutrals), they will raise as Undead(AI) units. |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips333331)
call ForceAddPlayer(fssd,Player(I))
if RusTips == true then
call PingMinimapForForceExJ(fssd, 8620., 12767., 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 100, 255, 140)
endif
call ForceRemovePlayer(fssd,Player(I))
call DestroyForce(fssd)
set fssd = null
endfunction
function DreadLord_Tips3333 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "2) Дредлорд невидим, пока не использует способности или не атакует противников. Старайтесь не идти в лобовое столкновение с Ополчением, и тем более с Паладинами. Ваша основная тактика заключается в убийстве наименее защищённых гражданских и мало укреплённых объектов. Весь основной урон от ополчения и Паладинов может принять на себя армия нежити, пока вы будете действовать из тени."
set r = 15.
else
set r = 10
set s = "|c00E77561 .2) Dreadlord is invisible until he cast or attack someone. You can be seen by true sight units, or some other detections. Your DreadLord can LVL up, finding item-relics on a map, getting Dark Essence(RESOURCE) from consuming Undead(AI) units|r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips33333)
endfunction
function DreadLord_Tips333 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "1) Сохранение эссенции стоит применять на ту нежить, которая вот-вот погибнет или идёт на бессмысленную гибель. Поглощение эссенции также восстанавливает вам часть здоровья и маны Но если способность прервать во время её применения, вы не получите никаких ресурсов. "
set r = 12.
else
set r = 8
set s = "|c00E77561 .1) If your hero dies - you get a mini-hero unit instead, while hero is getting respawned for 4 mins. So be careful |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips3333)
endfunction
function DreadLord_Tips33 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "5 также значимых правила:"
set r = 4.
else
set r = 0
set s = "."
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips333)
endfunction
function DreadLord_Tips3 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "4) Собирайте тёмную эссенцию - ресурс, кол-во которого отражается в верхней правой части экрана - вместо дерева. Получать её можно захватывая регионы, или используя спообность Сохранение эссенции (Essence Preservation), доступная Дредлорду."
set r = 12.
else
set r = 4
set s = "|c00E77561 Here are some additional rules you still need: |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips33)
endfunction
function DreadLord_Tips22222 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "3) Смерть Тени не создаст никаких трудностей для дальнейшей игры, при этом убить её могут только Паладины. Смерть Дредлорда будет стоить вам ожидания в виде 4 минут, в течение которых вам будет отведена игра за юнита более низкого ранга и силы. "
set r = 11.
else
set r = 15
set s = "|c00E77561 .4) Your primal goal is to kill 80% of citizens within 20 mins. In 20 mins steam tanks will arrive, and that would be extremely dangerous for your Master Mind core. But if you kill enough citizens within time, the hellmouth will be captured, and you will be tasked to crush Paladins completely. |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips3)
endfunction
function DreadLord_Tips2222 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "2) Любое убитое живое существо (не считая нейтралов) восстаёт из мёртвых как воин тьмы. Это компьютерный игрок, который будет самостоятельно отдавать приказы восставшему. "
set r = 9.
else
set r = 6
set s = "|c00E77561 .3) Militia (AI), Citizens and team |c00FA6343Paladins|r|c0060CA51 are your enemies |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips22222)
endfunction
function DreadLord_Tips222 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "1) Ваша цель уничтожать гражданское население на полуострове. Убив более 80% - вы захватите весь полуостров, и со всей грозной ордой сможете пойти на осаду форта Паладинов, и выиграть игру."
set r = 8.
else
set r = 6
set s = "|c00E77561 .2) Undead(AI), team |c0000AE57Dreadlord|r|c00E77561 are your allies |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2,false,function DreadLord_Tips2222)
endfunction
function DreadLord_Tips22 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "4 важнейших правила:"
set r = 4.
else
set r = 14
set s = "|c00E77561 .1) Shade is unable to attack, completely invisible, and has an ability to strengheten future Dreadlord form. Go through living creatures, like a spooky ghost in horror movie, to collect stacks of life force for DreadLord's power |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2.5,false,function DreadLord_Tips222)
endfunction
function DreadLord_Tips2 takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "Проходите сквозь живых существ (подобно призракам из фильма ужасов), заполняя счётчик жизненной силы. Чем больше его будет, тем больше бонусов получит Дредлорд на старте. "
set r = 12.
else
set r = 3.
set s = "|c00E77561 Here are some main rules: |r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s )
call TimerStart(T,r+2.5,false,function DreadLord_Tips22)
endfunction
function DreadLord_Tips takes nothing returns nothing
local real r
local string s
set T = GetExpiredTimer()
set I = LoadInteger(Hash,GetHandleId(T),0)
if RusTips == true then
set s = "В течение 3 минут вы играете за Тень. Запомните участок, заполненный зелёным свечением - именно тут вы будете воскрешены за Дредлорда по истечению времени. "
set r = 14.
else
set r = 14
set s = "|c00E77561 You have been spawned as a Shade at a random point of map for 3 mins, after time expired you will get to play Dreadlord|r"
endif
call DisplayTimedTextToPlayer(Player(I), 0, 0, r, s)
call TimerStart(T,r+2.5,false,function DreadLord_Tips2)
endfunction
function Trig_DreadLordPitCreating_Actions takes nothing returns nothing
local integer i = GetPlayerId(udg_Missile__Owner)
local integer i2 = DreadSpawnInteger[i]
local trigger Shukuchi
local texttag tg
local effect effect2
local force forceP
local force forceP2
local real timespawn
set udg_Missile__WantDestroy = true
if PlayerInGame[i] and IsPlayerInForce(Player(i), UndeadForce) then
set CinematicEnd[i] = TRUE
endif
set forceP = CreateForce()
call ForceAddPlayer(forceP, Player(i))
//set Ef = AddSpecialEffect("Abilities\\Spells\\Undead\\UnholyAura\\UnholyAura.mdl",GetRectCenterX(Spawn[i]),GetRectCenterY(Spawn[i]))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",GetRectCenterX(Spawn[i2]),GetRectCenterY(Spawn[i2])))
set effect2 = AddSpecialEffect("Abilities\\Spells\\NightElf\\CorrosiveBreath\\ChimaeraAcidTargetArt.mdl",GetRectCenterX(Spawn[i2]),GetRectCenterY(Spawn[i2]))
set F = CreateUnit(Player(i),'e00C',GetRectCenterX(Spawn[i2]),GetRectCenterY(Spawn[i2]),GetRandomReal(0,360))
call UnitAddAbility(F,'Arav')
call UnitApplyTimedLife(F,'BTLF',180) //180
call TriggerSleepAction(2.)
set Shadows[i] = CreateUnit(Player(i),'ushd',GetRectCenterX(Spawn[i2]),GetRectCenterY(Spawn[i2]),GetRandomReal(0,360))
set ShadowsGroup[i] = CreateGroup()
set B = Condition(function ShadowsGroup_F)
call GroupEnumUnitsInRect(ShadowsGroup[i],bj_mapInitialPlayableArea,B)
set ShadowsStacks[i] = 0
set Ss = ""
if GetLocalPlayer() == Player(i) then
set Ss = I2S(ShadowsStacks[i])
endif
set tg = CreateTextTagUnitBJ( Ss, Shadows[i], 25.00, 10.00, 50.00, 10.00, 50.00, 15.00 )
call SaveTextTagHandle(Hash,GetHandleId(Shadows[i]),4,tg)
set Shukuchi = CreateTrigger()
call TriggerRegisterUnitInRange(Shukuchi, Shadows[i], 30, B)
call SaveTriggerHandle(Hash,GetHandleId(Shadows[i]),0, Shukuchi)
if i == 6
call SaveTriggerActionHandle(Hash,GetHandleId(Shadows[i]),1,TriggerAddAction(Shukuchi,function Shukuchi_6))
elseif i == 7
call SaveTriggerActionHandle(Hash,GetHandleId(Shadows[i]),1,TriggerAddAction(Shukuchi,function Shukuchi_7))
elseif i == 8
call SaveTriggerActionHandle(Hash,GetHandleId(Shadows[i]),1,TriggerAddAction(Shukuchi,function Shukuchi_8))
else
call SaveTriggerActionHandle(Hash,GetHandleId(Shadows[i]),1,TriggerAddAction(Shukuchi,function Shukuchi_9))
endif
set T = CreateTimer()
set I = GetHandleId(T)
call SaveUnitHandle(Hash,I,1,Shadows[i])
call SaveEffectHandle(Hash,I,2,effect2)
call SaveInteger(Hash,I,3,i)
call CinematicModeExBJ(false, forceP, bj_CINEMODE_INTERFACEFADE) // should check it
set forceP2 = CreateForce()
set I2 = 6
loop
exitwhen I2 > 8
if I2 != i then
call ForceAddPlayer(forceP2, Player(I2))
endif
I2++
endloop
//if IsPlayerInForce(GetLocalPlayer(),forceP2) then //+++++ REMOVING FOG MASK TO ALLOW PLAYER LOOK FOR MISSLE
//call FogEnable(false)
//call FogMaskEnable(false)
//endif
/*set I2 = 6
loop
exitwhen I2 > 8
if not IsPlayerInForce(I2,forceP) thne
call CinematicModeExBJ(true, UndeadForce, bj_CINEMODE_INTERFACEFADE)
endif
I2++
endloop
*/
call CameraSetSmoothingFactor( 1 )
set F = CreateUnit(Player(i),'e001',GetRectCenterX(Spawn[i2]),GetRectCenterY(Spawn[i2]),0)
//call TriggerSleepAction(.5)
call IssueImmediateOrder(Shadows[i],"windwalk")
/*
if (GetLocalPlayer() == Player(i)) then
call ClearSelection()
call SelectUnit(F, true)
call ForceUIKey( "Z" )
endif
*/
call UnitApplyTimedLife(F,'BTLF',180)
//call RemoveLocation(udg_Missile__Impact)
set S = ""
if (GetLocalPlayer() == Player(i)) then
set S = "Materializing..."
endif
call SaveTimerDialogHandle(Hash,I,6,CreateTimerDialogJ(T,S))
call TimerDialogDisplay(bj_lastCreatedTimerDialog, false) // I should check it
if TEST == true then
set timespawn = 30.
else
set timespawn = 175 //175
endif
call TimerStart(T,timespawn,false,function DreadLord_Spawn) //175 время спавна появления материализации
set T = CreateTimer()
call SaveInteger(Hash,GetHandleId(T),0,i)
call TimerStart(T,8.,false,function DreadLord_Tips)
if (GetLocalPlayer() == Player(i)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
endif
call DestroyForce(forceP)
call DestroyForce(forceP2)
set forceP2 = null
set tg= null
set forceP = null
set effect2 = null
endfunction
//===========================================================================
function InitTrig_DreadLordPitCreating takes nothing returns nothing
set gg_trg_DreadLordPitCreating = CreateTrigger( )
call TriggerAddAction( gg_trg_DreadLordPitCreating, function Trig_DreadLordPitCreating_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_ZiccurateBuilding_Actions takes nothing returns nothing
local real textHeight
local string Ss
integer i = 6
set F = GetTriggerUnit()
call echo(GetUnitName(F))
call KillUnit(LoadUnitHandle(Hash,GetHandleId(F),StringHash("DummyZiccurate")))
loop
exitwhen I > 9
if Shadows[I] == F then
call echo("nomer " + I2S(I))
set ShadowsStacks[I] = 0
set textHeight = 10 * 0.023 / 10
set Ss = ""
if GetLocalPlayer() == Player(I) then
set Ss = I2S(ShadowsStacks[I])
endif
call SetTextTagText(LoadTextTagHandle(Hash,GetHandleId(Shadows[9]),4), Ss, textHeight)
endif
I++
endloop
endfunction
//===========================================================================
function InitTrig_ZiccurateBuilding takes nothing returns nothing
set gg_trg_ZiccurateBuilding = CreateTrigger( )
// call TriggerRegisterAnyUnitEventBJ( gg_trg_ZiccurateBuilding, EVENT_PLAYER_UNIT_CONSTRUCT_START )
call TriggerRegisterPlayerUnitEvent(gg_trg_ZiccurateBuilding, Player(6), EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_ZiccurateBuilding, Player(7), EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_ZiccurateBuilding, Player(8), EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_ZiccurateBuilding, Player(9), EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
call TriggerAddAction( gg_trg_ZiccurateBuilding, function Trig_ZiccurateBuilding_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DreadLordLVLup_Actions takes nothing returns nothing
set F = GetTriggerUnit()
call echo(GetUnitName(F))
set I = GetPlayerId(GetOwningPlayer(F))
call echo(I2S(I))
//call echo("gets")
if IsUnitInGroup(F,DreadLords) then
//call echo("gets")
if LVLUPadditionalHL[I] == 0 then
set LVLUPadditionalHL[I] = 1
endif
set LVLUPadditionalHL[I] = LVLUPadditionalHL[I] + 1
//call echo(I2S(LVLUPadditionalHL[I]))
//call UnitAddAbility(F,'A016')
call SetUnitAbilityLevel(F,'A017',LVLUPadditionalHL[I])
endif
endfunction
//===========================================================================
function InitTrig_DreadLordLVLup takes nothing returns nothing
set I = 0
loop
exitwhen I > 11
set LVLUPadditionalHL[I] = 0
I++
endloop
set gg_trg_DreadLordLVLup = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_DreadLordLVLup, EVENT_PLAYER_HERO_LEVEL )
call TriggerAddAction( gg_trg_DreadLordLVLup, function Trig_DreadLordLVLup_Actions )
endfunction
//TESH.scrollpos=483
//TESH.alwaysfold=0
scope DreadLordScope initializer DreadLord_Init
function Rain_Loop takes nothing returns nothing
local rect rct
local real r
local real x
local real y
local real radius
local real damage
local real destination
local timer t = GetExpiredTimer()
//set T =
set ID = GetHandleId(t)
set X = LoadReal(Hash,ID,StringHash("Rain_X"))
set Y = LoadReal(Hash,ID,StringHash("Rain_Y"))
set F = LoadUnitHandle(Hash,ID,StringHash("Rain_c"))
set I = LoadInteger(Hash,ID,StringHash("Rain_I"))
set I2 = LoadInteger(Hash,ID,StringHash("Rain_Max"))
set R = LoadReal(Hash,ID,StringHash("Rain_Damage"))
set rct = RectFromCenterSizeJ(X,Y,600,600)
//call echo("www")
if GetUnitCurrentOrder(F) == String2OrderId("drain") then
//call echo("does")
call SaveReal(Hash,GetHandleId(F),StringHash("DreadInvis"),4.)
if I == 0 then
//call echo("FIRST TIME")
set I = 1
set r = 2.25
set x = X
set y = Y
set R2 = -780
set radius = 250 // 300 has been before
set R = 120 // 160 has been before
set destination = 0.6
else
set destination = 0.6
set R2 = -734
set x = GetRandomReal(GetRectMinX(rct), GetRectMaxX(rct))
set y = GetRandomReal(GetRectMinY(rct), GetRectMaxY(rct))
//set x = GetRandomReal(X-600, X+600)
//set y = GetRandomReal(Y-600, Y+600)
set radius = 200
set r = 1.
set R = 60
endif
//call echo(R2S(R))
//loop
//exitwhen I > 8
set F2 = CreateUnit(GetOwningPlayer(F),'e00Q',x,y,GetRandomReal(0,360))
//if UnitAddAbility(F2,'Amrf') then
call UnitAddAbility(F2,'Arav')
//endif
call SetUnitScale(F2,r,r,r)
call SetUnitFlyHeight(F2,R2,r)
call SaveReal(Hash,GetHandleId(F2),StringHash("Rain_radius"),radius)
//
call GroupAddUnit(RainFire,F2)
call SaveReal(Hash,GetHandleId(F2),StringHash("Rain_Detonation"),destination)
call SaveReal(Hash,GetHandleId(F2),StringHash("Rain_damage"),R)
call SaveUnitHandle(Hash,GetHandleId(F2),StringHash("Rain_caster"),F)
//I++
//endloop
if I < I2 then
//call echo("ddd")
call SaveReal(Hash,ID,StringHash("Rain_Damage"),R) // 80 has been before
I++
call SaveInteger(Hash,ID,StringHash("Rain_I"),I)
else
call RemoveUnit(LoadUnitHandle(Hash,ID,StringHash("Rain_Bar"))) // remove cast bar dummy
call FlushChildHashtable(Hash,ID)
call PauseTimer(t)
call DestroyTimer(t)
endif
else
call RemoveUnit(LoadUnitHandle(Hash,ID,StringHash("Rain_Bar"))) // remove cast bar dummy
call FlushChildHashtable(Hash,ID)
call PauseTimer(t)
call DestroyTimer(t)
endif
call RemoveRect(rct)
set rct = null
set t = null
endfunction
function Circulation_Projectiles_L takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit tr = LoadUnitHandle(Hash,idT,0)
local integer clot = LoadInteger(Hash,idT,3) - 1
local unit c = LoadUnitHandle(Hash,idT,6)
local boolean b = LoadBoolean(Hash,idT,9)
//local location l =
//local location l2 =
local integer i4
if b == true then
set b = false
set i4 = 1
else
set b = true
set i4 = 2
endif
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Source = c
set udg_Missile__Owner = GetOwningPlayer(c)
//set udg_Missile__Target = c
set udg_Missile__Origin = GetUnitLoc(tr)
set udg_Missile__OriginZ = 50.00
set udg_Missile__Impact = GetUnitLoc(c)
set udg_Missile__ImpactZ = 80.00
if DistanceXY(GetUnitX(c),GetUnitY(c),GetUnitX(tr),GetUnitY(tr)) < 230 then
set udg_Missile__FlyTime = 0.45
else
set udg_Missile__FlyTime = 1.15
endif
set udg_Missile__Speed = 250.
set udg_Missile__Collision = 108.00 //64
set udg_Missile__Height = 130// GetRandomReal(110,195) //250.00
set udg_Missile__Damage = 1.00
set udg_Missile__Curve = ( -40.00 + ( 25.00 * I2R( i4 ) ) )
set udg_Missile__Model = "Void Spear.mdx"
set udg_Missile__Scale = 1.10
//"Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
//set udg_Missile__OnCollideUnit = gg_trg_DreadLordGetHealed
set udg_Missile__OnFinish = gg_trg_DreadLordGetHealed
set udg_Missile__Data = 1
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
/*
set udg_Projectile_AttackType = ATTACK_TYPE_NORMAL
set udg_Projectile_Damage = 0.00
set udg_Projectile_DamageType = DAMAGE_TYPE_UNKNOWN
set udg_Projectile_Impact = ""
set udg_Projectile_Height = GetRandomReal(110,170) //GetRandomReal(40,120.)
set udg_Projectile_Model = "Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
set udg_Projectile_Source = tr
set udg_Projectile_Speed = 30.00
set udg_Projectile_TargetUnit = c
set udg_Projectile_Trigger = gg_trg_DreadLordGetHealed
set udg_Projectile_UnitOrPoint = true
set udg_Projectile_HArc = true
set udg_Projectile_HArcWidth = 15.00
set udg_Projectile_HArcLeftOrRight = b // yeah we change it
set udg_Projectile_Size = GetRandomReal(65,100)
call TriggerExecute( gg_trg_CPS_Creating ) */
if clot <= 0 then
//call RemoveSavedReal(Hash,GetHandleId(c),StringHash("Circulation_HPRestoration"))
//call RemoveSavedReal(Hash,GetHandleId(c),StringHash("Circulation_MPRestoration"))
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(Hash,idT)
call KillUnit(tr)
call RemoveUnit(tr)
else
call SaveInteger(Hash,idT,3,clot)
call SaveBoolean(Hash,idT,9,b)
//if clot <= 3 then
//call DestroyEffect(LoadEffectHandle(Hash,idT,11))
//endif
endif
set tr = null
set t = null
set c = null
endfunction
function Circulation_L takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit tr = LoadUnitHandle(Hash,idT,0)
local real time = LoadReal(Hash,idT,3) +0.1
local integer trsp = LoadInteger(Hash,idT,1) - LoadInteger(Hash,idT,5)
local unit c = LoadUnitHandle(Hash,idT,6)
local integer clot = 0
local unit d = LoadUnitHandle(Hash,idT,11)
local integer trsp2 = LoadInteger(Hash,idT,12) + 10
local integer i
local real r
//call echo(R2S(time))
if time <= 0. then
set time = 0.1
endif
if time >= 3. and not IsUnitDead(tr) and GetUnitCurrentOrder(c) == 852101 and not IsUnitDead(c) then
call SaveReal(Hash,GetHandleId(c),StringHash("DreadInvis"),4.)
//call SaveReal(Hash,idT,StringHash("X"),GetUnitX(tr))
//call SaveReal(Hash,idT,StringHash("Y"),GetUnitY(tr))
if GetUnitTypeId(tr) == 'uloc' then
set clot = 1
elseif GetUnitTypeId(tr) == zombiew then
set clot = 2
elseif GetUnitTypeId(tr) == zombie then
set clot = 3
//elseif GetUnitTypeId(tr) == skeletonmage then
//set clot = 4
elseif GetUnitTypeId(tr) == skeleton or GetUnitTypeId(tr) == skeletonarcher or GetUnitTypeId(tr) == skeletonmage then
set clot = 5
elseif GetUnitTypeId(tr) == 'uabo' // abomination
set clot = 1
elseif GetUnitTypeId(tr) == 'nvdw' // void shadow
set clot = 2
endif
//call KillUnit(d)
call RemoveUnit(LoadUnitHandle(Hash,idT,StringHash("E_Bar"))) // removing cast bar dummy
call DestroyEffect(AddSpecialEffect("Soul Discharge Purple.mdx",GetUnitX(tr),GetUnitY(tr)))
call PauseUnit(tr,true)
call ShowUnit(tr,false)
//call RemoveSavedHandle(Hash,idT,0)
if SoulLust then
set Circulation_HPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.54) / clot
set Circulation_MPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.43) / clot
else
set Circulation_HPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.44) / clot
set Circulation_MPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.28) / clot
endif
call SaveReal(Hash,GetHandleId(c),StringHash("Circulation_HPRestoration"),Circulation_HPRestoration[GetPlayerId(GetOwningPlayer(c))])
call SaveReal(Hash,GetHandleId(c),StringHash("Circulation_MPRestoration"),Circulation_MPRestoration[GetPlayerId(GetOwningPlayer(c))])
call PauseTimer(t)
call UnitApplyTimedLife(d,'BTLF',1.)
call RemoveSavedHandle(Hash,idT,12)
call RemoveSavedReal(Hash,idT,3)
call RemoveSavedInteger(Hash,idT,StringHash("C_int"))
call SaveInteger(Hash,idT,3,clot)
call SaveBoolean(Hash,idT,9,true)
call TimerStart(t,0.2,true,function Circulation_Projectiles_L)
//call echo("МИИИИ")
elseif time < 3. and not IsUnitDead(tr) and GetUnitCurrentOrder(c) == 852101 and not IsUnitDead(c) then
call SaveReal(Hash,GetHandleId(c),StringHash("DreadInvis"),4.)
if trsp > 2 then
call SetUnitVertexColor(tr,100,100,100,trsp)
endif
if trsp2 <= 255 then
call SetUnitVertexColor(d,100,100,100,trsp2)
endif
call SaveInteger(Hash,idT,1,trsp)
call SaveInteger(Hash,idT,12,trsp2)
call SaveReal(Hash,idT,3,time )
if time == 2.5 then
call SaveInteger(Hash,idT,5,10)
endif
else
call RemoveUnit(LoadUnitHandle(Hash,idT,StringHash("E_Bar"))) // removing cast bar dummy
//if IsUnitDead(tr)
//call echo("миша давай по новой")
set i = LoadInteger(Hash,idT,StringHash("C_int"))
//call DestroyCastBar(Preservation_Bar[i])
call KillUnit(d)
call KillUnit(tr)
call PauseTimer(t)
call DestroyTimer(t)
//call DestroyEffect(LoadEffectHandle(Hash,idT,11))
call FlushChildHashtable(Hash,idT)
call SetUnitVertexColor(tr,100,100,100,255)
if SoulLust then
//set F = CreateUnit(GetOwningPlayer(c),'e008',GetUnitX(tr),GetUnitY(tr),0)
//call UnitApplyTimedLife(F,'BTLF',2.5)
call DestroyEffect(AddSpecialEffect("DreamFunnel.mdx",GetUnitX(tr),GetUnitY(tr)))
if GetUnitTypeId(tr) == 'uloc' then
set clot = 1
elseif GetUnitTypeId(tr) == zombiew then
set clot = 2
elseif GetUnitTypeId(tr) == zombie then
set clot = 3
elseif GetUnitTypeId(tr) == skeleton or GetUnitTypeId(tr) == skeletonarcher or GetUnitTypeId(tr) == skeletonmage then
set clot = 5
endif
if SoulLust then
set Circulation_HPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.49)
set Circulation_MPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.28)
else
set Circulation_HPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.34)
set Circulation_MPRestoration[GetPlayerId(GetOwningPlayer(c))] = (GetUnitState(tr,UNIT_STATE_MAX_LIFE) * 0.18)
endif
call GroupClear(P)
set B = Condition(function SoulLust_F)
call GroupEnumUnitsInRange(P,GetUnitX(tr),GetUnitY(tr),550,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
set d = CreateUnit(GetOwningPlayer(c),dummy,GetUnitX(d),GetUnitY(d),0)
call UnitApplyTimedLife(d,'BTLF',0.1)
call UnitAddAbility(d,'Ablo')
call IssueTargetOrder(d,"bloodlust",F)
//call echo("bloodlust")
call SetUnitLife(F,GetUnitLife(F) + Circulation_HPRestoration[GetPlayerId(GetOwningPlayer(c))] / 2.)
call GroupRemoveUnit(P,F)
endloop
//call echo("МИИИИ")
call DestroyBoolExpr(B)
endif
endif
set tr = null
set t = null
set c = null
set d = null
endfunction
function FelShield_End takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit c = LoadUnitHandle(Hash,idT,0)
if GetUnitAbilityLevel(c,'B001') > 0 then
call RemoveSavedReal(Hash,GetHandleId(c),StringHash("FS_r"))
call UnitRemoveAbility(c,'B001')
endif
call UnitRemoveAbility(c,'A018')
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
set c = null
endfunction
function Trig_DreadLordSkills_Actions takes nothing returns boolean
local unit c = GetSpellAbilityUnit()
local timer t
local integer idT
local unit tr
local real x
local real y
local real r
local string s
local integer trsp
local unit d
local integer typ
local integer i
local real dmg
local integer i2
if GetSpellAbilityId() == 'A006' then // ESSENCE PRESERVATION
set tr = GetSpellTargetUnit()
set trsp = 225
call PauseUnit(tr,true)
call PlaySoundOnUnit( gg_snd_SoulPreservation, 75, tr,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 950.00 )
call SetUnitVertexColor(tr,100,100,100,trsp)
set F = CreateUnit(GetOwningPlayer(c),dummy,GetUnitX(tr),GetUnitY(tr),0)
call UnitApplyTimedLife( F ,'BTLF' , 0.1 )
call UnitAddAbility(F,'A007')
//call SetUnitAbilityLevel(d,'A03K',LVL)
call IssueTargetOrder(F,"innerfire",tr)
set t = CreateTimer()
set idT = GetHandleId(t)
call SaveUnitHandle(Hash,idT,0 ,tr)
call SaveUnitHandle(Hash,idT,6 ,c)
call SaveInteger(Hash,idT,1 ,trsp)
call SaveInteger(Hash,idT,5 ,6)
set udg_ProgressBarSpeed = 3.
set udg_Height = 200.00
//udg_HandleID = GetTriggerUnit()
//set udg_Point = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 15.00, 180.00)
set x = GetUnitX(c) + 15 * Cos(180 * bj_DEGTORAD) // default 15 and 180
set y = GetUnitY(c) + 15 * Sin(180 * bj_DEGTORAD)
set typ = 0 // transparency
if GetLocalPlayer() == GetOwningPlayer(c) then
set typ = 255
endif
set F = CreateUnit(GetOwningPlayer(c), ProgressBar, x, y, bj_UNIT_FACING )
call SetUnitVertexColor(F,255,255,255,typ) //hl
//call SaveUnitHandleBJ( GetLastCreatedUnit(), 0, GetHandleIdBJ(udg_HandleID), udg_Hash )
call SaveUnitHandle(Hash,idT,StringHash("E_Bar"),F)
//call GroupAddUnitSimple( GetLastCreatedUnit(), udg_ChangeColorGP )
call UnitAddAbility( F, 'Arav' )
//call UnitAddAbilityBJ( 'Arav', GetLastCreatedUnit() )
//call SetUnitFlyHeightBJ( GetLastCreatedUnit(), ( GetUnitFlyHeight(GetTriggerUnit()) + udg_Height ), 0.00 )
call SetUnitFlyHeight(F, GetUnitFlyHeight(c) + udg_Height, 0.) // 0 is default
//call SetUnitTimeScalePercent( GetLastCreatedUnit(), ( ( 1 / udg_ProgressBarSpeed ) * 100.00 ) )
call SetUnitTimeScale(F, (( 1 / udg_ProgressBarSpeed ) * 100.00 ) * 0.01)
//call SaveEffectHandle(Hash,idT,11,AddSpecialEffect("VoidSkullAura_v5.mdx",GetUnitX(tr),GetUnitY(tr)))
set d = CreateUnit(GetOwningPlayer(c),'e000',GetUnitX(tr),GetUnitY(tr),0)
call SaveUnitHandle(Hash,idT,11,d)
set trsp = 120
call SaveInteger(Hash,idT,12,trsp)
call SetUnitVertexColor(d,255,255,255,trsp)
//set i = GetPlayerId(GetOwningPlayer(c))
set Preservation_Integer = Preservation_Integer + 1
// function CreateCastBarAtPos takes real x, real y, real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
// set Preservation_Bar[Preservation_Integer] = CreateCastBarAtPos(GetUnitX(c),GetUnitY(c), 3.00, 110, "preservation", true, true)
// Set the color
//call SetCastBarColor(Preservation_Bar[Preservation_Integer], 0.5, 0.3, 0.8, 1)
// call CastBarShowText(Preservation_Bar[Preservation_Integer],false)
//if GetLocalPlayer() != GetOwningPlayer(c) then
//Make the CastBar transparent
//call CastBarShow(Preservation_Bar[Preservation_Integer],false)
//call SetCastBarColor(Preservation_Bar[i], 0, 0, 0, 0)
//endif
call SaveInteger(Hash,idT,StringHash("C_int"),Preservation_Integer)
call TimerStart(t,0.1,true,function Circulation_L)
elseif GetSpellAbilityId() == 'A008' then // TRACK
set tr = GetSpellTargetUnit()
set i = GetUnitAbilityLevel(c,'A008')
if not IsUnitType(tr,UNIT_TYPE_HERO) then
set r = 45.
else
set r = 20.
endif
if IsUnitInGroup(tr,ShareVisionGroup) then
call SaveReal(Hash,GetHandleId(tr),StringHash("SV_r"),r)
call SaveInteger(Hash,GetHandleId(tr),StringHash("SV_i"),i)
call KillUnit(LoadUnitHandle(Hash,GetHandleId(tr),StringHash("SV_d")))
else
call SaveReal(Hash,GetHandleId(tr),StringHash("SV_r"),r)
call SaveInteger(Hash,GetHandleId(tr),StringHash("SV_i"),i)
call GroupAddUnit(ShareVisionGroup,tr)
set s = ""
if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
set s = "Pearlescence.mdx" //"HuntersMarkTarget.mdx"
endif
call SaveEffectHandle(Hash,GetHandleId(tr),StringHash("SV_e"),AddSpecialEffectTarget(s,tr,"head")) // overhead
endif
if i == 1 then
set typ = 'e001'
elseif i == 2 then
set typ = 'e002'
else
set typ = 'e003'
endif
set d = CreateUnit(GetOwningPlayer(c),typ,GetUnitX(tr),GetUnitY(tr),0)
call SaveUnitHandle(Hash,GetHandleId(tr),StringHash("SV_d"),d)
elseif GetSpellAbilityId() == 'A009' then // FEL SHIELD
set i = GetUnitAbilityLevel(c,'A009')
//call SaveEffectHandle(Hash,GetHandleId(c),StringHash("FS_e"),/*
// */AddSpecialEffectTarget("DemonShieldTarget3A.mdx",c,"chest"))
if i == 1 then
set r = 190
set i2 = 6 // +1 and we get the the number of hp reg
elseif i == 2 then
set r = 290
set i2 = 11
else
set r = 390
set i2 = 16
endif
//call echo("ыввы")
call UnitAddAbility(c,'A018')
call SetUnitAbilityLevel(c,'A018',i2)
call SaveReal(Hash,GetHandleId(c),StringHash("FS_r"),r)
set d = CreateUnit(GetOwningPlayer(c),dummy,GetUnitX(c),GetUnitY(c),0)
call UnitApplyTimedLife( d ,'BTLF' , 0.1 )
call UnitAddAbility(d,'A00A')
//call SetUnitAbilityLevel(d,'A03K',LVL)
call IssueTargetOrder(d,"innerfire",c)
set t = CreateTimer()
call SaveUnitHandle(Hash,GetHandleId(t),0,c)
call TimerStart(t,12.,false,function FelShield_End)
elseif GetSpellAbilityId() == 'A00C' then // ARCANE TERROR arcane terror
set tr = GetSpellTargetUnit()
call PlaySoundOnUnit( gg_snd_GargoyleMissileLaunch3, 85, c,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 850.00 )
set i = GetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_LUMBER)
if i < 10 then
set r = 0.
elseif i >= 10 and i < 20 then
set r = 1.
elseif i >= 20 and i < 30 then
set r = 2.
elseif i >= 30 then
set r = 3.
endif
set i2 = GetUnitAbilityLevel(c,'A00C')
if i2 == 1 then
set dmg = 30
elseif i2 == 2 then
set dmg = 45
else
set dmg = 60
endif
//call AdjustPlayerStateJ( R2I(-r), GetOwningPlayer(c), PLAYER_STATE_RESOURCE_LUMBER )
set ArcaneTerror_Level[GetPlayerId(GetOwningPlayer(c))] = i2
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Source = c
set udg_Missile__Owner = GetOwningPlayer(c)
set udg_Missile__Target = tr
set udg_Missile__Origin = GetUnitLoc(c)
set udg_Missile__OriginZ = 90.00
set udg_Missile__Impact = GetUnitLoc(tr)
set udg_Missile__ImpactZ = 90.00
//set udg_Missile__FlyTime = 1.15
set udg_Missile__Speed = 440 + ( r* 20 ) //840
set udg_Missile__Collision = 90.00 + (r*4)// 64
set udg_Missile__Height = 130// GetRandomReal(110,195) //250.00
set udg_Missile__Damage = 110.00 + (dmg * r) //110
// set ArcaneTerror_Damage[GetPlayerId(GetOwningPlayer(c))] = 110.00 + (dmg * r)
//set udg_Missile__Curve = ( -40.00 + ( 25.00 * I2R( i4 ) ) )
set udg_Missile__Model = "OrbOfCorruption.mdx"
set udg_Missile__Scale = 0.8 + ( 0.2 * r )
//set udg_Missile__OnCollideUnit = gg_trg_DreadLordGetHealed
set udg_Missile__OnFinish = gg_trg_ArcaneTerror
set udg_Missile__Data = 1
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
/* set udg_Projectile_AttackType = ATTACK_TYPE_MAGIC
set udg_Projectile_Damage = 110.00 + (dmg * r)
set udg_Projectile_DamageType = DAMAGE_TYPE_MAGIC
set udg_Projectile_Impact = "Punishment_Missle.mdx"
set udg_Projectile_Height = 105.00 //60
set udg_Projectile_Model = "Punishment_Missle.mdx"
set udg_Projectile_Source = c
set udg_Projectile_Speed = 27.00 //25 - (1 * r)
set udg_Projectile_TargetUnit = tr
set udg_Projectile_Trigger = gg_trg_ArcaneTerror
set udg_Projectile_UnitOrPoint = true
set udg_Projectile_Size = 80.00 + (20 * r)//100
call TriggerExecute( gg_trg_CPS_Creating ) */
elseif GetSpellAbilityId() == 'A01E' then // VOID METEORS
//call echo("1")
set X = GetSpellTargetX()
set Y = GetSpellTargetY()
set I = GetUnitAbilityLevel(c,'A01E')
set T = CreateTimer()
set ID = GetHandleId(T)
if I == 1 then
set i = 15
call SaveReal(Hash,ID,StringHash("Rain_Damage"),120) //80 has been before 4.5
endif
set I2 = 0
set i = 15
loop
exitwhen I2 > 15
if GreatSources[I2] != null then
set i = i + 2
endif
I2++
endloop
set r = 7/I2R(i) // 7/I2R(i)
//call echo(R2S(r))
//call echo("work")
set udg_ProgressBarSpeed = 7.5
set udg_Height = 200.00
//udg_HandleID = GetTriggerUnit()
//set udg_Point = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 15.00, 180.00)
set x = GetUnitX(c) + 15 * Cos(180 * bj_DEGTORAD) // default 15 and 180
set y = GetUnitY(c) + 15 * Sin(180 * bj_DEGTORAD)
set typ = 0 // transparency
if GetLocalPlayer() == GetOwningPlayer(c) then
set typ = 255
endif
set F = CreateUnit(GetOwningPlayer(c), ProgressBar, x, y, bj_UNIT_FACING )
call SetUnitVertexColor(F,255,255,255,typ) //hl
//call SaveUnitHandleBJ( GetLastCreatedUnit(), 0, GetHandleIdBJ(udg_HandleID), udg_Hash )
call SaveUnitHandle(Hash,ID,StringHash("Rain_Bar"),F)
//call GroupAddUnitSimple( GetLastCreatedUnit(), udg_ChangeColorGP )
call UnitAddAbility( F, 'Arav' )
//call UnitAddAbilityBJ( 'Arav', GetLastCreatedUnit() )
//call SetUnitFlyHeightBJ( GetLastCreatedUnit(), ( GetUnitFlyHeight(GetTriggerUnit()) + udg_Height ), 0.00 )
call SetUnitFlyHeight(F, GetUnitFlyHeight(c) + udg_Height, 0.) // 0 is default
//call SetUnitTimeScalePercent( GetLastCreatedUnit(), ( ( 1 / udg_ProgressBarSpeed ) * 100.00 ) )
call SetUnitTimeScale(F, (( 1 / udg_ProgressBarSpeed ) * 100.00 ) * 0.01)
call SaveInteger(Hash,ID,StringHash("Rain_Max"),i) //6
call SaveReal(Hash,ID,StringHash("Rain_X"),X)
call SaveReal(Hash,ID,StringHash("Rain_Y"),Y)
call SaveUnitHandle(Hash,ID,StringHash("Rain_c"),c)
call TimerStart(T,r,true,function Rain_Loop) //0.85
endif
if GetSpellAbilityId() != 'A008' then
//call echo("cast refresh")
call SaveReal(Hash,GetHandleId(c),StringHash("DreadInvis"),4.)
if GetUnitAbilityLevel(c,Invis) > 0 then
//call echo("cast remove")
call UnitRemoveAbility(c,Invis)
call GroupAddUnit(DreadStealth,c)
endif
endif
set t = null
set tr = null
set d = null
set c = null
return false
endfunction
function Pres_PreCast_C takes nothing returns boolean
local unit c = GetSpellAbilityUnit()
local unit tr
local real r
local integer i
if GetSpellAbilityId() == 'A006' then
set tr = GetSpellTargetUnit()
if IsUnitPaused(tr) then
call DropOrder(c) //tr lol
if GetUnitAbilityLevel(tr,'B000') > 0 then
call SimError(GetOwningPlayer(c),"The target is already focused.")
else
call SimError(GetOwningPlayer(c),"Wait.")
endif
if GetUnitAbilityLevel(tr,'B000') > 0 then
call SimError(GetOwningPlayer(c),"The target is already focused.")
call DropOrder(c)
endif
endif
endif
set tr = null
set c = null
return false
endfunction
//===========================================================================
function DreadLord_Init takes nothing returns nothing
local trigger Preserv_PreCast = CreateTrigger()
local unit d
set d = CreateUnit(Player(13),'e001',0,0,0)
call UnitAddAbility(d,'A00A')
call UnitAddAbility(d,'A00B')
call UnitAddAbility(d,'A00H')
call SetUnitAbilityLevel(d,'A00H',3)
call RemoveUnit(d)
set d = CreateUnit(Player(13),'e002',0,0,0)
call RemoveUnit(d)
set d = CreateUnit(Player(13),'e003',0,0,0)
call RemoveUnit(d)
set d = CreateUnit(Player(13),'e008',0,0,0)
call RemoveUnit(d)
set gg_trg_DreadLordSkills = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_DreadLordSkills, gg_unit_Udre_0043, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_DreadLordSkills, gg_unit_U000_0551, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_DreadLordSkills, gg_unit_U001_0718, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_DreadLordSkills, gg_unit_U002_0716, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent(Preserv_PreCast,gg_unit_Udre_0043,EVENT_UNIT_SPELL_CAST)
call TriggerRegisterUnitEvent(Preserv_PreCast,gg_unit_U000_0551,EVENT_UNIT_SPELL_CAST)
call TriggerRegisterUnitEvent(Preserv_PreCast,gg_unit_U001_0718,EVENT_UNIT_SPELL_CAST)
call TriggerRegisterUnitEvent(Preserv_PreCast,gg_unit_U002_0716,EVENT_UNIT_SPELL_CAST)
if TEST == true then
call TriggerRegisterUnitEvent( gg_trg_DreadLordSkills, gg_unit_Udre_0818, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent(Preserv_PreCast,gg_unit_Udre_0818,EVENT_UNIT_SPELL_CAST)
else
call RemoveUnit(gg_unit_Udre_0818)
call ShowUnit(gg_unit_Ucrl_0723, false)
endif
call TriggerAddCondition( gg_trg_DreadLordSkills, Condition(function Trig_DreadLordSkills_Actions ))
call TriggerAddCondition( Preserv_PreCast, Condition(function Pres_PreCast_C ))
set Preserv_PreCast = null
set d = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ArcaneTerror_Actions takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(udg_Missile__Source))
set udg_Missile__WantDestroy = true
call UnitDamageTarget(udg_Missile__Source,udg_Missile__Target,udg_Missile__Damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call PlaySoundOnUnit( gg_snd_DemonHunterMissileHit3, 80, udg_Missile__Target,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 850.00 )
//call PolledWait(0.5)
set F = CreateUnit(GetOwningPlayer(udg_Missile__Source),dummy,GetUnitX(udg_Missile__Target),GetUnitY(udg_Missile__Target),0)
call UnitApplyTimedLife( F,'BTLF' , 0.1 )
call UnitAddAbility(F,'A00H')
call SetUnitAbilityLevel(F,'A00H',ArcaneTerror_Level[i])
//call echo(I2S(ArcaneTerror_Level[GetPlayerId(GetOwningPlayer(AC_Caster))]))
//call SetUnitAbilityLevel(F,'A03K',LVL)
call IssueTargetOrder(F,"cripple",udg_Missile__Target)
//call UnitDamageTarget(udg_Missile_Source,udg_Missile_Target,ArcaneTerror_Damage[i])
endfunction
//===========================================================================
function InitTrig_ArcaneTerror takes nothing returns nothing
set gg_trg_ArcaneTerror = CreateTrigger( )
call TriggerAddAction( gg_trg_ArcaneTerror, function Trig_ArcaneTerror_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DreadLordGetHealed_Actions takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(udg_Missile__Source))
local real R3
set udg_Missile__WantDestroy = true
set R = LoadReal(Hash,GetHandleId(udg_Missile__Source),StringHash("Circulation_HPRestoration"))
set R2 = LoadReal(Hash,GetHandleId(udg_Missile__Source),StringHash("Circulation_MPRestoration"))
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl",udg_SPSD_TargetUnit,"chest"))
if GetUnitMaxLife(udg_Missile__Source) > 0 and not IsUnitDead(udg_Missile__Source) then
set R3 = GetUnitLife(udg_Missile__Source) / GetUnitMaxLife(udg_Missile__Source) * 100.0
else
set R3 = 0.
endif
if R3 < 100 then
if GetInventoryIndexOfItemTypeJ(udg_Missile__Source, 'sprn') > 0 and GetInventoryIndexOfItemTypeJ(udg_Missile__Source, 'stwa') > 0 then
set R = R * 1.21
elseif GetInventoryIndexOfItemTypeJ(udg_Missile__Source, 'sprn') > 0
set R = R * 1.01
elseif GetInventoryIndexOfItemTypeJ(udg_Missile__Source, 'stwa') > 0
set R = R * 1.2
endif
call SetUnitLife(udg_Missile__Source,GetUnitLife(udg_Missile__Source) + R)
endif
if GetUnitStatePercentJ(udg_Missile__Target, UNIT_STATE_MANA, UNIT_STATE_MAX_MANA) < 100 then
call SetUnitState(udg_Missile__Source,UNIT_STATE_MANA,GetUnitState(udg_Missile__Source,UNIT_STATE_MANA) + R2)
endif
call AdjustPlayerStateJ( 1, GetOwningPlayer(udg_Missile__Source), PLAYER_STATE_RESOURCE_LUMBER )
endfunction
//===========================================================================
function InitTrig_DreadLordGetHealed takes nothing returns nothing
set gg_trg_DreadLordGetHealed = CreateTrigger( )
call TriggerAddAction( gg_trg_DreadLordGetHealed, function Trig_DreadLordGetHealed_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_GREATPORTALHEAL_Actions takes nothing returns nothing
local real R3
local integer i = GetPlayerId(GetOwningPlayer(udg_Missile__Source))
set udg_Missile__WantDestroy = true
set R = LoadReal(Hash,GetHandleId(udg_Missile__Source),StringHash("Circulation2_HPRestoration"))
set R2 = LoadReal(Hash,GetHandleId(udg_Missile__Source),StringHash("Circulation2_MPRestoration"))
if GetUnitMaxLife(udg_Missile__Source) > 0 and not IsUnitDead(udg_Missile__Source) then
set R3 = GetUnitLife(udg_Missile__Source) / GetUnitMaxLife(udg_Missile__Source) * 100.0
else
set R3 = 0.
endif
//call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl",udg_SPSD_TargetUnit,"chest"))
if R3 < 100 then
call SetUnitLife(udg_Missile__Source,GetUnitLife(udg_Missile__Source) + R)
endif
if GetUnitStatePercentJ(udg_Missile__Target, UNIT_STATE_MANA, UNIT_STATE_MAX_MANA) < 100 then
call SetUnitState(udg_Missile__Source,UNIT_STATE_MANA,GetUnitState(udg_Missile__Source,UNIT_STATE_MANA) + R2)
endif
call AdjustPlayerStateJ( 1, GetOwningPlayer(udg_Missile__Source), PLAYER_STATE_RESOURCE_LUMBER )
endfunction
//===========================================================================
function InitTrig_GREATPORTALHEAL takes nothing returns nothing
set gg_trg_GREATPORTALHEAL = CreateTrigger( )
call TriggerAddAction( gg_trg_GREATPORTALHEAL, function Trig_GREATPORTALHEAL_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DreadEssenseChange_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i
set DreadEssence = GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
set i = 6
loop
exitwhen i > 9
call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_LUMBER,DreadEssence)
set i = i + 1
endloop
set p = null
endfunction
//===========================================================================
function InitTrig_DreadEssenseChange takes nothing returns nothing
set gg_trg_DreadEssenseChange = CreateTrigger( )
call TriggerRegisterPlayerStateEvent( gg_trg_DreadEssenseChange, Player(6), PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerRegisterPlayerStateEvent( gg_trg_DreadEssenseChange, Player(7), PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerRegisterPlayerStateEvent( gg_trg_DreadEssenseChange, Player(8), PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerRegisterPlayerStateEvent( gg_trg_DreadEssenseChange, Player(9), PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN_OR_EQUAL, 0.00 )
call TriggerAddAction( gg_trg_DreadEssenseChange, function Trig_DreadEssenseChange_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CreepSpells_Actions takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local unit tr
if UnitTypeNotDummy(c) then
if GetSpellAbilityId() == 'Auhf' then
set tr= GetSpellTargetUnit()
call GroupAddUnit(RageOfTheDamned,tr)
elseif GetSpellAbilityId() == 'Aply' then
//call GroupAddUnit(Sorcerers, c)
// call SaveReal(Hash, GetHandleId(c), StringHash("POL_r"), 10.)
elseif GetSpellAbilityId() == 'A00Q' then
set tr= GetSpellTargetUnit()
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Source = c
set udg_Missile__Owner = GetOwningPlayer(c)
set udg_Missile__Target = tr
set udg_Missile__Origin = GetUnitLoc(c)
set udg_Missile__OriginZ = 90.00
set udg_Missile__Impact = GetUnitLoc(tr)
set udg_Missile__ImpactZ = 90.00
//set udg_Missile__FlyTime = 1.15
set udg_Missile__Speed = 790
set udg_Missile__Collision = 100.00 // 64
set udg_Missile__Height = 170// GetRandomReal(110,195) //250.00
set udg_Missile__Damage = 115
// set ArcaneTerror_Damage[GetPlayerId(GetOwningPlayer(c))] = 110.00 + (dmg * r)
//set udg_Missile__Curve = ( -40.00 + ( 25.00 * I2R( i4 ) ) )
set udg_Missile__Model = "SolarBlast2.mdx"
set udg_Missile__Scale = 1.
//set udg_Missile__OnCollideUnit = gg_trg_DreadLordGetHealed
set udg_Missile__OnFinish = gg_trg_HolySmite
set udg_Missile__Data = 1
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
endif
endif
set tr= null
set c = null
endfunction
//===========================================================================
function InitTrig_CreepSpells takes nothing returns nothing
set gg_trg_CreepSpells = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_CreepSpells, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_CreepSpells, Player(4), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_CreepSpells, Player(5), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_CreepSpells, Player(10), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_CreepSpells, Player(11), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
//call TriggerRegisterAnyUnitEventBJ( gg_trg_CreepSpells, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_CreepSpells, function Trig_CreepSpells_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_HolySmite_Actions takes nothing returns nothing
//local integer i = GetPlayerId(GetOwningPlayer(udg_Missile__Source))
set udg_Missile__WantDestroy = true
call UnitDamageTarget(udg_Missile__Source,udg_Missile__Target,udg_Missile__Damage + GetUnitMaxLife(udg_Missile__Target) * 0.05,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call PlaySoundOnUnit( gg_snd_DemonHunterMissileHit3, 80, udg_Missile__Target )
//call SetSoundDistanceCutoff( bj_lastPlayedSound, 850.00 )
//call PolledWait(0.5)
/*
set F = CreateUnit(GetOwningPlayer(udg_Missile__Source),dummy,GetUnitX(udg_Missile__Target),GetUnitY(udg_Missile__Target),0)
call UnitApplyTimedLife( F,'BTLF' , 0.1 )
call UnitAddAbility(F,'A00P')
call IssueTargetOrder(F,"soulburn",udg_Missile__Target) */ //(GetUnitState(udg_Missile__Target,UNIT_STATE_MAX_LIFE)
endfunction
//===========================================================================
function InitTrig_HolySmite takes nothing returns nothing
set gg_trg_HolySmite = CreateTrigger( )
call TriggerAddAction( gg_trg_HolySmite, function Trig_HolySmite_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function PlayerLost takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local string s
set I = LoadInteger(Hash,idT,0)
if I != 4 and I <= 11 then
if I < 5 then
if RusTips == false then
set s = "|c00FA6343Paladin"
else
set s = "|c00FA6343Paladin"
endif
else
set s = "|c0000AE57DreadLord"
endif
if RusTips == false then
call Msg(" " + GetColoredPlayerName( I ) + "|r " + s +" |c00E35782 has died!",5.5)
else
call Msg(" " + GetColoredPlayerName( I ) + "|r " + s +" |c00E35782 был убит!",5.5)
endif
endif
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
endfunction
function SpawnPaladinKnight2 takes nothing returns nothing
local timer t = GetExpiredTimer()
//set T
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0) //I
if GameOver != true then
call SetUnitAnimation( gg_unit_hbar_0084, "stand" )
set F = CreateUnit(Player(I2),'hkni',-2443., 3092,275.)
call TriggerRegisterUnitEvent( gg_trg_PaladinsSkills, F, EVENT_UNIT_SPELL_EFFECT )
set Knight[I2] = F
//if GetLocalPlayer() == Player(I2) then
//call StartSound( gg_snd_ArrangedTeamInvitation )
//call StartSound( gg_snd_KnightPissed5 )
//endif
else
//call echo("game is ended 3")
endif
call FlushChildHashtable(Hash,I)
call DestroyTimer(t)
set t=null
endfunction
function SpawnPaladinKnight takes nothing returns nothing
local timer t = GetExpiredTimer()
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0) //I
if GameOver != true
if (GetLocalPlayer() == Player(I2)) then
call PanCameraToTimed(-2690., 3570, 2.5)
endif
call SetUnitAnimation( gg_unit_hbar_0084, "stand work" )
endif
call TimerStart(t,3.5,false,function SpawnPaladinKnight2) //3.5
set t = null
endfunction
function SpawnPaladin takes nothing returns nothing
local timer t = GetExpiredTimer()
local timerdialog td
//set T =
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0) //I
set td =LoadTimerDialogHandle(Hash,I,6)
call DestroyTimerDialog(td)
call RemoveUnit(Knight[I2])
call SetUnitAnimation( gg_unit_hbar_0084, "stand" )
if GameOver != true
if (GetLocalPlayer() == Player(I2)) then
call PanCameraToTimed(-2443., 3092, 2.5)
endif
//call SetUnitAnimation( gg_unit_hbar_0085, "stand work" )
endif
call ReviveHero(HERO[I2],-2443., 3092,false)
call SetUnitLife(HERO[I2],GetUnitMaxLife(HERO[I2]))
call FlushChildHashtable(Hash,I)
call DestroyTimer(t)
set t = null
set td = null
endfunction
function RevivePaladin takes nothing returns nothing
local timer t = GetExpiredTimer()
//set T = GetExpiredTimer()
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0) //I
call SetUnitAnimation( gg_unit_hbar_0084, "stand work" )
if (GetLocalPlayer() == Player(I2)) then
call PanCameraToTimed(-2438., 3083, 1.5)
endif
set PaladinsCount = PaladinsCount + 1
if LeaderBoardActive == true then
call LeaderboardSetItemValue(CilivianzAlive, LeaderboardGetPlayerIndex(CilivianzAlive, Player(5)), PaladinsCount)
endif
if GameOver != true then
//call MsgP(GetPlayerId(Player(I2)), "The Paladin Knight is called to serve you." ,5.)
call TimerStart(t,6,false,function SpawnPaladin) //6
else
//call echo("game is ended 2")
call FlushChildHashtable(Hash,I)
call DestroyTimer(t)
endif
set t = null
endfunction
function ReviveDreadLord takes nothing returns nothing
local timer t = GetExpiredTimer()
local timerdialog td
//set T =
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0)
set td = LoadTimerDialogHandle(Hash,I,6)
call DestroyTimerDialog(td)
if (GetLocalPlayer() == Player(I2)) then
call PanCameraToTimed(11900., 10080, 1.5)
endif
set DreadLordsCount = DreadLordsCount + 1
if LeaderBoardActive then
call LeaderboardSetItemValue(CilivianzAlive, LeaderboardGetPlayerIndex(CilivianzAlive, Player(6)), DreadLordsCount)
endif
if I2 == 6
//call SetUnitX(HERO[I2],)
//call SetUnitY(HERO[I2],)
//set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P6Spawn),GetRectCenterY(gg_rct_P6Spawn),180.)
elseif I2 == 7
call SetUnitX(HERO[I2],GetRectCenterX(gg_rct_P7Spawn))
call SetUnitY(HERO[I2],GetRectCenterY(gg_rct_P7Spawn))
//set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P7Spawn),GetRectCenterY(gg_rct_P7Spawn),180.)
elseif I2 == 8
call SetUnitX(HERO[I2],GetRectCenterX(gg_rct_P8Spawn))
call SetUnitY(HERO[I2],GetRectCenterY(gg_rct_P8Spawn))
//set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P8Spawn),GetRectCenterY(gg_rct_P8Spawn),180.)
elseif I2 == 9
call SetUnitX(HERO[I2],GetRectCenterX(gg_rct_P9Spawn))
call SetUnitY(HERO[I2],GetRectCenterY(gg_rct_P9Spawn))
//set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P9Spawn),GetRectCenterY(gg_rct_P9Spawn),180.)
endif
call ReviveHero(HERO[I2],GetRectCenterX(gg_rct_P6Spawn), GetRectCenterY(gg_rct_P6Spawn),false)
call SetUnitLife(HERO[I2],GetUnitMaxLife(HERO[I2]))
call RemoveUnit(DarkSpirit[I2])
call FlushChildHashtable(Hash,I)
call DestroyTimer(t)
set td = null
set t=null
endfunction
function GetCalledPaladinKnight takes nothing returns nothing
local timer t = GetExpiredTimer()
//set T
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0) //I
if GameOver != true then
call MsgP(GetPlayerId(Player(I2)), "The Paladin Knight is called to serve you." ,5.)
call TimerStart(t,6,false,function SpawnPaladinKnight)
else
//call echo("game is ended")
call FlushChildHashtable(Hash,I)
call DestroyTimer(t)
endif
set t=null
endfunction
function Necro_Life takes nothing returns nothing
local timer t = GetExpiredTimer()
//set T
set I = GetHandleId(t)
set I2 = LoadInteger(Hash,I,0)
if (GetLocalPlayer() == Player(I2)) then
call PanCameraToTimed(11900., 10080, 1.5)
endif
if I2 == 6
set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P6Spawn),GetRectCenterY(gg_rct_P6Spawn),180.)
elseif I2 == 7
set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P7Spawn),GetRectCenterY(gg_rct_P7Spawn),180.)
elseif I2 == 8
set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P8Spawn),GetRectCenterY(gg_rct_P8Spawn),180.)
elseif I2 == 9
set F = CreateUnit(Player(I2),'unec',GetRectCenterX(gg_rct_P9Spawn),GetRectCenterY(gg_rct_P9Spawn),180.)
endif
set DarkSpirit[I2] = F
call FlushChildHashtable(Hash,I)
call DestroyTimer(t)
endfunction
function Zombify_End1 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit u = LoadUnitHandle(Hash,idT,StringHash("Z_Undead"))
if DreadInstantKillUnit == true then
call IssuePointOrder(u,"attack",GetUnitX(CrystalShield),GetUnitY(CrystalShield))
elseif FocusedUnit[UGM] != null then
call IssuePointOrder(u,"attack",UndeadFocusX[UGM],UndeadFocusY[UGM])
endif
call FlushChildHashtable(Hash,idT)
call PauseTimer(t)
call DestroyTimer(t)
set u = null
set t = null
endfunction
function Zombify_End takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit u = LoadUnitHandle(Hash,idT,StringHash("Z_Undead"))
local effect e = LoadEffectHandle(Hash,idT,StringHash("Z_Conversion"))
call DestroyEffect(e)
call PauseUnit(u,false)
call PauseTimer(t)
call TimerStart(t,0.9,false,function Zombify_End1)
set u = null
set t = null
set e = null
endfunction
function Zombify_Start2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local real x = LoadReal(Hash,idT,StringHash("Z_x"))
local real y = LoadReal(Hash,idT,StringHash("Z_y"))
local real bb
local real r
local real r2
local unit f
local integer ir
local unit brc
local boolean barrfound
local integer i2
local boolean blt
// local location lc
//local effect e = LoadEffectHandle(Hash,idT,2)
// call DestroyEffect(e)
set UDUNITS = UDUNITS + 1
call ShowUnit(LoadUnitHandle(Hash,idT,StringHash("Z_du")),false)
call RemoveSavedHandle(Hash,idT,StringHash("Z_du"))
set F = CreateUnit(Player(10),LoadInteger(Hash,idT,StringHash("Z_typ")),x,y,bj_UNIT_FACING)
if ConcentratedHorror == true and GetUnitTypeId(F) == 'H00I' then
call DestroyEffect(AddSpecialEffect("war3mapImported\\Desecrate.mdx",GetUnitX(F),GetUnitY(F)))
call SetHeroLevel(F,LoadInteger(Hash,idT,StringHash("Z_PaladinLVL")),false)
endif
set f = PickRandomUnit(Undead[UGM]) // в теории все работает как distunit
if UGM == 1 and UDUNITS == 1 then
set UndeadGroupIsOn[1] = true
elseif UDUNITS >= UndeadMaxCount or DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(f),GetUnitY(f)) > 1300 then
set UDUNITS = 1
set UndeadGroupShouldBeEliminated[UGM] = true
set UGM = UGM + 1 //??? =)
set UndeadGroupIsOn[UGM] = true
set Undead[UGM] = CreateGroup() // создается новая группа, без этого никак. Чуть ниже добавляется юнит
//call echo("UGM == " + I2S(UGM))
//set UDUNITS[UGM-1] = 0
endif
call GroupAddUnit(Undead[UGM],F)
set B = Condition(function PatrolsEnemy_Expr)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1200,B)
set bl = false
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(P,function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null or bl == true
if IsUnitVisible(F2,Player(0)) then
set bl = true
endif
call GroupRemoveUnit(P2,F2)
endloop
set I = 0
if bl == true then
//call echo("visible")
loop
set F2 = FirstOfGroup(P)
exitwhen F2 == null
I++
call GroupRemoveUnit(P,F2)
endloop
if I >= UndeadMaxCount and CaptainActivated then // UndeadMaxCount
//call echo("undead defend patrol")
// before we check like rect contains coord(x,y) and is alive. Then we check is barracks alive and only then we find the nearest barrack in 3500 range
set i2 = 1
set barrfound = false
loop
exitwhen i2 > 12 or barrfound == true
if IsUnitInRegion(LivingRegionGlobal[i2],F) and not IsUnitDead(Barrack[i2]) and ISRECTALIVE[i2] == true and CaptainIsOnCd[i2] != true then
set barrfound = true
set whatBarrack = i2
endif
i2++
endloop
if barrfound != true then
set barrfound = false
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(BarracksGroup,function GroupAddGroupEnumJ)
loop
set brc = GetClosestUnitInGroup(GetUnitX(F),GetUnitY(F),P2)
//set F2 = FirstOfGroup(P2)
exitwhen brc == null or barrfound == true
if not IsUnitDead(brc) and DistanceXY(GetUnitX(brc),GetUnitY(brc),GetUnitX(F),GetUnitY(F)) <= 3500 and ISRECTALIVE[i2] == true and CaptainIsOnCd[i2] != true then
set barrfound = true
endif
call GroupRemoveUnit(P2,brc)
endloop
set i2= 0
set blt = false
loop
exitwhen i2 > 12 or blt == true
if brc == Barrack[i2] then
set whatBarrack = i2
set blt = true
endif
i2++
endloop
if brc != null and barrfound == true and blt == true then
set CaptainX = GetUnitX(F)
set CaptainY = GetUnitY(F)
//set whatBarrack = we already know that
set CaptainCd[whatBarrack] = 46. // ? reduce 6 from this
set CaptainIsOnCd[whatBarrack] = true //?
call TriggerExecute(gg_trg_GetCaptain)
endif
else
set CaptainX = GetUnitX(F)
set CaptainY = GetUnitY(F)
// set Barrack X
//set Barrack Y
set CaptainCd[whatBarrack] = 46. // ?
set CaptainIsOnCd[whatBarrack] = true //?
call TriggerExecute(gg_trg_GetCaptain)
endif
endif
else
//call echo("not visible")
endif
call DestroyBoolExpr(B)
//call IsWalking_Add(F)
//if GetRandomInt(0,100) < 55 then
//set lc = Location(x,y)
//if GetRandomInt(0,100) < 30 then
//set bb = 150.
//else
set bb = 148.
//endif
call SetBlight( Player(8), x ,y, bb,true )
if GetRandomInt(0,100) < 30 then
set ir = GetRandomInt(1,4)
if ir == 1 then
set r = 148
set r2 = -148
elseif ir == 2 then
set r = -148
set r2 = 148
elseif ir == 3 then
set r = -148
set r2 = -148
else
set r = 148
set r2 = 148
endif
//call SetBlight( Player(8), x + r ,y+ r2, bb,true )
set ir = GetRandomInt(1,4)
if ir == 1 then
set r = 148
set r2 = -148
elseif ir == 2 then
set r = -148
set r2 = 148
elseif ir == 3 then
set r = -148
set r2 = -148
else
set r = 148
set r2 = 148
endif
call SetBlight( Player(8), x + r ,y+ r2, bb,true )
//if GetRandomInt(0,100) < 30 then
endif
//call RemoveLocation(lc)
//call echo("blight done")
//endifs
call PauseUnit(F,true)
call SetUnitAnimation(F,"birth")
call SaveUnitHandle(Hash,idT,StringHash("Z_Undead"),F)
//call RemoveSavedReal(Hash,idT,0
call PauseTimer(t)
call TimerStart(t,0.65,false,function Zombify_End)
//call FlushChildHashtable(Hash,idT)
//call DestroyTimer(t)
//set e = null
set t = null
//set lc = null
set brc = null
set f = null
endfunction
function Zombify_Start takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local real x = LoadReal(Hash,idT,StringHash("Z_x"))
local real y = LoadReal(Hash,idT,StringHash("Z_y"))
local effect e = LoadEffectHandle(Hash,idT,StringHash("Z_Sleep"))
call DestroyEffect(e)
call RemoveSavedHandle(Hash,idT,StringHash("Z_Sleep"))
call SaveEffectHandle(Hash,idT, StringHash("Z_Conversion"),AddSpecialEffect("Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl",x,y))
call PauseTimer(t)
call TimerStart(t,3.2,false,function Zombify_Start2)
set e = null
set t = null
endfunction
function Trig_UnitDies_Actions takes nothing returns nothing
local unit d = GetDyingUnit()
local unit k = GetKillingUnit()
local unit dm
local integer idT
local timer t
local integer i = 1
local real x
local real y
local real r
local group g
local integer chance
local integer typ
local integer cnt
local integer idD = GetHandleId(d)
local integer i2
local unit brc
local boolean barrfound
//local integer i2
local boolean blt
local timer t2
if UnitTypeNotDummy(d) and not GameOver then
if IsUnitInGroup(d,ZiccuratDefenseGroup) then
call GroupRemoveUnit(ZiccuratDefenseGroup,d)
endif
if IsUnitInGroup(d,SteamTanksGroup) then
call GroupRemoveUnit(SteamTanksGroup,d)
endif
/*
if IsUnitInGroup(d,Corruption) then
call RemoveSavedHandle(Hash,GetHandleId(d),StringHash("Corruption_origins"))
call GroupRemoveUnit(Corruption,d)
endif */
if IsUnitInGroup(d,Radiance) then
//call echo("they died")
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(d),StringHash("Radiance_eff")))
call GroupRemoveUnit(Radiance,d)
endif
if IsUnitInGroup(d,PatrolRepeatEffect) and not IsUnitType(d,UNIT_TYPE_HERO) then
//call echo("removes")
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(d),StringHash("PatrolRepeat_eff")))
call GroupRemoveUnit(PatrolRepeatEffect,d)
call FlushChildHashtable(Hash,GetHandleId(d))
endif
if d == MasterMind then
// команда паладинов побеждает
call KillUnit(GreatSourcePortal) // косметический дамми
call TriggerExecute(gg_trg_PalSurvive)
endif
if d == CrystalShield then
// команда дредлордов побеждает
call TriggerExecute(gg_trg_TeamDreadLordsWin)
endif
set I = 0
loop
exitwhen I >3
if GetPlayerId(GetOwningPlayer(k)) == I then
if GetOwningPlayer(d) == Player(4) or GetOwningPlayer(d) == Player(12) then
set NeutralsKilled[I] = NeutralsKilled[I] + 1
elseif IsPlayerInForce(GetOwningPlayer(d), UndeadForce) and not IsUnitType(d,UNIT_TYPE_HERO) then
set UndeadKilled[I] = UndeadKilled[I] + 1
elseif IsUnitType(d,UNIT_TYPE_HERO) then
set DreadLordsKilled[I] = DreadLordsKilled[I] + 1
endif
endif
I++
endloop
set I = 6
loop
exitwhen I >9
if GetPlayerId(GetOwningPlayer(k)) == I then
if GetOwningPlayer(d) == Player(5) and IsUnitInGroup(d,CilivianzGroup) then
set HumanKilled[I] = HumanKilled[I] + 1
elseif IsUnitInGroup(d, MilitiaGroup) then
set MilitiaKilled[I] = MilitiaKilled[I] + 1
elseif IsUnitType(d,UNIT_TYPE_HERO) and IsPlayerInForce(GetOwningPlayer(d), HumanForce) then
set PaladinsKilled[I] = PaladinsKilled[I] + 1
endif
endif
I++
endloop
//call echo("sdasad")
if IsUnitInGroup(d,QuestionMarkGroup)
call GroupRemoveUnit(QuestionMarkGroup,d)
call KillUnit(LoadUnitHandle(Hash,GetHandleId(d),StringHash("QuestMark")))
endif
if (GetOwningPlayer(d) == Player(12) or GetOwningPlayer(d) == Player(4)) // so here after some unit of player 12 dies, we detect the chance and if it triggers - detect nearest paladins and give him some stuff
if PaladinsChanceGetItem >= GetRandomInt(0,100) and PalItemCounter < PalItemsMaxCount // we can crash this game if we would not detect if items are all used already
set B = Condition(function Paladins_Filter)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(d),GetUnitY(d),250,B)
set F = GroupPickRandomUnitEx(P)
if F == null then
call DestroyBoolExpr(B)
set B = Condition(function Paladins_Filter)
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(d),GetUnitY(d),800,B)
call DestroyBoolExpr(B)
set F = GetClosest(d,P,800)
endif
if CountUnitsInGroupJ(P) > 0 and F != null then
set PaladinsChanceGetItem = 0
PalItemCounter++
set Bol = false
loop
set I = GetRandomInt(1,9)
exitwhen Bol == true
if I == 1 and not PalItem[1]
set I2 = 'tels'
set PalItem[1] = true
set Bol = true
elseif I == 2 and not PalItem[2]
set I2 = 'rnsp'
set PalItem[2] = true
set Bol = true
elseif I == 3 and not PalItem[3]
set I2 = 'shhn'
set PalItem[3] = true
set Bol = true
elseif I == 4 and not PalItem[4]
set I2 = 'srtl'
set PalItem[4] = true
set Bol = true
elseif I == 5 and not PalItem[5]
set I2 = 'rat3'
set PalItem[5] = true
set Bol = true
elseif I == 6 and not PalItem[6]
set I2 = 'schl'
set PalItem[6] = true
set Bol = true
elseif I == 7 and not PalItem[7]
set I2 = 'anfg'
set PalItem[7] = true
set Bol = true
elseif I == 8 and not PalItem[8]
set I2 = 'lnrn'
set PalItem[8] = true
set Bol = true
elseif I == 9 and not PalItem[9]
set I2 = 'dtsb'
set PalItem[9] = true
set Bol = true
endif
endloop
set bj_lastCreatedItem = CreateItem(I2, GetUnitX(F), GetUnitY(F))
call UnitAddItem(F, bj_lastCreatedItem)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00FBE14F item! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagText(TX, S, 0.012 ) //14 05
call SetTextTagPos(TX, GetUnitX(F), GetUnitY(F), 25)
call SetTextTagVelocity(TX, 0.02, 0.01) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.5)
call FT.add(TX, S)
endif
else
PaladinsChanceGetItem++
endif
endif
if IsUnitInGroup(d,RebelsGroup2)
call GroupRemoveUnit(RebelsGroup2,d)
set I = CountUnitsInGroupJ(RebelsGroup2)
if I == 0 then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(RebelsMainUnit),GetUnitY(RebelsMainUnit))
call GroupRemoveUnit(P,F)
endloop
if not IsUnitDead(gg_unit_hfoo_0794)
call UnitAddAbility(gg_unit_hfoo_0794,'A00J')
call SetUnitAbilityLevel(gg_unit_hfoo_0794,'A00J',6)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00D36D47I will be a hero!!! "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 190) //250
call SetTextTagTextJ(TX, S, 0.009 ) //14 05
call SetTextTagPos(TX, GetUnitX(gg_unit_hfoo_0794), GetUnitY(gg_unit_hfoo_0794), GetRandomReal( 5, 10))
call SetTextTagVelocity(TX, 0.01, 0.02) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 3.)
endif
endif
endif
if IsUnitInGroup(d,RebelsGroup)
call GroupRemoveUnit(RebelsGroup,d)
set I = CountUnitsInGroupJ(RebelsGroup)
if I == 0 then
call SetUnitState(gg_unit_nchp_0802, UNIT_STATE_MANA, GetUnitState(gg_unit_nchp_0802, UNIT_STATE_MAX_MANA) * RMaxJ(0,100) * 0.01)
call SetUnitState(gg_unit_nmed_0796, UNIT_STATE_MANA, GetUnitState(gg_unit_nchp_0802, UNIT_STATE_MAX_MANA) * RMaxJ(0,100) * 0.01)
set F = CreateUnit(Player(11),'h006',1000,-9750,330)
call UnitApplyTimedLife(F,'BTLF',1.5)
call IssuePointOrder(F,"attackground",GetRectCenterX(gg_rct_DestructablesExplode1),GetRectCenterY(gg_rct_DestructablesExplode1))
set F = CreateUnit(Player(11),'h006',980,-9340,340)
call UnitApplyTimedLife(F,'BTLF',1.5)
call IssuePointOrder(F,"attackground",GetRectCenterX(gg_rct_DestructablesExplode1),GetRectCenterY(gg_rct_DestructablesExplode1))
set F = CreateUnit(Player(11),'h006',2850,-9950, 200)
call UnitApplyTimedLife(F,'BTLF',1.5)
call IssuePointOrder(F,"attackground",GetRectCenterX(gg_rct_DestructablesExplode2),GetRectCenterY(gg_rct_DestructablesExplode2))
set F = CreateUnit(Player(11),'h006',2800,-9600,223)
call UnitApplyTimedLife(F,'BTLF',1.5)
call IssuePointOrder(F,"attackground",GetRectCenterX(gg_rct_DestructablesExplode2),GetRectCenterY(gg_rct_DestructablesExplode2))
call TriggerExecute( gg_trg_RebelsNextAttack )
/* call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(gg_unit_h00B_0800),GetUnitY(gg_unit_h00B_0800))
call GroupRemoveUnit(P,F)
endloop */
else
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(RebelsMainUnit),GetUnitY(RebelsMainUnit))
call GroupRemoveUnit(P,F)
endloop
endif
endif
if d == gg_unit_nhea_0808 then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F,"attack",GetUnitX(RebelsMainUnit),GetUnitY(RebelsMainUnit))
call GroupRemoveUnit(P,F)
endloop
endif
if d == RebelsMainUnit then
call GroupClear(RebelsGroup)
call DestroyGroup(RebelsGroup)
call GroupClear(RebelsGroup2)
call DestroyGroup(RebelsGroup2)
call TriggerRemoveAction(RebelsAttack,LoadTriggerActionHandle(Hash,GetHandleId(RebelsAttack),0))
call DestroyTrigger(RebelsAttack)
//set bj_lastPlayedSound = gg_snd_QuestActivateWhat101
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_QuestActivateWhat101)
//endif
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RebelsAttackGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call SaveReal(Hash,GetHandleId(F),StringHash("DS_trsp"),255)
call GroupAddUnit(DSgroup,F)
call GroupRemoveUnit(P,F)
endloop
call GroupClear(RebelsAttackGroup)
call DestroyGroup(RebelsAttackGroup) // coz we should destroy it after ofc
call MsgForce(HumanForce,"|c00FF712DRebellion|r - quest completed. |c00FEBA0E+600")
set QuestCompleted[5] = true
//call KillUnit( gg_unit_nmed_0796 )
call QuestSetCompleted( RebelsQuest, true )
set I = 600 / T1Nplayer
set I2 = 0
loop
exitwhen I2 > 3
if PlayerIsActive(Player(I2)) then
call SetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD) + I)
endif
I2++
endloop
endif
if d == gg_unit_nmed_0796 and RebelsCanBeCanceled then
call QuestSetFailed( RebelsQuest, true )
//call KillUnit( gg_unit_nmed_0796 )
//call KillUnit( gg_unit_e00P_0292 )
call KillUnit(gg_unit_e00P_0292)
call TriggerRemoveAction(RebelsAttack,LoadTriggerActionHandle(Hash,GetHandleId(RebelsAttack),0))
call DestroyTrigger(RebelsAttack)
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(gg_unit_nmed_0796),StringHash("QuestMark")))
endif
if d == MilitiaMan and OrcInvasionCanBeCanceled then
//call QuestSetFailed( RebelsQuest, true )
call KillUnit(gg_unit_e00P_0812)
call TriggerRemoveAction(OrcInvasionTrigger,LoadTriggerActionHandle(Hash,GetHandleId(OrcInvasionTrigger),0))
call DestroyTrigger(OrcInvasionTrigger)
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(MilitiaMan),StringHash("QuestMark")))
endif
if d == gg_unit_hbew_0535 and ThugsRaidCanBeCanceled then
set udg_WithinRangeUnit = gg_unit_hbew_0535
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
call GroupClear(ThugsRaidGroup)
call DestroyGroup(ThugsRaidGroup)
call GroupClear(ThugsCampGroup)
call DestroyGroup(ThugsCampGroup)
call QuestSetFailed( ThugsRaid, true )
call KillUnit( gg_unit_e00P_0262 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[1]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[1])
//call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(gg_unit_hbew_0535),StringHash("QuestMark")))
endif
if d == gg_unit_nbld_0755 then
set ThugsReal = 0.
call GroupClear(ThugsRaidGroup)
call DestroyGroup(ThugsRaidGroup)
call GroupClear(ThugsCampGroup)
call DestroyGroup(ThugsCampGroup)
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(gg_unit_nbld_0755),StringHash("QuestMark")))
if IsPlayerInForce(GetOwningPlayer(k),UndeadForce) then
call QuestSetFailed( ThugsRaid, true )
else
//set bj_lastPlayedSound = gg_snd_QuestActivateWhat101
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_QuestActivateWhat101)
//endif
call MsgForce(HumanForce,"|c00FF712DBandits Raids|r - quest completed. |c00FEBA0E+450")
call QuestSetCompleted( ThugsRaid, true )
set QuestCompleted[3] = true
set I = 500 / T1Nplayer
set I2 = 0
loop
exitwhen I2 > 3
if PlayerIsActive(Player(I2)) then
call SetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD) + I)
endif
I2++
endloop
endif
endif
if IsUnitInGroup(d,CryptSpidersGroup) then
call GroupRemoveUnit(CryptSpidersGroup,d)
endif
if d == MortarUnitQuest then
//call echo("dead quest")
call GroupRemoveUnit(QuestGroup,d)
call GroupClear(CryptSpidersGroup)
call DestroyGroup(CryptSpidersGroup)
call QuestSetFailed( CryptSpiders, true )
call KillUnit( gg_unit_e00P_0278 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("QuestMark")))
//call TriggerRemoveAction(CryptSpidersTrigger,LoadTriggerActionHandle(Hash,GetHandleId(CryptSpidersTrigger),0))
// call DestroyTrigger(CryptSpidersTrigger)
// call QuestSetFailed( CryptSpiders, true )
// call TriggerRemoveAction(gg_trg_CryptSpidersQuest,LoadTriggerActionHandle(Hash,GetHandleId(gg_trg_CryptSpidersQuest),0))
// call DestroyTrigger(gg_trg_CryptSpidersQuest)
//call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(gg_unit_hmtm_0774),StringHash("QuestMark")))
endif
if CryptSpidersCompleted == false and CryptSpidersGroup != null and CountUnitsInGroupJ(CryptSpidersGroup) <= 0 and not IsUnitDead(MortarUnitQuest)
call GroupClear(CryptSpidersGroup)
call DestroyGroup(CryptSpidersGroup)
call RemoveRect(gg_rct_SpiderRegion)
//set bj_lastPlayedSound = gg_snd_QuestActivateWhat101
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_QuestActivateWhat101)
//endif
set CryptSpidersCompleted = true
call MsgForce(HumanForce,"|c00FF712DSleepers on a field|r - quest completed??? ")
call TriggerExecute(gg_trg_CryptLord)
//call QuestSetCompleted( CryptSpiders, true )
//call SetPlayerState(Player(0),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(0),PLAYER_STATE_RESOURCE_GOLD) + 500)
endif
if GetUnitTypeId(d) == 'H007' and not IsUnitDead(MortarUnitQuest) then
call MsgForce(HumanForce,"|c00FF712DSleepers on a field|r - quest completed. |c00FEBA0E+500")
set QuestCompleted[4] = true
call KillUnit( gg_unit_e00P_0278 )
//set bj_lastPlayedSound = gg_snd_QuestActivateWhat101
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_QuestActivateWhat101)
//endif
call QuestSetCompleted( CryptSpiders, true )
set I = 500 / T1Nplayer
set I2 = 0
loop
exitwhen I2 > 3
if PlayerIsActive(Player(I2)) then
call SetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD) + I)
endif
I2++
endloop
endif
if IsUnitInGroup(d,ThugsRaidGroup) then
call GroupRemoveUnit(ThugsRaidGroup,d)
endif
if CountUnitsInGroupJ(ThugsRaidGroup) <= 0 and ThugsRaidTakeDown == false then
set ThugsRaidTakeDown = true
call PingMinimapForForceExJ(HumanForce, GetUnitX(gg_unit_nbld_0755 ), GetUnitY(gg_unit_nbld_0755 ), 3.5, bj_MINIMAPPINGSTYLE_FLASHY, 50, 45, 57)
endif
if GetUnitTypeId(d) == 'nenp' then
EntCount--
endif
if EntCount == 0 and EntCorruptionTakeDown == false then
set EntCorruptionTakeDown = true
call PingMinimapForForceExJ(HumanForce, GetUnitX(gg_unit_nepl_0748), GetUnitY(gg_unit_nepl_0748), 3.5, bj_MINIMAPPINGSTYLE_FLASHY, 50, 45, 57)
call ShowUnit(gg_unit_nepl_0748,true)
call KillDestructable( gg_dest_FTtw_5299 )
call KillDestructable( gg_dest_FTtw_5300 )
call KillDestructable( gg_dest_FTtw_5264 )
call KillDestructable( gg_dest_FTtw_5252 )
call KillDestructable( gg_dest_FTtw_5251 )
endif
if d == gg_unit_nepl_0748 then
if IsPlayerInForce(GetOwningPlayer(k),UndeadForce) then
call QuestSetFailed( EntCorruption, true )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[2]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[2])
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[3]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[3])
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(VisionQuestDummy[4]),StringHash("Vision_Qeff")))
call KillUnit(VisionQuestDummy[4])
else
//set bj_lastPlayedSound = gg_snd_QuestActivateWhat101
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_QuestActivateWhat101)
//endif
call MsgForce(HumanForce,"|c00FF712DBloodthirsty trees|r - quest completed. |c00FEBA0E+450")
set QuestCompleted[2] = true
call KillUnit(EntQuestionMark[4])
call QuestSetCompleted( EntCorruption, true )
//set QuestCompleted[2] = true
set I = 400 / T1Nplayer
set I2 = 0
loop
exitwhen I2 > 3
if PlayerIsActive(Player(I2)) then
call SetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD) + I)
endif
I2++
endloop
endif
endif
set i = 1
loop
exitwhen i > UGM
//call echo(I2S(UGM) + " UGM")
if d == FocusedUnit[i] then
set IsUnitFocused[i] = false
set FocusedUnit[i] = null
set UndeadFocusX[i] = 0.
set UndeadFocusY[i] = 0.
//call echo("смена цели")
endif
if IsUnitInGroup(d,Undead[i]) then
//call echo("убрать из анд.")
//set UDUNITS = UDUNITS - 1 doesnt need
call GroupRemoveUnit(Undead[i],d)
//call echo(" пока хз группа - " + I2S(i))
if UndeadGroupShouldBeEliminated[i] == true then
//set UDUNITS[i] = UDUNITS[i] -1
//call echo(" срезаем колво - " + I2S(i))
//call GroupClear(P)
set cnt = 0
set g = CopyGroup(Undead[i])
loop
set F = FirstOfGroup(g)
exitwhen F == null
if not IsUnitDead(F) then
set cnt = cnt + 1
//call echo(GetUnitName(F))
endif
call GroupRemoveUnit(g,F)
endloop
//call echo(I2S(cnt))
call DestroyGroup(g)
//call echo(I2S(cnt)) OLD DEBUG
//call echo(I2S(cnt))
if cnt <= 0 then
set UndeadGroupEliminated[i] = true
set UndeadGroupIsOn[i] = false
//set I = LoadInteger(Hash,GetHandleId(d),StringHash("FocusedUnit[i]_i"))
call RemoveUnit(HuntTargetUnitDummy[i])
call DestroyEffect(HuntTargetEffect[i])
call RemoveSavedInteger(Hash,GetHandleId(FocusedUnit[i]),StringHash("FocusedUnit[i]_i"))
call GroupRemoveUnit(FocusedUnitVision,FocusedUnit[i])
//call echo("Группа уничтожена - " + I2S(i)) //уничтожаем группу. Возможно создаст баги в будущем баг
//call echo(I2S(CountUnitsInGroup(Undead[i])) + " в группе оставалось")
call GroupClear(Undead[i])
call DestroyGroup(Undead[i])
endif
endif
endif
set i = i + 1
endloop
//call echo("still works")
set i = 1
//loop
//call echo("с232на цели")
//exitwhen i > CGMmax
//call echo(I2S(CGMMax))
//call echo(I2S(CGM))
if IsUnitInGroup(d,CilivianzGroup) then
//call echo("убрать из цив.")
set CGM = CGM - 1
if CGMMax / 2 > CGM and HalfIsDeadTip == false then
//call echo("убрать из цив. 2")
set HalfIsDeadTip = true
call PlaySoundJ( gg_snd_CreepAggroWhat1 )
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00BD204F 50% of the citizens have been killed. |r |r")
endif
elseif CGMMax/3.31 > CGM and HalfIsDeadTip2 == false then
set HalfIsDeadTip2 = true
//call echo("убрать из цив.3")
call PlaySoundJ( gg_snd_CreepAggroWhat1 )
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c005B002E 70% of the citizens have been killed. |r |r")
endif
elseif (CGMMax/5 > CGM and CiliviansMurdered == false and GameOver != true) or (TESTdreadlordFocus == true and CGMMax/5 > CGM and CiliviansMurdered == false and GameOver != true) then //
//call echo("убрать из цив. 4")
call ClearTextMessages()
call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 128.00, 0.00, 128.00, 0. )
call SetTerrainFogExBJ( 0, 1000, 8000, 0, 30.00, 80.00, 30.00 )
// set GameOver = true LETS CHANGE THE RULES IN 4.6
set CiliviansMurdered = true
call PingMinimapForForceExJ(HumanForce, GetUnitX(CrystalShield),GetUnitY(CrystalShield), 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 130, 255, 200)
call PingMinimapForForceExJ(UndeadForce, GetUnitX(CrystalShield),GetUnitY(CrystalShield), 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 130, 255, 200)
if RusTips == false then
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00017E49The Hellmouth is captured by undead|r")
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Paladins! Defend the Crystal Shield. It's the core building of your team. Dont let |c0026D94AUndead|r |c00FBB704 destroy it. |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00A31CE3DreadLords! Finish these foolish Paladins, destroy the |c00FBB704Crystal Shield|r |c00A31CE3, their main base if defenseless. |r")
endif
else
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Полуостров захвачен нежитью. |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00FBB704Паладины! Защищайте Crystal Shield, ваше главное ядро на вашей базе. Вся |c0026D94AНежить|r |c00FBB704 идёт на штурм. |r")
endif
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00A31CE3Дредлорды! Покончите с Паладинами. Вся нежить идёт уничтожать |c00FBB704Crystal Shield|r |c00A31CE3, в форте Паладинов. |r")
endif
endif
call PlaySoundJ(gg_snd_UndeadVictory)
set DreadInstantKillUnit = true
call UnitRemoveAbility(CrystalShield,'A01H')
call UnitRemoveAbility(CrystalShield,'Avul')
call UnitAddAbility(CrystalShield, 'A01X')
call UnitAddAbility(CrystalShield, 'A01Y')
//call UnitRemoveAbility(CrystalShield,'A01H')
//call UnitRemoveAbility(CrystalShield,'Avul')
set I = 1
loop
exitwhen I > 8
call KillUnit(TeleportEffect[I])
I++
endloop
call DisableTrigger(Teleport)
call DestroyTrigger(Teleport)
set F = CreateUnit(Player(0),dummy,GetUnitX(CrystalShield),GetUnitY(CrystalShield),0)
call UnitAddAbility(F,'ANmo')
//call UnitAddAbility(F,'Avu')
call IssuePointOrder(F,"monsoon",GetUnitX(CrystalShield),GetUnitY(CrystalShield))
set F = CreateUnit(Player(6),'e001',GetUnitX(CrystalShield),GetUnitY(CrystalShield),0)
call KillDestructable( gg_dest_Dofw_1083 )
call KillDestructable( gg_dest_Dofw_1084 )
call KillDestructable( gg_dest_Dofw_1082 )
call KillDestructable( gg_dest_Dofw_1085 )
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if (IsUnitInGroup(F,CilivianzGroup) or IsUnitInGroup(F,MilitiaGroup)) and GetUnitTypeId(F) != steamtank then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",F,"chest"))
call KillUnit(F)
endif
call GroupRemoveUnit(P,F)
endloop
endif
if LeaderBoardActive then
call LeaderboardSetLabel(CilivianzAlive,"Villagers Alive - " + I2S(R2I(100* CGM/CGMMax)) + "%") // I dont remember for what reason I made CGMmax, but THEY ARE DIFFRENT CGMMax and CGMmax
//call LeaderboardSetItemValue(CilivianzAlive,0,R2I(CGM))
endif
//call echo(I2S(R2I(100* CGM/CGMMax)))
//call echo(I2S(CGM))
//call echo("still works 2")
call GroupRemoveUnit(CilivianzGroup,d)
endif
//call echo("stod")
if IsUnitInGroup(d,ReplicsGroup) then
call GroupRemoveUnit(ReplicsGroup, d)
endif
if IsUnitInGroup(d,InitiationG) then
call GroupRemoveUnit(InitiationG, d)
endif
if IsUnitInGroup(d,ReplicsGroupIsOnPoint) then
call GroupRemoveUnit(ReplicsGroupIsOnPoint, d)
endif
if IsUnitInGroup(d,MilitiaGroup) then
//call echo("убрать из ополчения")
//call LeaderboardSetItemValue(CilivianzAlive,0,R2I(CGM))
//call echo(I2S(CGM))
call GroupRemoveUnit(MilitiaGroup,d)
endif
if IsUnitInGroup(d,Sorcerers) then
call GroupRemoveUnit(Sorcerers,d)
endif
if IsUnitInGroup(d,DSgroup) then
call GroupRemoveUnit(DSgroup,d)
endif
if IsUnitInGroup(d,RageOfTheDamned) then
call GroupRemoveUnit(RageOfTheDamned,d)
endif
if IsUnitInGroup(d,BuildVision) then
call RemoveUnit(LoadUnitHandle(Hash,idD,StringHash("STR_u")))
call GroupRemoveUnit(BuildVision,d)
call RemoveSavedHandle(Hash,idD,StringHash("STR_u"))
call RemoveSavedReal(Hash,idD,StringHash("STR_r"))
endif
if IsUnitInGroup(d,ShareVisionGroup) then
//call echo("share vision remove")
set dm = LoadUnitHandle(Hash,idD,StringHash("SV_d"))
call RemoveUnit(dm)
call DestroyEffect(LoadEffectHandle(Hash,idD,StringHash("SV_e")))
call RemoveSavedHandle(Hash,idD,StringHash("SV_e"))
call RemoveSavedHandle(Hash,idD,StringHash("SV_d"))
call RemoveSavedReal(Hash,idD,StringHash("SV_r"))
call GroupRemoveUnit(ShareVisionGroup,d)
endif
if IsUnitInGroup(d,FocusedUnitVision) then
//call echo("share vision remove")
set I = LoadInteger(Hash,GetHandleId(d),StringHash("FocusedUnit[i]_i"))
call RemoveUnit(HuntTargetUnitDummy[I])
call DestroyEffect(HuntTargetEffect[I])
call RemoveSavedInteger(Hash,GetHandleId(d),StringHash("FocusedUnit[i]_i"))
call GroupRemoveUnit(FocusedUnitVision,d)
endif
//if IsUnitInGroup(d,Corruption) then
//endif
if IsUnitInGroup(d,PowerDashHaste) then
call UnitRemoveAbility(d,'ACua')
call RemoveSavedReal(Hash,GetHandleId(d),StringHash("CPT_HASTE"))
call GroupRemoveUnit(PowerDashHaste,d)
endif
//call echo("ыы")
//set i = i + 1
//set g = null
//endloop
//call echo(GetUnitName(k))
//if IsPlayerInForce(GetOwningPlayer(k),UndeadForce) then
//call echo("in undead force Dabdab")
//endif
// **************************************** ЗНАМЕНИТЫЙ РЕСП АНДЕДОВ УРА *********************************
if (GetOwningPlayer(d) == Player(5) or GetOwningPlayer(d) == Player(11) or (ConcentratedHorror == true and IsUnitInGroup(d,Paladins))) and (IsPlayerInForce(GetOwningPlayer(k),UndeadForce) or DreadInstantKillUnit == true)/*
*/ and not IsUnitType(d,UNIT_TYPE_STRUCTURE) and /*
*/ GetUnitTypeId(d) != 'hrdh' and GetUnitTypeId(d) != 'hhdl' /*
*/and GetUnitTypeId(d) != 'hbew' /*
*/ and GetUnitTypeId(d) != golemtype and GetUnitTypeId(d) != steamtank then // блокировка респа андедов у конницы или механических юнитов
// ЗНАМЕНИТЫЙ ТРИГГЕР РЕСПА АНДЕДОВ УРА
//call echo("doessssSSS")
if Locust then
set F = CreateUnit(Player(10),'uloc',GetUnitX(d),GetUnitY(d),0)
call UnitApplyTimedLife(F,'BTLF',7.5)
endif
if IsUnitType(k,UNIT_TYPE_HERO) or BetterZombify then
set chance = 100
else
set chance = 70
endif
if GetRandomInt(0,100) <= chance then
if GetUnitTypeId(d) != kid and GetUnitTypeId(d) != kid2 then
if GetUnitTypeId(d) == footman or GetUnitTypeId(d) == captain then
set typ = skeleton
elseif GetUnitTypeId(d) == sniper then
set typ = skeletonarcher
else
if FelGenome and ( GetUnitTypeId(d) == priest or GetUnitTypeId(d) == sorcerer ) then
set typ = skeletonmage
else
set typ = zombie
endif
endif
else
set typ = zombiew
endif
set t = CreateTimer()
set idT = GetHandleId(t)
set x = GetUnitX(d)
set y = GetUnitY(d)
call SaveReal(Hash,idT,StringHash("Z_x"),x)
call SaveReal(Hash,idT,StringHash("Z_y"),y)
if IsUnitType(d,UNIT_TYPE_HERO) then
set typ = 'H00I'
call SaveInteger(Hash,idT,StringHash("Z_PaladinLVL"),GetHeroLevel(d))
endif
call SaveInteger(Hash,idT,StringHash("Z_typ"),typ)
call SaveUnitHandle(Hash,idT,StringHash("Z_du"),d)
//Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
call SaveEffectHandle(Hash,idT,StringHash("Z_Sleep"),AddSpecialEffect("Abilities\\Spells\\Undead\\Sleep\\SleepTarget.mdl",x,y))
if BetterZombify then
set R = GetRandomReal(2.5,3.5) - 0.5
else
set R = GetRandomReal(2.5,3.5)
endif
call TimerStart(t,R,false,function Zombify_Start)
endif
endif
// **************************************
set i = 1
loop
exitwhen i > 12
//if RectContainsCoordsJ(LIVINGRECT[i], GetUnitX(d), GetUnitY(d)) then
//endif
if IsUnitInGroup(d,LIVINGgroup[i]) then //если юнит имеет принадлежность к какому-то поселениб ( а будет иметь он его только находясь в нем), то при его смерте и подсчете населения могут вызвать сквад на место смерти
// при кд ответственность на другие барраки не накладывается
//call echo("lv group remove")
if ISRECTALIVE[i] == TRUE then
set RectCountCr[i] = RectCountCr[i] - 1
if RectCountCr[i] < RectCount[i] * 0.9 and not CaptainIsOnCd[i] and CaptainActivated then
//call echo("undead defend patrol")
// before we check like rect contains coord(x,y) and is alive. Then we check is barracks alive and only then we find the nearest barrack in 3500 range
set i2 = 1
set barrfound = false
loop
exitwhen i2 > 12 or barrfound == true
if IsUnitInRegion(LivingRegionGlobal[i2],F) and not IsUnitDead(Barrack[i2]) and ISRECTALIVE[i2] == true and CaptainIsOnCd[i2] != true then
set barrfound = true
set whatBarrack = i2
endif
i2++
endloop
if barrfound != true then
set barrfound = false
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(BarracksGroup,function GroupAddGroupEnumJ)
loop
set brc = GetClosestUnitInGroup(GetUnitX(F),GetUnitY(F),P2)
//set F2 = FirstOfGroup(P2)
exitwhen brc == null or barrfound == true
if not IsUnitDead(brc) and DistanceXY(GetUnitX(brc),GetUnitY(brc),GetUnitX(F),GetUnitY(F)) <= 3500 and ISRECTALIVE[i2] == true and CaptainIsOnCd[i2] != true then
set barrfound = true
endif
call GroupRemoveUnit(P2,brc)
endloop
set i2= 0
set blt = false
loop
exitwhen i2 > 12 or blt == true
if brc == Barrack[i2] then
set whatBarrack = i2
set blt = true
endif
i2++
endloop
if brc != null and barrfound == true and blt == true then
set CaptainX = GetUnitX(F)
set CaptainY = GetUnitY(F)
//set whatBarrack = we already know that
set CaptainCd[whatBarrack] = 25. // ?
set CaptainIsOnCd[whatBarrack] = true //?
call TriggerExecute(gg_trg_GetCaptain)
endif
else
set CaptainX = GetUnitX(F)
set CaptainY = GetUnitY(F)
// set Barrack X
//set Barrack Y
set CaptainCd[whatBarrack] = 25. // ?
set CaptainIsOnCd[whatBarrack] = true //?
call TriggerExecute(gg_trg_GetCaptain)
endif
elseif RectCountCr[i] * 1.2 < RectCount[i] then
//call echo("cap is on cd")
endif
//Makes
// 0.60 was
if RectCountCr[i] < RectCount[i] * 0.7 and RectCountCr[i] > RectCount[i] * 0.15 and MedRectWarnReal <= 0. and MedRectWarn[i] != true then
//call echo(I2S(RectCountCr[i]))
//call echo(I2S(RectCount[i]))
//set MedRectWarn[i] = true
set d = CreateUnit(Player(0),'e009',GetRectCenterX(LIVINGrect[i]), GetRectCenterY(LIVINGrect[i]),0)
call UnitApplyTimedLife(d,'BTLF',5.)
call PingMinimapForForceExJ(HumanForce, GetRectCenterX(LIVINGrect[i]), GetRectCenterY(LIVINGrect[i]), 4.5, bj_MINIMAPPINGSTYLE_SIMPLE, 255, 40, 30) // 50 40 30
//PREVENT FROM SOUND WARNING TOO OFTEN
if MedRectWarnReal <= 0. then
set bj_lastPlayedSound = gg_snd_KnightAllyTownAttack1
//if IsPlayerInForce(GetLocalPlayer(),HumanForce)
// call StartSound(gg_snd_KnightAllyTownAttack1)
//endif
set MedRectWarnReal = 12. //12
endif
endif
set R = RectCount[i] * 0.05 // 0.05
if R < 4 then
set R = 4
endif
/*set BOOLEAN = false
if RectCountCr[i] < RectCount[i] * 0.85 then //85% хотя бы должны быть убиты. Да это глупо. но не будет лишней нагрузки на карту
call GroupClear(P)
call GroupEnumUnitsInRect(P,LIVINGrect[i],null)
set BOOLEAN = true
set I = 0
loop
set F = FirstOfGroup(P)
exitwhen F == null
if not IsUnitOwnedByPlayer(F,Player(11)) and IsUnitInGroup(F,CilivianzGroup) and not IsUnitDead(F) then
I++
endif
call GroupRemoveUnit(P,F)
endloop
endif */
if RectCountCr[i] < R then // 0.05 R < R //or (BOOLEAN == true and I < R + 3)
//if I < RectCount[i] * 0.95 then
//call echo("im gonna put some dirt in your eyes")
//endif
//call echo("енд")
set GreatSourceInt = i
call TriggerExecute(gg_trg_GREATPORTALCREATE) //great source creation
// ->>
//call echo("енд2")
endif
endif
call GroupRemoveUnit(LIVINGgroup[i],d)
endif
set i = i + 1
endloop
if DarkReflection and IsPlayerInForce(GetOwningPlayer(d),UndeadForce) and IsUnitInGroup(k,Paladins) and GetUnitTypeId(d) != 'uloc' then
if IsUnitType(d,UNIT_TYPE_HERO) or GetRandomInt(0,100) <= 8 then
//call echo("sss")
set udg_CP_Point = Location(0.,0)
loop
set I = GetRandomInt(0,4)
if I == 1 then
call MoveLocation(udg_CP_Point,GetUnitX(k) + 650.,GetUnitY(k) + 650)
elseif I == 2 then
call MoveLocation(udg_CP_Point,GetUnitX(k)-650.,GetUnitY(k)+650)
elseif I == 3 then
call MoveLocation(udg_CP_Point,GetUnitX(k)+650,GetUnitY(k)-650)
else
call MoveLocation(udg_CP_Point,GetUnitX(k)-650.,GetUnitY(k)-650)
endif
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
//call echo("sss2")
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl",udg_CP_Point))
set F = CreateUnitAtLoc(Player(10),'ugho',udg_CP_Point,AngleBetweenXY(GetUnitX(F),GetUnitY(F),GetUnitX(k),GetUnitY(k)))
call UnitApplyTimedLife( F ,'BTLF' , 25. )
call IssueTargetOrder(F,"attack",k)
if IsUnitType(d,UNIT_TYPE_HERO) then
set F = CreateUnitAtLoc(Player(10),'ugho',udg_CP_Point,AngleBetweenXY(GetUnitX(F),GetUnitY(F),GetUnitX(k),GetUnitY(k)))
call UnitApplyTimedLife( F ,'BTLF' , 25. )
call IssueTargetOrder(F,"attack",k)
endif
call RemoveLocation(udg_CP_Point)
endif
endif
if IsUnitInGroup(d,MilitiaBrothers) then
call GroupRemoveUnit(MilitiaBrothers,d)
endif
if IsUnitInGroup(d,QuestionMarkGroup)
call GroupRemoveUnit(QuestionMarkGroup,d)
//if CountUnitsInGroupJ(QuestionMarkGroup) <= 0
//call DestroyGroup(QuestionMarkGroup)
//endif
endif
if GetOwningPlayer(d) == Player(4) //gotcha, bitch
set I = LoadInteger(Hash,GetHandleId(d),StringHash("RaidInteger"))
//call echo("gotcha bitch")
if IsUnitInGroup(d,RaidGroup[I])
//call echo("gotcha bitch 2")
call GroupRemoveUnit(RaidGroup[I],d)
if CountUnitsInGroupJ(RaidGroup[I]) <= 0 then
call DestroyGroup(RaidGroup[I])
//call echo("group done")
set RaidActive[I] = false
endif
endif
endif
if GetUnitTypeId(d) == 'H00I' then
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",GetUnitX(d),GetUnitY(d)))
//call RemoveUnit(d)
endif
if not IsUnitType(d,UNIT_TYPE_HERO) or GetOwningPlayer(d) == Player(4) or GetUnitTypeId(d) == 'H00I' then // there we get the shit out of non hero unit
call FlushChildHashtable(Hash,GetHandleId(d)) //neutral heroes gets cleaned so ad undead paladins
else
if IsUnitInGroup(d,DreadLords) // -->
set DreadLordsCount = DreadLordsCount - 1
if LeaderBoardActive then
call LeaderboardSetItemValue(CilivianzAlive, LeaderboardGetPlayerIndex(CilivianzAlive, Player(6)), DreadLordsCount)
endif
//call GroupRemoveUnit(DreadLords,d)
//call GroupRemoveUnit(DreadLordsVision,LoadUnitHandle(Hash,GetHandleId(d),StringHash("DL_Vision")))
//call KillUnit(LoadUnitHandle(Hash,GetHandleId(d),StringHash("DL_Vision")))
//call RemoveSavedHandle(Hash,GetHandleId(d),StringHash("DL_Vision"))
// if CountUnitsInGroupJ(DreadLords) <= 0
/*
set GameOver = true
call PlaySoundJ(gg_snd_NewTournament)
// call KillSoundWhenDone(bj_lastPlayedSound)
call ClearTextMessages()
call PlayThematicMusic( "Sound\\Music\\mp3Music\\HumanVictory.mp3" )
call CinematicFadeJ( bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 60.00, 60.00, 60.00, 0 )
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 4., "|c00E35782 PALADINS HAVE WON |r |r")
endif
call GroupClear(P)
call GroupEnumUnitsInRect(P,bj_mapInitialPlayableArea,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call PauseUnit(F,true)
call SetUnitInvulnerable( F, true )
if GetUnitTypeId(F) == footman then
call SetUnitAnimation(F,"stand victory")
elseif GetUnitTypeId(F) == sniper then
call SetUnitAnimation(F,"spell")
elseif IsUnitInGroup(F,Paladins) then
call SetUnitAnimation(F,"stand victory")
endif
call GroupRemoveUnit(P,F)
endloop
*/
//else
set I = GetPlayerId(GetOwningPlayer(d))
set t2 = CreateTimer()
set ID = GetHandleId(t2)
set t =CreateTimer()
set idT = GetHandleId(t)
call SaveInteger(Hash,idT,0,I)
call SaveInteger(Hash,ID,0,I)
if GetLocalPlayer() == GetOwningPlayer(d)
call ClearTextMessages()
endif
call MsgP(GetPlayerId(GetOwningPlayer(d)), "|c005B002EYou let your Lord down. But still you can never leave him.|r",5.)
call TimerStart(t2,5.,false,function Necro_Life)
if ConcentratedHorror == false then
call TimerStart(t,240,false,function ReviveDreadLord) //120
else
call TimerStart(t,180.,false,function ReviveDreadLord)
endif
set S = ""
if (GetLocalPlayer() == Player(I)) then
set S = "Revive Time"
endif
call SaveTimerDialogHandle(Hash,idT ,6,CreateTimerDialogJ(t,S))
call TimerDialogDisplay(bj_lastCreatedTimerDialog, false)
if (GetLocalPlayer() == Player(I)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
endif
// endif
endif // <--
if IsUnitInGroup(d,Paladins)
// call echo("died bitch")
set PaladinsCount = PaladinsCount - 1
if LeaderBoardActive == true then
call LeaderboardSetItemValue(CilivianzAlive, LeaderboardGetPlayerIndex(CilivianzAlive, Player(5)), PaladinsCount)
endif
//call GroupRemoveUnit(Paladins,d)
//call KillUnit(LoadUnitHandle(Hash,GetHandleId(d),StringHash("P_Vision")))
set I = GetPlayerId(GetOwningPlayer(d))
set t =CreateTimer()
set idT = GetHandleId(t)
set t2 = CreateTimer()
set ID = GetHandleId(t2)
call SaveInteger(Hash,idT,0,I)
call SaveInteger(Hash,ID,0,I)
call TimerStart(t,2,false,function GetCalledPaladinKnight) // 2
if GreatIntention == false then
//120 240 now
call TimerStart(t2,240,false,function RevivePaladin)
else
call TimerStart(t2,180,false,function RevivePaladin)
endif
set S = ""
if (GetLocalPlayer() == Player(I)) then
set S = "Revive Time"
endif
call SaveTimerDialogHandle(Hash,ID,6,CreateTimerDialogJ(t2,S))
call TimerDialogDisplay(bj_lastCreatedTimerDialog, false)
if (GetLocalPlayer() == Player(I)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
endif
endif
if GetOwningPlayer(d) != Player(12) or GetOwningPlayer(d) != Player(13) then // generals for both clans
set I = GetPlayerId(GetOwningPlayer(d))
//set PlayerHasLost[I] = true
set t =CreateTimer()
set idT = GetHandleId(t)
call SaveInteger(Hash,idT,0,I)
call TimerStart(t,2.,false,function PlayerLost)
endif
endif
endif // unit type not dummy or GameOver
call RemoveLocation(udg_CP_Point)
set t = null
set d = null
set k = null
set dm = null
set g = null
set t2 = null
set brc = null
endfunction
//===========================================================================
function InitTrig_UnitDies takes nothing returns nothing
local integer index
set gg_trg_UnitDies = CreateTrigger( )
set index = 0
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_UnitDies, Player(index), EVENT_PLAYER_UNIT_DEATH, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
set index = 0
loop
exitwhen index > 9
set PalItem[index] = false
index++
endloop
set index = 0
loop
exitwhen index > 10
set HumanKilled[index] = 0
set MilitiaKilled[index] = 0
set PaladinsKilled[index] = 0
set UndeadKilled[index] = 0
set DreadLordsKilled[index] = 0
index++
endloop
call TriggerAddAction( gg_trg_UnitDies, function Trig_UnitDies_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________013_Conditions takes nothing returns boolean
if 1 / 1 > 10 then
return false
endif
return true
endfunction
function Trig_____________________________________013_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_____________________________________013 takes nothing returns nothing
set gg_trg_____________________________________013 = CreateTrigger( )
call TriggerAddCondition( gg_trg_____________________________________013, Condition( function Trig_____________________________________013_Conditions ) )
call TriggerAddAction( gg_trg_____________________________________013, function Trig_____________________________________013_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Barracks_F takes nothing returns boolean
return not IsUnitDead(GetFilterUnit()) and GetUnitTypeId(GetFilterUnit()) == 'h00D' and GetOwningPlayer(GetFilterUnit()) == Player(11)
endfunction
function Patrol_Remove takes nothing returns nothing
local timer t = GetExpiredTimer()
set ID = GetHandleId(t)
local group g = LoadGroupHandle(Hash,ID,0)
local boolexpr b = Condition(function PatrolsEnemy_Expr)
local unit d
local integer i2 = LoadInteger(Hash,ID,12)
local integer i3 = LoadInteger(Hash,ID,13)
if i3 == 0 then
call TimerStart(T,7,true,function Patrol_Remove)
call SaveInteger(Hash,ID,13,66)
endif
//if CountUnitsInGroupE(g) > 0 then
set I2 = 0
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P)
exitwhen F2 == null
if not IsUnitDead(F2) then
I2++
else
call GroupRemoveUnit(g,F2)
endif
call GroupRemoveUnit(P,F2)
endloop
set F = GroupPickRandomUnitEx(g)
if not IsUnitDead(F) then
call GroupClear(P2)
call GroupEnumUnitsInRange(P2,GetUnitX(F),GetUnitY(F),2500,b) //5500
//set F2 = DistToUnit(GetUnitX(F),GetUnitY(F),P)
//set I = 1
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
set F2 = DistToUnit(GetUnitX(F),GetUnitY(F),P2)
exitwhen F2 != null or F == null
//I++
call GroupRemoveUnit(P,F)
endloop
if F2 == null then
call DestroyBoolExpr(b)
set b = Condition(function PatrolsEnemy_ExprHeroesIncluded)
call GroupClear(P2)
call GroupEnumUnitsInRange(P2,GetUnitX(F),GetUnitY(F),2500,b) //lol
//set F2 = DistToUnit(GetUnitX(F),GetUnitY(F),P)
//set I = 1
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
set F2 = DistToUnit(GetUnitX(F),GetUnitY(F),P2)
exitwhen F2 != null or F == null
//I++
call GroupRemoveUnit(P,F)
endloop
endif
endif
if F2 != null and I2 > 0 then
call PingMinimapForForceExJ(HumanForce, GetUnitX(F2), GetUnitY(F2), 3, bj_MINIMAPPINGSTYLE_SIMPLE, 100, 40, 30)
set d = CreateUnit(Player(0),dummy,GetUnitX(F2),GetUnitY(F2),0)
call UnitApplyTimedLife(d,'BTLF',2)
call SetUnitVertexColor(d,255,80,0,255)
call SetUnitScale(d,3.,0,0)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),HumanForce) then
set S = "Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl"
endif
call SaveEffectHandle(Hash,GetHandleId(d),StringHash("PatrolRepeat_eff"),AddSpecialEffectTarget(S,d,"origin"))
call GroupAddUnit(PatrolRepeatEffect,d)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P2)
exitwhen F == null
//call echo("attack")
if not IsUnitDead(F) then
call IssuePointOrder(F,"attack",GetUnitX(F2),GetUnitY(F2))
endif
call GroupRemoveUnit(P2,F)
endloop
else
if I2 > 0 then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(g,function GroupAddGroupEnumJ)
//set g2 = CopyGroup(g)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call SaveReal(Hash,GetHandleId(F),StringHash("DS_trsp"),255)
call GroupAddUnit(DSgroup,F)
call GroupRemoveUnit(P,F)
endloop
elseif CaptainIsOnCd[i2] == true then
// пока сделано так - если в течение 25 сек после спавна патруля какой-то патруль не помер, то кд не увеличивается на следующий
// from 25 to 35
set CaptainCd[i2] = CaptainCd[i2] + 35
endif
call GroupClear(g)
call DestroyGroup(g)
call FlushChildHashtable(Hash,ID)
call PauseTimer(t)
call DestroyTimer(t)
endif
call DestroyBoolExpr(b)
set b=null
set t = null
set d=null
endfunction
function Captain_Attack takes nothing returns nothing
local integer i
local real r
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local group g = LoadGroupHandle(Hash,idT,2)
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
local integer AID = LoadInteger(Hash,idT,4)
local integer i2 = LoadInteger(Hash,ID,12)
set r = LoadReal(Hash,idT,3)
set AID = 3
if AID == 3 then
set T =CreateTimer()
set ID = GetHandleId(T)
call SaveGroupHandle(Hash,ID,0,g)
call SaveInteger(Hash,ID,12,i2)
call TimerStart(T,1,false,function Patrol_Remove)
// we dont destroy group g
call FlushChildHashtable(Hash,idT)
call PauseTimer(t)
call DestroyTimer(t)
else
if AID == 0 then
set AID = 1
endif
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(g,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if not IsUnitDead(F) then
call IssuePointOrder(F,"attack",x,y)
endif
call GroupRemoveUnit(P,F)
endloop
AID++
call SaveInteger(Hash,idT,4,AID)
call SaveReal(Hash,idT,3,r)
if AID == 3 then
//call echo("starting checking")
call TimerStart(t,r*0.2,false,function Captain_Attack)
else
call TimerStart(t,r*0.4,false,function Captain_Attack)
endif
endif
set g = null
set t = null
endfunction
function GetCaptain2 takes nothing returns nothing
local integer i
local real r
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local group g = LoadGroupHandle(Hash,idT,2)
local real x = LoadReal(Hash,idT,0)
local real y = LoadReal(Hash,idT,1)
local integer i2 = LoadInteger(Hash,idT,12)
//local real x2
//local real y2
local real DistS
local unit f = Barrack[i2]
local real fc
//local sound s
//local real angle
if BetterPatrols then
set DistS = 330
set R = 320
else
set DistS = 200
set R = 333
endif
//set X = GetUnitX(f) - DistS * Cos(GetUnitFacing(f) * bj_DEGTORAD) // cos
//set Y = GetUnitY(f) - DistS * Sin(GetUnitFacing(f) * bj_DEGTORAD) // sin
// set angle = bj_RADTODEG * Atan2(GetUnitFacing(f) - GetUnitY(f), GetUnitFacing - GetLocationX(locA))
set X = GetUnitX(f) + DistS * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set Y = GetUnitY(f) + DistS * Sin(GetUnitFacing(f) * bj_DEGTORAD)
//set X = Atan2(DistS - GetUnitY(GetTriggerUnit()), GetSpellTargetX() - GetUnitX(GetTriggerUnit()))
set DistS = DistS - 50
call SetUnitAnimation( f, "stand" )
set fc = GetUnitFacing(f) + GetRandomReal(-30,30)
set F = CreateUnit(Player(11),captain, X,Y,fc)
set F2 = F
if GetRandomInt(1,2) == 1 then
call PlaySoundOnUnit( gg_snd_FootmanYesAttack3, 100, PDDS.target,95 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1400.00 )
//set s = "Units\\Human\\Footman\\FootmanYes4.wav"
else
call PlaySoundOnUnit( gg_snd_FootmanYes4, 100, PDDS.target,95 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 1400.00 )
//set s = "Units\\Human\\Footman\\FootmanYesAttack3.wav"
endif
//call PlaySoundAtPoint(s,X,Y) //,1600,90
set r = DistanceXY(GetUnitX(F),GetUnitY(F),x,y) / R
if r > 7 and r <10 then
set r = r + 2
elseif r > 10 then
set r = r + 4
endif
/* if r < 2000. then
set r = r + 3.
elseif r > 2000 and r < 4000 then
set r = r + 2
else
set r = r + 1
endif */
call GroupAddUnit(g,F)
call IssuePointOrder(F,"attack",x,y)
call UnitAddAbility(F,'ACua')
call SaveReal(Hash,GetHandleId(F),StringHash("CPT_HASTE"),r)
call GroupAddUnit(PowerDashHaste,F)
//1500
set F2 = CreateUnit(Player(0),'e00F',x, y,0)
call UnitApplyTimedLife(F2,'BTLF',6.)
if (IsPlayerInForce(GetLocalPlayer(), UndeadForce)) then //making unit invisible for UNDEAD
call SetUnitVertexColor(F2, 255, 255, 255, 0)
endif
if (IsPlayerInForce(GetLocalPlayer(), HumanForce)) then // пока так - маркер и оповещние приходят уже после спавна рескью скуад
// Use only local code (no net traffic) within this block to avoid desyncs.
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8, "|c00FD4E40Rescue squad is moving out|r")
endif
call PingMinimapForForceExJ(HumanForce, GetUnitX(F), GetUnitY(F), 3, bj_MINIMAPPINGSTYLE_SIMPLE, 60, 80, 40)
// call PingMinimapForForceExJ(HumanForce, x, y, 3, bj_MINIMAPPINGSTYLE_SIMPLE, 100, 40, 30) resucue location marker
set i = 0
loop
exitwhen i > 3
if (GetLocalPlayer() == Player(i)) then
call SetCameraQuickPosition(GetUnitX(F), GetUnitY(F))
endif
set i = i + 1
endloop
set X = GetUnitX(f) + DistS * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set Y = GetUnitY(f) + DistS * Sin(GetUnitFacing(f) * bj_DEGTORAD)
set DistS = DistS - 50
set fc = GetUnitFacing(f) + GetRandomReal(-30,30)
set F = CreateUnit(Player(11),footman, X,Y,fc)
call GroupAddUnit(g,F)
call IssuePointOrder(F,"attack",x,y)
call UnitAddAbility(F, 'A00O')
call UnitAddAbility(F,'ACua')
call UnitAddAbility(F,'A01C')
call SetUnitAbilityLevel(F,'A01C',1)
// set r = DistanceXY(GetUnitX(F),GetUnitY(F),x,y) /R
call SaveReal(Hash,GetHandleId(F),StringHash("CPT_HASTE"),r)
call GroupAddUnit(PowerDashHaste,F)
if BetterPatrols then
set X = GetUnitX(f) + DistS * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set Y = GetUnitY(f) + DistS * Sin(GetUnitFacing(f) * bj_DEGTORAD)
set DistS = DistS - 50
set fc = GetUnitFacing(f) + GetRandomReal(-30,30)
set F = CreateUnit(Player(11),sniper, X,Y,fc)
call GroupAddUnit(g,F)
call IssueTargetOrder(F,"move",F2)//x,y)
call UnitAddAbility(F, 'A00O')
call UnitAddAbility(F,'ACua')
call UnitAddAbility(F,'A01C')
call SetUnitAbilityLevel(F,'A01C',1)
// set r = DistanceXY(GetUnitX(F),GetUnitY(F),x,y) /R
call SaveReal(Hash,GetHandleId(F),StringHash("CPT_HASTE"),r)
call GroupAddUnit(PowerDashHaste,F)
set X = GetUnitX(f) + DistS * Cos(GetUnitFacing(f) * bj_DEGTORAD)
set Y = GetUnitY(f) + DistS * Sin(GetUnitFacing(f) * bj_DEGTORAD)
set DistS = DistS - 50
set fc = GetUnitFacing(f) + GetRandomReal(-30,30)
set F = CreateUnit(Player(11),priest, X,Y,fc)
call GroupAddUnit(g,F)
call IssuePointOrder(F,"attack",x,y)
call UnitAddAbility(F, 'A00O')
call UnitAddAbility(F,'ACua')
call UnitAddAbility(F,'A01C')
call SetUnitAbilityLevel(F,'A01C',2)
// set r = DistanceXY(GetUnitX(F),GetUnitY(F),x,y) /R
call SaveReal(Hash,GetHandleId(F),StringHash("CPT_HASTE"),r)
call GroupAddUnit(PowerDashHaste,F)
endif
//1500
//call echo(R2S(r))
//call echo("cp att repeat")
call SaveReal(Hash,idT,3,r)
call TimerStart(t,r,false,function Captain_Attack) //r * 0.4
set g = null
set f= null
set t = null
endfunction
function Trig_GetCaptain_Actions takes nothing returns nothing
local integer i
local real r
//local unit cp
local group g = CreateGroup()
local timer t
local integer idT
local real x
local real y
set t = CreateTimer()
set idT = GetHandleId(t)
set g= CreateGroup()
set x = CaptainX
set y = CaptainY
call SaveReal(Hash,idT,0,x)
call SaveReal(Hash,idT,1,y)
call SaveGroupHandle(Hash,idT,2,g)
call SaveInteger(Hash,idT,12,whatBarrack)
call SetUnitAnimation( Barrack[whatBarrack], "stand work" )
//local group g2
//call echo("cp go")
call TimerStart(t,6.,false,function GetCaptain2)
//call TriggerSleepAction(4.)
//call echo("cp dis")
// need to complete
// set g2 = null
set g = null
set t = null
//set cp = null
endfunction
//===========================================================================
function InitTrig_GetCaptain takes nothing returns nothing
local integer i = 1
set gg_trg_GetCaptain = CreateTrigger( )
set B = Condition(function Barracks_F)
call GroupClear(BarracksGroup)
call GroupEnumUnitsInRect(BarracksGroup,bj_mapInitialPlayableArea,B)
set Barrack[1] = gg_unit_h00D_0594
set Barrack[2] = ( gg_unit_h00D_0076 )
set Barrack[3] = ( gg_unit_h00D_0623 )
set Barrack[4] = ( gg_unit_h00D_0610 )
set Barrack[5] = ( gg_unit_h00D_0632 )
set Barrack[6] = ( gg_unit_h00D_0598 )
set Barrack[7] = ( gg_unit_h00D_0634 )
set Barrack[8] = ( gg_unit_h00D_0636 )
set Barrack[9] = ( gg_unit_h00D_0628 )
set Barrack[10] = ( gg_unit_h00D_0597 )
set Barrack[11] = ( gg_unit_h00D_0599 )
set Barrack[12] = ( gg_unit_h00D_0638 )
call DestroyBoolExpr(B)
loop
exitwhen i > 12
set CaptainCd[i] = 25
set CaptainIsOnCd[i] = false
i++
endloop
call TriggerAddAction( gg_trg_GetCaptain, function Trig_GetCaptain_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
/*****************************************************************************
*
* GetClosestWidget v3.0.1.3
* by Bannar aka Spinnaker
*
* Allows finding closest widget with ease.
*
******************************************************************************
*
* Configurables:
*
* Choose which modules should or should not be implemented.
*
* constant boolean UNITS_MODULE
* constant boolean GROUP_MODULE
* constant boolean ITEMS_MODULE
* constant boolean DESTS_MODULE
*
* Define start and final distances for search iterations within generic GetClosest functions.
* If final value is reached, enumeration is performed on whole map.
*
* constant real START_DISTANCE
* constant real FINAL_DISTANCE
*
******************************************************************************
*
* Functions:
*
* Units:
* | function GetClosestUnit takes real x, real y, boolexpr filter returns unit
* | returns unit closest to coords(x, y)
* |
* | function GetClosestUnitInRange takes real x, real y, real radius, boolexpr filter returns unit
* | returns unit closest to coords(x, y) within range radius
* |
* | function GetClosestUnitInGroup takes real x, real y, group g returns unit
* | returns unit closest to coords(x, y) within group g
*
*
* Group:
* | function GetClosestNUnitsInRange takes real x, real y, real radius, integer n, group dest, boolexpr filter returns nothing
* | adds to group dest up to N units, closest to coords(x, y) within range radius
* |
* | function GetClosestNUnitsInGroup takes real x, real y, integer n, group source, group dest returns nothing
* | adds to group dest up to N units, closest to coords(x, y) within group source
*
*
* Items:
* | function GetClosestItem takes real x, real y, boolexpr filter returns item
* | returns item closest to coords(x, y)
* |
* | function GetClosestItemInRange takes real x, real y, real radius, boolexpr filter returns item
* | returns item closest to coords(x, y) within range radius
*
*
* Destructables:
* | function GetClosestDestructable takes real x, real y, boolexpr filter returns destructable
* | returns destructable closest to coords(x, y)
* |
* | function GetClosestDestructableInRange takes real x, real y, real radius, boolexpr filter returns destructable
* | returns destructable closest to coords(x, y) within range radius
*
*
*****************************************************************************/
library GetClosestWidget
globals
private constant boolean UNITS_MODULE = true
private constant boolean GROUP_MODULE = true
private constant boolean ITEMS_MODULE = true
private constant boolean DESTS_MODULE = true
private constant real START_DISTANCE = 800
private constant real FINAL_DISTANCE = 3200
endglobals
globals
private real distance
private real coordX
private real coordY
endglobals
private keyword GroupModule
private function calcDistance takes real x, real y returns real
local real dx = x - coordX
local real dy = y - coordY
return ( (dx*dx + dy*dy) / 10000 )
endfunction
private struct ClosestWidget extends array
static if UNITS_MODULE then
static unit unit
static group group = CreateGroup()
endif
static if GROUP_MODULE then
static if not UNITS_MODULE then
static group group = CreateGroup()
endif
static integer count = 0
static unit array sorted
static real array vector
implement GroupModule
endif
static if ITEMS_MODULE then
static item item
static rect area = Rect(0, 0, 0, 0)
endif
static if DESTS_MODULE then
static destructable destructable
static if not ITEMS_MODULE then
static rect area = Rect(0, 0, 0, 0)
endif
endif
endstruct
private function Defaults takes real x, real y returns nothing
static if UNITS_MODULE then
set ClosestWidget.unit = null
endif
static if ITEMS_MODULE then
set ClosestWidget.item = null
endif
static if DESTS_MODULE then
set ClosestWidget.destructable = null
endif
set distance = 100000
set coordX = x
set coordY = y
endfunction
static if UNITS_MODULE then
//! runtextmacro DEFINE_GCW_UNIT_MODULE()
endif
static if GROUP_MODULE then
//! runtextmacro DEFINE_GCW_GROUP_MODULE()
endif
static if ITEMS_MODULE then
//! runtextmacro DEFINE_GCW_MODULE("Item", "item")
endif
static if DESTS_MODULE then
//! runtextmacro DEFINE_GCW_MODULE("Destructable", "destructable")
endif
//! textmacro DEFINE_GCW_UNIT_MODULE
private function doEnumUnits takes unit u returns nothing
local real dist = calcDistance(GetUnitX(u), GetUnitY(u))
if ( dist < distance ) then
set ClosestWidget.unit = u
set distance = dist
endif
endfunction
private function enumUnits takes nothing returns nothing
call doEnumUnits(GetEnumUnit())
endfunction
function GetClosestUnit takes real x, real y, boolexpr filter returns unit
local real r = START_DISTANCE
local unit u
call Defaults(x, y)
loop
if ( r > FINAL_DISTANCE ) then
call GroupEnumUnitsInRect(ClosestWidget.group, GetWorldBounds(), filter)
exitwhen true
else
call GroupEnumUnitsInRange(ClosestWidget.group, x, y, r, filter)
exitwhen FirstOfGroup(ClosestWidget.group) != null
endif
set r = 2*r
endloop
loop
set u = FirstOfGroup(ClosestWidget.group)
exitwhen u == null
call doEnumUnits(u)
call GroupRemoveUnit(ClosestWidget.group, u)
endloop
return ClosestWidget.unit
endfunction
function GetClosestUnitInRange takes real x, real y, real radius, boolexpr filter returns unit
local unit u
call Defaults(x, y)
if ( radius >= 0 ) then
call GroupEnumUnitsInRange(ClosestWidget.group, x, y, radius, filter)
loop
set u = FirstOfGroup(ClosestWidget.group)
exitwhen u == null
call doEnumUnits(u)
call GroupRemoveUnit(ClosestWidget.group, u)
endloop
endif
return ClosestWidget.unit
endfunction
function GetClosestUnitInGroup takes real x, real y, group g returns unit
call Defaults(x, y)
call ForGroup(g, function enumUnits)
return ClosestWidget.unit
endfunction
//! endtextmacro
//! textmacro DEFINE_GCW_GROUP_MODULE
private module GroupModule
static method doSaveUnits takes unit u returns nothing
set count = count + 1
set sorted[count] = u
set vector[count] = calcDistance(GetUnitX(u), GetUnitY(u))
endmethod
static method saveUnits takes nothing returns nothing
call doSaveUnits(GetEnumUnit())
endmethod
static method sortUnits takes integer lo, integer hi returns nothing
local integer i = lo
local integer j = hi
local real pivot = vector[(lo+hi)/2]
loop
loop
exitwhen vector[i] >= pivot
set i = i + 1
endloop
loop
exitwhen vector[j] <= pivot
set j = j - 1
endloop
exitwhen i > j
set vector[0] = vector[i]
set vector[i] = vector[j]
set vector[j] = vector[0]
set sorted[0] = sorted[i]
set sorted[i] = sorted[j]
set sorted[j] = sorted[0]
set i = i + 1
set j = j - 1
endloop
if ( lo < j ) then
call sortUnits(lo, j)
endif
if ( hi > i ) then
call sortUnits(i, hi)
endif
endmethod
static method fillGroup takes integer n, group dest returns nothing
loop
exitwhen count <= 0 or sorted[count] == null
if ( count <= n ) then
call GroupAddUnit(dest, sorted[count])
endif
set sorted[count] = null
set count = count - 1
endloop
endmethod
endmodule
function GetClosestNUnitsInRange takes real x, real y, real radius, integer n, group dest, boolexpr filter returns nothing
local unit u
call Defaults(x, y)
if ( radius >= 0 )then
call GroupEnumUnitsInRange(ClosestWidget.group, x, y, radius, filter)
loop
set u = FirstOfGroup(ClosestWidget.group)
exitwhen u == null
call ClosestWidget.doSaveUnits(u)
call GroupRemoveUnit(ClosestWidget.group, u)
endloop
call ClosestWidget.sortUnits(1, ClosestWidget.count)
call ClosestWidget.fillGroup(n, dest)
endif
endfunction
function GetClosestNUnitsInGroup takes real x, real y, integer n, group source, group dest returns nothing
local integer i = 0
call Defaults(x, y)
call ForGroup(source, function ClosestWidget.saveUnits)
call ClosestWidget.sortUnits(1, ClosestWidget.count)
call ClosestWidget.fillGroup(n, dest)
endfunction
//! endtextmacro
//! textmacro DEFINE_GCW_MODULE takes NAME, TYPE
private function enum$NAME$s takes nothing returns nothing
local $TYPE$ temp = GetEnum$NAME$()
local real dist = calcDistance(Get$NAME$X(temp), Get$NAME$Y(temp))
if ( dist < distance ) then
set ClosestWidget.$TYPE$ = temp
set distance = dist
endif
set temp = null
endfunction
function GetClosest$NAME$ takes real x, real y, boolexpr filter returns $TYPE$
local real r = START_DISTANCE
call Defaults(x, y)
loop
if ( r > FINAL_DISTANCE ) then
call Enum$NAME$sInRect(GetWorldBounds(), filter, function enum$NAME$s)
exitwhen true
else
call SetRect(ClosestWidget.area, x-r, y-r, x+r, y+r)
call Enum$NAME$sInRect(ClosestWidget.area, filter, function enum$NAME$s)
exitwhen ClosestWidget.$TYPE$ != null
endif
set r = 2*r
endloop
return ClosestWidget.$TYPE$
endfunction
function GetClosest$NAME$InRange takes real x, real y, real radius, boolexpr filter returns $TYPE$
call Defaults(x, y)
if ( radius > 0 ) then
call SetRect(ClosestWidget.area, x-radius, y-radius, x+radius, y+radius)
call Enum$NAME$sInRect(ClosestWidget.area, filter, function enum$NAME$s)
endif
return ClosestWidget.$TYPE$
endfunction
//! endtextmacro
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library CastBarSystem
/* CastBar System v1.12
by Flux
http://www.hiveworkshop.com/forums/members/flux/
CastBarSystem allows you to easily create and modifies CastBars.
Required skill to use:
* Minimum JASS scripting skills, if you know how to remove
leaks, you can easily use this system.
To know how this system works, you need vJASS knowledge.
Features:
* CastBar comes with a name and time remaining displayed as
a floating text.
* Customizable colors of CastBar and CastBar text.
* CastBars can be free-floating, attached to unit or attached
to a player's camera.
* Provides event APIs allowing you to easily detect when a
CastBar has expired.
************** HOW TO USE: **************************
1. Copy the variable "CastBar_Expires" to your map then copy
the CastBarSystem Trigger. Make sure you have Jass New Gen Pack
for this to work because it is written in vJASS.
2.1 If you are satisfied with the CastBar design, import Bar.blp and
LightningData.slk to your map as well. Make sure you have
the same path as shown here (Press F12).
2.2 If you want a different/custom design, create your own artwork
and LightningData.slk. Then configure BAR_ID based on your
values in LightningData.slk. Make sure the texture you create
is white-filled color for you to change the color.
Read more here on how to customize lightning effects so you can
make your own design for a CastBar.
http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/how-customise-lightning-effects-203171/
3. Configure and read the API provided.
*/
globals
//CONFIGURATION
//Initial Height of created CastBars
private constant real DEFAULT_HEIGHT = 50.0
//Initial Height of created CastBars attached to unit
private constant real DEFAULT_HEIGHT_IN_UNIT = 150.0
//The size of the floating text in the center of the CastBar
private constant real DEFAULT_TEXT_SIZE = 0.025
//The visual appearance of the CastBar
private constant string BAR_ID = "CBAR"
//--------------------- SET THE COLOR OF THE CAST BAR ------------------
//Set the default color of the Cast Bar. Value is between 0 and 1
//In this current setting, CastBars will have a green color by default
//RGB of empty CastBar
private constant real EMPTY_RED = 0.5
private constant real EMPTY_GREEN = 0
private constant real EMPTY_BLUE = 0
//RGB of full CastBar by default
private constant real FULL_RED = 0
private constant real FULL_GREEN = 1
private constant real FULL_BLUE = 0
//--------------------- SET THE TEXT COLOR OF THE CAST BAR ----------------
//Determines the defualt initial and final color of the CastBar's text
//In this current setting, text colors will start in fully red color and end up
//in fully green color. Value is between 0 and 255.
private constant integer TEXT_RED1 = 255
private constant integer TEXT_GREEN1 = 0
private constant integer TEXT_BLUE1 = 0
private constant integer TEXT_RED2 = 0
private constant integer TEXT_GREEN2 = 255
private constant integer TEXT_BLUE2 = 0
endglobals
/*
========================== Application Program Interface: ===========================
------------------------------------CREATE CASTBAR------------------------------------
CREATE CASTBAR INPUT ARGUMENTS
- real time: How long the CastBar will last.
- real barLength: The horizontal length of the CastBar.
- string whichName: The name in the center of the CastBar
- boolean emptyToFull: Determines the direction flow of the CastBar. If set to true, the
CastBar will start empty and fills as time goes. Setting it to false result to
opposite effect.
- boolean visibleInFog: Determines when the CastBar can be seen through Fog and BlackMask
* function CreateCastBarAtPos takes real x, real y, real time, real barLength,
string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
- Create a CastBar at a certain position by specifiying the x and y coordinate.
* function CreateCastBarAtLoc takes location l, real time, real barLength,
string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
- Create a CastBar at a certain location.
* function CreateCastBarAtUnit takes unit whichUnit, real time, real barLength,
string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
- Create a CastBar attached to a unit. The CastBar will follow the unit.
* function CreateCastBarAtPlayer takes player whichPlayer, real cameraOffset, real time,
real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
- Create a CastBar attached to a player's camera. The CastBar will follow the camera of the player.
The cameraOffset determines the position of the CastBar relative to the center of the camera.
CastBar created through this function is only visible to the player.
-------------------------------------------------------------------------------------------------
* function DestroyCastBar takes CastBar cb returns nothing
- Destroy a CastBar. Note that expiring CastBar are automatically destroyed.
* function CastBarDetach takes CastBar cb, unit whichUnit returns nothing
- Detach a CastBar from a unit so that the CastBar will no longer follow the unit.
* function CastBarMove takes CastBar cb, real x, real y returns nothing
- Move a CastBar to a certain position. Does not work if the CastBar is attached to a unit.
* function CastBarReset takes CastBar cb returns nothing
- Reset the timer of a CastBar. Also caused the CastBar to be unpaused.
* function CastBarShowText takes CastBar cb, boolean flag returns nothing
- Modifies the visibility of the CastBar text. Works in local blocks and can be used
with GetLocalPlayer()
* function CastBarShow takes CastBar cb, boolean flag returns nothing
- Modifies the visibility of a CastBar. Works in local blocks and can be used with
GetLocalPlayer(). This also modifies the visibility of the CastBar text.
* function CastBarPause takes CastBar cb, boolean flag returns boolean
- Pause/Unpause the timer of the CastBar.
* function SetCastBarTime takes CastBar cb, real newTime returns nothing
- Set the time remaining in a CastBar
* function SetCastBarPercent takes CastBar cb, real percentage returns nothing
- Set the percentage completion in a CastBar. Setting it to 0 resets the CastBar.
Setting it to 1 completes the CastBar.
* function SetCastBarHeight takes CastBar cb, real newHeight returns nothing
- Set the height of a CastBar relative from the ground.
* function SetCastBarDisplayPercent takes CastBar cb, boolean flag returns nothing
- Determines whether the text in the CastBar is displayed as percentage
or actual value.
* function SetCastBarTextSize takes CastBar cb, real newSize returns nothing
- Set the texttag size of the name and value of the CastBar.
* function SetCastBarColor takes CastBar cb, real red, real green, real blue, real alpha returns nothing
- Set the filled-CastBar color
* function SetCastBarColorChange takes CastBar cb, integer red1, integer green1, integer blue1,
integer red2, integer green2, integer blue2 returns nothing
- Set the initial and final text color of the CastBar. The text color will change
proportional to the percent completion.
* function SetCastBarInitialTime takes CastBar cb, real newInitTime returns nothing
- Change the initial time of a CastBar.
* function GetCastBarName takes CastBar cb returns string
- Returns the name of a CastBar.
* function GetCastBarUnit takes CastBar cb returns unit
- Returns the unit where the CastBar is attached.
* function GetCastBarX takes CastBar cb returns real
- Returns the x-coordinate of a CastBar.
* function GetCastBarY takes CastBar cb returns real
- Returns the y-coordinate of a CastBar.
* function GetExpiringCastBar takes nothing returns CastBar
- Returns the expiring CastBar in the Event: Game - CastBar_Expires becomes Equal to 1.00
*/
globals
//SYSTEM VARIABLES
private constant real TIMEOUT = 0.03125000
private timer periodic = CreateTimer()
private CastBar expire
private CastBar lastCreated
private location l = Location(0, 0)
endglobals
struct CastBar
unit u //The unit the CastBar is attached if any
boolean paused //Determines whether a CastBar is paused or not
real t //The current time left in the CastBar
real t0 //The initial time
real height //CastBar Height
player p //The player whose camera the CastBar is attached
real yOffset //How much below the CastBar from the center of camera
real textSize //Size of the texttag in the CastBar
texttag text
//--- CAST BAR COLOR
real er
real eg
real eb
real ea
real fr
real fg
real fb
real fa
//--- TEXT COLOR CHANGE ---
integer tr1
integer tg1
integer tb1
integer tr2
integer tg2
integer tb2
//--------------------
real nameOffset //x-offset of the string name, to make it appear in the middle
boolean textInValue //If true, the texttag in the CastBar dispays the actual value
//If false, the texttag in the CastBar dispays the percentage
readonly real x //CastBar X Location
readonly real y //CastBar Y Location
readonly string name //The name of the castbar
readonly boolean startEmpty //If true, the cast bar will start empty and fills as time goes
readonly lightning fullBar
readonly lightning emptyBar
private real length //The length of the CastBar
private boolean checkVisibility
private static integer array next
private static integer array prev
method destroy takes nothing returns nothing
//Remove from the List
set next[prev[this]] = next[this]
set prev[next[this]] = prev[this]
//Timer
if next[0] == 0 then
call PauseTimer(periodic)
endif
//Clean Handles
call DestroyLightning(.fullBar)
call DestroyLightning(.emptyBar)
if .text != null then
call DestroyTextTag(.text)
set .text = null
endif
//Clean References
set .u = null
set .p = null
set .fullBar = null
set .emptyBar = null
call deallocate()
endmethod
method move takes real xPos, real yPos returns real
local real xOffset = 0.5*.length
local real xMin = xPos - xOffset
local real xMax = xPos + xOffset
local real percent = .t/.t0
local real xMid
local real zBar = .height
local real zText = .height - 5
if .startEmpty then
set xMid = xMax - (xMax - xMin)*percent
else
set xMid = xMin + (xMax - xMin)*percent
endif
if .u != null then
call MoveLocation(l, xPos, yPos)
set zBar = zBar + GetLocationZ(l)
elseif .p != null then
call MoveLocation(l, xPos, yPos)
set zText = zText - GetLocationZ(l)
endif
if .checkVisibility then
if IsVisibleToPlayer(xPos, yPos, GetLocalPlayer()) then
call SetLightningColor(.emptyBar, .er, .eg, .eb, .ea)
call SetLightningColor(.fullBar, .fr, .fg, .fb, .fa)
else
call SetLightningColor(.fullBar, 0, 0, 0, 0)
call SetLightningColor(.emptyBar, 0, 0, 0, 0)
endif
endif
call MoveLightningEx(.emptyBar, .checkVisibility, xMin, yPos, zBar, xMax, yPos, zBar)
call MoveLightningEx(.fullBar, .checkVisibility, xMin, yPos, zBar, xMid, yPos, zBar)
call SetTextTagPos(.text, xPos - .nameOffset, yPos, zText)
set .x = xPos
set .y = yPos
return percent
endmethod
private method update takes nothing returns nothing
local real percent
//If CastBar is paused and attached,
//still update position
if .paused then
if .u != null then
call move(GetUnitX(.u), GetUnitY(.u))
elseif .p != null then
call move(GetCameraTargetPositionX(), GetCameraTargetPositionY() + .yOffset)
endif
else
set .t = .t - TIMEOUT
if .t > 0 then
if .u != null then
set percent = move(GetUnitX(.u), GetUnitY(.u))
elseif .p != null then
set percent = move(GetCameraTargetPositionX(), GetCameraTargetPositionY() + .yOffset)
else
set percent = move(.x, .y)
endif
if .textInValue then
call SetTextTagText(.text, .name + ": " + R2S(.t), .textSize)
else
call SetTextTagText(.text, .name + ": " + I2S(R2I(percent*100)), .textSize)
endif
set percent = 1 - percent
call SetTextTagColor(.text, R2I((.tr2 - .tr1)*percent + .tr1), R2I((.tg2 - .tg1)*percent + .tg1), R2I((.tb2 - .tb1)*percent + .tb1), 255)
else
set expire = this
set udg_CastBar_Expires = 1.00
set udg_CastBar_Expires = 0.00
call destroy()
endif
endif
endmethod
private static method pickAll takes nothing returns nothing
local thistype this = next[0]
loop
exitwhen this == 0
call update()
set this = next[this]
endloop
endmethod
static method create takes real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns thistype
local thistype this = allocate()
set .t0 = time
set .t = time
set .length = barLength
set .name = whichName
set .startEmpty = emptyToFull
set .checkVisibility = not visibileInFog
set .paused = false
set .height = DEFAULT_HEIGHT
set .textSize = DEFAULT_TEXT_SIZE
set .textInValue = true
set .nameOffset = I2R(StringLength(whichName) + 5)/(8*DEFAULT_TEXT_SIZE)
set .emptyBar = AddLightning(BAR_ID, .checkVisibility, 0, 0, 0, 0)
set .fullBar = AddLightning(BAR_ID, .checkVisibility, 0, 0, 0, 0)
set .text = CreateTextTag()
//CastBar Color
set .er = EMPTY_RED
set .eg = EMPTY_GREEN
set .eb = EMPTY_BLUE
set .ea = 1
set .fr = FULL_RED
set .fg = FULL_GREEN
set .fb = FULL_BLUE
set .fa = 1
call SetLightningColor(.emptyBar, .er, .eg, .eb, .ea)
call SetLightningColor(.fullBar, .fr, .fg, .fb, .fa)
//Text Color Change
set tr1 = TEXT_RED1
set tg1 = TEXT_GREEN1
set tb1 = TEXT_BLUE1
set tr2 = TEXT_RED2
set tg2 = TEXT_GREEN2
set tb2 = TEXT_BLUE2
call SetTextTagText(.text, .name + ": " + R2S(.t), DEFAULT_TEXT_SIZE)
call SetTextTagColor(.text, .tr1, .tg1, .tb1, 255)
//Insert in the list
set next[this] = 0
set prev[this] = prev[0]
set next[prev[this]] = this
set prev[0] = this
if prev[this] == 0 then
call TimerStart(periodic, TIMEOUT, true, function thistype.pickAll)
endif
return this
endmethod
endstruct
//------------------- WRAPPER FUNCTIONS ----------------------------
// You may end up not using these if you know how to use structs
function CreateCastBarAtPos takes real x, real y, real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
local CastBar cb = CastBar.create(time, barLength, whichName, emptyToFull, visibileInFog)
call cb.move(x, y)
set lastCreated = cb
return cb
endfunction
function CreateCastBarAtLoc takes location l, real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
local CastBar cb = CastBar.create(time, barLength, whichName, emptyToFull, visibileInFog)
call cb.move(GetLocationX(l), GetLocationY(l))
set lastCreated = cb
return cb
endfunction
function CreateCastBarAtUnit takes unit whichUnit, real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
local CastBar cb = CastBar.create(time, barLength, whichName, emptyToFull, visibileInFog)
set cb.u = whichUnit
set cb.height = DEFAULT_HEIGHT_IN_UNIT
set lastCreated = cb
return cb
endfunction
function CreateCastBarAtPlayer takes player whichPlayer, real cameraOffset, real time, real barLength, string whichName, boolean emptyToFull, boolean visibileInFog returns CastBar
local CastBar cb = CastBar.create(time, barLength, whichName, emptyToFull, visibileInFog)
set cb.p = whichPlayer
set cb.yOffset = cameraOffset
if GetLocalPlayer() != whichPlayer then
call DestroyTextTag(cb.text)
set cb.text = null
endif
set lastCreated = cb
return cb
endfunction
function DestroyCastBar takes CastBar cb returns nothing
call cb.destroy()
endfunction
function CastBarDetach takes CastBar cb returns nothing
set cb.u = null
endfunction
function CastBarMove takes CastBar cb, real x, real y returns nothing
call cb.move(x, y)
endfunction
function CastBarReset takes CastBar cb returns nothing
set cb.t = cb.t0
set cb.paused = false
endfunction
function CastBarShowText takes CastBar cb, boolean flag returns nothing
call SetTextTagVisibility(cb.text, flag)
endfunction
function CastBarShow takes CastBar cb, boolean flag returns nothing
if flag then
call SetLightningColor(cb.emptyBar, cb.er, cb.eg, cb.eb, cb.ea)
call SetLightningColor(cb.fullBar, cb.fr, cb.fg, cb.fb, cb.fa)
else
call SetLightningColor(cb.fullBar, 0, 0, 0, 0)
call SetLightningColor(cb.emptyBar, 0, 0, 0, 0)
endif
call SetTextTagVisibility(cb.text, flag)
endfunction
function CastBarPause takes CastBar cb, boolean flag returns nothing
set cb.paused = flag
endfunction
function SetCastBarTime takes CastBar cb, real newTime returns nothing
local real percent
if newTime > cb.t0 then
set cb.t = cb.t0
else
set cb.t = newTime
endif
set percent = cb.t/cb.t0
if cb.textInValue then
call SetTextTagText(cb.text, cb.name + ": " + R2S(cb.t), cb.textSize)
else
call SetTextTagText(cb.text, cb.name + ": " + I2S(R2I(percent*100)), cb.textSize)
endif
set percent = 1 - percent
call SetTextTagColor(cb.text, R2I((cb.tr2 - cb.tr1)*percent + cb.tr1), R2I((cb.tg2 - cb.tg1)*percent + cb.tg1), R2I((cb.tb2 - cb.tb1)*percent + cb.tb1), 255)
endfunction
function SetCastBarPercent takes CastBar cb, real percent returns nothing
if percent > 1 then
set cb.t = cb.t0
call SetTextTagColor(cb.text, cb.tr2, cb.tg2, cb.tb2, 255)
else
set percent = 1 - percent
set cb.t = cb.t0*percent
call SetTextTagColor(cb.text, R2I((cb.tr2 - cb.tr1)*percent + cb.tr1), R2I((cb.tg2 - cb.tg1)*percent + cb.tg1), R2I((cb.tb2 - cb.tb1)*percent + cb.tb1), 255)
set percent = 1 - percent
endif
if cb.textInValue then
call SetTextTagText(cb.text, cb.name + ": " + R2S(cb.t), cb.textSize)
else
call SetTextTagText(cb.text, cb.name + ": " + I2S(R2I(percent*100)), cb.textSize)
endif
endfunction
function SetCastBarHeight takes CastBar cb, real newHeight returns nothing
set cb.height = newHeight
endfunction
function SetCastBarTextSize takes CastBar cb, real newSize returns nothing
local real percent = cb.t/cb.t0
set cb.textSize = newSize
set cb.nameOffset = I2R(StringLength(cb.name) + 5)/(8*newSize)
call cb.move(cb.x, cb.y)
if cb.textInValue then
call SetTextTagText(cb.text, cb.name + ": " + R2S(cb.t), cb.textSize)
else
call SetTextTagText(cb.text, cb.name + ": " + I2S(R2I(percent*100)), cb.textSize)
endif
set percent = 1 - percent
call SetTextTagColor(cb.text, R2I((cb.tr2 - cb.tr1)*percent + cb.tr1), R2I((cb.tg2 - cb.tg1)*percent + cb.tg1), R2I((cb.tb2 - cb.tb1)*percent + cb.tb1), 255)
endfunction
function SetCastBarDisplayPercent takes CastBar cb, boolean flag returns nothing
set cb.textInValue = not flag
endfunction
function SetCastBarColor takes CastBar cb, real red, real green, real blue, real alpha returns nothing
set cb.fr = red
set cb.fg = green
set cb.fb = blue
set cb.fa = alpha
call SetLightningColor(cb.emptyBar, cb.er, cb.eg, cb.eb, cb.ea)
call SetLightningColor(cb.fullBar, cb.fr, cb.fg, cb.fb, cb.fa)
endfunction
function SetCastBarColorChange takes CastBar cb, integer red1, integer green1, integer blue1, integer red2, integer green2, integer blue2 returns nothing
set cb.tr1 = red1
set cb.tg1 = green1
set cb.tb1 = blue1
set cb.tr2 = red2
set cb.tg2 = green2
set cb.tb2 = blue2
endfunction
function SetCastBarInitialTime takes CastBar cb, real newInitTime returns nothing
set cb.t0 = newInitTime
endfunction
function GetCastBarName takes CastBar cb returns string
return cb.name
endfunction
function GetCastBarUnit takes CastBar cb returns unit
return cb.u
endfunction
function GetCastBarX takes CastBar cb returns real
return cb.x
endfunction
function GetCastBarY takes CastBar cb returns real
return cb.y
endfunction
function GetExpiringCastBar takes nothing returns CastBar
return expire
endfunction
function GetLastCreatedCastBar takes nothing returns CastBar
return lastCreated
endfunction
endlibrary
//TESH.scrollpos=39
//TESH.alwaysfold=0
library FloatingText
// Библиотека bee на xgm.ru Незаслуженно забытая система..
// Спс ему)
globals
private constant real period = 1.00 / 40.00
private constant real rate = 0.001265
private constant real max = 0.034155
private constant real min = 0.02277
private constant real lifetime = 2.80
endglobals
struct FT
static FT array data
static integer count=0
static timer timer=CreateTimer()
static method tim takes nothing returns nothing
local FT this
local integer i=0
loop
exitwhen i>=.count
set this=.data[i]
if .b then
set .fg=.fg+rate
if .fg>max then
set .b=false
else
call SetTextTagText(.tt, .s, .fg)
endif
else
set .fg=.fg-rate
if .fg<min then
call SetTextTagPermanent(.tt, false)
call SetTextTagLifespan( .tt, lifetime )
call SetTextTagFadepoint( .tt, lifetime-0.1 )
call .destroy()
set .count=.count-1
set .data[i]=.data[.count]
set i=i-1
if .count==0 then
call PauseTimer(.timer)
endif
else
call SetTextTagText(.tt, .s, .fg)
endif
endif
set i=i+1
endloop
endmethod
static method add takes texttag tt, string s returns nothing
set .data[.count]=FT.create()
set .data[.count].tt=tt
set .data[.count].fg=min
set .data[.count].b=true
set .data[.count].s=s
if .count==0 then
call TimerStart(.timer,period,true,function FT.tim)
endif
set .count=.count+1
endmethod
texttag tt
real fg
boolean b
string s
endstruct
endlibrary
//TESH.scrollpos=81
//TESH.alwaysfold=0
library Color initializer InitColor
//===========================================================================//
// Автор: quq_CCCP для сайта XGM.RU //
// копируем и юзаем, GetColoredPlayerName, GetColoredString, RED, GREEN, BLUE//
//===========================================================================//
globals
integer array RED[9]
integer array GREEN[9]
integer array BLUE[9]
private string array ColorString[9]
endglobals
function GetPlayerColorIndex takes integer nPlayerIndex returns integer
local playercolor pc = GetPlayerColor( Player( nPlayerIndex ) )
if ( pc == PLAYER_COLOR_RED ) then
return 0
elseif ( pc == PLAYER_COLOR_BLUE ) then
return 1
elseif ( pc == PLAYER_COLOR_CYAN ) then
return 2
elseif ( pc == PLAYER_COLOR_PURPLE ) then
return 3
elseif ( pc == PLAYER_COLOR_YELLOW ) then
return 4
elseif ( pc == PLAYER_COLOR_ORANGE ) then
return 5
elseif ( pc == PLAYER_COLOR_GREEN ) then
return 6
elseif ( pc == PLAYER_COLOR_PINK ) then
return 7
elseif ( pc == PLAYER_COLOR_LIGHT_GRAY ) then
return 8
elseif ( pc == PLAYER_COLOR_LIGHT_BLUE ) then
return 9
elseif ( pc == PLAYER_COLOR_AQUA ) then
return 10
elseif ( pc == PLAYER_COLOR_BROWN ) then
return 11
endif
return 0
endfunction
function GetColoredString takes integer nPlayerIndex, string str returns string
return ColorString[GetPlayerColorIndex( nPlayerIndex )] + str + "|r"
endfunction
function GetColoredPlayerName takes integer nPlayerIndex returns string
return GetColoredString( nPlayerIndex, GetPlayerName( Player( nPlayerIndex ) ) )
endfunction
function InitColor takes nothing returns nothing
local integer nIndex = 0
set RED[nIndex] = 255
set GREEN[nIndex] = 0
set BLUE[nIndex] = 0
set ColorString[nIndex] = "|cffff0000" //red
set nIndex = nIndex + 1
set RED[nIndex] = 0
set GREEN[nIndex] = 0
set BLUE[nIndex] = 255
set ColorString[nIndex] = "|cff0000ff" //blue
set nIndex = nIndex + 1
set RED[nIndex] = 0
set GREEN[nIndex] = 245
set BLUE[nIndex] = 255
set ColorString[nIndex] = "|cff00f5ff" //Teal
set nIndex = nIndex + 1
set RED[nIndex] = 85
set GREEN[nIndex] = 26
set BLUE[nIndex] = 139
set ColorString[nIndex] = "|cff551A8B" //Purple
set nIndex = nIndex + 1
set RED[nIndex] = 255
set GREEN[nIndex] = 255
set BLUE[nIndex] = 0
set ColorString[nIndex] = "|cffffff00" //Yellow
set nIndex = nIndex + 1
set RED[nIndex] = 248
set GREEN[nIndex] = 154
set BLUE[nIndex] = 0
set ColorString[nIndex] = "|cffEE9A00" //Orange
set nIndex = nIndex + 1
set RED[nIndex] = 0
set GREEN[nIndex] = 255
set BLUE[nIndex] = 0
set ColorString[nIndex] = "|cff00CD00" //Green
set nIndex = nIndex + 1
set RED[nIndex] = 255
set GREEN[nIndex] = 105
set BLUE[nIndex] = 180
set ColorString[nIndex] = "|cffFF69B4" //Pink
set nIndex = nIndex + 1
set RED[nIndex] = 192
set GREEN[nIndex] = 192
set BLUE[nIndex] = 192
set ColorString[nIndex] = "|cffC0C0C0" //Gray
set nIndex = nIndex + 1
set RED[nIndex] = 176
set GREEN[nIndex] = 226
set BLUE[nIndex] = 255
set ColorString[nIndex] = "|cffB0E2FF" //Light Blue
set nIndex = nIndex + 1
set RED[nIndex] = 0
set GREEN[nIndex] = 100
set BLUE[nIndex] = 0
set ColorString[nIndex] = "|cff006400" //Dark Green
set nIndex = nIndex + 1
set RED[nIndex] = 139
set GREEN[nIndex] = 69
set BLUE[nIndex] = 19
set ColorString[nIndex] = "|cff8B4513" //Brown
endfunction
function ResetPlayerNameColor takes boolean bColored returns nothing
local integer nIndex = 0
loop
exitwhen nIndex >= 8
if ( bColored ) then
call SetPlayerName( Player( nIndex ), GetColoredPlayerName( nIndex ) )
else
call SetPlayerName( Player( nIndex ), GetPlayerName( Player( nIndex ) ) )
endif
set nIndex = nIndex + 1
endloop
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=============================================================
// Name: Missile
// Version: 1.6.1
// Description: A system for your projectile needs.
// Author: BPower
//
// Written in JASS, API designed for usage with GUI.
// Published on hiveworkshop.com
// - hiveworkshop.com/forums/spells-569/missile-gui-version-1-1-a-275718/
//=============================================================
// Before getting started make sure that you check
// the settings in trigger Missile Configurate.
//
// udg_Missile__DummyTypeId
// • Make sure you have Vexorians dummy.mdx imported.
// • Only units of this type id will be recycled.
//
//=============================================================
// Variable naming.
//=============================================================
// Variables which users shouldn't access have no underscore.
// Array variables which are available at any time have one underscore _.
// Scalar variables which are only available during events have two underscores __.
//
//=============================================================
// Missile API.
//=============================================================
// Syntax for missile creation in GUI:
// 1. Run trigger Missile Configurate <gen>
// 2. Set properties via scalar variables.
// 3. Run trigger Missile <gen>
// JASS users may call the create and launch function directly.
//
// Missile operates with custom events.
// This means that you have access to
// a missile's properties within action functions
// of the Missile trigger interface.
//
// "udg_Missile__EventId" indicates
// which event trigger has been dispatched.
//
// "udg_Missile__EventIndex" is the array index
// of the triggering missile.
//
// Avaliable events are:
//
// 1.) udg_EVENT_MISSILE_COLLIDE_UNIT
// • Runs when a missile collides with a unit.
//
// 2.) udg_EVENT_MISSILE_COLLIDE_DEST
// • Runs when a missile collides with a destructable.
//
// 3.) udg_EVENT_MISSILE_PERIODIC
// • Runs every missile timer interval.
//
// 4.) udg_EVENT_MISSILE_FINISH
// • Runs when a missile reaches its impact position.
//
// 5.) udg_EVENT_MISSILE_REMOVE
// • Runs when a missile is destroyed.
//
// 6.) udg_EVENT_MISSILE_NOTHING
// • Value of udg_Missile__EventId when accessed
// from outside a trigger action function.
//
// During every missile event you may use the
// following GUI generated variables.
// Every scalar variable has an equivalent array variable,
// which you can read and use at any time.
// For exmple: udg_Missile__Source vs. udg_Missile_Source[index]
//
// Trigger variables which fire Missile events:
//
// trigger udg_Missile__OnCollideUnit - trigger array udg_Missile_OnUnit
// trigger udg_Missile__OnCollideDestructable - trigger array udg_Missile_OnDest
// trigger udg_Missile__OnPeridoic - trigger array udg_Missile_OnPeriodic
// trigger udg_Missile__OnRemove - trigger array udg_Missile_OnRemove
// trigger udg_Missile__OnFinish - trigger array udg_Missile_OnFinish
//
// Variables which mimic a function call:
//
// location udg_Missile__Origin
// location udg_Missile__Impact
// boolean udg_Missile__WantDestroy - boolean array udg_Missile_WantDestroy
// boolean udg_Missile__Recycle - boolean array udg_Missile_Recycle
// real udg_Missile__Scale - real array udg_Missile_Scale
// real udg_Missile__FlyTime - real array udg_Missile_FlyTime ( Converts time in seconds to a vector lenght )
// real udg_Missile__Model - string array udg_Missile_Model ( Converts a string path to a special effect )
// real udg_Missile__Arc - real array udg_Missile_Arc ( Converts an arc in degree to height value )
// real udg_Missile__Curve - real array udg_Missile_Curve ( Converts a curve in degree to an open value )
//
// Variables for read-only:
//
// integer udg_Missile__EventId
// integer udg_Missile__EventIndex
// unit udg_Missile__Dummy - unit array udg_Missile_Dummy
// real udg_Missile__Angle - real array udg_Missile_Angle ( In radians )
// real udg_Missile__Distance - real array udg_Missile_Distance ( Total distance traveled )
//
// Variables for read and set.
//
// unit udg_Missile__Source - unit array udg_Missile_Source
// unit udg_Missile__Target - unit array udg_Missile_Target ( Enables homing behaviour towards a target unit )
// player udg_Missile__Owner - unit array udg_Missile_Owner ( Pseudo-owner for better onCollide evaluation )
// real udg_Missile__ImpactZ - real array udg_Missile_ImpactZ
// real udg_Missile__OriginZ - real array udg_Missile_OriginZ
// real udg_Missile__Damage - real array udg_Missile_Damage
// real udg_Missile__Collision - real array udg_Missile_Collision
// real udg_Missile__Speed - real array udg_Missile_Speed
// real udg_Missile__Acceleration - real array udg_Missile_Acceleration
// real udg_Missile__Height - real array udg_Missile_Height ( Highest point of the parabola )
// real udg_Missile__Open - real array udg_Missile_Open
// real udg_Missile__Turn - real array udg_Missile_Turn ( Turn ratio per second )
// real udg_Missile__Data - integer array udg_Missile_Data
//
//=============================================================
// JASS user settings.
//=============================================================
// Set the timer timeout for projectile motion and trigger interface evaluation.
constant function Missile_GetTimerTimeout takes nothing returns real
return 0.031250000
endfunction
// Set the maximum widget collision radius in this map.
// By default the largest pathing is the human townhall with 196.
constant function Missile_GetMaxCollision takes nothing returns real
return 196.
endfunction
// Set the owning player of all dummy units.
// It should be a neutral player in your map.
constant function Missile_GetDummyOwner takes nothing returns player
return Player(PLAYER_NEUTRAL_PASSIVE)
endfunction
// Fictional z height for units in your map.
function Missile_GetUnitBodySize takes unit whichUnit returns real
return 100.
endfunction
// Fictional z height for destructables in your map.
function Missile_GetDestructableHeight takes destructable whichDest returns real
return GetDestructableOccluderHeight(whichDest)
endfunction
// Fictional value for the maximum effect death time in your map.
constant function Missile_GetEffectDeathTime takes nothing returns integer
return 3
endfunction
//=============================================================
// Required utility functions.
//=============================================================
// Debugging Missile.
// Change the condition from "true" to "false" or delete
// the content of this function to disable error messages.
function Missile_ErrorMessage takes boolean expr, string func, string object, integer index, string text returns nothing
local string orange = "|cffffa500"
local string blue = "|cff99b4d1"
local string next = "\n"
local string space = " "
local string str = space + next
if expr and true then
set str = str + orange + "Error in Trigger Missile|r"
set str = str + next + next + space + orange + "Function: |r" + blue + func + "|r"
set str = str + next + space + orange + "Object: |r" + blue + object + "|r"
set str = str + next + space + orange + "Index: |r" + blue + I2S(index) + "|r"
set str = str + next + space + orange + "Description: |r" + blue + text + "|r"
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.00, 0.00, 3600.00, str)
endif
endfunction
// Returns the proper Z height of point p(x/y).
function Missile_GetLocZ takes real x, real y returns real
call MoveLocation(udg_MissileLocZ, x, y)
return GetLocationZ(udg_MissileLocZ)
endfunction
function Missile_GetArc takes integer index returns real
return Tan(udg_Missile__Arc*bj_DEGTORAD)*udg_Missile_AB_Distance[index]/4
endfunction
function Missile_GetCurve takes integer index returns real
return Tan(udg_Missile__Curve*bj_DEGTORAD)*udg_Missile_AB_Distance[index]
endfunction
// Converts fly time to missile speed.
// Doesn't take acceleration into account.
function Missile_GetFlyTime takes integer index returns real
return (udg_Missile_AB_Distance[index] - udg_Missile_AB_Traveled[index])/RMaxBJ(0.0000001, udg_Missile__FlyTime)
endfunction
function Missile_Math takes integer index returns nothing
local real dx
local real dy
local real iz// Allows to set an impact offset in z.
if udg_Missile_Target[index] != null and GetUnitTypeId(udg_Missile_Target[index]) != 0 then
set udg_Missile_OriginX[index] = GetUnitX(udg_Missile_Dummy[index])
set udg_Missile_OriginY[index] = GetUnitY(udg_Missile_Dummy[index])
set udg_Missile_OriginZ[index] = GetUnitFlyHeight(udg_Missile_Dummy[index])
set udg_Missile_ImpactX[index] = GetUnitX(udg_Missile_Target[index])
set udg_Missile_ImpactY[index] = GetUnitY(udg_Missile_Target[index])
set udg_Missile_AB_Traveled[index] = 0.00
// Once you set a homing target you'll lose arc & curve settings.
// That may get patched in the next version update.
set udg_Missile_Open[index] = 0.00
set udg_Missile_Height[index] = 0.00
set udg_Missile_Curve[index] = 0.00
set udg_Missile_Arc[index] = 0.00
set iz = GetUnitFlyHeight(udg_Missile_Target[index]) + udg_Missile_ImpactZ[index]
else
set iz = udg_Missile_ImpactZ[index]
endif
loop
set dx = udg_Missile_OriginX[index] - udg_Missile_ImpactX[index]
set dy = udg_Missile_OriginY[index] - udg_Missile_ImpactY[index]
set dx = dx*dx + dy*dy
set dy = SquareRoot(dx)
exitwhen dx != 0.00 and dy != 0.00// Check for parabola limits.
set udg_Missile_OriginX[index] = udg_Missile_OriginX[index] + 0.01
endloop
set udg_Missile_A_Z[index] = Missile_GetLocZ(udg_Missile_OriginX[index], udg_Missile_OriginY[index])
set udg_Missile_B_Z[index] = Missile_GetLocZ(udg_Missile_ImpactX[index], udg_Missile_ImpactY[index])
set udg_Missile_AB_Square[index] = dx
set udg_Missile_AB_Distance[index] = dy
set udg_Missile_AB_Angle[index] = Atan2(udg_Missile_ImpactY[index] - udg_Missile_OriginY[index], udg_Missile_ImpactX[index] - udg_Missile_OriginX[index])
set udg_Missile_AB_Pitch[index] = ((iz + udg_Missile_B_Z[index]) - (udg_Missile_OriginZ[index] + udg_Missile_A_Z[index]))/dy
endfunction
// Doesn't include all array types. Only those which require a reset.
function Missile_ResetArrays takes integer index returns nothing
set udg_Missile_AB_Traveled[index] = 0.00
set udg_Missile_Acceleration[index] = 0.00
set udg_Missile_Arc[index] = 0.00
set udg_Missile_Collision[index] = 0.00
set udg_Missile_Curve[index] = 0.00
set udg_Missile_CurveX[index] = 0.00
set udg_Missile_CurveY[index] = 0.00
set udg_Missile_Damage[index] = 0.00
set udg_Missile_Data[index] = 0
set udg_Missile_Distance[index] = 0.00
set udg_Missile_Dummy[index] = null
set udg_Missile_Effect[index] = null
set udg_Missile_Model[index] = null
set udg_Missile_FlyTime[index] = 0.00
set udg_Missile_Height[index] = 0.00
set udg_Missile_OriginZ[index] = 0.00
set udg_Missile_ImpactZ[index] = 0.00
set udg_Missile_OnUnit[index] = null
set udg_Missile_OnDest[index] = null
set udg_Missile_OnPeriodic[index] = null
set udg_Missile_OnFinish[index] = null
set udg_Missile_OnRemove[index] = null
set udg_Missile_Open[index] = 0.00
set udg_Missile_Owner[index] = null
set udg_Missile_Recycle[index] = false
set udg_Missile_Scale[index] = 1.00
set udg_Missile_Source[index] = null
set udg_Missile_Speed[index] = 0.00
set udg_Missile_Target[index] = null
set udg_Missile_Turn[index] = 0.00
set udg_Missile_WantDestroy[index] = false
endfunction
function Missile_SaveUserData takes integer index returns nothing
local boolean math = false
set udg_Missile_OnUnit[index] = udg_Missile__OnCollideUnit
set udg_Missile_OnDest[index] = udg_Missile__OnCollideDestructable
set udg_Missile_OnPeriodic[index] = udg_Missile__OnPeriodic
set udg_Missile_OnFinish[index] = udg_Missile__OnFinish
set udg_Missile_OnRemove[index] = udg_Missile__OnRemove
set udg_Missile_Source[index] = udg_Missile__Source
set udg_Missile_Target[index] = udg_Missile__Target
set udg_Missile_Owner[index] = udg_Missile__Owner
set udg_Missile_Data[index] = udg_Missile__Data
set udg_Missile_Collision[index] = udg_Missile__Collision
set udg_Missile_WantDestroy[index] = udg_Missile__WantDestroy
set udg_Missile_Damage[index] = udg_Missile__Damage
set udg_Missile_Acceleration[index] = udg_Missile__Acceleration
set udg_Missile_Turn[index] = udg_Missile__Turn
// The user set a new origin point.
if udg_Missile__Origin != null then
set udg_Missile_OriginX[index] = GetLocationX(udg_Missile__Origin)
set udg_Missile_OriginY[index] = GetLocationY(udg_Missile__Origin)
call RemoveLocation(udg_Missile__Origin)
set udg_Missile__Origin = null
set math = true
endif
if udg_Missile_OriginZ[index] != udg_Missile__OriginZ then
set udg_Missile_OriginZ[index] = udg_Missile__OriginZ
set math = true
endif
if udg_Missile__Impact != null then
set udg_Missile_ImpactX[index] = GetLocationX(udg_Missile__Impact)
set udg_Missile_ImpactY[index] = GetLocationY(udg_Missile__Impact)
call RemoveLocation(udg_Missile__Impact)
set udg_Missile__Impact = null
set math = true
endif
if udg_Missile_ImpactZ[index] != udg_Missile__ImpactZ then
set udg_Missile_ImpactZ[index] = udg_Missile__ImpactZ
set math = true
endif
if math then
call Missile_Math(index)
endif
// The user defined a new model.
if udg_Missile_Model[index] != udg_Missile__Model then
set udg_Missile_Model[index] = udg_Missile__Model
if udg_Missile_Effect[index] != null then
call DestroyEffect(udg_Missile_Effect[index])
endif
if StringLength(udg_Missile__Model) > 0 then
set udg_Missile_Effect[index] = AddSpecialEffectTarget(udg_Missile__Model, udg_Missile_Dummy[index], "origin")
else
set udg_Missile_Effect[index] = null
endif
endif
// Default scaling on Missile_Create is 1.00.
if udg_Missile_Scale[index] != udg_Missile__Scale then
set udg_Missile_Scale[index] = udg_Missile__Scale
call SetUnitScale(udg_Missile_Dummy[index], udg_Missile__Scale, 0.00, 0.00)
endif
if udg_Missile_Curve[index] != udg_Missile__Curve then
set udg_Missile_Curve[index] = udg_Missile__Curve
set udg_Missile_Open[index] = Missile_GetCurve(index)
else
set udg_Missile_Open[index] = udg_Missile__Open
endif
if udg_Missile_Arc[index] != udg_Missile__Arc then
set udg_Missile_Arc[index] = udg_Missile__Arc
set udg_Missile_Height[index] = Missile_GetArc(index)
else
set udg_Missile_Height[index] = udg_Missile__Height
endif
if udg_Missile_FlyTime[index] != udg_Missile__FlyTime then
set udg_Missile_FlyTime[index] = udg_Missile__FlyTime
set udg_Missile_Speed[index] = Missile_GetFlyTime(index)
else
set udg_Missile_Speed[index] = udg_Missile__Speed
endif
endfunction
function Missile_LoadData takes integer index returns nothing
set udg_Missile__Index = index
// Load event triggers.
set udg_Missile__OnCollideUnit = udg_Missile_OnUnit[index]
set udg_Missile__OnCollideDestructable = udg_Missile_OnDest[index]
set udg_Missile__OnPeriodic = udg_Missile_OnPeriodic[index]
set udg_Missile__OnFinish = udg_Missile_OnFinish[index]
set udg_Missile__OnRemove = udg_Missile_OnRemove[index]
// Load other handle types.
set udg_Missile__Dummy = udg_Missile_Dummy[index]
set udg_Missile__Source = udg_Missile_Source[index]
set udg_Missile__Target = udg_Missile_Target[index]
set udg_Missile__Owner = udg_Missile_Owner[index]
set udg_Missile__Damage = udg_Missile_Damage[index]
set udg_Missile__Collision = udg_Missile_Collision[index]
set udg_Missile__Model = udg_Missile_Model[index]
set udg_Missile__Data = udg_Missile_Data[index]
set udg_Missile__Scale = udg_Missile_Scale[index]
set udg_Missile__WantDestroy = udg_Missile_WantDestroy[index]
set udg_Missile__Speed = udg_Missile_Speed[index]
set udg_Missile__Acceleration = udg_Missile_Acceleration[index]
set udg_Missile__Open = udg_Missile_Open[index]
set udg_Missile__Turn = udg_Missile_Turn[index]
set udg_Missile__Height = udg_Missile_Height[index]
set udg_Missile__Angle = udg_Missile_Angle[index]
set udg_Missile__Distance = udg_Missile_Distance[index]
set udg_Missile__Arc = udg_Missile_Arc[index]
set udg_Missile__Curve = udg_Missile_Curve[index]
set udg_Missile__FlyTime = udg_Missile_FlyTime[index]
set udg_Missile__OriginZ = udg_Missile_OriginZ[index]
set udg_Missile__ImpactZ = udg_Missile_ImpactZ[index]
endfunction
function Missile_ResetScalars takes nothing returns nothing
if udg_Missile__Origin != null then
call RemoveLocation(udg_Missile__Origin)
set udg_Missile__Origin = null
endif
if udg_Missile__Impact != null then
call RemoveLocation(udg_Missile__Origin)
set udg_Missile__Impact = null
endif
set udg_Missile__WantDestroy = false
set udg_Missile__Recycle = false
set udg_Missile__OnCollideUnit = null
set udg_Missile__OnPeriodic = null
set udg_Missile__OnFinish = null
set udg_Missile__OnCollideDestructable = null
set udg_Missile__OnRemove = null
set udg_Missile__Dummy = null
set udg_Missile__Source = null
set udg_Missile__Target = null
set udg_Missile__Owner = null
set udg_Missile__Model = null
set udg_Missile__Angle = 0.00
set udg_Missile__Collision = 0.00
set udg_Missile__Damage = 0.00
set udg_Missile__Speed = 0.00
set udg_Missile__Acceleration = 0.00
set udg_Missile__Open = 0.00
set udg_Missile__Height = 0.00
set udg_Missile__Turn = 0.00
set udg_Missile__Distance = 0.00
set udg_Missile__ImpactZ = 0.00
set udg_Missile__OriginZ = 0.00
set udg_Missile__Arc = 0.00
set udg_Missile__Curve = 0.00
set udg_Missile__FlyTime = 0.00
set udg_Missile__Scale = 1.00
set udg_Missile__EventId = udg_EVENT_MISSILE_NOTHING
set udg_Missile__Data = 0
set udg_Missile__Index = 0
endfunction
//=============================================================
// Wrapper functions.
//=============================================================
function Missile_RunTrigger takes integer index, trigger trig, integer eventId returns boolean
set udg_Missile__EventId = eventId
set udg_Missile__EventIndex = index
call Missile_LoadData(index)
if TriggerEvaluate(trig) then
call TriggerExecute(trig)
call Missile_SaveUserData(index)
endif
// Just in case the user accidently changes udg_Missile__Index.
set udg_Missile__EventIndex = 0
set udg_Missile__EventId = udg_EVENT_MISSILE_NOTHING
return udg_Missile__WantDestroy
endfunction
//=============================================================
// Delayed dummy recycler. Data structure stack.
//=============================================================
// According to my tests:
// - Using KillUnit(unit) will remove the 'Aloc' effect for group enumerations.
// - Using UnitApplyTimedLife(unit, 'BTLF', 0.01) keeps on dropping the fps until you hit 0.
//
// The cleanest approach appears to be RemoveUnit(unit). Using a stack with timed dummy
// recycling helps us to properly display the attached special effects.
function Missile_UpdateStack takes nothing returns nothing
local integer index = 0
loop
exitwhen index == udg_MissileDummyCount
if udg_MissileDummyTime[index] <= 0 then
call RemoveUnit(udg_MissileDummyStack[index])
set udg_MissileDummyCount = udg_MissileDummyCount - 1
if udg_MissileDummyCount == 0 then
set udg_MissileDummyStack[index] = null
call PauseTimer(udg_MissileDummyTimer)
else
set udg_MissileDummyStack[index] = udg_MissileDummyStack[udg_MissileDummyCount]
set udg_MissileDummyTime[index] = udg_MissileDummyTime[udg_MissileDummyCount]
set udg_MissileDummyStack[udg_MissileDummyCount] = null
endif
else
set udg_MissileDummyTime[index] = udg_MissileDummyTime[index] - 1
set index = index + 1
endif
endloop
endfunction
function Missile_RecycleDummy takes unit dummy returns nothing
if GetUnitTypeId(dummy) == udg_Missile__DummyTypeId then
set udg_MissileDummyTime[udg_MissileDummyCount] = Missile_GetEffectDeathTime()// Approximate death time for special effects.
set udg_MissileDummyStack[udg_MissileDummyCount] = dummy
if udg_MissileDummyCount == 0 then
call TimerStart(udg_MissileDummyTimer, 1., true, function Missile_UpdateStack)
endif
set udg_MissileDummyCount = udg_MissileDummyCount + 1
endif
endfunction
//=============================================================
// Missile structure. Static unique doubly linked list.
//=============================================================
function Missile_SetListNextNode takes integer node, integer nextNode returns nothing
set udg_MissileNextNode[node] = nextNode
endfunction
constant function Missile_GetListNextNode takes integer node returns integer
return udg_MissileNextNode[node]
endfunction
function Missile_SetListPrevNode takes integer node, integer prevNode returns nothing
set udg_MissilePrevNode[node] = prevNode
endfunction
constant function Missile_GetListPrevNode takes integer node returns integer
return udg_MissilePrevNode[node]
endfunction
function Missile_SetListFirstNode takes integer node returns nothing
set udg_MissileNextNode[0] = node
endfunction
constant function Missile_GetListFirstNode takes nothing returns integer
return udg_MissileNextNode[0]
endfunction
function Missile_SetListLastNode takes integer node returns nothing
set udg_MissilePrevNode[0] = node
endfunction
constant function Missile_GetListLastNode takes nothing returns integer
return udg_MissilePrevNode[0]
endfunction
function Missile_ListRemoveNode takes integer node returns nothing
call Missile_SetListNextNode(Missile_GetListPrevNode(node), Missile_GetListNextNode(node))
call Missile_SetListPrevNode(Missile_GetListNextNode(node), Missile_GetListPrevNode(node))
endfunction
function Missile_ListPushNode takes integer node returns nothing
call Missile_SetListPrevNode(Missile_GetListFirstNode(), node)
call Missile_SetListNextNode(node, Missile_GetListFirstNode())
call Missile_SetListFirstNode(node)
call Missile_SetListPrevNode(node, 0)
endfunction
function Missile_AllocateNode takes nothing returns integer
local integer node = udg_MissileRecycler[0]
if node == 0 then
set node = udg_MissileNodes + 1
// Overflow
if node == JASS_MAX_ARRAY_SIZE then
call Missile_ErrorMessage(true, "Missile_AllocateNode", "udg_MissileNodes", JASS_MAX_ARRAY_SIZE, "Stack overflow!")
return 0
endif
set udg_MissileNodes = node
else
set udg_MissileRecycler[0] = udg_MissileRecycler[node]
endif
set udg_MissileAllocated[node] = true
return node
endfunction
function Missile_RecycleNode takes integer node returns nothing
set udg_MissileAllocated[node] = false
set udg_MissileRecycler[node] = udg_MissileRecycler[0]
set udg_MissileRecycler[0] = node
endfunction
//=================================================================
// Destructor & Cleanup.
//=================================================================
function Missile_Clear takes integer index returns nothing
if udg_Missile_Effect[index] != null then
call DestroyEffect(udg_Missile_Effect[index])
endif
call Missile_RecycleDummy(udg_Missile_Dummy[index])
call Missile_ResetArrays(index)
call FlushChildHashtable(udg_MissileHash, index)
endfunction
function Missile_Destroy takes integer index returns nothing
if udg_MissileAllocated[index] then
if udg_MissileLaunched[index] then
if udg_Missile_OnRemove[index] != null then
call Missile_RunTrigger(index, udg_Missile_OnRemove[index], udg_EVENT_MISSILE_REMOVE)
endif
call Missile_ListRemoveNode(index)
if Missile_GetListFirstNode() == 0 then
call PauseTimer(udg_MissileTimer)
endif
set udg_MissileLaunched[index] = false
endif
call Missile_Clear(index)
call Missile_RecycleNode(index)
else
call Missile_ErrorMessage(true, "Missile_Destroy", "udg_MissileAllocated", index, "Attempt to destroy invalid node!")
endif
endfunction
//=============================================================
// Widget collision code.
//=============================================================
// For a rectangle collision z values are
// very inaccurate, hence they are completly ignored.
function Missile_IsWidgetInRectangleRad takes integer index, widget w returns boolean
local real wx = GetWidgetX(w)
local real wy = GetWidgetY(w)
local real dx = udg_Missile_PosX[index] - udg_Missile_PrevX[index]
local real dy = udg_Missile_PosY[index] - udg_Missile_PrevY[index]
local real s = (dx*(wx - udg_Missile_PrevX[index]) + dy*(wy - udg_Missile_PrevY[index]))/RMaxBJ(0.0001, (dx*dx + dy*dy))
if s < 0.00 then
set s = 0.00
elseif s > 1.00 then
set s = 1.00
endif
set dx = (udg_Missile_PrevX[index] + s*dx) - wx
set dy = (udg_Missile_PrevY[index] + s*dy) - wy
return dx*dx + dy*dy <= udg_Missile_Collision[index]*udg_Missile_Collision[index]
endfunction
function Missile_IsWidgetInRange takes integer index, widget w, real wz, real distance returns boolean
local real wx = GetWidgetX(w)
local real wy = GetWidgetY(w)
local real dz = Missile_GetLocZ(wx, wy) - udg_Missile_TerrainZ[index]
return IsUnitInRangeXY(udg_Missile_Dummy[index], wx, wy, distance) and dz + wz >= udg_Missile_PosZ[index] and dz <= udg_Missile_PosZ[index] + distance
endfunction
function Missile_SetRectRectangle takes integer index returns rect
local real x1 = udg_Missile_PrevX[index]
local real y1 = udg_Missile_PrevY[index]
local real x2 = udg_Missile_PosX[index]
local real y2 = udg_Missile_PosY[index]
local real d = udg_Missile_Collision[index] + Missile_GetMaxCollision()
// What is min, what is max ...
if x1 < x2 then
if y1 < y2 then
call SetRect(udg_MissileRect, x1 - d, y1 - d, x2 + d, y2 + d)
else
call SetRect(udg_MissileRect, x1 - d, y2 - d, x2 + d, y1 + d)
endif
else
if y1 < y2 then
call SetRect(udg_MissileRect, x2 - d, y1 - d, x1 + d, y2 + d)
else
call SetRect(udg_MissileRect, x2 - d, y2 - d, x1 + d, y1 + d)
endif
endif
return udg_MissileRect
endfunction
function Missile_SetRectCircle takes integer index returns rect
local real x = udg_Missile_PosX[index]
local real y = udg_Missile_PosY[index]
local real d = udg_Missile_Collision[index] + Missile_GetMaxCollision()
call SetRect(udg_MissileRect, x - d, y - d, x + d, y + d)
return udg_MissileRect
endfunction
function Missile_RunUnitCollision takes integer index returns nothing
local real size = udg_Missile_Collision[index]
local boolean rectangle = size < udg_Missile_Speed[index]*Missile_GetTimerTimeout()
local real collideZ
local boolean hit
local unit u
if rectangle then
call GroupEnumUnitsInRect(udg_MissileGroup, Missile_SetRectRectangle(index), null)
else
call GroupEnumUnitsInRange(udg_MissileGroup, udg_Missile_PosX[index], udg_Missile_PosY[index], size + Missile_GetMaxCollision(), null)
endif
loop
set u = FirstOfGroup(udg_MissileGroup)
exitwhen u == null
call GroupRemoveUnit(udg_MissileGroup, u)
// Chech if missile already hit this unit.
if not HaveSavedHandle(udg_MissileHash, index, GetHandleId(u)) then
set hit = false
// Evaluate rectangle collision.
if rectangle then
set hit = Missile_IsWidgetInRectangleRad(index, u)
// Evaluate circular collision.
elseif IsUnitInRange(u, udg_Missile_Dummy[index], size) then
set collideZ = Missile_GetLocZ(GetUnitX(u), GetUnitY(u)) + GetUnitFlyHeight(u) - udg_Missile_TerrainZ[index]
set hit = (collideZ + Missile_GetUnitBodySize(u) >= udg_Missile_PosZ[index] - size) and (collideZ <= udg_Missile_PosZ[index] + size)
endif
if hit then
call SaveUnitHandle(udg_MissileHash, index, GetHandleId(u), u)
set udg_Missile__UnitHit = u
if Missile_RunTrigger(index, udg_Missile_OnUnit[index], udg_EVENT_MISSILE_COLLIDE_UNIT) then
call Missile_Destroy(index)
exitwhen true
endif
endif
endif
endloop
set u = null
set udg_Missile__UnitHit = null
endfunction
function Missile_EnumDestructables takes nothing returns nothing
local integer index = udg_Missile__Index
local destructable d = GetEnumDestructable()
local boolean hit
// Enum trigger action threads can't be canceled. Therefore
// the code must check for each trigger execution if the index is still allocated.
if udg_MissileAllocated[index] and not HaveSavedHandle(udg_MissileHash, index, GetHandleId(d)) then
set hit = false
// Run rectangle collision.
if udg_Missile_Collision[index] < udg_Missile_Speed[index]*Missile_GetTimerTimeout() then
set hit = Missile_IsWidgetInRectangleRad(index, d)
else
// Run circular collision.
set hit = Missile_IsWidgetInRange(index, d, Missile_GetDestructableHeight(d), udg_Missile_Collision[index])
endif
if hit then
call SaveDestructableHandle(udg_MissileHash, index, GetHandleId(d), d)
set udg_Missile__DestructableHit = d
if Missile_RunTrigger(index, udg_Missile_OnDest[index], udg_EVENT_MISSILE_COLLIDE_DEST) then
call Missile_Destroy(index)
endif
set udg_Missile__DestructableHit = null
endif
endif
set d = null
endfunction
function Missile_RunDestructableCollision takes integer index returns nothing
set udg_Missile__Index = index
if udg_Missile_Collision[index] < udg_Missile_Speed[index]*Missile_GetTimerTimeout() then
call EnumDestructablesInRect(Missile_SetRectRectangle(index), null, function Missile_EnumDestructables)
else
call EnumDestructablesInRect(Missile_SetRectCircle(index), null, function Missile_EnumDestructables)
endif
endfunction
//=============================================================
// Core.
//=============================================================
function Missile_UpdatePosition takes integer index returns nothing
local real velocity = udg_Missile_Speed[index]*Missile_GetTimerTimeout()
local real turn = udg_Missile_Turn[index]*Missile_GetTimerTimeout()
local unit missile = udg_Missile_Dummy[index]
local real posX = GetUnitX(missile)
local real posY = GetUnitY(missile)
local real posZ
local real angle
local real point // Current point on the parabola curve.
local real pitch
local real square
local real distance
local real curveX
local real curveY
// Save previous, respectively current missile position.
// This is required for a possible rectangle collision.
set udg_Missile_PrevX[index] = posX
set udg_Missile_PrevY[index] = posY
// For further calculations local real velocity is used instead of speed[index].
set udg_Missile_Speed[index] = udg_Missile_Speed[index] + udg_Missile_Acceleration[index]
// Update missile guidance to its intended target.
if udg_Missile_Target[index] != null then
if GetUnitTypeId(udg_Missile_Target[index]) == 0 then
set udg_Missile_Target[index] = null
else
call Missile_Math(index)
endif
endif
// For read-abilty improvement, eventually also performance.
set square = udg_Missile_AB_Square[index]
set distance = udg_Missile_AB_Distance[index]
set point = udg_Missile_AB_Traveled[index]
// Update the missile angle dependant on the turn ratio.
if turn != 0.00 and Cos(udg_Missile_Angle[index] - udg_Missile_AB_Angle[index]) < Cos(turn) then
if Sin(udg_Missile_AB_Angle[index] - udg_Missile_Angle[index]) < 0.00 then
set udg_Missile_Angle[index] = udg_Missile_Angle[index] - turn
else
set udg_Missile_Angle[index] = udg_Missile_Angle[index] + turn
endif
else
set udg_Missile_Angle[index] = udg_Missile_AB_Angle[index]
endif
// Update the missile point on the parabola.
set udg_Missile_Recycle[index] = point + velocity >= distance
if udg_Missile_Recycle[index] then
set udg_Missile_Distance[index] = udg_Missile_Distance[index] + distance - point
set point = udg_Missile_AB_Distance[index]
else
set udg_Missile_Distance[index] = udg_Missile_Distance[index] + velocity
set point = point + velocity
endif
set udg_Missile_AB_Traveled[index] = point
// Set new position in plane x & y, as well as the facing angle in radians.
set angle = udg_Missile_Angle[index]
set posX = posX + velocity*Cos(angle)
set posY = posY + velocity*Sin(angle)
// Update point(x/y) if a curving trajectory is defined.
if udg_Missile_Open[index] != 0.00 then
set velocity = 4*udg_Missile_Open[index]*point*(distance - point)/square
set curveX = velocity*Cos(angle + bj_PI/2)
set curveY = velocity*Sin(angle + bj_PI/2)
set posX = posX + velocity*Cos(angle + bj_PI/2) - udg_Missile_CurveX[index]
set posY = posY + velocity*Sin(angle + bj_PI/2) - udg_Missile_CurveY[index]
set angle = angle + Atan(-((4*udg_Missile_Open[index])*(2*point - distance))/square)
// Save the current offset in plane x / y.
set udg_Missile_CurveX[index] = curveX
set udg_Missile_CurveY[index] = curveY
endif
// Update point(x,y,z) if an arc or height is defined.
set pitch = udg_Missile_AB_Pitch[index]
set udg_Missile_TerrainZ[index] = Missile_GetLocZ(posX, posY)
if udg_Missile_Height[index] == 0.00 and pitch == 0.00 then
set posZ = udg_Missile_OriginZ[index] + udg_Missile_A_Z[index] - udg_Missile_TerrainZ[index]
else
set posZ = udg_Missile_OriginZ[index] + udg_Missile_A_Z[index] - udg_Missile_TerrainZ[index] + pitch*point
set pitch = Atan(pitch)*bj_RADTODEG
if udg_Missile_Height[index] != 0.00 then
set posZ = posZ + 4*udg_Missile_Height[index]*point*(distance - point)/square
set pitch = pitch - Atan(((4*udg_Missile_Height[index])*(2*point - distance))/square)*bj_RADTODEG
endif
endif
// Update the pitch angle of the dummy unit.
if GetUnitTypeId(missile) == udg_Missile__DummyTypeId then
call SetUnitAnimationByIndex(missile, R2I(pitch + 90.5))
endif
set udg_Missile_PosX[index] = posX
set udg_Missile_PosY[index] = posY
set udg_Missile_PosZ[index] = posZ
// Finally update the missile dummy position and facing angle.
call SetUnitFacing(missile, angle*bj_RADTODEG)
call SetUnitFlyHeight(missile, posZ, 0.00)
if posX < udg_MissileMaxX and posX > udg_MissileMinX and posY < udg_MissileMaxY and posY > udg_MissileMinY then
call SetUnitX(missile, posX)
call SetUnitY(missile, posY)
endif
set missile = null
endfunction
function Missile_Core takes nothing returns boolean
local integer loops = 0 // Iteration counter.
local integer limit = 100 // Maximum iterations per trigger evaluate.
local integer index
local integer next
loop
exitwhen udg_Missile__Index == 0
exitwhen limit == loops
set index = udg_Missile__Index
set next = Missile_GetListNextNode(index)
if udg_Missile_WantDestroy[index] then
call Missile_Destroy(index)
else
set udg_Missile__Index = next
call Missile_UpdatePosition(index)
set udg_Missile__Index = index
// Run unit collision code.
if udg_MissileAllocated[index] and udg_Missile_OnUnit[index] != null and udg_Missile_Collision[index] > 0.00 then
call Missile_RunUnitCollision(index)
endif
// Run destructable collision code.
if udg_MissileAllocated[index] and udg_Missile_OnDest[index] != null and udg_Missile_Collision[index] > 0.00 then
call Missile_RunDestructableCollision(index)
endif
// Runs when the impact point is reached.
if udg_MissileAllocated[index] and udg_Missile_Recycle[index] then
if udg_Missile_OnFinish[index] != null then
if Missile_RunTrigger(index, udg_Missile_OnFinish[index], udg_EVENT_MISSILE_FINISH) then
call Missile_Destroy(index)
endif
else
call Missile_Destroy(index)
endif
endif
// Runs periodically every timer timeout.
if udg_MissileAllocated[index] and udg_Missile_OnPeriodic[index] != null then
if Missile_RunTrigger(index, udg_Missile_OnPeriodic[index], udg_EVENT_MISSILE_PERIODIC) then
call Missile_Destroy(index)
endif
endif
endif
set loops = loops + 1
set udg_Missile__Index = next
endloop
return udg_Missile__Index == 0
endfunction
// Missile_GetTimerTimeout()
function Missile_OnPeriodic takes nothing returns nothing
set udg_Missile__Index = Missile_GetListFirstNode()
loop
exitwhen TriggerEvaluate(udg_MissileCore)
endloop
call Missile_ResetScalars()
endfunction
function Missile_InitNewMissile takes integer index returns nothing
local real originX = GetLocationX(udg_Missile__Origin)
local real originY = GetLocationY(udg_Missile__Origin)
local real face = Atan2(GetLocationY(udg_Missile__Impact) - originY, GetLocationX(udg_Missile__Impact) - originX)*bj_RADTODEG
// A user may pass his/her own units as projectile dummies.
if udg_Missile__Dummy == null then
set bj_lastCreatedUnit = CreateUnit(Missile_GetDummyOwner(), udg_Missile__DummyTypeId, originX, originY, face)
set udg_Missile__Dummy = bj_lastCreatedUnit// GUI compatibility for function CreateUnitAtLocSaveLast.
call UnitAddAbility(udg_Missile__Dummy, 'Aloc')
call PauseUnit(udg_Missile__Dummy, true)
endif
// Enables fly height manipulation for the dummy.
if UnitAddAbility(udg_Missile__Dummy, 'Amrf') and UnitRemoveAbility(udg_Missile__Dummy, 'Amrf') then
endif
call SetUnitFlyHeight(udg_Missile__Dummy, udg_Missile__OriginZ, 0.00)
set udg_Missile_Dummy[index] = udg_Missile__Dummy
set udg_Missile_Scale[index] = 1.00
set udg_Missile_Angle[index] = GetUnitFacing(udg_Missile__Dummy)*bj_DEGTORAD
// Prevent the missile from colliding with itself.
call SaveUnitHandle(udg_MissileHash, index, GetHandleId(udg_Missile__Dummy), udg_Missile__Dummy)
endfunction
function Missile_BuildLocations takes nothing returns boolean
if udg_Missile__Origin == null then
// Build from dummy position.
if udg_Missile__Dummy != null then
set udg_Missile__Origin = Location(GetUnitX(udg_Missile__Dummy), GetUnitY(udg_Missile__Dummy))
// Build from source position
elseif udg_Missile__Source != null then
set udg_Missile__Origin = Location(GetUnitX(udg_Missile__Source), GetUnitY(udg_Missile__Source))
else
call Missile_ErrorMessage(true, "Missile_BuildLocations", "Missile__Origin", udg_Missile__Index, "Missile is unable to build an origin location.
The process requires either a target or source unit.")
return false
endif
endif
if udg_Missile__Impact == null then
// Build from target position.
if GetUnitTypeId(udg_Missile__Target) != 0 then
set udg_Missile__Impact = Location(GetUnitX(udg_Missile__Target), GetUnitY(udg_Missile__Target))
else
// Build from origin using angle ( radians! ) and distance.
set udg_Missile__Impact = PolarProjectionBJ(udg_Missile__Origin, udg_Missile__Distance, udg_Missile__Angle*bj_RADTODEG)
endif
endif
return true
endfunction
// Action function of trigger Missile.
function Missile_Launch takes nothing returns nothing
local integer index = udg_Missile__Index
if not udg_MissileAllocated[index] or udg_MissileLaunched[index] then
// This is an invalid situation caused by faulty
// usage of the Missile API. Missile_Launch was executed
// without a previous execution of Missile_Create.
// Error identification.
call Missile_ErrorMessage(udg_MissileLaunched[index], "Missile_Launch", "Missile_Launched", index, "Attempt to double launch a missile!
Make sure you use Run Missile Configurate <gen> - Your missile settings - Run Missile <gen> syntax.")
call Missile_ErrorMessage(not udg_MissileAllocated[index], "Missile_Launch", "Missile__Index ", index, "Attempt to launch invalid missile index!
Make sure you use Run Missile Configurate <gen> - Your missile settings - Run Missile <gen> syntax.")
// Check if Missile has to build an origin or impact location.
elseif ((udg_Missile__Origin == null) or (udg_Missile__Impact == null)) and not Missile_BuildLocations() then
call Missile_Destroy(index)
else
set udg_MissileLaunched[index] = true
if Missile_GetListFirstNode() == 0 then
call TimerStart(udg_MissileTimer, Missile_GetTimerTimeout(), true, function Missile_OnPeriodic)
endif
call Missile_ListPushNode(index)
call Missile_InitNewMissile(index)
call Missile_SaveUserData(index)
endif
call Missile_ResetScalars()
if udg_Missile__EventIndex != 0 then
call Missile_LoadData(udg_Missile__EventIndex)
endif
endfunction
// Action function of trigger Missile Configurate.
function Missile_Create takes nothing returns nothing
// In most cases udg_Missile__Index is 0, thus not allocated.
if udg_MissileAllocated[udg_Missile__Index] then
// Check if Missile_Create runs from inside a Missile event trigger.
if udg_Missile__EventIndex == udg_Missile__Index then
// Save all data from scalar to array variables.
call Missile_SaveUserData(udg_Missile__EventIndex)
elseif not udg_MissileLaunched[udg_Missile__Index] then
// This is an invalid situation caused by faulty
// usage of the Missile API. Missile_Create was executed twice
// without launching the previously created index.
// Missile compensates for that error by destroying
// the forgotten index.
call Missile_Destroy(udg_Missile__Index)
// Print it for the user.
call Missile_ErrorMessage(true, "Missile_Create", "Missile_Launched", udg_Missile__Index, "You forgot to launch the previous created missile!
Make sure you use Run Missile Configurate <gen> - Your missile settings - Run Missile <gen> syntax.")
endif
endif
call Missile_ResetScalars()
set udg_Missile__Index = Missile_AllocateNode()
endfunction
//===========================================================================
function InitTrig_Missile takes nothing returns nothing
if gg_trg_Missile != null then
return// Missile has already been initialized.
endif
set udg_MissileHash = InitHashtable()
set udg_MissileCore = CreateTrigger()
set udg_MissileRect = GetWorldBounds()
set udg_MissileLocZ = Location(0.00, 0.00)
// It's necessary to prevent missiles, units in general, from leaving map boundaries.
set udg_MissileMaxX = R2I(GetRectMaxX(udg_MissileRect)) - 197
set udg_MissileMaxY = R2I(GetRectMaxY(udg_MissileRect)) - 197
set udg_MissileMinX = R2I(GetRectMinX(udg_MissileRect)) + 197
set udg_MissileMinY = R2I(GetRectMinY(udg_MissileRect)) + 197
// Trigger that controlls the trajectory of all missiles.
call TriggerAddCondition(udg_MissileCore, Condition(function Missile_Core))
// Run the configuration trigger before the first missile is created.
call TriggerExecute(gg_trg_Missile_Configurate)
call TriggerClearActions(gg_trg_Missile_Configurate)
call DestroyTrigger(gg_trg_Missile_Configurate)
// Transform the configurate trigger into the index allocator.
set gg_trg_Missile_Configurate = CreateTrigger()
call TriggerAddAction(gg_trg_Missile_Configurate, function Missile_Create)
// Build the launching trigger for missiles.
set gg_trg_Missile = CreateTrigger()
call TriggerAddAction(gg_trg_Missile, function Missile_Launch)
// Set the missile system ready.
call Missile_ResetScalars()
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Big_Bomber_Cast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A002' ) ) then
return false
endif
return true
endfunction
function Trig_Big_Bomber_Cast_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 3
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Big_Bomber_Cast takes nothing returns nothing
set gg_trg_Big_Bomber_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Big_Bomber_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Big_Bomber_Cast, Condition( function Trig_Big_Bomber_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Big_Bomber_Cast, function Trig_Big_Bomber_Cast_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Zoom_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(),6,10))
//call Msg(I2S(i),2.5)
if i >= 1000 and i <= 5000 then
set distance[GetPlayerId(GetTriggerPlayer())] = i
endif
endfunction
//===========================================================================
function InitTrig_Zoom takes nothing returns nothing
set gg_trg_Zoom = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(0), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(1), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(2), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(3), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(6), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(7), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(8), "-zoom ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Zoom, Player(9), "-zoom ", false )
call TriggerAddAction( gg_trg_Zoom, function Trig_Zoom_Actions )
endfunction
//TESH.scrollpos=846
//TESH.alwaysfold=0
scope OnDamage initializer i
function OrcHero_Fell1 takes nothing returns nothing
local unit d
set T = GetExpiredTimer()
set I = GetHandleId(T)
set I2 = LoadInteger(Hash,I,2)
if I2 == 0 then
set I2 = 1
else
I2++
endif
call SaveInteger(Hash,I,2,I2)
//call echo(I2S(I2))
if I2 == 1 then
set d = CreateUnit(Player(4),dummy,GetUnitX(OrcHero),GetUnitY(OrcHero),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'Awrh')
call SetUnitAbilityLevel(d,'Awrh',2)
call IssueImmediateOrder(d,"stomp")
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",GetUnitX(OrcHero),GetUnitY(OrcHero)))
call PauseUnit(OrcHero,false)
call UnitAddAbility(OrcHero,'Abun')
//call UnitAddAbility(OrcHero,'Avul')
if not IsUnitDead(gg_unit_nchw_0857) then
call KillUnit(gg_unit_nchw_0857)
endif
if not IsUnitDead(gg_unit_nchw_0856) then
call KillUnit(gg_unit_nchw_0856)
endif
call TimerStart(T,1.5,false,function OrcHero_Fell1)
elseif I2 == 2 then
call PauseUnit(OrcHero,true)
call SetUnitAnimation(OrcHero,"death")
call CreateItem('axas',GetUnitX(OrcHero), GetUnitY(OrcHero))
call TimerStart(T,1.5,false,function OrcHero_Fell1)
elseif I2 == 3 then
set S = "... that's painful"
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 14 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcHero), GetUnitY(OrcHero), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.5)
if IsPlayerInForce(GetLocalPlayer(),HumanForce)
set S = " |c00FE6741 Underestimated... Next time Ill finish you!|r "
endif
set TX = CreateTextTag()
call SetTextTagColor(TX, 143, 120, 150, 250) //250
call SetTextTagTextJ(TX, S, 14 ) //14 05
call SetTextTagPos(TX, GetUnitX(OrcHero), GetUnitY(OrcHero), GetRandomReal( 15, 25))
call SetTextTagVelocity(TX, 0.01, 0.04) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 5.5)
call SetUnitOwner(gg_unit_ojgn_0847,Player(4),true)
call IssuePointOrder(gg_unit_ojgn_0847,"move",-6135,-13150)
call TimerStart(T,2.5,false,function OrcHero_Fell1)
elseif I2 == 4
call PauseUnit(OrcHero,false)
call IssuePointOrder(OrcHero,"move",-6135,-13150)
call TimerStart(T,2.5,false,function OrcHero_Fell1)
elseif I2 == 5
call PauseUnit(OrcHero,false)
call SetUnitMoveSpeed(OrcHero,200)
call IssueTargetOrder(gg_unit_ojgn_0847,"load",OrcHero)
call IssueTargetOrder(OrcHero,"load",gg_unit_ojgn_0847)
call TimerStart(T,4.,false,function OrcHero_Fell1)
elseif I2 == 6
call DestroyTimer(T)
call FlushChildHashtable(Hash,I)
call IssuePointOrder(gg_unit_ojgn_0847,"move",-8478,-13710)
call SaveReal(Hash,GetHandleId(gg_unit_ojgn_0847),StringHash("DS_trsp"),255)
call GroupAddUnit(DSgroup,gg_unit_ojgn_0847)
call QuestSetCompleted( OrcInvasion, true )
call MsgForce(HumanForce,"|c00FF712DOrc Invasion|r - quest completed. |c00FEBA0E+1500")
set QuestCompleted[6] = true
set I = 1500 / T1Nplayer
set I2 = 0
loop
exitwhen I2 > 3
if PlayerIsActive(Player(I2)) then
call SetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(I2),PLAYER_STATE_RESOURCE_GOLD) + I)
endif
I2++
endloop
endif
set d = null
endfunction
function WhirlWind_Stops takes nothing returns nothing
set T = GetExpiredTimer()
set I = GetHandleId(T)
local real r = LoadReal(Hash,I,0)
set X = LoadReal(Hash,I,1)
set Y = LoadReal(Hash,I,2)
if r <= 0. then
set r = 0.1
//call TimerStart(GetExpiredTimer(),0.1,true,function WhirlWind_Stops)
else
set r = r + 0.1
endif
call SaveReal(Hash,I,0,r)
if r >= 2.5 and not OrcInvasion_made and not OrcInvasion_elapsed then
//call echo("ending of 1 spell")
call UnitRemoveAbility(OrcHero,'AOww')
call FlushChildHashtable(Hash,I)
call DestroyTimer(GetExpiredTimer())
call SaveBoolean(Hash,GetHandleId(OrcHero),StringHash("Whirlwind_active"),false)
else
call SetUnitX(OrcHero,X)
call SetUnitY(OrcHero,Y)
endif
//call SetUnitMoveSpeed(OrcHero,320)
//call PauseUnit(OrcHero,false)
//if
//call TimerStart(GetExpiredTimer(),0.5,false,function WhirlWind_Stops)
//endif
endfunction
function WhirlWind_A takes nothing returns nothing
local group g
local unit f
local integer i2
call PauseUnit(OrcHero,false)
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(OrcHero),StringHash("WhirlWind_eff1")))
if not OrcInvasion_elapsed and not IsUnitDead(OrcHero) and not IsUnitInGroup(OrcHero,OrcMovesBack) and GetUnitState(OrcHero,UNIT_STATE_MANA) > 200 then
//actually he cannot be stunned to prevent whirwind now
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",GetUnitX(OrcHero),GetUnitY(OrcHero)))
call SetUnitLife(OrcHero,GetUnitLife(OrcHero) + 300)
set g= CreateGroup()
//set B = Condition(function Revelation_F)
call GroupEnumUnitsInRange(g,GetUnitX(OrcHero),GetUnitY(OrcHero),200,null)
loop
set f = FirstOfGroup(g)
exitwhen f == null
if not IsUnitDead(f) and IsUnitEnemy(f,Player(4)) then
call UnitDamageTargetEx(OrcHero,f,190 ,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS) //dmg
endif
call GroupRemoveUnit(g,f)
endloop
call UnitAddAbility(OrcHero,'AOww')
call IssueImmediateOrder(OrcHero,"whirlwind")
set i2 = GetHandleId(GetExpiredTimer())
call SaveReal(Hash,i2,1,GetUnitX(OrcHero))
call SaveReal(Hash,i2,2,GetUnitY(OrcHero))
//call SetUnitMoveSpeed(OrcHero,50)
//call UnitRemoveAbility( OrcHero, 'Amov' )
//call PauseUnit(OrcHero,true)
call SaveBoolean(Hash,GetHandleId(OrcHero),StringHash("Whirlwind_active"),true)
call TimerStart(GetExpiredTimer(),0.1,true,function WhirlWind_Stops)
call DestroyGroup(g)
else
call DestroyTimer(GetExpiredTimer())
endif
set f = null
set g= null
endfunction
function Explode takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local unit u = LoadUnitHandle(Hash,idT,0)
local unit source = LoadUnitHandle(Hash,idT,1)
local real x
local real y
if IsUnitDead(u) then
set x = GetUnitX(u)
set y = GetUnitY(u)
if GetUnitTypeId(source) == steamtank then
call DestroyEffect(AddSpecialEffect("CorpseExplosion.mdx",x,y))
elseif GetUnitTypeId(u) == 'nvil' or GetUnitTypeId(u) == 'nvlw'/*
*/ or GetUnitTypeId(u) == 'nhef' or GetUnitTypeId(u) == 'nvl2' /*
*/ or GetUnitTypeId(u) == footman or GetUnitTypeId(u) == sniper or/*
*/ GetUnitTypeId(u) == sorcerer or GetUnitTypeId(u) == priest then
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl",x,y))
elseif GetUnitTypeId(u) == zombie or GetUnitTypeId(u) == zombiew then // красная мякоть
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Orc\\OrcLargeDeathExplode\\OrcLargeDeathExplode.mdl",x,y))
elseif GetUnitTypeId(u) == 'nslm' then // темно красная мякоть
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl",x,y))
elseif GetUnitTypeId(u) == murl then // темно-темно красная...
call DestroyEffect(AddSpecialEffect("Units\\Undead\\Abomination\\AbominationExplosion.mdl",x,y))
elseif GetUnitTypeId(u) == 'nslm' then // масисвный хлопок из воздуха :D
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\GryphonRiderMissile\\GryphonRiderMissileTarget.mdl",x,y))
endif
//if GetUnitTypeId(u) != 'hwt2' then
//call SetUnitVertexColor(u,200,200,200,0)
//call FlushChildHashtable(Hash,GetHandleId(u))
call ShowUnit(u,false)
//endif
//endif
endif
call FlushChildHashtable(Hash,idT)
call DestroyTimer(t)
set t = null
set u = null
set source=null
endfunction
function OnDamage_Actions takes nothing returns nothing
local timer t
local integer idT
local real r
local unit d
local real ff
local real x
local real y
local boolean bl
// local integer typ
// local integer idM
local integer pid
// local integer sp1
// local integer sp2
// local integer sp3
// local integer sp4
// local integer sp5
local integer il
local integer ii
//local integer targetype =
// local item indexItem
//local real x2
// local real y2
if (GetUnitTypeId(PDDS.target) == 'H00F'/*
*/or GetUnitTypeId(PDDS.target) == 'H00E' /*
*/ or GetUnitTypeId(PDDS.target) == 'H00G' /*
*/or GetUnitTypeId(PDDS.target) == 'H00H') then // and PDDS.amount > GetUnitState(PDDS.target,UNIT_STATE_LIFE) *0.01 /GetUnitState(PDDS.target,UNIT_STATE_MAX_LIFE)and MountSwapTime[GetPlayerId(GetOwningPlayer(PDDS.target))] == false
//call echo("got damaged")
set pid = GetPlayerId(GetOwningPlayer(PDDS.target))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl",GetUnitX(PDDS.target),GetUnitY(PDDS.target)))
ii = GetUnitAbilityLevel(PDDS.target,'A01F')
if pid == 0 then
set il = 'A01M'
elseif pid == 1 then
set il = 'A01O'
elseif pid == 2 then
set il = 'A01S'
elseif pid == 3 then
set il = 'A01T'
//call
endif
//set I2 = GetUnitAbilityLevel(PDDS.target,'A01U')
// тут надо учитывать в ульти что бафа то уже нет от ульты
call SetUnitAbilityLevel(PDDS.target,'A01U',1)
//call UnitRemoveAbility(PDDS.target,'A01U')
call GroupRemoveUnit(MountSpeedIncreasement,PDDS.target)
call UnitAddAbility(PDDS.target,il)
call UnitRemoveAbility(PDDS.target,il)
call SetUnitAbilityLevel(PDDS.target,'A01U',1)
if GetUnitAbilityLevel(PDDS.target,'A003') < 1 then
call UnitAddAbility( PDDS.target,'A003' )
endif
if IsUnitInGroup(PDDS.target,Radiance) then
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(PDDS.target),StringHash("Radiance_eff")))
call SaveEffectHandle(Hash,GetHandleId(PDDS.target),StringHash("Radiance_eff"),/*
*/AddSpecialEffectTarget("Liberty.mdx",PDDS.target,"chest"))
endif
// daem slow
call UnitAddAbility(PDDS.target,'A01V')
call GroupAddUnit(UnmountedSlow, PDDS.target)
call SaveReal(Hash, GetHandleId(PDDS.target), StringHash("UnmountedSlow_r"),3.)
call SetPlayerAbilityAvailable(Player(pid), 'A01J', true)
//call UnitRemoveAbility(PDDS.target,'A01U')
call GroupRemoveUnit(MountSpeedIncreasement,PDDS.target)
elseif 1 == 3 and GetUnitTypeId(PDDS.source) == 'H00F' then //and MountSwapTime[GetPlayerId(GetOwningPlayer(PDDS.source))] == false
//call echo("did damage"
endif
if UnitTypeNotDummy(PDDS.target) then
//if IsUnitInGroup(PDDS.source,DreadLords) then Проверено - дамаг выдается спустя резист
//call echo(R2S(PDDS.amount))
//endif
/*
set R = LoadReal(Hash,GetHandleId(PDDS.target),StringHash("HolyBoltDamage"))
if R > 0 then
call echo("sad")
call UnitDamageTargetEx(PDDS.source, PDDS.target, R, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
endif */
if GetOwningPlayer(PDDS.target) == Player(10) and (GetUnitTypeId(PDDS.target) == zombie or GetUnitTypeId(PDDS.target) == zombiew) and PDDS.amount > GetUnitLife(PDDS.target) * 3 then //5
set t = CreateTimer()
set idT = GetHandleId(t)
//call SaveBoolean(Hash,GetHandleId(PDDS.target),StringHash("Explode_true"),true)
call SaveUnitHandle(Hash,idT,0,PDDS.target)
call SaveUnitHandle(Hash,idT,1,PDDS.source)
call TimerStart(t,0.2,false,function Explode)
endif
if IsUnitInGroup(PDDS.target,DSgroup) and GetUnitAbilityLevel(PDDS.target,'ACua') > 0 and GetUnitTypeId(PDDS.source) != 'e00L' then
call SetUnitVertexColor(PDDS.target, 255, 255, 255, 255)
call SaveReal(Hash, GetHandleId(PDDS.target), StringHash("DS_trsp"), 255)
endif
if (GetOwningPlayer(PDDS.source) == Player(4) or GetOwningPlayer(PDDS.source) == Player(12)) and IsPlayerInForce(GetOwningPlayer(PDDS.target),UndeadForce)
set PDDS.amount = PDDS.amount * 1.6 //1.6
endif
if (GetOwningPlayer(PDDS.target) == Player(4) or GetOwningPlayer(PDDS.target) == Player(12)) and IsPlayerInForce(GetOwningPlayer(PDDS.source),UndeadForce)
set PDDS.amount = PDDS.amount * 0.6 //0.6
endif
if GetInventoryIndexOfItemTypeJ(PDDS.target, 'fwss') > 0 and GetRandomInt(0,100) < 15 //15
set d = CreateUnit(GetOwningPlayer(PDDS.target),dummy,GetUnitX(PDDS.source),GetUnitY(PDDS.source),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'AUsl')
call IssueTargetOrder(d,"sleep",PDDS.source)
endif
if Everlasting and (GetUnitTypeId(PDDS.target) == zombie or GetUnitTypeId(PDDS.target) == zombiew) and PDDS.amount > GetUnitLife(PDDS.target) /*
*/ and GetUnitAbilityLevel(PDDS.target,'AOre') == 0 //and not LoadBoolean(Hash,GetHandleId(PDDS.target),StringHash("Explode_true"))
call UnitAddAbility(PDDS.target,'AOre')
endif
//Crystal shield buff
if GetUnitAbilityLevel(PDDS.target,'BHds') > 0 then
set PDDS.amount = 0
endif
if PDDS.target == gg_unit_h008_0577 and FurblogsCanBeCanceled == true then
set FurblogsCanBeCanceled = false
call QuestSetFailed( Furblogs, true )
set udg_WithinRangeUnit = gg_unit_h008_0577
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(udg_WithinRangeUnit) )
//call DisplayTextToForce( GetPlayersAll(), ( "Remove RangeDetecion: " + R2S(udg_WithinRangeRange) ) )
call TriggerExecute( udg_WithinRange__DeRegister )
call KillUnit( gg_unit_e00P_0283 )
call KillUnit(LoadUnitHandle(Hash,GetHandleId(gg_unit_h008_0577),StringHash("QuestMark"))) // yeah our bro gets damage and thats it
call RemoveSavedHandle(Hash,GetHandleId(gg_unit_h008_0577),StringHash("QuestMark"))
call GroupRemoveUnit(QuestionMarkGroup,gg_unit_h008_0577)
call DisableTrigger(gg_trg_FurblogsQuest)
endif
if PDDS.amount > 0 and not IsUnitType(PDDS.target,UNIT_TYPE_STRUCTURE) /*
*/ then
//CAUSES SLOW
//BEFORE 3.2 - CAUSES SLOW FOR BOTH SOURCE AND TARGET UNIT
//AFTER 3.2 - CAUSES SLOW ONLY FOR TARGET
set d = CreateUnit(GetOwningPlayer(PDDS.source),dummy,GetUnitX(PDDS.target),GetUnitY(PDDS.target),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'A00E')
call IssueTargetOrder(d,"slow",PDDS.target)
call UnitAddAbility(PDDS.source,'Aasl')
call GroupAddUnit(AttackingGroup,PDDS.source)
call SaveReal(Hash,GetHandleId(PDDS.source),StringHash("Attacking"),4.)
/*
set d = CreateUnit(GetOwningPlayer(PDDS.target),dummy,GetUnitX(PDDS.source),GetUnitY(PDDS.source),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'A00E')
call IssueTargetOrder(d,"slow",PDDS.source) */
endif
if IsUnitInGroup(PDDS.target,Paladins) and GetUnitTypeId(PDDS.source) == 'ugho' then
set PDDS.amount = PDDS.amount * 2.00
//ghoul deals 200% damage against paladins
endif
if IsUnitInGroup(PDDS.target,Paladins) and GetUnitAbilityLevel(PDDS.target,'A01F') > 0 then
set PDDS.amount = PDDS.amount * 0.85
endif
if IsUnitInGroup(PDDS.target,DreadLords) and IsUnitInGroup(PDDS.source,Paladins) then // 20% additional damage / block of 20% incoming damage
set PDDS.amount = PDDS.amount * 1.20
elseif IsUnitInGroup(PDDS.target,Paladins) and IsUnitInGroup(PDDS.source,DreadLords) then
set PDDS.amount = PDDS.amount * 0.80
endif
if GetUnitAbilityLevel(PDDS.target,'B002') > 0 or GetUnitAbilityLevel(PDDS.target,'B003') > 0 then
//call Msg("отслежена атака",2.)
if GetInventoryIndexOfItemTypeJ(PDDS.source, 'rugt') > 0
set d = CreateUnit(GetOwningPlayer(PDDS.source),dummy,GetUnitX(PDDS.target),GetUnitY(PDDS.target),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'Afae')
call IssueTargetOrder(d,"faeriefire",PDDS.target)
endif
if GetUnitAbilityLevel(PDDS.target,'B002') > 0 then // МИЛИ М И Л И MELEE
//if IsUnitInGroup(PDDS.source,Paladins)
//call Msg("мили",2.)
//endif
if IsUnitInGroup(PDDS.source,DreadLords)
call SaveReal(Hash,GetHandleId(PDDS.source),StringHash("DreadInvis"),4.)
if GetUnitAbilityLevel(PDDS.source,Invis) > 0 then
call UnitRemoveAbility(PDDS.source,Invis)
call GroupAddUnit(DreadStealth,PDDS.source)
endif
endif
if GetInventoryIndexOfItemTypeJ(PDDS.source, 'axas') > 0 //15
call SetUnitLife(PDDS.source,GetUnitLife(PDDS.source) + PDDS.amount*0.5)
call DestroyEffect(AddSpecialEffect("BirdShitTarget_1.mdx",GetUnitX(PDDS.source),GetUnitY(PDDS.source)))
endif
if GetUnitAbilityLevel(PDDS.source,'ANca') > 0 then
call UnitRemoveAbility(PDDS.source,'ANca')
set BladeCd = 5.
endif
if GetUnitTypeId(PDDS.target) == sniper and Planning and not IsUnitType(PDDS.source,UNIT_TYPE_HERO) then
set bl = false
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(PDDS.target),GetUnitY(PDDS.target),800,null)
loop
set F = FirstOfGroup(P)
exitwhen F == null or bl == true
if GetUnitMaxLife(F) > 0 and not IsUnitDead(F) then
set R = GetUnitLife(F) / GetUnitMaxLife(F) * 100.0
else
set R = 0.
endif
if (GetUnitTypeId(F) == footman or GetUnitTypeId(F) == captain) and R > 50 then
set bl = true
set x = GetUnitX(F)
set y = GetUnitY(F)
set ff =AngleBetweenXY(GetUnitX(PDDS.source),GetUnitY(PDDS.source),x,y)
set x=x+200*Cos(ff*bj_DEGTORAD)
set y=y+200*Sin(ff*bj_DEGTORAD)
call IssuePointOrder(PDDS.target,"move",x,y)
endif
call GroupRemoveUnit(P,F)
endloop
endif
if IsUnitInGroup(PDDS.target,ShareVisionGroup) and IsUnitInGroup(PDDS.source,DreadLords) then
set ff = GetUnitFacing(PDDS.source) - GetUnitFacing(PDDS.target)
//call echo(R2S(ff))
set x = GetUnitX(PDDS.target)
set y = GetUnitY(PDDS.target)
if (ff > -52 and ff < 52) then //and DistanceXY(x,y,GetUnitX(PDDS.source),GetUnitY(PDDS.source)) < 145
//call SetUnitAnimation(at,"Stand, Defend")
//call echo("спина")
call AddEffectTimeToUnit("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",PDDS.target,"chest",1.5)
/* set d = CreateUnit(GetOwningPlayer(at),dummy,GetUnitX(at),GetUnitY(at),0)
call UnitApplyTimedLife(d,'BTLF',0.1)
call UnitAddAbility(d,'A01T')
call IssueTargetOrder(d,"creepthunderbolt",ar) */
set I = LoadInteger(Hash,GetHandleId(PDDS.target),StringHash("SV_i"))
if I == 1 then
set PDDS.amount = PDDS.amount * 2.5
elseif I == 2 then
set PDDS.amount = PDDS.amount * 3.5
elseif I == 3 then
set PDDS.amount = PDDS.amount * 4.5
endif
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagColor(bj_lastCreatedTextTag, 243, 90, 50, 250) //250
call SetTextTagText(bj_lastCreatedTextTag, I2S(R2I(PDDS.amount)), 0.006 ) //14 05
call SetTextTagPos(bj_lastCreatedTextTag, GetUnitX(PDDS.source), GetUnitY(PDDS.source), GetRandomReal( 25, 35))
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.02, 0.02) //0.06 0.04
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.7)
call FT.add(bj_lastCreatedTextTag, I2S(R2I(PDDS.amount)))
call SaveReal(Hash,GetHandleId(PDDS.target),StringHash("SV_r"),/*
*/LoadReal(Hash,GetHandleId(PDDS.target),0))
/*call SaveReal(Hash,GetHandleId(PDDS.target),StringHash("SV_r"),LoadReal(Hash,GetHandleId(PDDS.target),StringHash("SV_r")) - 4) */
endif
endif
if GetUnitAbilityLevel(PDDS.source,'B007') > 0 then // ZEAL STUN + DAMAGE
call GroupRemoveUnit(Zeal_Casters,PDDS.source)
//call UnitRemoveAbility(PDDS.source,'A00J')
set I2 = LoadInteger(Hash,GetHandleId(PDDS.source),StringHash("Zeal_lvl"))
if I2 == 1 then
set I = 3
//call SetUnitAbilityLevel(c,'A00J',1)
elseif I2 == 2 then
set I = 5
//call SetUnitAbilityLevel(c,'A00J',3)
elseif I2 == 3 then
set I = 7
//call SetUnitAbilityLevel(c,'A00J',5)
endif
call SetUnitAbilityLevel(PDDS.source,'A01U',GetUnitAbilityLevel(PDDS.source,'A01U') - I)
call UnitRemoveAbility(PDDS.source,'A00K')
call UnitRemoveAbility(PDDS.source,'B007')
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(PDDS.source),StringHash("Zeal_e")))
call RemoveSavedHandle(Hash,GetHandleId(PDDS.source),StringHash("Zeal_e"))
call RemoveSavedReal(Hash,GetHandleId(PDDS.source),StringHash("Zeal_time"))
call RemoveSavedInteger(Hash, GetHandleId(PDDS.source), StringHash("Zeal_lvl"))
set d = CreateUnit(GetOwningPlayer(PDDS.source),dummy,GetUnitX(PDDS.target),GetUnitY(PDDS.target),0)
call UnitApplyTimedLife( d,'BTLF' , 0.1 )
call UnitAddAbility(d,'A22Q')
call SetUnitAbilityLevel(d,'A22Q',GetUnitAbilityLevel(PDDS.source,'A00I'))
call IssueTargetOrder(d,"creepthunderbolt",PDDS.target)
call KillUnit(CreateUnit(GetOwningPlayer(PDDS.source),'e00J',GetUnitX(PDDS.target),GetUnitY(PDDS.target),0))
call DestroyEffect(AddSpecialEffect("Divine Edict.mdx",GetUnitX(PDDS.target),GetUnitY(PDDS.target)))
call PlaySoundOnUnit( gg_snd_Incinerate1, 100, PDDS.target,127 )
call SetSoundDistanceCutoff( bj_lastPlayedSound, 950.00 )
//call AddEffectTimeToUnit("Flameshock.mdx",PDDS.target,"chest",2.5)
if GetUnitAbilityLevel(PDDS.source,'A00I') == 1 then
set R = 20
elseif GetUnitAbilityLevel(PDDS.source,'A00I') == 2 then
set R = 50
else
set R = 90
endif
call UnitDamageTargetEx(PDDS.source, PDDS.target, 30 + R, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
endif
call UnitRemoveAbility(PDDS.target,'B002')
// РАЗ ДВА ТРИ
elseif GetUnitAbilityLevel(PDDS.target,'B003') > 0 then // Р Э Н Д Ж РЭНДЖ
//call Msg("рэндж",2.3) DEFEND spell
if GetUnitTypeId(PDDS.source) == steamtank then
//call echo("steam tank attack")
if IsUnitType(PDDS.target,UNIT_TYPE_STRUCTURE) then
//call echo("zdanie")
set PDDS.amount = PDDS.amount * 4.
endif
call GroupClear(P)
set B = Condition(function SteamTank_F)
call GroupEnumUnitsInRange(P,GetUnitX(PDDS.source),GetUnitY(PDDS.source),1400,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
//call echo("goo")
//set F2 = CreateUnit(Player(11),dummy,GetUnitX(PDDS.source),GetUnitY(PDDS.source),0)
//call UnitApplyTimedLife( F2,'BTLF' , 0.1 )
//call UnitAddAbility(F2,'AEsh')
//call IssueTargetOrder(F2,"shadowstrike",F)
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Source = PDDS.source
set udg_Missile__Owner = GetOwningPlayer(PDDS.source)
//set udg_Missile__Target = c
set udg_Missile__Target = F
set udg_Missile__Origin = GetUnitLoc(PDDS.source)
set udg_Missile__OriginZ = 50.00
set udg_Missile__Impact = GetUnitLoc(F)
set udg_Missile__ImpactZ = 90.00
//if DistanceXY(GetUnitX(c),GetUnitY(c),GetUnitX(tr),GetUnitY(tr)) < 230 then
//set udg_Missile__FlyTime = 0.45
// else
set udg_Missile__Speed = 900.
//set udg_Missile__FlyTime = 1.15
//endif
set udg_Missile__Collision = 108.00 //64
set udg_Missile__Height = 130// GetRandomReal(110,195) //250.00
set udg_Missile__Damage = 40.00
//set udg_Missile__Curve = ( -40.00 + ( 25.00 * 1 ) ) //I2R( i4 )
set udg_Missile__Model = "Abilities\\Weapons\\RocketMissile\\RocketMissile.mdl"
set udg_Missile__Scale = 1.10
//"Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
//set udg_Missile__OnCollideUnit = gg_trg_DreadLordGetHealed
set udg_Missile__OnFinish = gg_trg_SteamTankDamageMissile
set udg_Missile__Data = 1
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
call GroupRemoveUnit(P,F)
endloop
call DestroyBoolExpr(B)
/*
call GroupClear(P)
set B = Condition(function SteamTank_F)
call GroupEnumUnitsInRange(P,GetUnitY(PDDS.source),GetUnitX(PDDS.source),1400,B)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call echo(GetUnitName(F))
call GroupRemoveUnit(P,F)
endloop
call DestroyBoolExpr(B) */
endif
if Defend and GetUnitTypeId(PDDS.target) == footman /*
*/ then // -- >
if not IsUnitInGroup(PDDS.target,DefendOff) then
call IssueImmediateOrder(PDDS.target,"defend")
call GroupAddUnit(DefendOff,PDDS.target)
call SaveReal(Hash,GetHandleId(PDDS.target),StringHash("Defend_R"),10.)
else
call SaveReal(Hash,GetHandleId(PDDS.target),StringHash("Defend_R"),10.)
endif
endif // <--
if (GetUnitTypeId(PDDS.source) == sorcerer or GetUnitTypeId(PDDS.target) == sorcerer) and GetRandomInt(0, 100) < 25/*
*/ then
//call echo("чародей <25")
if GetUnitTypeId(PDDS.source) == sorcerer and GetUnitState(PDDS.source, UNIT_STATE_MANA) >= 135 then// заставляем чародея использовать хекс
if IssueTargetOrder(PDDS.source, "polymorph", PDDS.target) then
call IssueTargetOrder(PDDS.source, "polymorph", PDDS.target)
else
call IssueTargetOrder(PDDS.source, "attack", PDDS.target)
endif
//call echo("чародей PDDS.source")
elseif GetUnitTypeId(PDDS.target) == sorcerer and GetUnitState(PDDS.target, UNIT_STATE_MANA) >= 135 then
if IssueTargetOrder(PDDS.target, "polymorph", PDDS.source) then
call IssueTargetOrder(PDDS.target, "polymorph", PDDS.source)
else
call IssueTargetOrder(PDDS.target, "attack", PDDS.source)
endif
//call echo("чародей PDDS.target")
endif
endif
if (GetUnitTypeId(PDDS.source) == skeletonmage or GetUnitTypeId(PDDS.target) == skeletonmage) and GetRandomInt(0, 100) < 30 then
//call echo("чародей <25")
if GetUnitTypeId(PDDS.source) == skeletonmage and GetUnitState(PDDS.source, UNIT_STATE_MANA) >= 55 then// заставляем чародея использовать хекс
//call echo("sk mage <30")
call GroupClear(P)
call GroupEnumUnitsInRange(P, GetUnitX(PDDS.source), GetUnitY(PDDS.source), 550, null)
//call echo("sk mage 1")
loop
set F = FirstOfGroup(P)
exitwhen F == null
if GetUnitMaxLife(F) > 0 and not IsUnitDead(F) then
set R = GetUnitLife(F) / GetUnitMaxLife(F) * 100.0
else
set R = 0.
endif
if not IsUnitDead(F) then
if not IsUnitInGroup(F, RageOfTheDamned) and IsUnitAlly(F, GetOwningPlayer(PDDS.source)) then
if F2 == null and R > 10 then
set F2 = F
//call echo(GetUnitName(F))
elseif IsUnitType(F, UNIT_TYPE_HERO) then
set F2 = F
//call echo("sk mage hero")
endif
endif
endif
call GroupRemoveUnit(P, F)
endloop
//call DestroyGroup(P)
//call echo("имя цели " + GetUnitName(F2))
if F2 != null then
call IssueTargetOrder(PDDS.source, "unholyfrenzy", F2)
//call echo("чародей PDDS.source")
endif
//call SaveReal(Hash,GetHandleId(PDDS.source),StringHash("POL_r"),10.)
elseif GetUnitTypeId(PDDS.target) == skeletonmage and GetUnitState(PDDS.target, UNIT_STATE_MANA) >= 55 then
//call echo("sk mage <30")
call GroupClear(P)
call GroupEnumUnitsInRange(P, GetUnitX(PDDS.target), GetUnitY(PDDS.target), 550, null)
//call echo("sk mage 1")
loop
set F = FirstOfGroup(P)
exitwhen F == null
if GetUnitMaxLife(F) > 0 and not IsUnitDead(F) then
set R = GetUnitLife(F) / GetUnitMaxLife(F) * 100.0
else
set R = 0.
endif
if not IsUnitDead(F) then
if not IsUnitInGroup(F, RageOfTheDamned) and IsUnitAlly(F, GetOwningPlayer(PDDS.target)) then
if F2 == null and R > 10 then
set F2 = F
//call echo(GetUnitName(F))
elseif IsUnitType(F, UNIT_TYPE_HERO) then
set F2 = F
//call echo("sk mage hero")
endif
endif
endif
//call echo("sk mage 2")
call GroupRemoveUnit(P, F)
endloop
// call DestroyGroup(P)
//call echo("имя цели " + GetUnitName(F2))
if F2 != null then
call IssueTargetOrder(PDDS.target, "unholyfrenzy", F2)
//call echo("чародей PDDS.source")
//call GroupAddUnit(RageOfTheDamned,F2)
endif
//call SaveReal(Hash,GetHandleId(PDDS.target),StringHash("POL_r"),10.)
endif
endif
if MeditationProcees and (GetUnitTypeId(PDDS.source) == priest or GetUnitTypeId(PDDS.target) == priest) and GetRandomInt(0, 100) < 25/*
*/ then
//call echo("чародей <25")
if GetUnitTypeId(PDDS.source) == priest and GetUnitState(PDDS.source, UNIT_STATE_MANA) >= 40 then// заставляем чародея использовать хекс
if IssueTargetOrder(PDDS.source, "firebolt", PDDS.target) then
call IssueTargetOrder(PDDS.source, "firebolt", PDDS.target)
else
call IssueImmediateOrder(PDDS.source, "stop")
endif
//call echo("чародей PDDS.source")
elseif GetUnitTypeId(PDDS.target) == sorcerer and GetUnitState(PDDS.target, UNIT_STATE_MANA) >= 40 then
if IssueTargetOrder(PDDS.target, "firebolt", PDDS.source) then
call IssueTargetOrder(PDDS.target, "firebolt", PDDS.source)
else
call IssueImmediateOrder(PDDS.target, "stop")
endif
//call echo("чародей PDDS.target")
endif
endif
call UnitRemoveAbility(PDDS.target,'B003')
endif
//call UnitRemoveAbility(PDDS.target,'B002')
//call UnitRemoveAbility(PDDS.target,'B003')
endif
if PDDS.damageType == SPELL then // МАГИЯ
if IsUnitType(PDDS.target,UNIT_TYPE_STRUCTURE) then
if PDDS.target == CrystalShield then
set PDDS.amount = PDDS.amount * 0.20
endif
if PDDS.target == MasterMind then
//call echo("ponishenie")
set PDDS.amount = PDDS.amount * 0.5
endif
if GetUnitTypeId(PDDS.target) == 'uzg2' then
set PDDS.amount = PDDS.amount * 0.5
endif
endif
if GetInventoryIndexOfItemTypeJ(PDDS.source, 'axas') > 0 //15
call SetUnitLife(PDDS.source,GetUnitLife(PDDS.source) + PDDS.amount*0.2)
call DestroyEffect(AddSpecialEffect("BirdShitTarget_1.mdx",GetUnitX(PDDS.source),GetUnitY(PDDS.source)))
endif
if GetUnitTypeId(PDDS.target) == steamtank then
set PDDS.amount = PDDS.amount * 0.30
endif
if GetInventoryIndexOfItemTypeJ(PDDS.target, 'anfg') > 0
set PDDS.amount = PDDS.amount * 0.82
endif
/*if PDDS.source == gg_unit_nmed_0813 or PDDS.source == gg_unit_nhea_0815 then
call echo("type == spell")
call echo("lvl1t == " + R2S(LVLspellfor1T))
call echo("lvl2t == " + R2S(LVLspellfor2T))
call echo(R2S(PDDS.amount))
endif */
//set PDDS.amount = PDDS.amount * 11
if GetInventoryIndexOfItemTypeJ(PDDS.source, 'stwa') > 0
set PDDS.amount = PDDS.amount * 1.20
endif
if GetInventoryIndexOfItemTypeJ(PDDS.target, 'fwss') > 0
set PDDS.amount = PDDS.amount * 0.82 //12
endif
if GetInventoryIndexOfItemTypeJ(PDDS.source, 'sprn') > 0
set PDDS.amount = PDDS.amount * 1.01 //12
endif
if GetInventoryIndexOfItemTypeJ(PDDS.source, 'rat3') > 0
set PDDS.amount = PDDS.amount + 12 //12
endif
if IsPlayerInForce(GetOwningPlayer(PDDS.target),HumanForce) then
set PDDS.amount = PDDS.amount * LVLspellfor1T
elseif IsPlayerInForce(GetOwningPlayer(PDDS.target),UndeadForce) then
set PDDS.amount = PDDS.amount * LVLspellfor2T
endif
//set PDDS.amount = PDDS.amount * 9.95
//call echo("Magic damage is getting caused")
if FelGenome and IsPlayerInForce(GetOwningPlayer(PDDS.target),UndeadForce) then
if IsUnitType(PDDS.target,UNIT_TYPE_HERO) then
set PDDS.amount = PDDS.amount * 0.95
else
set PDDS.amount = PDDS.amount * 0.9
endif
endif
if GetUnitAbilityLevel(PDDS.target,'B001') > 0 then
set r = LoadReal(Hash,GetHandleId(PDDS.target),StringHash("FS_r"))
//call echo(I2S(LVLfor2T))
set r = r - PDDS.amount
if r > 0 then
if PDDS.amount > 5. and GetUnitAbilityLevel(PDDS.target,'A018') > 1 then
call SetUnitAbilityLevel(PDDS.target,'A018',GetUnitAbilityLevel(PDDS.target,'A018') - 1 )
endif
call SaveReal(Hash,GetHandleId(PDDS.target),StringHash("FS_r"),r)
set PDDS.amount = 0
elseif r < 0 then
call UnitRemoveAbility(PDDS.target,'A018')
call RemoveSavedReal(Hash,GetHandleId(PDDS.target),StringHash("FS_r"))
call UnitRemoveAbility(PDDS.target,'B001')
set PDDS.amount = -r
//call echo(R2S(-r))
//call UnitDamageTargetEx(PDDS.source, PDDS.target, -r, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
// damage the rest
endif
endif
elseif PDDS.damageType == CODE then
//call echo("code")
//call echo("CODE damage is getting caused")
elseif PDDS.damageType == PHYSICAL then
//call echo("ph damage is getting caused")
endif
if PDDS.target == OrcMage then
set bl = LoadBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_bl"))
//if bl == false then
set PDDS.amount = PDDS.amount * 0.6
if PDDS.amount * 1.2 > GetUnitLife(OrcMage) then
if bl != true then
set bl = true
call SaveBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcMage_bl"),bl)
endif
set PDDS.amount = PDDS.amount * 0.
endif
endif
if PDDS.target == OrcHero and GetUnitTypeId(OrcHero) == 'Opgh' then
set bl = LoadBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcHero_bl"))
//if bl == false then
//set PDDS.amount = PDDS.amount * 0.6
if PDDS.amount * 1.2 > GetUnitLife(OrcHero) then
//call echo("gets dead")
if bl != true then
set bl = true
set OrcInvasion_made = true
call SaveBoolean(Hash,GetHandleId(OrcMage),StringHash("OrcHero_bl"),bl)
call UnitAddAbility(OrcHero,'ACmi')
call UnitRemoveBuffs(OrcHero,true,true)
call PauseUnit(OrcHero,true)
call SetUnitAnimation(OrcHero,"Attack Slam")
call DestroyTimerDialog(LoadTimerDialogHandle(Hash,GetHandleId(OrcHero),StringHash("Timer_td")))
set T = LoadTimerHandle(Hash,GetHandleId(OrcHero),StringHash("Timer_timer"))
call FlushChildHashtable(Hash,GetHandleId(T))
call DestroyTimer(T)
call TimerStart(CreateTimer(),0.5,false,function OrcHero_Fell1)
endif
set PDDS.amount = PDDS.amount * 0.
elseif OrcInvasion_elapsed then
set PDDS.amount = PDDS.amount * 0.
elseif not OrcInvasion_made and WhirlWindCD <= 0. and GetRandomInt(0,100) < 30 and not IsUnitInGroup(PDDS.target,OrcMovesBack) and GetUnitState(PDDS.target,UNIT_STATE_MANA) > 200 and GetUnitAbilityLevel(PDDS.target,'BSTN') <= 0 then
//set PDDS.amount = PDDS.amount * 0.
//call echo("SPELL 1")
set WhirlWindCD = 20.
call PauseUnit(OrcHero,true)
call SetUnitAnimationByIndex(OrcHero,10)
call SaveEffectHandle(Hash,GetHandleId(OrcHero),StringHash("WhirlWind_eff1"), AddSpecialEffectTarget("Abilities\\Spells\\Items\\VampiricPotion\\VampPotionCaster.mdl",OrcHero,"origin"))
call TimerStart(CreateTimer(),4.,false,function WhirlWind_A)
endif
if IsUnitInGroup(PDDS.target,OrcMovesBack) then
set PDDS.amount = PDDS.amount * 0.2
endif
endif
endif
set t = null
set d = null
endfunction
private function i takes nothing returns nothing
call AddDamageHandler(function OnDamage_Actions)
endfunction
endscope
//TESH.scrollpos=66
//TESH.alwaysfold=0
library DamageEvent/* v 1.3.0.0
**********************************************************************************
*
* Physical Damage Detection Engine
* --------------------------------
* By looking_for_help aka eey
*
* This system is able to detect, modify and deal damage. It can differentiate
* between physical and spell damage, as well as block, reduce or increase the
* applied damage to a desired value. You can also allocate damage events from
* running damage events.
*
**********************************************************************************
*
* Implementation
* --------------
* 1. Copy this trigger to your map. With the AddDamageHandler function you can
* add as many handlers as you like (compare the OnDamage scope).
* 2. Copy the two custom abilities to your map and make sure they have the
* correct ID in the globals variable block.
* 3. Go to the locust swarm ability and invert its damage return portion
* from (default) 0.75 to -0.75.
* 4. Remove the spell damage reduction ability from the spell damage reduction
* items you use (runed bracers). You can configure the resistance of this
* item in the globals block, modifying BRACERS_SPELL_DAMAGE_REDUCTION.
*
**********************************************************************************
*
* Important Notes
* ---------------
* 1. Life Drain does not work with this system, so you should use a triggered
* version of this spell if you want to use it.
* 2. Same for Finger of Death, if you want to use this spell bug free with this
* system, you should use a triggered version of it.
* 3. If you use damage modifiers by setting the damage amount variable, you have
* to use GetUnitLife, GetUnitMaxLife and SetUnitLife instead of GetWidgetLife,
* GetUnitState for UNIT_STATE_MAX_LIFE and SetWidgetLife in your whole map to
* ensure there occure no bugs.
* 4. The boolean USE_SPELL_RESISTANCE_AUTO_DETECT is only neccessary set to true
* if you want to use a customized damage table with spell damage resistance
* above 100%. If this is not the case, it should be set to false, as the
* system is faster then and still works correct.
* 5. As already mentioned you can't use the spell reduction ability when using this
* system (runed bracers and elunes grace). If you want to use them, you can
* trigger them by using the damage modifiers. Runed bracers is already considered
* in this system, so you don't have to code it.
*
**********************************************************************************
*
* System API
* ----------
* unit PDDS.target
* - In this global unit variable, the damaged unit is saved. Don't write any-
* thing into this variable, use it as readonly.
*
* unit PDDS.source
* - In this global unit variable, the damage source is saved. Don't write any-
* thing into this variable, use it as readonly.
*
* real PDDS.amount
* - In this global real variable, the amount of damage is saved. This amount
* can be modified by simply setting it to the desired amount that should be
* applied to the target. Set the amount to 0.0 to block the damage completly.
* Negative values will result in heal.
*
* integer PDDS.damageType
* - In this global integer variable, the damage type of the current damage is
* saved. Use it to differentiate between physical, spell and code damage. The
* variable can takes the values PHYSICAL == 0, SPELL == 1 and CODE == 2. Don't
* write anything into this variable, use it as readonly.
*
* function UnitDamageTargetEx takes unit localSource, unit localTarget, real localAmount,
* boolean attack, boolean ranged, attacktype localAttackType,
* damagetype localDamageType, weapontype localWeaponType
* returns boolean
* - Use this function to allocate attacks from a running damage event. You can use
* it in exactly the same way as the standard native UnitDamageTarget. The function
* is designed recursive, so you can allocate as many attacks as you want. Do not
* use this function outside of a damage event.
*
* function GetUnitLife takes unit u returns real
* - Use this function instead of the GetWidgetLife native. It ensures that you
* get the correct health value, even when damage modifiers are applied. If
* you don't use damage modifiers at all, you don't need this function.
*
* function GetUnitMaxLife takes unit u returns real
* - Use this function instead of the GetUnitState(u, UNIT_STATE_MAX_LIFE) native.
* It will return the correct value, even when damage modifiers are applied. If
* you don't use damage modifiers at all, you don't need this function.
*
* function SetUnitLife takes unit u, real newLife returns nothing
* - Use this function instead of the SetWidgetLife(u, newLife) native if you use
* damage modifiers in your map. Same rules as for the GetUnitMaxLife and the
* GetUnitMaxLife functions.
*
* function AddDamageHandler takes code damageHandler returns nothing
* - Allows you to add a damage handler function to the system. Compare the
* OnDamage scope for an example usage.
*
* function RemoveDamageHandler takes code damageHandler returns nothing
* - Allows you to remove a damage handler function from the system dynamic-
* ally. If you added the same handler function multiple times to the sys-
* tem, this function will remove all of these equal functions.
*
*********************************************************************************/
globals
/*************************************************************************
* Customizable globals
*************************************************************************/
private constant integer DAMAGE_TYPE_DETECTOR = 'A000'
private constant integer SET_MAX_LIFE = 'A001'
private constant integer SPELL_DAMAGE_REDUCTION_ITEM = 'brac'
private constant boolean USE_SPELL_RESISTANCE_AUTO_DETECT = false
private constant real ETHEREAL_DAMAGE_FACTOR = 1.66
private constant real BRACERS_SPELL_DAMAGE_REDUCTION = 0.
private constant real TRIGGER_CLEANUP_PERIOD = 10.0
/*************************************************************************
* End of Customizable globals
*************************************************************************/
constant integer PHYSICAL = 0
constant integer SPELL = 1
constant integer CODE = 2
constant real UNIT_MIN_LIFE = 0.406
private constant attacktype ATTACK_TYPE_UNIVERSAL = ConvertAttackType(7)
private hashtable h
private real pureAmount
private trigger damageEvent
private trigger damageHandler
private trigger runAllocatedAttacks
private integer allocatedAttacks
private integer totalAllocs
private integer allocCounter
private real damageEventTrigger
endglobals
struct PDDS extends array
static unit source
static unit target
static real amount
static integer damageType
endstruct
/******************************************************************************
* User functions
******************************************************************************/
function AddDamageHandler takes code func returns nothing
local integer id = GetHandleId(Condition(func))
local integer index = 0
// Loop to manage equal damage handlers
loop
exitwhen ( LoadTriggerConditionHandle(h, id, index) == null )
set index = index + 1
endloop
// Store the desired damage handler function
call SaveTriggerConditionHandle(h, id, index, TriggerAddCondition(damageHandler, Filter(func)))
endfunction
function RemoveDamageHandler takes code func returns nothing
local integer id = GetHandleId(Condition(func))
local integer index = 0
// Loop through all equal damage handlers
loop
exitwhen ( LoadTriggerConditionHandle(h, id, index) == null )
call TriggerRemoveCondition(damageHandler, LoadTriggerConditionHandle(h, id, index))
set index = index + 1
endloop
// Clean things up
call FlushChildHashtable(h, id)
endfunction
function GetUnitLife takes unit u returns real
local boolean duringModification
local integer uId = GetHandleId(u)
local real health
local real storedHealth = LoadReal(h, uId, 2)
local real storedDamage = LoadReal(h, uId, 1)
// Check if the unit is being rescued from damage
set duringModification = GetUnitAbilityLevel(u, SET_MAX_LIFE) > 0
if duringModification then
call UnitRemoveAbility(u, SET_MAX_LIFE)
endif
// Get the correct health value of the unit
if storedHealth != 0.0 then
set health = storedHealth - storedDamage
else
set health = GetWidgetLife(u) - storedDamage
endif
// Restore the rescue ability and return
if duringModification then
call UnitAddAbility(u, SET_MAX_LIFE)
endif
return health
endfunction
function GetUnitMaxLife takes unit u returns real
local real maxHealth
// Check if the unit is being rescued from damage
if GetUnitAbilityLevel(u, SET_MAX_LIFE) > 0 then
call UnitRemoveAbility(u, SET_MAX_LIFE)
set maxHealth = GetUnitState(u, UNIT_STATE_MAX_LIFE)
call UnitAddAbility(u, SET_MAX_LIFE)
return maxHealth
endif
// If the unit isn't being rescued, use the standard native
return GetUnitState(u, UNIT_STATE_MAX_LIFE)
endfunction
function SetUnitLife takes unit u, real newLife returns nothing
local integer targetId
local integer oldTimerId
local real oldHealth
// Check if the unit is being rescued from damage
if GetUnitAbilityLevel(u, SET_MAX_LIFE) > 0 then
call UnitRemoveAbility(u, SET_MAX_LIFE)
call SetWidgetLife(u, newLife)
call UnitAddAbility(u, SET_MAX_LIFE)
// Get the unit specific timer information
set targetId = GetHandleId(u)
set oldHealth = LoadReal(h, targetId, 0)
// Update the unit specific timer information
if oldHealth != 0.0 then
set oldTimerId = LoadInteger(h, targetId, 3)
call SaveReal(h, targetId, 2, newLife)
call SaveReal(h, targetId, 0, newLife)
call SaveReal(h, oldTimerId, 4, newLife)
endif
return
endif
// If the unit isn't being rescued, use the standard native
call SetWidgetLife(u, newLife)
endfunction
function UnitDamageTargetEx takes unit localSource, unit localTarget, real localAmount, boolean attack, /*
*/boolean ranged, attacktype localAttackType, damagetype localDamageType, /*
*/weapontype localWeaponType returns boolean
// Avoid infinite loop due to recursion
if PDDS.damageType == CODE then
return false
endif
// Avoid allocating attacks on units that are about to be killed
if ( localTarget == PDDS.target and GetUnitLife(localTarget) - PDDS.amount < UNIT_MIN_LIFE ) then
return false
endif
// Store all damage parameters determined by the user
set allocatedAttacks = allocatedAttacks + 1
call SaveUnitHandle(h, allocatedAttacks, 0, localSource)
call SaveUnitHandle(h, allocatedAttacks, 1, localTarget)
call SaveReal(h, allocatedAttacks, 2, localAmount)
call SaveBoolean(h, allocatedAttacks, 3, attack)
call SaveBoolean(h, allocatedAttacks, 4, ranged)
call SaveInteger(h, allocatedAttacks, 5, GetHandleId(localAttackType))
call SaveInteger(h, allocatedAttacks, 6, GetHandleId(localDamageType))
call SaveInteger(h, allocatedAttacks, 7, GetHandleId(localWeaponType))
// Return true if the damage was allocated
return true
endfunction
/******************************************************************************
* Sub functions
******************************************************************************/
private function DealFixDamage takes unit source, unit target, real pureAmount returns nothing
local real MAX_DAMAGE = 1000000.0
local real beforeHitpoints
local real newHitpoints
// Ensure the amount is positive
if pureAmount < 0 then
set pureAmount = -pureAmount
endif
// Save the targets hitpoints
set beforeHitpoints = GetWidgetLife(target)
set newHitpoints = beforeHitpoints - pureAmount
// Apply the desired, fixed amount
if newHitpoints >= UNIT_MIN_LIFE then
call SetUnitState(target, UNIT_STATE_LIFE, newHitpoints)
else
if ( IsUnitType(target, UNIT_TYPE_ETHEREAL) == false ) then
call SetWidgetLife(target, 1.0)
call UnitDamageTarget(source, target, MAX_DAMAGE, true, false, ATTACK_TYPE_UNIVERSAL, DAMAGE_TYPE_UNIVERSAL, null)
else
call UnitRemoveAbility(target, DAMAGE_TYPE_DETECTOR)
call SetWidgetLife(target, 1.0)
call UnitDamageTarget(source, target, MAX_DAMAGE, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, null)
endif
endif
endfunction
private function GetUnitSpellResistance takes unit u returns real
local real originalHP
local real beforeHP
local real afterHP
local real resistance
local real DUMMY_DAMAGE = 100
local real DUMMY_FACTOR = 0.01
// Deal spell damage in order to get the units resistance
call UnitRemoveAbility(u, DAMAGE_TYPE_DETECTOR)
set originalHP = GetWidgetLife(u)
call UnitAddAbility(u, SET_MAX_LIFE)
call SetWidgetLife(u, 20000.0)
set beforeHP = GetWidgetLife(u)
call DisableTrigger(damageEvent)
call UnitDamageTarget(PDDS.source, u, DUMMY_DAMAGE, true, false, null, DAMAGE_TYPE_UNIVERSAL, null)
call EnableTrigger(damageEvent)
set afterHP = GetWidgetLife(u)
call UnitRemoveAbility(u, SET_MAX_LIFE)
call SetWidgetLife(u, originalHP)
call UnitAddAbility(u, DAMAGE_TYPE_DETECTOR)
call UnitMakeAbilityPermanent(u, true, DAMAGE_TYPE_DETECTOR)
// Calculate this resistance
set resistance = DUMMY_FACTOR*(beforeHP - afterHP)
// If the resistance was greater than 100%, return it
if resistance > 1.0 then
return resistance
else
return 1.0
endif
endfunction
private function UnitHasItemOfType takes unit u, integer itemId returns integer
local integer index = 0
local item indexItem
// Check if the target has a spell damage reducing item
loop
set indexItem = UnitItemInSlot(u, index)
if ( indexItem != null ) and ( GetItemTypeId(indexItem) == itemId ) then
set indexItem = null
return index + 1
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
set indexItem = null
return 0
endfunction
/******************************************************************************
* Damage Engine
******************************************************************************/
private function AfterDamage takes nothing returns nothing
local timer time = GetExpiredTimer()
local integer id = GetHandleId(time)
local unit localSource = LoadUnitHandle(h, id, 0)
local unit localTarget = LoadUnitHandle(h, id, 1)
local real amount = LoadReal(h, id, 3)
local real originalHealth = LoadReal(h, id, 4)
// If the damage was modified, restore units health
if originalHealth != 0.0 then
call UnitRemoveAbility(localTarget, SET_MAX_LIFE)
call SetWidgetLife(localTarget, originalHealth)
endif
// Apply the desired amount of damage
if amount > 0.0 then
call DisableTrigger(damageEvent)
call DealFixDamage(localSource, localTarget, amount)
call EnableTrigger(damageEvent)
else
call SetWidgetLife(localTarget, originalHealth - amount)
endif
// Clean things up
call FlushChildHashtable(h, id)
call FlushChildHashtable(h, GetHandleId(localTarget))
call DestroyTimer(time)
set time = null
set localSource = null
set localTarget = null
endfunction
private function DamageEngine takes nothing returns nothing
local timer time
local integer id
local real rawAmount
local real originalHealth
local integer targetId
local integer oldTimerId
local real oldHealth
local real oldOriginalHealth
local real oldAmount
// Set damage variables
set rawAmount = GetEventDamage()
if rawAmount == 0.0 then
return
endif
set PDDS.source = GetEventDamageSource()
set PDDS.target = GetTriggerUnit()
// Determine the damage type
if rawAmount > 0.0 then
if PDDS.damageType != CODE then
set PDDS.damageType = PHYSICAL
endif
set PDDS.amount = rawAmount
else
if PDDS.damageType != CODE then
set PDDS.damageType = SPELL
endif
set PDDS.amount = -rawAmount
endif
// Register spell reduction above 100%
static if USE_SPELL_RESISTANCE_AUTO_DETECT then
set PDDS.amount = GetUnitSpellResistance(PDDS.target)*PDDS.amount
else
if ( IsUnitType(PDDS.target, UNIT_TYPE_ETHEREAL) and IsUnitEnemy(PDDS.target, GetOwningPlayer(PDDS.source)) and rawAmount < 0.0 ) then
set PDDS.amount = ETHEREAL_DAMAGE_FACTOR*PDDS.amount
endif
endif
// Register spell damage reducing items like runed bracers
if ( IsUnitType(PDDS.target, UNIT_TYPE_HERO) and UnitHasItemOfType(PDDS.target, SPELL_DAMAGE_REDUCTION_ITEM) > 0 ) and rawAmount < 0.0 then
set PDDS.amount = (1 - BRACERS_SPELL_DAMAGE_REDUCTION)*PDDS.amount
endif
// Save health and damage variables
if PDDS.damageType != CODE then
call UnitRemoveAbility(PDDS.target, SET_MAX_LIFE)
endif
set pureAmount = PDDS.amount
set originalHealth = GetWidgetLife(PDDS.target)
set oldTimerId = 0
// Call damage handlers
set damageEventTrigger = 0.0
set damageEventTrigger = 1.0
set damageEventTrigger = 0.0
// If the damage was modified, apply the rescue ability
if PDDS.amount != pureAmount then
call UnitAddAbility(PDDS.target, SET_MAX_LIFE)
call SetWidgetLife(PDDS.target, GetWidgetLife(PDDS.target) + pureAmount)
endif
// Check if a previous timer didn't yet expire
set targetId = GetHandleId(PDDS.target)
set oldHealth = LoadReal(h, targetId, 0)
// If this is the case, update the timer information
if oldHealth != 0.0 then
set oldTimerId = LoadInteger(h, targetId, 3)
set oldOriginalHealth = LoadReal(h, targetId, 2)
set oldAmount = LoadReal(h, targetId, 1)
set originalHealth = oldOriginalHealth - oldAmount
call SaveReal(h, oldTimerId, 4, oldOriginalHealth)
endif
// Call after damage event if damage was spell, modified, code or parallel
if ( rawAmount < 0.0 or pureAmount != PDDS.amount or oldTimerId != 0 or allocatedAttacks > 0 ) then
set time = CreateTimer()
set id = GetHandleId(time)
// Save handles for after damage event
call SaveUnitHandle(h, id, 0, PDDS.source)
call SaveUnitHandle(h, id, 1, PDDS.target)
call SaveReal(h, id, 2, pureAmount)
call SaveReal(h, id, 3, PDDS.amount)
call SaveReal(h, id, 4, originalHealth)
// Save this extra to manage parallel damage instances
call SaveReal(h, targetId, 0, GetWidgetLife(PDDS.target))
call SaveReal(h, targetId, 1, PDDS.amount)
call SaveReal(h, targetId, 2, originalHealth)
call SaveInteger(h, targetId, 3, id)
// Avoid healing of negative spell damage
if rawAmount < 0.0 then
call DisableTrigger(damageEvent)
call DealFixDamage(PDDS.source, PDDS.target, -rawAmount)
if ( originalHealth - PDDS.amount < UNIT_MIN_LIFE ) then
call UnitRemoveAbility(PDDS.target, SET_MAX_LIFE)
call DealFixDamage(PDDS.source, PDDS.target, PDDS.amount)
endif
call EnableTrigger(damageEvent)
endif
// Guarantee unit exploding
if originalHealth - PDDS.amount < UNIT_MIN_LIFE then
if rawAmount > 0.0 then
call UnitRemoveAbility(PDDS.target, SET_MAX_LIFE)
call SetWidgetLife(PDDS.target, UNIT_MIN_LIFE)
endif
endif
// Start the after damage event
call TimerStart(time, 0.0, false, function AfterDamage)
endif
// Handle allocated attacks from UnitDamageTargetEx
if totalAllocs == 0 then
set totalAllocs = allocatedAttacks
endif
if allocatedAttacks > 0 then
set allocatedAttacks = allocatedAttacks - 1
set allocCounter = allocCounter + 1
call TriggerEvaluate(runAllocatedAttacks)
endif
// Reset all required variables
set totalAllocs = 0
set allocCounter = -1
set PDDS.damageType = -1
endfunction
/******************************************************************************
* Initialization
******************************************************************************/
private function RestoreTriggers takes nothing returns nothing
local unit enumUnit = GetEnumUnit()
// Re-register units that are alive
if GetUnitTypeId(enumUnit) != 0 then
call TriggerRegisterUnitEvent(damageEvent, enumUnit, EVENT_UNIT_DAMAGED)
endif
set enumUnit = null
endfunction
private function ClearMemory_Actions takes nothing returns nothing
local group g = CreateGroup()
local code c = function DamageEngine
// Reset the damage event
call GroupEnumUnitsInRect(g, GetWorldBounds(), null)
call ResetTrigger(damageEvent)
call DestroyTrigger(damageEvent)
set damageEvent = null
// Rebuild it then
set damageEvent = CreateTrigger()
call TriggerAddCondition(damageEvent, Filter(c))
call ForGroup(g, function RestoreTriggers)
// Clean things up
call DestroyGroup(g)
set g = null
set c = null
endfunction
private function MapInit takes nothing returns nothing
local unit enumUnit = GetEnumUnit()
// Register units on map initialization
call UnitAddAbility(enumUnit, DAMAGE_TYPE_DETECTOR)
call UnitMakeAbilityPermanent(enumUnit, true, DAMAGE_TYPE_DETECTOR)
call TriggerRegisterUnitEvent(damageEvent, enumUnit, EVENT_UNIT_DAMAGED)
set enumUnit = null
endfunction
private function UnitEntersMap takes nothing returns nothing
local unit triggerUnit = GetTriggerUnit()
// Register units that enter the map
if ( GetUnitAbilityLevel(triggerUnit, DAMAGE_TYPE_DETECTOR) < 1 ) then
call UnitAddAbility(triggerUnit, DAMAGE_TYPE_DETECTOR)
call UnitMakeAbilityPermanent(triggerUnit, true, DAMAGE_TYPE_DETECTOR)
call TriggerRegisterUnitEvent(damageEvent, triggerUnit, EVENT_UNIT_DAMAGED)
endif
set triggerUnit = null
endfunction
private function RunAllocatedAttacks takes nothing returns nothing
local integer localAllocAttacks = allocatedAttacks + 1
// Calculate the correct sequence of allocated attacks
set localAllocAttacks = localAllocAttacks - totalAllocs + 1 + 2*allocCounter
// Deal code damage if the unit isn't exploding
set PDDS.damageType = CODE
if GetUnitLife(LoadUnitHandle(h, localAllocAttacks, 1)) >= UNIT_MIN_LIFE then
call UnitDamageTarget(LoadUnitHandle(h, localAllocAttacks, 0), LoadUnitHandle(h, localAllocAttacks, 1), /*
*/LoadReal(h, localAllocAttacks, 2), LoadBoolean(h, localAllocAttacks, 3), /*
*/LoadBoolean(h, localAllocAttacks, 4), ConvertAttackType(LoadInteger(h, /*
*/localAllocAttacks, 5)), ConvertDamageType(LoadInteger(h, localAllocAttacks, 6)), /*
*/ConvertWeaponType(LoadInteger(h, localAllocAttacks, 7)))
else
call FlushChildHashtable(h, localAllocAttacks - 1)
endif
// Clean things up
call FlushChildHashtable(h, localAllocAttacks)
endfunction
private module Inits
private static method onInit takes nothing returns nothing
local group g = CreateGroup()
local region r = CreateRegion()
local trigger UnitEnters = CreateTrigger()
local trigger ClearMemory = CreateTrigger()
local code cDamageEngine = function DamageEngine
local code cUnitEnters = function UnitEntersMap
local code cClearMemory = function ClearMemory_Actions
local code cRunAllocatedAttacks = function RunAllocatedAttacks
// Initialize variables
set h = InitHashtable()
set damageEvent = CreateTrigger()
set damageHandler = CreateTrigger()
set PDDS.damageType = -1
set allocatedAttacks = 0
set runAllocatedAttacks = CreateTrigger()
set totalAllocs = 0
set allocCounter = -1
// Register units on map initialization
call TriggerRegisterVariableEvent(damageHandler, SCOPE_PRIVATE + "damageEventTrigger", EQUAL, 1.0)
call TriggerAddCondition(damageEvent, Filter(cDamageEngine))
call GroupEnumUnitsInRect(g, GetWorldBounds(), null)
call ForGroup(g, function MapInit)
// Register units that enter the map
call RegionAddRect(r, GetWorldBounds())
call TriggerRegisterEnterRegion(UnitEnters, r, null)
call TriggerAddCondition(UnitEnters, Filter(cUnitEnters))
// Register trigger for allocated attacks
call TriggerAddCondition(runAllocatedAttacks, Filter(cRunAllocatedAttacks))
// Clear memory leaks
call TriggerRegisterTimerEvent(ClearMemory, TRIGGER_CLEANUP_PERIOD, true)
call TriggerAddCondition(ClearMemory, Filter(cClearMemory))
// Clean things up
call DestroyGroup(g)
set UnitEnters = null
set ClearMemory = null
set cDamageEngine = null
set cUnitEnters = null
set cClearMemory = null
set cRunAllocatedAttacks = null
set g = null
set r = null
endmethod
endmodule
private struct Init extends array
implement Inits
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_SteamTankDamageMissile_Actions takes nothing returns nothing
local real r
set udg_Missile__WantDestroy = true
set r = udg_Missile__Damage
if IsUnitType(udg_Missile__Target,UNIT_TYPE_STRUCTURE) then
set r = r*3.
endif
call UnitDamageTarget(udg_Missile__Source,udg_Missile__Target,r,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endfunction
//===========================================================================
function InitTrig_SteamTankDamageMissile takes nothing returns nothing
set gg_trg_SteamTankDamageMissile = CreateTrigger( )
call TriggerAddAction( gg_trg_SteamTankDamageMissile, function Trig_SteamTankDamageMissile_Actions )
endfunction
//TESH.scrollpos=57
//TESH.alwaysfold=0
function Trig_Progress_Bar_Start_Func001C takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A000' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A002' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A003' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A001' ) ) then
return true
endif
return false
endfunction
function Trig_Progress_Bar_Start_Conditions takes nothing returns boolean
if ( not Trig_Progress_Bar_Start_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Start_Func002C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Start_Func003C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Start_Func004C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A002' ) ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Start_Func005C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A003' ) ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Start_Actions takes nothing returns nothing
if ( Trig_Progress_Bar_Start_Func002C() ) then
set udg_ProgressBarSpeed = 2.00
set udg_Height = 160.00
else
endif
if ( Trig_Progress_Bar_Start_Func003C() ) then
set udg_ProgressBarSpeed = 1.00
set udg_Height = 225.00
else
endif
if ( Trig_Progress_Bar_Start_Func004C() ) then
set udg_ProgressBarSpeed = 7.00
set udg_Height = 150.00
else
endif
if ( Trig_Progress_Bar_Start_Func005C() ) then
set udg_ProgressBarSpeed = 3.00
set udg_Height = 270.00
else
endif
set udg_HandleID = GetTriggerUnit()
set udg_Point = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 15.00, 180.00)
local real x = GetUnitX(f) + 15 * Cos(180 * bj_DEGTORAD)
local real y = GetUnitY(f) + 15 * Sin(180 * bj_DEGTORAD)
call CreateNUnitsAtLoc( 1, 'o000', ConvertedPlayer(udg_PlayerIndex), udg_Point, bj_UNIT_FACING )
call SaveUnitHandleBJ( GetLastCreatedUnit(), 0, GetHandleIdBJ(udg_HandleID), udg_Hash )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_ChangeColorGP )
call UnitAddAbilityBJ( 'Arav', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'Arav', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), ( GetUnitFlyHeight(GetTriggerUnit()) + udg_Height ), 0.00 )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), ( ( 1 / udg_ProgressBarSpeed ) * 100.00 ) )
call RemoveLocation (udg_Point)
endfunction
//===========================================================================
function InitTrig_Progress_Bar_Start takes nothing returns nothing
set gg_trg_Progress_Bar_Start = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Progress_Bar_Start, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Progress_Bar_Start, Condition( function Trig_Progress_Bar_Start_Conditions ) )
call TriggerAddAction( gg_trg_Progress_Bar_Start, function Trig_Progress_Bar_Start_Actions )
endfunction
//TESH.scrollpos=2
//TESH.alwaysfold=0
function Trig_Progress_Bar_Channel_End_Func003C takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A000' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A002' ) ) then
return true
endif
return false
endfunction
function Trig_Progress_Bar_Channel_End_Conditions takes nothing returns boolean
if ( not Trig_Progress_Bar_Channel_End_Func003C() ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Channel_End_Actions takes nothing returns nothing
set udg_HandleID = GetTriggerUnit()
call RemoveUnit( LoadUnitHandleBJ(0, GetHandleIdBJ(udg_HandleID), GetLastCreatedHashtableBJ()) )
endfunction
//===========================================================================
function InitTrig_Progress_Bar_Channel_End takes nothing returns nothing
set gg_trg_Progress_Bar_Channel_End = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Progress_Bar_Channel_End, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Progress_Bar_Channel_End, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Progress_Bar_Channel_End, Condition( function Trig_Progress_Bar_Channel_End_Conditions ) )
call TriggerAddAction( gg_trg_Progress_Bar_Channel_End, function Trig_Progress_Bar_Channel_End_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Progress_Bar_Cast_End_Func003C takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A003' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A001' ) ) then
return true
endif
return false
endfunction
function Trig_Progress_Bar_Cast_End_Conditions takes nothing returns boolean
if ( not Trig_Progress_Bar_Cast_End_Func003C() ) then
return false
endif
return true
endfunction
function Trig_Progress_Bar_Cast_End_Actions takes nothing returns nothing
set udg_HandleID = GetTriggerUnit()
call RemoveUnit( LoadUnitHandleBJ(0, GetHandleIdBJ(udg_HandleID), GetLastCreatedHashtableBJ()) )
endfunction
//===========================================================================
function InitTrig_Progress_Bar_Cast_End takes nothing returns nothing
set gg_trg_Progress_Bar_Cast_End = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Progress_Bar_Cast_End, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Progress_Bar_Cast_End, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Progress_Bar_Cast_End, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Progress_Bar_Cast_End, Condition( function Trig_Progress_Bar_Cast_End_Conditions ) )
call TriggerAddAction( gg_trg_Progress_Bar_Cast_End, function Trig_Progress_Bar_Cast_End_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Example_Func007C takes nothing returns boolean
if ( not ( udg_CP_PointIsWalkable == true ) ) then
return false
endif
return true
endfunction
function Trig_Example_Actions takes nothing returns nothing
// Set CP_Point to the point you want to check for walkability
set udg_CP_Point = GetOrderPointLoc()
// Run "Check Walkability"
call TriggerExecute( gg_trg_Check_Walkability )
// If CP_PointIsWalkable is true, then the point is walkable
// If it is false, then it isn't pathable.
if ( Trig_Example_Func007C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_497" )
else
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_496" )
endif
call RemoveLocation(udg_CP_Point)
endfunction
//===========================================================================
function InitTrig_Example takes nothing returns nothing
set gg_trg_Example = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Example, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddAction( gg_trg_Example, function Trig_Example_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
library Assembler initializer HandleCounter
globals
private leaderboard Ass341
endglobals
private function HandleCounter_Update takes nothing returns nothing
local integer i = 0
local integer id
local location array Z
local real result=0
loop
exitwhen i >= 50
set i = i + 1
set Z[i] = Location(0,0)
set id = GetHandleId(Z[i])
set result = result + (id-0x100000)
endloop
set result = result/i-i/2
loop
call RemoveLocation(Z[i])
set Z[i] = null
exitwhen i <= 1
set i = i - 1
endloop
call LeaderboardSetItemValue(Ass341,0,R2I(result))
endfunction
private function HandleCounter_Actions takes nothing returns nothing
set Ass341 = CreateLeaderboard()
call LeaderboardSetLabel(Ass341, "Handle Counter")
call PlayerSetLeaderboard(GetLocalPlayer(),Ass341)
call LeaderboardDisplay(Ass341,true)
call LeaderboardAddItem(Ass341,"Handles",0,Player(0))
call LeaderboardSetSizeByItemCount(Ass341,1)
call HandleCounter_Update()
call TimerStart(GetExpiredTimer(),0.1,true,function HandleCounter_Update)
endfunction
private function HandleCounter takes nothing returns nothing
call TimerStart(CreateTimer(),0,false,function HandleCounter_Actions)
endfunction
endlibrary
//TESH.scrollpos=24
//TESH.alwaysfold=0
function Trig_ME_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(),7,9))
call echo("region " + I2S(i) + " COUNTS IS " + I2S(RectCountCr[i]))
/*
call echo(I2S(i))
if IsUnitFocused[i] then
call echo("фокус есть")
else
call echo("фокуса нет")
endif
call echo("Имя - " + GetUnitName(FocusedUnit[i]))
if not IsUnitDead(FocusedUnit[i]) then
call echo("скорее жив")
else
call echo("скорее мертв")
endif
*/
/*
if not IsUnitDead(F) then
call echo("alive")
endif
if IsUnitInGroup(F,Paladins) then
call echo("Paladins group")
else
call echo("Paladins not group")
endif
if IsUnitInGroup(F,DreadLords) then
call echo("DreadLords group")
else
call echo("DreadLords not group")
endif */
//call echo(I2S(T1Nplayer) + " number 1")
//call echo(I2S(T2Nplayer) + " number 2")
//if IsPlayerInForce(GetOwningPlayer(F),UndeadForce) then
//call echo("in undead force")
//endif
//call SetTerrainFogExBJ( 0, 1000, 8000, 0, 85.00, 85.00, 55.00 )
endfunction
//===========================================================================
function InitTrig_ME takes nothing returns nothing
set gg_trg_ME = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_ME, Player(0), "-check ", false )
//call TriggerRegisterPlayerUnitEvent(gg_trg_ME, Player(0), EVENT_PLAYER_UNIT_SELECTED, null)
// call TriggerRegisterPlayerUnitEvent(gg_trg_ME, Player(6), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerChatEvent( gg_trg_ME, Player(6), "-check ", false )
call TriggerAddAction( gg_trg_ME, function Trig_ME_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_CheckDreadLordPatry_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(),12,14))
call echo(GetUnitName(HERO[i]))
if IsUnitInGroup(HERO[i],DreadLords) and not IsUnitDead(HERO[i]) then
call echo("в группе гандон")
elseif IsUnitInGroup(HERO[i],DreadLords) and IsUnitDead(HERO[i]) then
call echo("в группе но умер")
else
call echo("ne в группе гандон")
endif
if UnitTypeNotDummy(HERO[i]) then
call echo("не дамми он")
endif
//call echo("region " + I2S(i) + " COUNTS IS " + I2S(RectCountCr[i]))
endfunction
//===========================================================================
function InitTrig_CheckDreadLordPatry takes nothing returns nothing
set gg_trg_CheckDreadLordPatry = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_CheckDreadLordPatry, Player(0), "-checkDread ", false )
//call TriggerRegisterPlayerUnitEvent(gg_trg_ME, Player(0), EVENT_PLAYER_UNIT_SELECTED, null)
// call TriggerRegisterPlayerUnitEvent(gg_trg_ME, Player(6), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerChatEvent( gg_trg_CheckDreadLordPatry, Player(6), "-checkDread ", false )
call TriggerAddAction( gg_trg_CheckDreadLordPatry, function Trig_CheckDreadLordPatry_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_CheckDreadLordPatry2_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(),10,12))
call echo(GetUnitName(HERO[i]))
if IsUnitInGroup(HERO[i],Paladins) and not IsUnitDead(HERO[i]) then
call echo("в группе гандон")
elseif IsUnitInGroup(HERO[i],Paladins) and IsUnitDead(HERO[i]) then
call echo("в группе но умер")
else
call echo("ne в группе гандон")
endif
if UnitTypeNotDummy(HERO[i]) then
call echo("не дамми он")
endif
call ReviveHero(HERO[i],-2443., 3092,true)
//call echo("region " + I2S(i) + " COUNTS IS " + I2S(RectCountCr[i]))
endfunction
//===========================================================================
function InitTrig_CheckDreadLordPatry_____________________u takes nothing returns nothing
set gg_trg_CheckDreadLordPatry_____________________u = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_CheckDreadLordPatry_____________________u, Player(0), "-checkPal ", false )
//call TriggerRegisterPlayerUnitEvent(gg_trg_ME, Player(0), EVENT_PLAYER_UNIT_SELECTED, null)
// call TriggerRegisterPlayerUnitEvent(gg_trg_ME, Player(6), EVENT_PLAYER_UNIT_SELECTED, null)
call TriggerRegisterPlayerChatEvent( gg_trg_CheckDreadLordPatry_____________________u, Player(6), "-checkPal ", false )
call TriggerAddAction( gg_trg_CheckDreadLordPatry_____________________u, function Trig_CheckDreadLordPatry2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_____________________________________021_Actions takes nothing returns nothing
call IssuePointOrder( gg_unit_Uwar_0895, "move", -2375,3089)
endfunction
//===========================================================================
function InitTrig_____________________________________021 takes nothing returns nothing
set gg_trg_____________________________________021 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_____________________________________021, 30.00 )
call TriggerAddAction( gg_trg_____________________________________021, function Trig_____________________________________021_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CR_cast_Actions takes nothing returns nothing
local integer h
local integer calc
local real angle
local real distance
set F = GetSpellAbilityUnit()
if GetSpellAbilityId() == 'A01D' then
// set T = CreateTimer()
// set ID = GetHandleId(T)
//set udg_CR_unit = GetTriggerUnit()
// set h = GetHandleId(F)
set I = 1
//set bj_forLoopAIndexEnd = udg_CR_missile_number
loop
exitwhen I > 12
//set calc = udg_CR_SaveUsage * I
set angle = ( ( 360.00 / I2R(12) ) * I2R(I) )
set distance = 650 //LoadReal(Hash, h, calc + 4)// + 600
//call SaveReal(Hash, h, calc + 4, distance)
//call echo("work")
set X = GetUnitX(F) + distance * Cos(angle * bj_DEGTORAD)
set Y = GetUnitY(F) + distance * Sin(angle * bj_DEGTORAD)
//
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Source = F
set udg_Missile__Owner = GetOwningPlayer(F)
//set udg_Missile__Target = c
set udg_Missile__Origin = Location(GetUnitX(F),GetUnitY(F))
set udg_Missile__OriginZ = 50.00
set udg_Missile__Impact = Location(X,Y)
set udg_Missile__ImpactZ = 50.00
// if DistanceXY(GetUnitX(F),GetUnitY(F),X,Y) < 230 then
// set udg_Missile__FlyTime = 0.85
// else
// set udg_Missile__FlyTime = 0.85
// endif
set udg_Missile__Speed = 300.
set udg_Missile__Collision = 80.00 //64
set udg_Missile__Height = 20// GetRandomReal(110,195) //250.00
set udg_Missile__Damage = 160.00
//set udg_Missile__Curve = ( -40.00 + ( 25.00 * I2R( i4 ) ) )
set udg_Missile__Model = "Abilities\\Weapons\\GargoyleMissile\\GargoyleMissile.mdl"
set udg_Missile__Scale = 1.30
//"Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl"
set udg_Missile__OnRemove = gg_trg_CorruptionCollision
set udg_Missile__OnCollideUnit = gg_trg_CorruptionCollision
set udg_Missile__OnFinish = gg_trg_CorruptionCollision
set udg_Missile__Data = 1
// Set trigger with should run on missile events.
call TriggerExecute( gg_trg_Missile )
//call SaveReal(Hash, ID, StringHash("Corruption_angle"), angle)
//call SaveReal(Hash, ID, StringHash("Corruption_CX"), )
//call SaveReal(Hash, ID, StringHash("Corruption_CY"), )
I++
endloop
//call SaveGroupHandle(Hash,ID,StringHash("Corruption_G"),P2)
//call SaveUnitHandle(Hash,ID,StringHash("Corruption_C"),F)
//call TimerStart(T,0.03,true,function Trig_CR_loop_Actions)
//call GroupAddUnit( udg_CR_group,udg_CR_unit )
endif
endfunction
//===========================================================================
function InitTrig_CR_cast takes nothing returns nothing
set gg_trg_CR_cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CR_cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
//call TriggerAddCondition( gg_trg_CR_cast, Condition( function Trig_CR_cast_Conditions ) )
call TriggerAddAction( gg_trg_CR_cast, function Trig_CR_cast_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_____________________________________014_Conditions takes nothing returns boolean
if ( not ( udg_Missile__EventId == udg_EVENT_MISSILE_REMOVE ) ) then
return false
endif
return true
endfunction
function Trig_____________________________________014_Func002C takes nothing returns boolean
if ( not ( udg_Missile__EventId == udg_EVENT_MISSILE_COLLIDE_UNIT ) ) then
return false
endif
if ( not ( IsUnitEnemy(udg_Missile__UnitHit, udg_Missile__Owner) == true ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(udg_Missile__UnitHit) == true ) ) then
return false
endif
return true
endfunction
function Trig_____________________________________014_Actions takes nothing returns nothing
if ( Trig_____________________________________014_Func002C() ) then
// See how easy damaging got.
call UnitDamageTargetBJ( udg_Missile__Source, udg_Missile__UnitHit, udg_Missile__Damage, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )
set udg_Missile__WantDestroy = true
else
endif
set udg_Missile__TempLoc = GetUnitLoc(udg_Missile__Dummy)
endfunction
//===========================================================================
function InitTrig_____________________________________014 takes nothing returns nothing
set gg_trg_____________________________________014 = CreateTrigger( )
call TriggerAddCondition( gg_trg_____________________________________014, Condition( function Trig_____________________________________014_Conditions ) )
call TriggerAddAction( gg_trg_____________________________________014, function Trig_____________________________________014_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_CorruptionCollision_Actions takes nothing returns nothing
if udg_Missile__EventId == udg_EVENT_MISSILE_COLLIDE_UNIT then
if udg_Missile__UnitHit != udg_Missile__Owner and UnitTypeNotDummy(udg_Missile__UnitHit) and not IsUnitDead(udg_Missile__UnitHit) and IsUnitEnemy(udg_Missile__UnitHit,Player(0)) then
//set udg_Missile__WantDestroy = true
call DestroyEffect( AddSpecialEffect( "Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl",GetUnitX(udg_Missile__UnitHit),GetUnitY(udg_Missile__UnitHit) ) )
call SetUnitLife(udg_Missile__UnitHit,GetUnitLife(udg_Missile__UnitHit) - udg_Missile__Damage)
call SetUnitLife(udg_Missile__Source,GetUnitLife(udg_Missile__Source) + udg_Missile__Damage)
//call UnitDamageTarget(udg_Missile__Source,udg_Missile__UnitHit,udg_Missile__Damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
endif
/*
if udg_Missile__EventId == udg_EVENT_MISSILE_REMOVE then
set udg_Missile__WantDestroy = true
call echo("removed")
call DestroyEffect( AddSpecialEffect( "Divine Edict.mdx",GetUnitX(udg_Missile__Dummy),GetUnitY(udg_Missile__Dummy) ) )
endif */
if udg_Missile__EventId == udg_EVENT_MISSILE_FINISH then
set udg_Missile__WantDestroy = true
//call DestroyEffect( AddSpecialEffect( "Soul Discharge Purple.mdx",GetUnitX(udg_Missile__Dummy),GetUnitY(udg_Missile__Dummy) ) )
//call echo("reached")
endif
endfunction
//===========================================================================
function InitTrig_CorruptionCollision takes nothing returns nothing
set gg_trg_CorruptionCollision = CreateTrigger( )
call TriggerAddAction( gg_trg_CorruptionCollision, function Trig_CorruptionCollision_Actions )
endfunction
//TESH.scrollpos=45
//TESH.alwaysfold=0
function Trig_Fireball_Actions_Copy_Func005Func001C takes nothing returns boolean
if ( not ( udg_Missile__EventId == udg_EVENT_MISSILE_COLLIDE_UNIT ) ) then
return false
endif
if ( not ( IsUnitEnemy(udg_Missile__UnitHit, udg_Missile__Owner) == true ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(udg_Missile__UnitHit) == true ) ) then
return false
endif
return true
endfunction
function Trig_Fireball_Actions_Copy_Func005Func002Func002002003001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), udg_Missile__Owner) == true )
endfunction
function Trig_Fireball_Actions_Copy_Func005Func002Func002002003002 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Fireball_Actions_Copy_Func005Func002Func002002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Fireball_Actions_Copy_Func005Func002Func002002003001(), Trig_Fireball_Actions_Copy_Func005Func002Func002002003002() )
endfunction
function Trig_Fireball_Actions_Copy_Func005Func002Func003A takes nothing returns nothing
call UnitDamageTargetBJ( udg_Missile__Source, GetEnumUnit(), udg_Missile__Damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
function Trig_Fireball_Actions_Copy_Func005Func002C takes nothing returns boolean
if ( not ( udg_Missile__Data == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Fireball_Actions_Copy_Func005C takes nothing returns boolean
if ( not ( udg_Missile__EventId == udg_EVENT_MISSILE_REMOVE ) ) then
return false
endif
return true
endfunction
function Trig_Fireball_Actions_Copy_Actions takes nothing returns nothing
// As you can see Missile__EventId allows you
// to identify which event trigger dispatched.
// Therefore you can run all actions from one trigger function.
// Of course you can also seperate triggers into different triggers.
if ( Trig_Fireball_Actions_Copy_Func005C() ) then
if ( Trig_Fireball_Actions_Copy_Func005Func002C() ) then
// Create more fireballs
// Reference to Missile__Dummy will be removed
// Once you call Run Missile Configurate <gen>
set udg_Missile__TempLoc = GetUnitLoc(udg_Missile__Dummy)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call TriggerExecute( gg_trg_Missile_Configurate )
set udg_Missile__Origin = Location(GetLocationX(udg_Missile__TempLoc), GetLocationY(udg_Missile__TempLoc))
set udg_Missile__Impact = PolarProjectionBJ(udg_Missile__Origin, 450.00, ( 60.00 * I2R(GetForLoopIndexA()) ))
set udg_Missile__ImpactZ = 50.00
set udg_Missile__Height = 350.00
set udg_Missile__OriginZ = 50.00
set udg_Missile__Speed = 500.00
set udg_Missile__Damage = 150.00
set udg_Missile__Source = udg_Missile_Source[udg_Missile__EventIndex]
set udg_Missile__Owner = udg_Missile_Owner[udg_Missile__EventIndex]
set udg_Missile__Model = "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdl"
set udg_Missile__OnCollideUnit = gg_trg_Fireball_Actions
set udg_Missile__OnRemove = gg_trg_Fireball_Actions
set udg_Missile__Data = 2
call TriggerExecute( gg_trg_Missile )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(udg_Missile__TempLoc)
set udg_Missile__TempLoc = null
else
set udg_Missile__TempLoc = GetUnitLoc(udg_Missile__Dummy)
set udg_Temp_Group = GetUnitsInRangeOfLocMatching(128.00, udg_Missile__TempLoc, Condition(function Trig_Fireball_Actions_Copy_Func005Func002Func002002003))
call ForGroupBJ( udg_Temp_Group, function Trig_Fireball_Actions_Copy_Func005Func002Func003A )
call AddSpecialEffectLocBJ( udg_Missile__TempLoc, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call DestroyGroup(udg_Temp_Group)
call RemoveLocation(udg_Missile__TempLoc)
set udg_Missile__TempLoc = null
endif
else
if ( Trig_Fireball_Actions_Copy_Func005Func001C() ) then
// See how easy damaging got.
call UnitDamageTargetBJ( udg_Missile__Source, udg_Missile__UnitHit, udg_Missile__Damage, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )
set udg_Missile__WantDestroy = true
else
endif
endif
endfunction
//===========================================================================
function InitTrig_Fireball_Actions_Copy takes nothing returns nothing
set gg_trg_Fireball_Actions_Copy = CreateTrigger( )
call TriggerAddAction( gg_trg_Fireball_Actions_Copy, function Trig_Fireball_Actions_Copy_Actions )
endfunction