Name | Type | is_array | initial_value |
Arthas | unit | No | |
ArthasSouls | integer | No | |
CountGroup1 | integer | No | |
CountGroup2 | integer | No | |
CountGroup3 | integer | No | |
CountHorse1 | integer | No | 2 |
CountHorse2 | integer | No | 3 |
CountHorse3 | integer | No | 8 |
CountHorse4 | integer | No | 8 |
CountHorse5 | integer | No | 5 |
CurrentCountDefeat | integer | No | |
CurrentZone1 | integer | Yes | |
CurrentZone2 | integer | Yes | |
EnemyHeroLevel | integer | No | |
GAME_DIFFICULTY | integer | No | |
LocalUnit | unit | No | |
Map | string | No | alterac |
MaxCountDefeat | integer | No | 0 |
MythicEnemy | player | No | Player05 |
MythicList | trigger | Yes | |
MythicRandom | real | No | |
PingTimer | real | No | 2.50 |
PingWaitTime | real | No | 0.33 |
PlayerArthas | player | No | |
PlayerThrall | player | No | |
RACE_RANDOM | race | No | |
RacesRandom | real | No | |
SetDifficulty | integer | No | |
SetEnemy | player | No | |
SetPlayerDifficulty | integer | Yes | |
SetRaces | race | No | |
SetRaces_Building | abilcode | No | |
SetRaces_Hero | abilcode | No | |
SetRaces_Unit | abilcode | No | |
SetRaces_Upgrade | techcode | Yes | |
SetZone | rect | No | |
ThrallMode | string | No | air |
ThrallTotems | integer | No | |
TimerAIUpgrade | timer | Yes | |
TimerEnemyWave | timer | Yes | |
TimerMinAIUpg | real | Yes | |
TimerMinEnemyWave | real | Yes | |
TimerMinWave | real | Yes | |
TimerWave | timer | Yes | |
UnitGroup11 | group | No | |
UnitGroup12 | group | No | |
UnitGroup13 | group | No | |
UnitGroup14 | group | No | |
UnitGroup15 | group | No | |
UnitGroup21 | group | No | |
UnitGroup22 | group | No | |
UnitGroup23 | group | No | |
UnitGroup24 | group | No | |
UnitGroup25 | group | No | |
UnitGroup31 | group | No | |
UnitGroupArray1 | group | Yes | |
UnitGroupArray2 | group | Yes | |
UnitGroupArray3 | group | Yes | |
WaveComplete | integer | No | |
WaveRandomWay | real | No | |
Way1 | rect | Yes | |
Way1Count | integer | No | |
Way2 | rect | Yes | |
Way2Count | integer | No | |
Whitemane_crusade_bool | boolean | No | |
Whitemane_crusade_current | real | No | |
Whitemane_crusade_default | real | No | |
Whitemane_crusade_level | integer | No | |
WhitemanePlayer | player | No | |
WrynnDeposit | integer | Yes | |
WrynnExp | integer | No | |
WrynnExpTable | integer | Yes | |
WrynnExpUnitCount | integer | No |
globals
framehandle ThrallIcon = null
endglobals
library THRALLUI initializer init
private function CreateIcon takes nothing returns nothing
set ThrallIcon = BlzCreateFrameByType("BACKDROP", "ThrallDynamicIcon", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(ThrallIcon, 0.05, 0.05)
call BlzFrameSetVisible(ThrallIcon, false)
endfunction
function ShowThrallUiForPlayer takes player p, string iconCode returns nothing
local string texturePath
local real xPos = 0.345
local real yPos = 0.118
if iconCode == "air" then
set texturePath = "UI\\Console\\Thrall\\air"
elseif iconCode == "fire" then
set texturePath = "UI\\Console\\Thrall\\fire"
elseif iconCode == "water" then
set texturePath = "UI\\Console\\Thrall\\water"
elseif iconCode == "earth" then
set texturePath = "UI\\Console\\Thrall\\earth"
else
return
endif
if GetLocalPlayer() == p then
call BlzFrameSetTexture(ThrallIcon, texturePath, 0, true)
call BlzFrameSetVisible(ThrallIcon, true)
call BlzFrameSetAbsPoint(ThrallIcon, FRAMEPOINT_TOPLEFT, xPos, yPos + 0.065)
call BlzFrameSetAbsPoint(ThrallIcon, FRAMEPOINT_BOTTOMRIGHT, xPos + 0.115, yPos)
endif
endfunction
private function init takes nothing returns nothing
call CreateIcon()
endfunction
endlibrary
globals
framehandle WhitemaneIcon = null
framehandle WhitemaneText = null
endglobals
library WHITEMANEUI initializer init
private function CreateIcon takes nothing returns nothing
// Создание иконки
set WhitemaneIcon = BlzCreateFrameByType("BACKDROP", "WhitemaneIcon", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(WhitemaneIcon, 0.05, 0.05)
call BlzFrameSetVisible(WhitemaneIcon, false)
// Создание текстового фрейма
set WhitemaneText = BlzCreateFrameByType("TEXT", "WhitemaneDynamicText", WhitemaneIcon, "", 0)
call BlzFrameSetPoint(WhitemaneText, FRAMEPOINT_CENTER, WhitemaneIcon, FRAMEPOINT_CENTER, 0, -0.0135)
call BlzFrameSetSize(WhitemaneText, 0.06, 0.025)
call BlzFrameSetScale(WhitemaneText, 1.25)
call BlzFrameSetTextAlignment(WhitemaneText, TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_MIDDLE)
call BlzFrameSetText(WhitemaneText, "")
call BlzFrameSetVisible(WhitemaneText, false)
endfunction
function ShowWhitemaneUiForPlayer takes player p, string iconCode returns nothing
local string texturePath
local real xPos = 0.345
local real yPos = 0.118
if iconCode == "off" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_off"
elseif iconCode == "on" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_on"
elseif iconCode == "on1" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_on1"
elseif iconCode == "on2" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_on2"
elseif iconCode == "on3" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_on3"
elseif iconCode == "on4" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_on4"
elseif iconCode == "on5" then
set texturePath = "UI\\Console\\Whitemane\\scarlet_crusade_on5"
else
return
endif
if GetLocalPlayer() == p then
call BlzFrameSetTexture(WhitemaneIcon, texturePath, 0, true)
call BlzFrameSetVisible(WhitemaneIcon, true)
call BlzFrameSetVisible(WhitemaneText, true)
call BlzFrameSetAbsPoint(WhitemaneIcon, FRAMEPOINT_TOPLEFT, xPos, yPos + 0.065)
call BlzFrameSetAbsPoint(WhitemaneIcon, FRAMEPOINT_BOTTOMRIGHT, xPos + 0.065, yPos)
endif
endfunction
function UpdateWhitemaneText takes player p, string text returns nothing
if GetLocalPlayer() == p then
call BlzFrameSetText(WhitemaneText, "|cFFBF0000" + text + "|r")
endif
endfunction
private function init takes nothing returns nothing
call CreateIcon()
endfunction
endlibrary
globals
framehandle ArthasIcon = null
framehandle ArthasText = null
endglobals
library ARTHASUI initializer init
private function CreateIcon takes nothing returns nothing
// Создание иконки
set ArthasIcon = BlzCreateFrameByType("BACKDROP", "ArthasIcon", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(ArthasIcon, 0.05, 0.05)
call BlzFrameSetVisible(ArthasIcon, false)
// Создание текстового фрейма
set ArthasText = BlzCreateFrameByType("TEXT", "ArthasDynamicText", ArthasIcon, "", 0)
call BlzFrameSetPoint(ArthasText, FRAMEPOINT_CENTER, ArthasIcon, FRAMEPOINT_CENTER, 0, -0.001)
call BlzFrameSetSize(ArthasText, 0.06, 0.025)
call BlzFrameSetScale(ArthasText, 1.3)
call BlzFrameSetTextAlignment(ArthasText, TEXT_JUSTIFY_CENTER, TEXT_JUSTIFY_MIDDLE)
call BlzFrameSetText(ArthasText, "")
call BlzFrameSetVisible(ArthasText, false)
endfunction
function ShowArthasUiForPlayer takes player p returns nothing
local real xPos = 0.168 // лево-право
local real yPos = 0.125 // верх=вниз
if GetLocalPlayer() == p then
call BlzFrameSetTexture(ArthasIcon, "UI\\Console\\Arthas\\arthas_souls", 0, true)
call BlzFrameSetVisible(ArthasIcon, true)
call BlzFrameSetVisible(ArthasText, true)
call BlzFrameSetAbsPoint(ArthasIcon, FRAMEPOINT_TOPLEFT, xPos, yPos + 0.065)
call BlzFrameSetAbsPoint(ArthasIcon, FRAMEPOINT_BOTTOMRIGHT, xPos + 0.065, yPos)
endif
endfunction
function UpdateArthasText takes player p, string text returns nothing
if GetLocalPlayer() == p then
call BlzFrameSetText(ArthasText, text)
endif
endfunction
private function init takes nothing returns nothing
call CreateIcon()
endfunction
endlibrary
globals
integer MYTHIC_INDEX = 0
endglobals
function FrameMythic takes string iconPath, string titleText, string descriptionText returns nothing
local framehandle buttonMyth
local framehandle new_Frame
local framehandle sprite
local framehandle tooltip
local real size = 0.025
local real offsetX = -0.057
local real offsetY = -0.057
local real scale = 0.5
local real pointx = 0.79
local real array yPositions
set yPositions[0] = 0.55
set yPositions[1] = yPositions[0] - 0.031
set yPositions[2] = yPositions[1] - 0.031
set yPositions[3] = yPositions[2] - 0.031
set buttonMyth = BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
call BlzFrameSetAbsPoint(buttonMyth, FRAMEPOINT_CENTER, pointx, yPositions[MYTHIC_INDEX])
call BlzFrameSetSize(buttonMyth, size, size)
set new_Frame = BlzCreateFrameByType("BACKDROP", "PORTRAIT", buttonMyth, "", 0)
call BlzFrameClearAllPoints(new_Frame)
call BlzFrameSetPoint(new_Frame, FRAMEPOINT_CENTER, buttonMyth, FRAMEPOINT_CENTER, 0, 0)
call BlzFrameSetSize(new_Frame, size, size)
call BlzFrameSetTexture(new_Frame, iconPath, 0, true)
set sprite = BlzCreateFrameByType("SPRITE", "justAName", new_Frame, "WarCraftIIILogo", 0)
call BlzFrameClearAllPoints(sprite)
call BlzFrameSetPoint(sprite, FRAMEPOINT_TOPRIGHT, new_Frame, FRAMEPOINT_TOPRIGHT, offsetX, offsetY)
call BlzFrameSetSize(sprite, 0.000025, 0.000025)
call BlzFrameSetScale(sprite, scale)
call BlzFrameSetModel(sprite, "UI\\Mythic\\Border\\damned_sprite.mdx", 0)
set tooltip = BlzCreateFrameByType("TEXT", "TooltipFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetText(tooltip, "|cFFA293FF" + titleText + "|r|n" + descriptionText)
call BlzFrameSetAbsPoint(tooltip, FRAMEPOINT_CENTER, pointx - 0.1, yPositions[MYTHIC_INDEX])
call BlzFrameSetVisible(tooltip, false)
call BlzFrameSetTooltip(buttonMyth, tooltip)
call BlzFrameSetVisible(buttonMyth, true)
set MYTHIC_INDEX = MYTHIC_INDEX + 1
endfunction
library FrameLoader initializer init_function
// in 1.31 and upto 1.32.9 PTR (when I wrote this). Frames are not correctly saved and loaded, breaking the game.
// This library runs all functions added to it with a 0s delay after the game was loaded.
// function FrameLoaderAdd takes code func returns nothing
// func runs when the game is loaded.
globals
private trigger eventTrigger = CreateTrigger()
private trigger actionTrigger = CreateTrigger()
private timer t = CreateTimer()
endglobals
function FrameLoaderAdd takes code func returns nothing
call TriggerAddAction(actionTrigger, func)
endfunction
private function timerAction takes nothing returns nothing
call TriggerExecute(actionTrigger)
endfunction
private function eventAction takes nothing returns nothing
call TimerStart(t, 0, false, function timerAction)
endfunction
private function init_function takes nothing returns nothing
call TriggerRegisterGameEvent(eventTrigger, EVENT_GAME_LOADED)
call TriggerAddAction(eventTrigger, function eventAction)
endfunction
endlibrary
library CustomConsoleUI initializer init_function requires optional FrameLoader, optional GameStatus
// CustomConsoleUI by Tasyen
// CustomConsoleUI allows to change the UI during the game, when setuped correctly. This excludes the mouse cursor and the UI sounds.
// In non reforged it can also not change the Idle worker Button nor the no inventory cover.
// How to setup this: First you have to make the default Console Textures be hidden that is done in Game Interface.
// Set ConsoleTexture01 to ConsoleTexture06 to UI\Widgets\EscMenu\Human\blank-background.blp
// The Day of Time clock has hardcoded textures therefore you need to swap it out. That also should be done in Gameinterface.
// TimeOfDayIndicator to the model included in this system.
// Now export and Import war3mapImported\CustomConsoleUI.toc & war3mapImported\CustomConsoleUI.fdf
// Finally you have to set the used textures into local data
globals
// workerFace = true can only be used when you save the map in 1.32.6+
private constant boolean workerFace = true
private framehandle idleWorkerButton
private framehandle idleWorkerButtonOverlay
private framehandle idleWorkerButtonOverlayParent
private framehandle customInventoryCover
private framehandle customInventoryCoverParent
public string array data
public integer array dataCount
private integer dataPageSize = 11
public real array x
public real array y
endglobals
function AddCustomConsole takes integer index, string texture returns nothing
set dataCount[index] = dataCount[index] + 1
set data[index*dataPageSize + dataCount[index]] = texture
endfunction
function UseCustomConsole takes player p, integer index returns nothing
local integer pageValue
if GetLocalPlayer() != p then
return
endif
if index < 1 then
set index = GetHandleId(GetPlayerRace(p))
endif
set pageValue = index*dataPageSize
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI5T", 0), data[pageValue + 5], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI6T", 0), data[pageValue + 6], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI4T", 0), data[pageValue + 4], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI3T", 0), data[pageValue + 3], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2TL", 0), data[pageValue + 2], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2TR", 0), data[pageValue + 2], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI1T", 0), data[pageValue + 1], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI1B", 0), data[pageValue + 1], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2B", 0), data[pageValue + 2], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI3B", 0), data[pageValue + 3], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI4B", 0), data[pageValue + 4], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI5B", 0), data[pageValue + 5], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI6B", 0), data[pageValue + 6], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUIClock", 0), data[pageValue + 7] ,0, true)
if GetLocalizedString("REFORGED") != "REFORGED" then
call BlzFrameSetTexture(BlzGetFrameByName("InventoryCoverTexture", 0), data[pageValue + 8] ,0, true)
static if workerFace then
call BlzFrameSetTexture(idleWorkerButtonOverlay, data[pageValue + 9], 0, false)
endif
else
call BlzFrameSetTexture(customInventoryCover, data[pageValue + 8] ,0, true)
endif
call BlzFrameSetPoint(BlzGetFrameByName("CustomConsoleUIClock", 0), FRAMEPOINT_TOP, BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_TOP, x[index], y[index])
endfunction
function CreateCustomConsole takes nothing returns nothing
call BlzLoadTOCFile( "war3mapimported\\CustomConsoleUI.toc" )
call BlzCreateSimpleFrame( "CustomConsoleUI", BlzGetFrameByName("ConsoleUI", 0), 0)
call BlzFrameSetLevel(BlzGetFrameByName("CustomConsoleUI", 0), 0)
if GetLocalizedString("REFORGED") != "REFORGED" then
// Requires a native existing only in Reforged
static if workerFace then
set idleWorkerButton = BlzFrameGetChild(BlzGetFrameByName("ConsoleBottomBar", 0), 3)
set idleWorkerButtonOverlayParent = BlzCreateSimpleFrame( "SimpleTextureFrame", idleWorkerButton, 0 )
set idleWorkerButtonOverlay = BlzGetFrameByName("SimpleTextureFrameValue", 0)
call BlzFrameSetAllPoints(idleWorkerButtonOverlay, idleWorkerButton)
call BlzFrameSetLevel(idleWorkerButtonOverlayParent, 4)
static if LIBRARY_GameStatus then
if GetGameStatus() == GAME_STATUS_REPLAY then
// call BlzFrameSetVisible(idleWorkerButtonOverlayParent, false)
endif
endif
endif
else
set customInventoryCoverParent = BlzCreateSimpleFrame( "SimpleTextureFrame", BlzGetFrameByName("ConsoleUI", 0), 0)
call BlzFrameSetLevel(customInventoryCoverParent, 4)
set customInventoryCover = BlzGetFrameByName("SimpleTextureFrameValue", 0)
call BlzFrameSetAbsPoint(customInventoryCover, FRAMEPOINT_BOTTOMRIGHT, 0.6, 0)
call BlzFrameSetAbsPoint(customInventoryCover, FRAMEPOINT_TOPLEFT, 0.6 - 0.128, 0.2558)
endif
// Preload
call BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)
call BlzGetFrameByName("InventoryCoverTexture", 0)
call BlzGetFrameByName("CustomConsoleUIClock", 0)
call BlzGetFrameByName("CustomConsoleUI5T", 0)
call BlzGetFrameByName("CustomConsoleUI6T", 0)
call BlzGetFrameByName("CustomConsoleUI4T", 0)
call BlzGetFrameByName("CustomConsoleUI3T", 0)
call BlzGetFrameByName("CustomConsoleUI2TL", 0)
call BlzGetFrameByName("CustomConsoleUI2TR", 0)
call BlzGetFrameByName("CustomConsoleUI1T", 0)
call BlzGetFrameByName("CustomConsoleUI1B", 0)
call BlzGetFrameByName("CustomConsoleUI2B", 0)
call BlzGetFrameByName("CustomConsoleUI3B", 0)
call BlzGetFrameByName("CustomConsoleUI4B", 0)
call BlzGetFrameByName("CustomConsoleUI5B", 0)
call BlzGetFrameByName("CustomConsoleUI6B", 0)
endfunction
private function Init takes nothing returns nothing
call CreateCustomConsole()
call UseCustomConsole(GetLocalPlayer(), 0)
endfunction
private function at0s takes nothing returns nothing
call Init()
call DestroyTimer(GetExpiredTimer())
endfunction
private function update takes nothing returns nothing
call BlzFrameSetVisible(customInventoryCoverParent, not BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)))
endfunction
private function init_function takes nothing returns nothing
local integer index = 0
set index = GetHandleId(RACE_HUMAN)
call AddCustomConsole(index, "ui\\console\\human\\humanuitile01")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile02")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile03")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile04")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeasant")
// offset this mostly is used to fit to the glowing orbs showing the houers
set x[index] = 0.0009
set y[index] = 0.0
set index = GetHandleId(RACE_ORC)
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile01")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile02")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile03")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile04")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeon")
set x[index] = 0.0004
set y[index] = 0.0
set index = GetHandleId(RACE_UNDEAD)
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile01")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile02")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile03")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile04")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNAcolyte")
set x[index] = 0.0009
set y[index] = 0.0
set index = GetHandleId(RACE_NIGHTELF)
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile01")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile02")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile03")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile04")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\Widgets\\EscMenu\\Human\\blank-background")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNWisp")
set x[index] = 0.0009
set y[index] = 0.0
set index = GetHandleId(ConvertRace(5))
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile01")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile02")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile03")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile04")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile05")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile06")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile-timeindicatorframe")
call AddCustomConsole(index, "UI\\Console\\Uther\\humanuitile-inventorycover")
call AddCustomConsole(index, "Legends\\Uther\\Pilgrim\\BTNPilgrim")
set x[index] = 0.000
set y[index] = 0.0
set index = GetHandleId(ConvertRace(6))
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile01")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile02")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile03")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile04")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile05")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile06")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile-timeindicatorframe")
call AddCustomConsole(index, "UI\\Console\\Tyrande\\nightelfuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNWisp")
set x[index] = 0.000
set y[index] = 0.0
set index = GetHandleId(ConvertRace(7))
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile01")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile02")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile03")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile04")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile05")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile06")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile-timeindicatorframe")
call AddCustomConsole(index, "UI\\Console\\Wrynn\\humanuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeasant")
set x[index] = 0.000
set y[index] = 0.0
set index = GetHandleId(ConvertRace(8))
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile01")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile02")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile03")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile04")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile05")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile06")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile-timeindicatorframe")
call AddCustomConsole(index, "UI\\Console\\Arthas\\undeaduitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNAcolyte")
set x[index] = 0.000
set y[index] = 0.0
set index = GetHandleId(ConvertRace(9))
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile01")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile02")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile03")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile04")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile05")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile06")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile-timeindicatorframe")
call AddCustomConsole(index, "UI\\Console\\Thrall\\orcuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeon")
set x[index] = 0.0004
set y[index] = 0.0
set index = GetHandleId(ConvertRace(10))
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile01")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile02")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile03")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile04")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile05")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile06")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile-timeindicatorframe")
call AddCustomConsole(index, "UI\\Console\\Whitemane\\humanuitile-inventorycover")
call AddCustomConsole(index, "Legends\\Whitemane\\Houndmaster\\BTNBeastmistress")
set x[index] = 0.000
set y[index] = 0.0
if GetLocalizedString("REFORGED") == "REFORGED" then
call TimerStart(CreateTimer(), 1/32.0, true, function update)
endif
call TimerStart(CreateTimer(), 0, false, function at0s)
static if LIBRARY_FrameLoader then
call FrameLoaderAdd(function Init)
endif
endfunction
endlibrary
function Trig_BtnF1_Conditions takes nothing returns boolean
return GetUnitTypeId(GetOrderedUnit()) == 'H02J'
endfunction
function Trig_BtnF1_UnitFilter_All takes nothing returns boolean
local unit u = GetFilterUnit()
return not IsUnitType(u, UNIT_TYPE_STRUCTURE) and not IsUnitType(u, UNIT_TYPE_PEON) and GetUnitTypeId(u) != 'H02J' and GetUnitAbilityLevel(u, 'Aloc') != 1 and GetUnitAbilityLevel(u, 'A09E') != 1
endfunction
function Trig_BtnF1_UnitFilter_NoWalk takes nothing returns boolean
local unit u = GetFilterUnit()
return not IsUnitType(u, UNIT_TYPE_STRUCTURE) and not IsUnitType(u, UNIT_TYPE_PEON) and GetUnitTypeId(u) != 'H02J' and GetUnitAbilityLevel(u, 'Aloc') != 1 and GetUnitAbilityLevel(u, 'A09E') != 1 and GetUnitAbilityLevel(u, 'A09D') != 1
endfunction
function Trig_BtnF1_Actions takes nothing returns nothing
local unit orderedUnit = GetOrderedUnit()
local player p = GetOwningPlayer(orderedUnit)
local integer orderId = GetIssuedOrderId()
local unit targetUnit = GetOrderTargetUnit()
local location targetLoc = GetOrderPointLoc()
local group g = null
local unit u
local integer unitCount = 0
if orderId == 0 then
if targetLoc != null then
call RemoveLocation(targetLoc)
endif
return
endif
if GetUnitAbilityLevel(orderedUnit, 'A09F') != 1 then
set g = GetUnitsOfPlayerMatching(p, Condition(function Trig_BtnF1_UnitFilter_All))
else
set g = GetUnitsOfPlayerMatching(p, Condition(function Trig_BtnF1_UnitFilter_NoWalk))
endif
if g != null then
loop
set u = FirstOfGroup(g)
exitwhen u == null
set unitCount = unitCount + 1
if targetUnit != null then
call IssueTargetOrderById(u, orderId, targetUnit)
elseif targetLoc != null then
call IssuePointOrderByIdLoc(u, orderId, targetLoc)
else
call IssueImmediateOrderById(u, orderId)
endif
call GroupRemoveUnit(g, u)
endloop
call DestroyGroup(g)
endif
if targetLoc != null then
call RemoveLocation(targetLoc)
endif
call SetUnitState(orderedUnit, UNIT_STATE_MANA, I2R(unitCount))
endfunction
function InitTrig_BtnF1 takes nothing returns nothing
set gg_trg_BtnF1 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_BtnF1, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerRegisterAnyUnitEventBJ(gg_trg_BtnF1, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterAnyUnitEventBJ(gg_trg_BtnF1, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(gg_trg_BtnF1, Condition(function Trig_BtnF1_Conditions))
call TriggerAddAction(gg_trg_BtnF1, function Trig_BtnF1_Actions)
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
call SetUnitState(GetEnumUnit(), UNIT_STATE_MANA, 100.00)
call BlzSetUnitMaxMana( GetEnumUnit(), 300 )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
function Trig_PreviewLegend takes nothing returns nothing
local integer abilityId = GetSpellAbilityId()
local integer unitType
local integer i
local force allPlayers = bj_FORCE_ALL_PLAYERS
local player p
local unit unitU = GetSpellAbilityUnit()
if abilityId == 'A01C' or abilityId == 'A01J' or abilityId == 'A031' or abilityId == 'A054' or abilityId == 'A06B' or abilityId == 'A071' then
if abilityId == 'A01C' then
set unitType = 'h00T'
elseif abilityId == 'A01J' then
set unitType = 'h00U'
elseif abilityId == 'A031' then
set unitType = 'h012'
elseif abilityId == 'A054' then
set unitType = 'h01L'
elseif abilityId == 'A06B' then
set unitType = 'h01M'
elseif abilityId == 'A071' then
set unitType = 'h01V'
else
return
endif
call ShowUnit(unitU, false)
set bj_lastCreatedUnit = CreateUnitAtLoc(GetOwningPlayer(unitU), unitType, GetUnitLoc(unitU), 275.00)
call SelectUnitForPlayerSingle(bj_lastCreatedUnit, GetOwningPlayer(unitU))
call RemoveUnit(unitU)
loop
set p = Player(0)
exitwhen p == null
if (p != null) then
if abilityId == 'A031' then
call SetPlayerAbilityAvailable(p, 'A031', false)
elseif abilityId == 'A01J' then
call SetPlayerAbilityAvailable(p, 'A01J', false)
elseif abilityId == 'A01C' then
call SetPlayerAbilityAvailable(p, 'A01C', false)
elseif abilityId == 'A054' then
call SetPlayerAbilityAvailable(p, 'A054', false)
elseif abilityId == 'A06B' then
call SetPlayerAbilityAvailable(p, 'A06B', false)
elseif abilityId == 'A071' then
call SetPlayerAbilityAvailable(p, 'A071', false)
endif
endif
set p = Player(23)
endloop
endif
endfunction
function InitTrig_PreviewLegend takes nothing returns nothing
set gg_trg_PreviewLegend = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_PreviewLegend, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddAction(gg_trg_PreviewLegend, function Trig_PreviewLegend)
endfunction
function InitTrig_ArthasFrostmourne takes nothing returns nothing
set gg_trg_ArthasFrostmourne = CreateTrigger( )
call DisableTrigger( gg_trg_ArthasFrostmourne )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ArthasFrostmourne, EVENT_PLAYER_HERO_SKILL )
if (GetLearnedSkill() == 'A02R') then
call SetPlayerTechResearched( GetOwningPlayer(GetLearningUnit()), 'R00S', GetUnitAbilityLevel(GetLearningUnit(), 'A02R'))
endif
endfunction
globals
framehandle Icon01 = null
framehandle Icon02 = null
framehandle Icon03 = null
integer currentIconIndex = 0
endglobals
library REFORGEDUIMAKER initializer init
private function CreateIcons takes nothing returns nothing
set Icon01 = BlzCreateFrameByType("BACKDROP", "Icon01", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(Icon01, 0.03, 0.03)
call BlzFrameSetVisible(Icon01, false)
set Icon02 = BlzCreateFrameByType("BACKDROP", "Icon02", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(Icon02, 0.03, 0.03)
call BlzFrameSetVisible(Icon02, false)
set Icon03 = BlzCreateFrameByType("BACKDROP", "Icon03", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(Icon03, 0.03, 0.03)
call BlzFrameSetVisible(Icon03, false)
endfunction
function ShowIconForPlayer takes player p, string iconCode returns nothing
local framehandle icon
local real xPos = 0.0
local real yPos = 0.0
local string texturePath
if currentIconIndex == 0 then
set icon = Icon01
elseif currentIconIndex == 1 then
set icon = Icon02
elseif currentIconIndex == 2 then
set icon = Icon03
else
return
endif
if iconCode == "frost" then
set texturePath = "Legends\\Arthas\\Mechanics\\Frost"
elseif iconCode == "blood" then
set texturePath = "Legends\\Arthas\\Mechanics\\Blood"
elseif iconCode == "unholy" then
set texturePath = "Legends\\Arthas\\Mechanics\\Unholy"
endif
call BlzFrameSetTexture(icon, texturePath, 0, true)
if GetLocalPlayer() == p then
if currentIconIndex == 0 then
set xPos = 0.355000
set yPos = 0.145000
elseif currentIconIndex == 1 then
set xPos = 0.385000
set yPos = 0.145000
elseif currentIconIndex == 2 then
set xPos = 0.415000
set yPos = 0.145000
endif
call BlzFrameSetAbsPoint(icon, FRAMEPOINT_TOPLEFT, xPos, yPos)
call BlzFrameSetAbsPoint(icon, FRAMEPOINT_BOTTOMRIGHT, xPos + 0.03, yPos - 0.03) // Размер области иконки
call BlzFrameSetVisible(icon, true)
endif
set currentIconIndex = currentIconIndex + 1
endfunction
private function init takes nothing returns nothing
call CreateIcons()
endfunction
endlibrary
function Trig_ArthasSoulReforge_CheckUnitType takes nothing returns integer
local integer unitType = GetUnitTypeId(GetSpellTargetUnit())
local integer array unitTypes
local integer i = 0
set unitTypes[0] = 'u010' // Ghoul
set unitTypes[1] = 'u011' // Crypt
set unitTypes[2] = 'u014' // Abomination
set unitTypes[3] = 'u015' // Wagon
set unitTypes[4] = 'u012' // Garg
set unitTypes[5] = 'u016' // Wyrm
loop
exitwhen i >= 6
if unitType == unitTypes[i] then
return i
endif
set i = i + 1
endloop
return -1
endfunction
function Trig_ArthasSoulReforge_Actions takes nothing returns nothing
local integer index
local string effectUnit
local integer array unitReplacements
if GetSpellAbilityId() == 'A01Y' then
// Unholy
set effectUnit = "Abilities\\Spells\\Items\\RitualDagger\\RitualDaggerTarget.mdl"
set unitReplacements[0] = 'u01H' // Ghoul
set unitReplacements[1] = 'u01K' // Crypt
set unitReplacements[2] = 'u01Q' // Abomination
set unitReplacements[3] = 'u01T' // Wagon
set unitReplacements[4] = 'u01N' // Garg
set unitReplacements[5] = 'u01W' // Wyrm
elseif GetSpellAbilityId() == 'A01W' then
// Blood
set effectUnit = "Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl"
set unitReplacements[0] = 'u00Y' // Ghoul
set unitReplacements[1] = 'u01I' // Crypt
set unitReplacements[2] = 'u01O' // Abomination
set unitReplacements[3] = 'u01R' // Wagon
set unitReplacements[4] = 'u01L' // Garg
set unitReplacements[5] = 'u01U' // Wyrm
elseif GetSpellAbilityId() == 'A01X' then
// Frost
set effectUnit = "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl"
set unitReplacements[0] = 'u01F' // Ghoul
set unitReplacements[1] = 'u01J' // Crypt
set unitReplacements[2] = 'u01P' // Abomination
set unitReplacements[3] = 'u01S' // Wagon
set unitReplacements[4] = 'u01M' // Garg
set unitReplacements[5] = 'u01V' // Wyrm
else
return
endif
set index = Trig_ArthasSoulReforge_CheckUnitType()
if ( index != -1 and I2R(udg_ArthasSouls) >= I2R(GetUnitLevel(GetSpellTargetUnit())) * 10.00 ) then
call ReplaceUnitBJ( GetSpellTargetUnit(), unitReplacements[index], bj_UNIT_STATE_METHOD_RELATIVE )
call AddSpecialEffectLoc( effectUnit, GetUnitLoc(bj_lastReplacedUnit) )
set udg_ArthasSouls = udg_ArthasSouls - ( GetUnitLevel(GetSpellTargetUnit()) * 10 )
call UpdateArthasText(GetOwningPlayer(GetSpellAbilityUnit()), I2S(udg_ArthasSouls))
else
call DisplayTextToPlayer(GetOwningPlayer(GetSpellAbilityUnit()), 0, 0, "TRIGSTR_2372")
endif
endfunction
function InitTrig_ArthasSoulReforge takes nothing returns nothing
set gg_trg_ArthasSoulReforge = CreateTrigger()
call DisableTrigger (gg_trg_ArthasSoulReforge)
call TriggerRegisterAnyUnitEventBJ( gg_trg_ArthasSoulReforge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_ArthasSoulReforge, function Trig_ArthasSoulReforge_Actions )
endfunction
function Trig_ArthasSurfeit_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A02J')
endfunction
function Trig_ArthasSurfeit_Actions takes nothing returns nothing
local integer AbominationSize = 0
local unit caster = GetSpellAbilityUnit()
local integer level = GetUnitAbilityLevelSwapped('A02L', caster)
if (level < 6) then
call SetUnitAbilityLevelSwapped('A02L', caster, level + 1)
call BlzSetUnitMaxHP(caster, BlzGetUnitMaxHP(caster) + 100)
set AbominationSize = 100 + (level + 1) * 7
call SetUnitScalePercent(caster, I2R(AbominationSize), I2R(AbominationSize), I2R(AbominationSize))
endif
endfunction
function InitTrig_ArthasSurfeit takes nothing returns nothing
set gg_trg_ArthasSurfeit = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ArthasSurfeit, EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(gg_trg_ArthasSurfeit, Condition(function Trig_ArthasSurfeit_Conditions))
call TriggerAddAction(gg_trg_ArthasSurfeit, function Trig_ArthasSurfeit_Actions)
endfunction
function Trig_UtherChurchDonations_Func001A takes nothing returns nothing
local player p = GetEnumPlayer()
local integer allyCount = 0
local integer i = 0
local integer goldAmount
local integer unitCount = CountUnitsInGroup(GetUnitsOfPlayerAndTypeId(p, 'h02F'))
local player ally
loop
set ally = Player(i)
if (IsPlayerAlly(ally, p) and GetPlayerSlotState(ally) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(ally) == MAP_CONTROL_USER) then
set allyCount = allyCount + 1
endif
set i = i + 1
if (i >= bj_MAX_PLAYERS) then
exitwhen true
endif
endloop
if (GetPlayerTechCountSimple('R010', p) == 1 and allyCount > 0) then
set goldAmount = unitCount * (10 / allyCount)
call AdjustPlayerStateBJ(goldAmount, p, PLAYER_STATE_RESOURCE_GOLD)
endif
set p = null
set ally = null
endfunction
function Trig_UtherChurchDonations_Actions takes nothing returns nothing
call ForForce(GetPlayersAll(), function Trig_UtherChurchDonations_Func001A)
endfunction
//===========================================================================
function Trig_UtherChurchDonations_Condition takes nothing returns boolean
local real currentTime = GetTimeOfDay()
return (currentTime > 6.00 and currentTime < 18.00)
endfunction
function InitTrig_UtherChurchDonations takes nothing returns nothing
local real dayTimer = 45.00 // timer income
set gg_trg_UtherChurchDonations = CreateTrigger()
call DisableTrigger(gg_trg_UtherChurchDonations)
call TriggerRegisterTimerEventPeriodic(gg_trg_UtherChurchDonations, dayTimer)
call TriggerAddCondition(gg_trg_UtherChurchDonations, Condition(function Trig_UtherChurchDonations_Condition))
call TriggerAddAction(gg_trg_UtherChurchDonations, function Trig_UtherChurchDonations_Actions)
endfunction
function Trig_WrynnUpgradeVeterans_Actions takes nothing returns nothing
local integer getSpell = GetSpellAbilityId()
local unit unitSpell = GetSpellAbilityUnit()
local integer array setAbil
local integer array setTrained1
local integer array setTrained2
local integer i = 0
// footman
set setAbil[0] = 'A03Z'
set setAbil[1] = 'A045'
set setTrained1[0] = 'A03Y'
set setTrained1[1] = 'A040'
// rifleman
set setAbil[2] = 'A041'
set setAbil[3] = 'A044'
set setTrained1[2] = 'A043'
set setTrained1[3] = 'A042'
// cavalry
set setAbil[4] = 'A049'
set setAbil[5] = 'A048'
set setTrained1[4] = 'A047'
set setTrained1[5] = 'A046'
// skyfire gunship
set setAbil[6] = 'A04C'
set setAbil[7] = 'A04D'
set setTrained1[6] = 'A04F'
set setTrained1[7] = 'A04E'
// fly machine
set setAbil[8] = 'A04J'
set setAbil[9] = 'A04H'
set setTrained1[8] = 'A04G'
set setTrained1[9] = 'A04I'
// priest
set setAbil[10] = 'A04O'
set setAbil[11] = 'A04P'
set setTrained1[10] = 'A04M'
set setTrained1[11] = 'A04N'
// sorceress
set setAbil[12] = 'A04Q'
set setAbil[13] = 'A04U'
set setTrained1[12] = 'A04R'
set setTrained1[13] = 'A04V'
// mortar team
set setAbil[14] = 'A04Y'
set setAbil[15] = 'A04W'
set setTrained1[14] = 'S002'
set setTrained1[15] = 'S003'
loop
exitwhen i > 15
if getSpell == setAbil[i] then
// exceptions
if (i == 6) then
call UnitRemoveAbility(unitSpell, 'Achd')
elseif (i == 7) then
call UnitAddAbility(unitSpell, 'A03X')
elseif (i == 11) then
call UnitRemoveAbility(unitSpell, 'A04K')
call UnitAddAbility(unitSpell, 'A04L')
elseif (i == 12) then
call UnitRemoveAbility(unitSpell, 'A03R')
call UnitAddAbility(unitSpell, 'A03O')
elseif (i == 13) then
call UnitRemoveAbility(unitSpell, 'A03Q')
call UnitRemoveAbility(unitSpell, 'A03P')
call UnitAddAbility(unitSpell, 'A04T')
call UnitAddAbility(unitSpell, 'A04S')
endif
call UnitAddAbility(unitSpell, setTrained1[i])
call UnitRemoveAbility(unitSpell, 'A056')
call UnitRemoveAbility(unitSpell, setAbil[i])
call UnitRemoveAbility(unitSpell, setAbil[i+1])
call UnitRemoveAbility(unitSpell, setAbil[i-1])
endif
set i = i + 1
endloop
set unitSpell = null
endfunction
function InitTrig_WrynnUpgradeVeterans takes nothing returns nothing
set gg_trg_WrynnUpgradeVeterans = CreateTrigger( )
call DisableTrigger( gg_trg_WrynnUpgradeVeterans )
call TriggerRegisterAnyUnitEventBJ( gg_trg_WrynnUpgradeVeterans, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddAction( gg_trg_WrynnUpgradeVeterans, function Trig_WrynnUpgradeVeterans_Actions )
endfunction
globals
hashtable udg_HashTable = InitHashtable()
endglobals
function Trig_WhitemaneBowman_Conditions takes nothing returns boolean
local unit attacker = GetEventDamageSource()
local unit target = GetTriggerUnit()
return IsUnitType(target, UNIT_TYPE_STRUCTURE) == false and GetUnitTypeId(attacker) == 'o00X' and IsUnitEnemy(target, GetOwningPlayer(attacker)) and GetPlayerTechCount(GetOwningPlayer(attacker), 'R032', true) > 0
endfunction
function MoveTarget takes nothing returns nothing
local integer max_attempts = 10
local real move_distance = 1.5
local timer t = GetExpiredTimer()
local unit target = LoadUnitHandle(udg_HashTable, GetHandleId(t), 0)
local real angle = LoadReal(udg_HashTable, GetHandleId(t), 1)
local integer attempts = LoadInteger(udg_HashTable, GetHandleId(t), 2)
local real x = GetUnitX(target) - move_distance * Cos(angle * bj_DEGTORAD)
local real y = GetUnitY(target) - move_distance * Sin(angle * bj_DEGTORAD)
if attempts < max_attempts and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) then
call SetUnitX(target, x)
call SetUnitY(target, y)
call SaveInteger(udg_HashTable, GetHandleId(t), 2, attempts + 1)
call TimerStart(t, 0.03, false, function MoveTarget)
else
call FlushChildHashtable(udg_HashTable, GetHandleId(t))
call DestroyTimer(t)
endif
endfunction
function Trig_WhitemaneBowman_Actions takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local real angle = GetUnitFacing(attacker) + 180
local timer t = CreateTimer()
local integer timerId = GetHandleId(t)
call SaveUnitHandle(udg_HashTable, timerId, 0, target)
call SaveReal(udg_HashTable, timerId, 1, angle)
call SaveInteger(udg_HashTable, timerId, 2, 0)
call TimerStart(t, 0.01, false, function MoveTarget)
endfunction
function InitTrig_WhitemaneBowman takes nothing returns nothing
set gg_trg_WhitemaneBowman = CreateTrigger()
call DisableTrigger(gg_trg_WhitemaneBowman)
call TriggerRegisterAnyUnitEventBJ(gg_trg_WhitemaneBowman, EVENT_PLAYER_UNIT_DAMAGED)
call TriggerAddCondition(gg_trg_WhitemaneBowman, Condition(function Trig_WhitemaneBowman_Conditions))
call TriggerAddAction(gg_trg_WhitemaneBowman, function Trig_WhitemaneBowman_Actions)
endfunction
function MythicAddRandom takes nothing returns nothing
local trigger array mutationTriggers
local integer availableMutations = 7
local integer mutationCount
local integer chosenMutation
set mutationTriggers[1] = gg_trg_Mythic1Boots
set mutationTriggers[2] = gg_trg_Mythic2Vampiric
set mutationTriggers[3] = gg_trg_Mythic3Tiranic
set mutationTriggers[4] = gg_trg_Mythic4Fortified
set mutationTriggers[5] = gg_trg_Mythic5Thorns
set mutationTriggers[6] = gg_trg_Mythic6Brilliance
set mutationTriggers[7] = gg_trg_Mythic7Shadow
if (udg_SetDifficulty == 4) then
set mutationCount = 1
elseif (udg_SetDifficulty == 5) then
set mutationCount = 2
elseif (udg_SetDifficulty == 6) then
set mutationCount = 3
elseif (udg_SetDifficulty == 7) then
set mutationCount = 4
else
set mutationCount = 0
endif
loop
exitwhen mutationCount == 0
set chosenMutation = GetRandomInt(1, availableMutations)
call TriggerExecute(mutationTriggers[chosenMutation])
set mutationTriggers[chosenMutation] = mutationTriggers[availableMutations]
set availableMutations = availableMutations - 1
set mutationCount = mutationCount - 1
endloop
endfunction
//===========================================================================
function InitTrig_MythicAddRandom takes nothing returns nothing
set gg_trg_MythicAddRandom = CreateTrigger()
call TriggerAddAction(gg_trg_MythicAddRandom, function MythicAddRandom)
endfunction
function Trig_Mythic1Boots_Func002A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'u004', GetEnumPlayer(), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07S', GetLastCreatedUnit() )
endfunction
function Trig_Mythic1Boots_Actions takes nothing returns nothing
call FrameMythic("UI\\Mythic\\BootsofSpeed.blp", "Boots of Speed", "Increased enemy movement speed +50%")
call ForForce( GetPlayersAllies(udg_MythicEnemy), function Trig_Mythic1Boots_Func002A )
endfunction
//===========================================================================
function InitTrig_Mythic1Boots takes nothing returns nothing
set gg_trg_Mythic1Boots = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic1Boots )
call TriggerAddAction( gg_trg_Mythic1Boots, function Trig_Mythic1Boots_Actions )
endfunction
function Trig_Mythic2Vampiric_Func001A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'u004', GetEnumPlayer(), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07T', GetLastCreatedUnit() )
endfunction
function Trig_Mythic2Vampiric_Actions takes nothing returns nothing
call FrameMythic("UI\\Mythic\\VampiricAura.blp", "Vampiric Aura", "Attack converts 50% of damage into health")
call ForForce( GetPlayersAllies(udg_MythicEnemy), function Trig_Mythic2Vampiric_Func001A )
endfunction
//===========================================================================
function InitTrig_Mythic2Vampiric takes nothing returns nothing
set gg_trg_Mythic2Vampiric = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic2Vampiric )
call TriggerAddAction( gg_trg_Mythic2Vampiric, function Trig_Mythic2Vampiric_Actions )
endfunction
function Trig_Mythic3Tiranic_Func001A takes nothing returns nothing
call SetPlayerHandicapBJ( GetEnumPlayer(), 120.00 )
endfunction
function Trig_Mythic3Tiranic_Actions takes nothing returns nothing
call FrameMythic("UI\\Mythic\\Tyrannical.blp", "Tyrannical", "Additional enemy health +20%")
call ForForce( GetPlayersAllies(udg_MythicEnemy), function Trig_Mythic3Tiranic_Func001A )
endfunction
//===========================================================================
function InitTrig_Mythic3Tiranic takes nothing returns nothing
set gg_trg_Mythic3Tiranic = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic3Tiranic )
call TriggerAddAction( gg_trg_Mythic3Tiranic, function Trig_Mythic3Tiranic_Actions )
endfunction
function Trig_Mythic4Fortified_Func001A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'u004', GetEnumPlayer(), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07U', GetLastCreatedUnit() )
endfunction
function Trig_Mythic4Fortified_Actions takes nothing returns nothing
call FrameMythic("UI\\Mythic\\Fortified.blp", "Fortified", "Additional enemy protection +5")
call ForForce( GetPlayersAllies(udg_MythicEnemy), function Trig_Mythic4Fortified_Func001A )
endfunction
//===========================================================================
function InitTrig_Mythic4Fortified takes nothing returns nothing
set gg_trg_Mythic4Fortified = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic4Fortified )
call TriggerAddAction( gg_trg_Mythic4Fortified, function Trig_Mythic4Fortified_Actions )
endfunction
function Trig_Mythic5Thorns_Func001A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'u004', GetEnumPlayer(), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07V', GetLastCreatedUnit() )
endfunction
function Trig_Mythic5Thorns_Actions takes nothing returns nothing
call FrameMythic("UI\\Mythic\\Thorns.blp", "Thorns", "Aura returns 30% of damage to attackers")
call ForForce( GetPlayersAllies(udg_MythicEnemy), function Trig_Mythic5Thorns_Func001A )
endfunction
//===========================================================================
function InitTrig_Mythic5Thorns takes nothing returns nothing
set gg_trg_Mythic5Thorns = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic5Thorns )
call TriggerAddAction( gg_trg_Mythic5Thorns, function Trig_Mythic5Thorns_Actions )
endfunction
function Trig_Mythic6Brilliance_Func001A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'u004', GetEnumPlayer(), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07W', GetLastCreatedUnit() )
endfunction
function Trig_Mythic6Brilliance_Actions takes nothing returns nothing
call FrameMythic("UI\\Mythic\\Brilliance.blp", "Brilliance", "Enemy mana regeneration aura 200%")
call ForForce( GetPlayersAllies(udg_MythicEnemy), function Trig_Mythic6Brilliance_Func001A )
endfunction
//===========================================================================
function InitTrig_Mythic6Brilliance takes nothing returns nothing
set gg_trg_Mythic6Brilliance = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic6Brilliance )
call TriggerAddAction( gg_trg_Mythic6Brilliance, function Trig_Mythic6Brilliance_Actions )
endfunction
function Trig_Mythic7Shadow_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_Mythic7ShadowAdd )
call FrameMythic("UI\\Mythic\\CloakofShadows.blp", "Cloak of Shadows", "Enemies receive constant invisibility")
endfunction
//===========================================================================
function InitTrig_Mythic7Shadow takes nothing returns nothing
set gg_trg_Mythic7Shadow = CreateTrigger( )
call DisableTrigger( gg_trg_Mythic7Shadow )
call TriggerAddAction( gg_trg_Mythic7Shadow, function Trig_Mythic7Shadow_Actions )
endfunction
function Trig_SetDifficultyGame_Actions takes nothing returns nothing
local string array nameMode
set nameMode[1] = "Easy"
set nameMode[2] = "Normal"
set nameMode[3] = "Hard"
set nameMode[4] = "|cFF00C850Mythic+|R"
set nameMode[5] = "|cFF007AE6Mythic+2|R"
set nameMode[6] = "|cFF9364FFMythic+3|R"
set nameMode[7] = "|cFFFFA200Mythic+4|R"
// Set the initial value to impossible (for comparison)
set udg_SetDifficulty = 999
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 24
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if (udg_SetPlayerDifficulty[bj_forLoopAIndex] > 0) then
if (udg_SetPlayerDifficulty[bj_forLoopAIndex] < udg_SetDifficulty) then
set udg_SetDifficulty = udg_SetPlayerDifficulty[bj_forLoopAIndex]
set udg_GAME_DIFFICULTY = udg_SetPlayerDifficulty[bj_forLoopAIndex]
endif
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if (udg_SetDifficulty == 999) then
set udg_SetDifficulty = 1
set udg_GAME_DIFFICULTY = 1
endif
call DisplayTextToForce( bj_FORCE_ALL_PLAYERS, ( "Difficulty level selected: " + nameMode[udg_SetDifficulty] + "!" ) )
// mythic mode execute
call TriggerExecute( gg_trg_MythicAddRandom )
// IniUnitsBuilding
call TriggerExecute( gg_trg_AddUnitBuildingHero )
call TriggerExecute( gg_trg_SetUpgradeList )
endfunction
//===========================================================================
function InitTrig_SetDifficultyGame takes nothing returns nothing
set gg_trg_SetDifficultyGame = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_SetDifficultyGame, 40.00, false )
call TriggerAddAction( gg_trg_SetDifficultyGame, function Trig_SetDifficultyGame_Actions )
endfunction
function Trig_WinFireworks_Func takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_WinFireworks_CreateUnit takes nothing returns nothing
local unit newUnit
local location loc
local integer randomIndex
local integer array randomUnit
set randomUnit[0] = 'u000'
set randomUnit[1] = 'u007'
set randomUnit[2] = 'u008'
set randomUnit[3] = 'u00D'
set randomIndex = R2I(GetRandomReal(0.0, 3.9))
set loc = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), GetRandomReal(50.00, 250.00), GetRandomReal(0, 360))
set newUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), randomUnit[randomIndex], GetLocationX(loc), GetLocationY(loc), bj_UNIT_FACING)
call UnitApplyTimedLife(newUnit, 'BTLF', 1.00)
call RemoveLocation(loc)
endfunction
function Trig_WinFireworks_Timer takes nothing returns nothing
local group heroGroup = GetUnitsInRectMatching(bj_mapInitialPlayableArea, Condition(function Trig_WinFireworks_Func))
call ForGroup(heroGroup, function Trig_WinFireworks_CreateUnit)
call DestroyGroup(heroGroup)
endfunction
function Trig_WinFireworks_Actions takes nothing returns nothing
local timer t
local integer unitCount
local real delay
local integer i
set unitCount = 5 + (udg_SetDifficulty * 3)
set i = 0
loop
exitwhen i >= unitCount
set t = CreateTimer()
call TimerStart(t, GetRandomReal(0.1, 2.5), false, function Trig_WinFireworks_Timer)
set i = i + 1
endloop
endfunction
function InitTrig_WinFireworks takes nothing returns nothing
set gg_trg_WinFireworks = CreateTrigger()
call TriggerAddAction(gg_trg_WinFireworks, function Trig_WinFireworks_Actions)
endfunction
function Trig_AlteracInitialization_Actions takes nothing returns nothing
// Ini
call TriggerExecute( gg_trg_AlliesEnemyAndNeutral )
// NPC
call TriggerExecute( gg_trg_NPCInitialization )
call EnableTrigger( gg_trg_NPCGreetings )
call EnableTrigger( gg_trg_NPCMissCaravan )
call EnableTrigger( gg_trg_NPCNextWave )
call EnableTrigger( gg_trg_NPCEnemyWave )
call EnableTrigger( gg_trg_NPCLastWave )
call EnableTrigger( gg_trg_NPCCompleteWave )
call EnableTrigger( gg_trg_NPCWin )
call EnableTrigger( gg_trg_NPCDefeat )
// Way
call EnableTrigger( gg_trg_SetWayPoint )
call EnableTrigger( gg_trg_Way1Ping )
call EnableTrigger( gg_trg_Way2Ping )
call TriggerExecute( gg_trg_IniZone )
call EnableTrigger( gg_trg_AlternateMovement )
call EnableTrigger( gg_trg_UnitGroupDead )
// Quest Start
call EnableTrigger( gg_trg_MainQuest )
// Quest Win
call EnableTrigger( gg_trg_Wave1Complete )
// LastWaveComplete start in WaveComplete
// Quest Defeat
call EnableTrigger( gg_trg_DefeatCondition )
// UnitGroup Initialization
call TriggerExecute( gg_trg_SetGroupArray )
// Wave Army Set
// Way
call EnableTrigger( gg_trg_UnitsInitializationWay1 )
call EnableTrigger( gg_trg_UnitsInitializationWay2 )
call EnableTrigger( gg_trg_UnitsInitializationWay3 )
call EnableTrigger( gg_trg_DebugUnitsIniWay3 )
call EnableTrigger( gg_trg_DebugUnitsIniWay3 )
call EnableTrigger( gg_trg_GroupArrayReset )
// CreateSquad
call EnableTrigger( gg_trg_CreateSpecUnitWave )
call EnableTrigger( gg_trg_CreateSquadWave1n1 )
call EnableTrigger( gg_trg_CreateSquadWave1n2 )
call EnableTrigger( gg_trg_CreateSquadWave2n1 )
call EnableTrigger( gg_trg_CreateSquadWave2n2 )
call EnableTrigger( gg_trg_CreateSquadWave3n1 )
call EnableTrigger( gg_trg_CreateSquadWave3n2 )
call EnableTrigger( gg_trg_CreateSquadWave4n1 )
call EnableTrigger( gg_trg_CreateSquadWave4n2 )
call EnableTrigger( gg_trg_CreateSquadWave5n1 )
call EnableTrigger( gg_trg_CreateSquadWave5n2 )
call EnableTrigger( gg_trg_CreateHero )
call EnableTrigger( gg_trg_CreateSquadEnemy1 )
call EnableTrigger( gg_trg_CreateSquadEnemy2 )
call EnableTrigger( gg_trg_CreateSquadEnemy3 )
call EnableTrigger( gg_trg_CreateSquadEnemy4 )
call EnableTrigger( gg_trg_DeadEnemyHero )
// MainQuest Wave
call TriggerExecute( gg_trg_WaveTimer )
call EnableTrigger( gg_trg_Wave1 )
call EnableTrigger( gg_trg_Wave2 )
call EnableTrigger( gg_trg_Wave3 )
call EnableTrigger( gg_trg_Wave4 )
call EnableTrigger( gg_trg_Wave5 )
// Enemy Wave
call TriggerExecute( gg_trg_EnemyTimer )
call EnableTrigger( gg_trg_EnemyRandomSpawn )
call EnableTrigger( gg_trg_EnemyWave1 )
call EnableTrigger( gg_trg_EnemyWave2 )
call EnableTrigger( gg_trg_EnemyWave3 )
call EnableTrigger( gg_trg_EnemyWave4 )
call EnableTrigger( gg_trg_EnemyHero )
call EnableTrigger( gg_trg_EnemyHeroAddItem )
endfunction
//===========================================================================
function InitTrig_AlteracInitialization takes nothing returns nothing
set gg_trg_AlteracInitialization = CreateTrigger( )
if ( udg_Map == "alterac" ) then
call TriggerAddAction( gg_trg_AlteracInitialization, function Trig_AlteracInitialization_Actions )
endif
endfunction
function Trig_NPCInitialization_Actions takes nothing returns nothing
call SetPlayerAlliance(Player(0), Player(2), ALLIANCE_SHARED_CONTROL, true)
call SetPlayerAlliance(Player(1), Player(2), ALLIANCE_SHARED_CONTROL, true)
call SetPlayerAlliance(Player(2), Player(0), ALLIANCE_SHARED_CONTROL, true)
call SetPlayerAlliance(Player(2), Player(0), ALLIANCE_SHARED_CONTROL, true)
endfunction
//===========================================================================
function InitTrig_NPCInitialization takes nothing returns nothing
set gg_trg_NPCInitialization = CreateTrigger( )
call DisableTrigger( gg_trg_NPCInitialization )
endfunction
function Trig_NPCGreetings_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 15.00
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "Welcome, my fellow legends! I am Stonebeard, and it seems we have a common enemy to face. Are you ready to take down the Syndicate and bring justice to the region?"
set NPCTextOptions[2] = "Ah, a legends! You don't look like the usual riff-raff that passes through here. I'm Stonebeard, and I've got a job that requires your skills. Care to lend me a hand against the Syndicate?"
set NPCTextOptions[3] = "By the hammers of Khaz Modan, it's good to see you all! I'm Stonebeard, and I'm on a mission to take down the Syndicate. Will you join me in battle?"
set NPCTextOptions[4] = "Greetings, legends! I'm Stonebeard, and it seems fate has brought us together. The Syndicate has been causing havoc in these parts for too long. Let's show them the might of our guns... or blades... or magic!"
set NPCTextOptions[5] = "By the forge of Ironforge, it's an honor to meet you! I'm Stonebeard, and I'm in dire need of legends to help me take down the Syndicate. Will you fight by my side?"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCGreetings takes nothing returns nothing
set gg_trg_NPCGreetings = CreateTrigger()
call DisableTrigger( gg_trg_NPCGreetings )
call TriggerAddAction(gg_trg_NPCGreetings, function Trig_NPCGreetings_Actions)
endfunction
function Trig_NPCMissCaravan_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 10.00
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "Don't worry, my friends, we'll catch up to them. It's a game of cat and mouse, and I intend to be the cat!"
set NPCTextOptions[2] = "Well, we may have missed that one, but we'll catch the next one. The Syndicate won't know what hit them!"
set NPCTextOptions[3] = "We missed one, but that's just a minor setback. We'll find another way to disrupt their supplies and bring them to their knees!"
set NPCTextOptions[4] = "Looks like we let one slip by us, but we'll make up for it. We'll hit them harder next time and show them that they can't outrun us!"
set NPCTextOptions[5] = "Aye, we may have missed that one, but the battle is far from over. We'll keep at it until the Syndicate is defeated, mark my words!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCMissCaravan takes nothing returns nothing
set gg_trg_NPCMissCaravan = CreateTrigger( )
call DisableTrigger( gg_trg_NPCMissCaravan )
call TriggerAddAction( gg_trg_NPCMissCaravan, function Trig_NPCMissCaravan_Actions )
endfunction
function Trig_NPCNextWave_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 7.50
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "Looks like the Syndicate is on the move. We need to act fast if we're going to catch them!"
set NPCTextOptions[2] = "The caravans are moving. We move forward. My rifle is at your service."
set NPCTextOptions[3] = "The Syndicate is moving their contraband, but we're not going to let them get away with it. It's time to take the fight to them!"
set NPCTextOptions[4] = "Those caravans won't stay on the move forever. We need to intercept them before they can reach their destination. Are you with me, legends?"
set NPCTextOptions[5] = "The caravans have left their bases, but we're not going to let them get far. We'll track them down and make sure the Syndicate regrets ever crossing us!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCNextWave takes nothing returns nothing
set gg_trg_NPCNextWave = CreateTrigger( )
call DisableTrigger( gg_trg_NPCNextWave )
call TriggerAddAction( gg_trg_NPCNextWave, function Trig_NPCNextWave_Actions )
endfunction
function Trig_NPCEnemyWave_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 7.50
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "The Syndicate is on the attack! We need to defend our base and drive them back. Are you ready, legends?"
set NPCTextOptions[2] = "Looks like the Syndicate is feeling desperate. But that's no excuse for them to attack our base! Let's teach them a lesson they won't forget!"
set NPCTextOptions[3] = "The Syndicate is throwing everything they've got at us. But they're no match for our skill and determination. Let's show them what we're made of, heroes!"
set NPCTextOptions[4] = "Our base is under attack, but we're not going to back down. We'll fight tooth and nail to protect what's ours and drive the Syndicate back where they belong!"
set NPCTextOptions[5] = "They want a fight? They've got it! Defend our base and send the Syndicate running with their tails between their legs!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCEnemyWave takes nothing returns nothing
set gg_trg_NPCEnemyWave = CreateTrigger( )
call DisableTrigger( gg_trg_NPCEnemyWave )
call TriggerAddAction( gg_trg_NPCEnemyWave, function Trig_NPCEnemyWave_Actions )
endfunction
function Trig_NPCLastWave_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 7.50
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "This is it, legends! The final wave. Let's give it everything we've got and show the Syndicate that we're not to be trifled with!"
set NPCTextOptions[2] = "We've made it to the last wave. This is where the real test begins. Keep your wits about you, friends, and let's finish this once and for all!"
set NPCTextOptions[3] = "This is what we've been waiting for, heroes. The final showdown. Let's make sure that the Syndicate knows they messed with the wrong crew!"
set NPCTextOptions[4] = "It's all come down to this, friends. The last wave. But we've come too far to back down now. Let's show the Syndicate what true courage and determination looks like!"
set NPCTextOptions[5] = "This is the moment we've been training for, friends. The last wave is here, and we're going to face it head-on. Let's do this!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCLastWave takes nothing returns nothing
set gg_trg_NPCLastWave = CreateTrigger( )
call DisableTrigger( gg_trg_NPCLastWave )
call TriggerAddAction( gg_trg_NPCLastWave, function Trig_NPCLastWave_Actions )
endfunction
function Trig_NPCCompleteWave_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 10.00
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "Well done, legends! But don't let your guard down just yet. There's still more work to be done!"
set NPCTextOptions[2] = "That was a good strike, but we need to keep the pressure on. The Syndicate won't give up that easily!"
set NPCTextOptions[3] = "We may have taken out one caravan, but there are more on the way. We need to stay alert and keep disrupting their supplies!"
set NPCTextOptions[4] = "That was just the beginning. We'll keep hitting them hard until they're running scared!"
set NPCTextOptions[5] = "Excellent work, friends! But we can't rest on our laurels. There's still more to be done to ensure that the Syndicate is brought to justice!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCCompleteWave takes nothing returns nothing
set gg_trg_NPCCompleteWave = CreateTrigger( )
call DisableTrigger( gg_trg_NPCCompleteWave )
call TriggerAddAction( gg_trg_NPCCompleteWave, function Trig_NPCCompleteWave_Actions )
endfunction
function Trig_NPCWin_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 10.00
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "Ha! That'll teach 'em not to mess with us."
set NPCTextOptions[2] = "We showed them what it means to be a true hero. Let's celebrate this victory!"
set NPCTextOptions[3] = "The Syndicate may have thought they had us, but they didn't count on our resilience."
set NPCTextOptions[4] = "It wasn't easy, but we did it. We defended our base, and we won."
set NPCTextOptions[5] = "The final victory against our enemies. Let's celebrate this moment, and remember it when we face future challenges!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCWin takes nothing returns nothing
set gg_trg_NPCWin = CreateTrigger( )
call DisableTrigger( gg_trg_NPCWin )
call TriggerAddAction( gg_trg_NPCWin, function Trig_NPCWin_Actions )
endfunction
function Trig_NPCDefeat_Actions takes nothing returns nothing
local real NPC_NumberRandom = GetRandomReal(0, 100.00)
local integer NPC_Index
local string array NPCTextOptions
local real NPC_TextDuration = 10.00
local string NPC_TextNice = "|cFF48BBFF"
local string NPC_Name = "Stonebeard"
local unit NPC_Unit = GroupPickRandomUnit(GetUnitsOfTypeIdAll('H004'))
set NPCTextOptions[1] = "I can't believe it. This is the final defeat. We fought with all our might, but the Syndicate was just too powerful."
set NPCTextOptions[2] = "I knew you *** legends had no honor, no respect, no beer!"
set NPCTextOptions[3] = "This is a dark day for all of us. The final defeat."
set NPCTextOptions[4] = "We've been defeated, but we're not broken. This final defeat will be a powerful motivator for us to come back even stronger."
set NPCTextOptions[5] = "This is a bitter pill to swallow. The final defeat. But we can't let it break our spirits. We'll come back with renewed determination, and show the Syndicate that we're not done yet!"
if NPC_NumberRandom <= 20.00 then
set NPC_Index = 1
elseif NPC_NumberRandom <= 40.00 then
set NPC_Index = 2
elseif NPC_NumberRandom <= 60.00 then
set NPC_Index = 3
elseif NPC_NumberRandom <= 80.00 then
set NPC_Index = 4
else
set NPC_Index = 5
endif
set NPC_TextNice = NPC_TextNice + NPCTextOptions[NPC_Index] + "|R"
call TransmissionFromUnitWithNameBJ(GetPlayersAll(), NPC_Unit, NPC_Name, null, NPC_TextNice, bj_TIMETYPE_ADD, NPC_TextDuration, true)
set NPC_Unit = null
endfunction
//===========================================================================
function InitTrig_NPCDefeat takes nothing returns nothing
set gg_trg_NPCDefeat = CreateTrigger( )
call DisableTrigger( gg_trg_NPCDefeat )
call TriggerAddAction( gg_trg_NPCDefeat, function Trig_NPCDefeat_Actions )
endfunction
function Trig_SetWayPoint_Actions takes nothing returns nothing
local integer regionSize = 1000
// Way1
set udg_Way1Count = 9
set udg_Way1[0] = RectFromCenterSizeBJ(Location(-6500.00, -9400.00), regionSize, regionSize)
set udg_Way1[1] = RectFromCenterSizeBJ(Location(-4200.00, -6700.00), regionSize, regionSize)
set udg_Way1[2] = RectFromCenterSizeBJ(Location(-2700.00, -7200.00), regionSize, regionSize)
set udg_Way1[3] = RectFromCenterSizeBJ(Location(320.00, -5100.00), regionSize, regionSize)
set udg_Way1[4] = RectFromCenterSizeBJ(Location(2600.00, -5900.00), regionSize, regionSize)
set udg_Way1[5] = RectFromCenterSizeBJ(Location(4100.00, -5100.00), regionSize, regionSize)
set udg_Way1[6] = RectFromCenterSizeBJ(Location(5100.00, -4300.00), regionSize, regionSize)
set udg_Way1[7] = RectFromCenterSizeBJ(Location(5600.00, -2600.00), regionSize, regionSize)
set udg_Way1[8] = RectFromCenterSizeBJ(Location(7100.00, -430.00), regionSize, regionSize)
set udg_Way1[9] = RectFromCenterSizeBJ(Location(9600.00, 1200.00), regionSize, regionSize)
// Way2
set udg_Way2Count = 8
set udg_Way2[0] = RectFromCenterSizeBJ(Location(-9300.00, -3800.00), regionSize, regionSize)
set udg_Way2[1] = RectFromCenterSizeBJ(Location(-7600.00, -2300.00), regionSize, regionSize)
set udg_Way2[2] = RectFromCenterSizeBJ(Location(-7600.00, 308.00), regionSize, regionSize)
set udg_Way2[3] = RectFromCenterSizeBJ(Location(-6200.00, 900.00), regionSize, regionSize)
set udg_Way2[4] = RectFromCenterSizeBJ(Location(-5800.00, 3300.00), regionSize, regionSize)
set udg_Way2[5] = RectFromCenterSizeBJ(Location(-2900.00, 3600.00), regionSize, regionSize)
set udg_Way2[6] = RectFromCenterSizeBJ(Location(800.00, 5000.00), regionSize, regionSize)
set udg_Way2[7] = RectFromCenterSizeBJ(Location(4800.00, 5800.00), regionSize, regionSize)
set udg_Way2[8] = RectFromCenterSizeBJ(Location(7600.00, 9300.00), regionSize, regionSize)
endfunction
//===========================================================================
function InitTrig_SetWayPoint takes nothing returns nothing
set gg_trg_SetWayPoint = CreateTrigger( )
call DisableTrigger( gg_trg_SetWayPoint )
call TriggerRegisterTimerEvent( gg_trg_SetWayPoint, 0.01, false )
call TriggerAddAction( gg_trg_SetWayPoint, function Trig_SetWayPoint_Actions )
endfunction
function Trig_DefeatCondition_Func001A takes nothing returns nothing
local unit enterUnit = GetEnumUnit()
if ( RectContainsUnit(udg_Way1[udg_Way1Count], enterUnit) == true or RectContainsUnit(udg_Way2[udg_Way2Count], enterUnit) == true ) then
if ( GetUnitTypeId(enterUnit) == 'h002' and udg_CurrentCountDefeat < udg_MaxCountDefeat ) then
call DisplayTextToForce( GetPlayersAll(), ( "Missed " + ( I2S(udg_CurrentCountDefeat) + ( "/" + ( I2S(udg_MaxCountDefeat) + " caravan!" ) ) ) ) )
call TriggerExecute( gg_trg_NPCMissCaravan )
endif
call KillUnit ( enterUnit )
call RemoveUnit( enterUnit )
if ( udg_CurrentCountDefeat >= udg_MaxCountDefeat ) then
call DisableTrigger( GetTriggeringTrigger() )
call TriggerExecute( gg_trg_Defeat )
call TriggerExecute( gg_trg_NPCDefeat )
call DisableTrigger( gg_trg_NPCMissCaravan )
call DisableTrigger( gg_trg_Wave1Complete )
endif
endif
set enterUnit = null
endfunction
function Trig_DefeatCondition_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfPlayerAll(Player(4)), function Trig_DefeatCondition_Func001A )
endfunction
//===========================================================================
function InitTrig_DefeatCondition takes nothing returns nothing
set gg_trg_DefeatCondition = CreateTrigger( )
call DisableTrigger( gg_trg_DefeatCondition )
call TriggerRegisterTimerEvent(gg_trg_DefeatCondition, 1.00, true)
call TriggerAddAction( gg_trg_DefeatCondition, function Trig_DefeatCondition_Actions )
endfunction
function Trig_SetGroupArray_Actions takes nothing returns nothing
set udg_UnitGroupArray1[1] = udg_UnitGroup11
set udg_UnitGroupArray1[2] = udg_UnitGroup12
set udg_UnitGroupArray1[3] = udg_UnitGroup13
set udg_UnitGroupArray1[4] = udg_UnitGroup14
set udg_UnitGroupArray1[5] = udg_UnitGroup15
set udg_UnitGroupArray2[1] = udg_UnitGroup21
set udg_UnitGroupArray2[2] = udg_UnitGroup22
set udg_UnitGroupArray2[3] = udg_UnitGroup23
set udg_UnitGroupArray2[4] = udg_UnitGroup24
set udg_UnitGroupArray2[5] = udg_UnitGroup25
set udg_UnitGroupArray3[1] = udg_UnitGroup31
endfunction
//===========================================================================
function InitTrig_SetGroupArray takes nothing returns nothing
set gg_trg_SetGroupArray = CreateTrigger( )
call DisableTrigger( gg_trg_SetGroupArray )
call TriggerAddAction( gg_trg_SetGroupArray, function Trig_SetGroupArray_Actions )
endfunction
function Trig_UnitsInitializationWay1_Func004A takes nothing returns nothing
if GetOwningPlayer(GetEnumUnit()) == udg_SetEnemy then
call GroupAddUnit(udg_UnitGroupArray1[udg_CountGroup1], GetEnumUnit())
endif
endfunction
function Trig_UnitsInitializationWay1_Actions takes nothing returns nothing
local group g = GetUnitsInRectOfPlayer(udg_SetZone, udg_SetEnemy)
//local location l = GetRectCenter(gg_rct_Way1_p1)
local integer i = udg_CountGroup1
// Initialize unit group and wait
call TriggerExecute(gg_trg_AddUnitBuildingHero)
call PolledWait(0.01)
// Add units to group and order attack
call ForGroupBJ(g, function Trig_UnitsInitializationWay1_Func004A)
// Cleanup
//call RemoveLocation(l)
call DestroyGroup(g)
endfunction
function InitTrig_UnitsInitializationWay1 takes nothing returns nothing
set gg_trg_UnitsInitializationWay1 = CreateTrigger()
call TriggerAddAction(gg_trg_UnitsInitializationWay1, function Trig_UnitsInitializationWay1_Actions)
endfunction
function Trig_UnitsInitializationWay2_Func004A takes nothing returns nothing
if GetOwningPlayer(GetEnumUnit()) == udg_SetEnemy then
call GroupAddUnit( udg_UnitGroupArray2[udg_CountGroup2], GetEnumUnit() )
endif
endfunction
function Trig_UnitsInitializationWay2_Actions takes nothing returns nothing
// Units Initialization
call TriggerExecute( gg_trg_AddUnitBuildingHero )
call PolledWait( 0.01 )
call ForGroupBJ( GetUnitsInRectOfPlayer(udg_SetZone, udg_SetEnemy), function Trig_UnitsInitializationWay2_Func004A )
endfunction
//===========================================================================
function InitTrig_UnitsInitializationWay2 takes nothing returns nothing
set gg_trg_UnitsInitializationWay2 = CreateTrigger( )
call TriggerAddAction( gg_trg_UnitsInitializationWay2, function Trig_UnitsInitializationWay2_Actions )
endfunction
function Trig_UnitsInitializationWay3_Func005A takes nothing returns nothing
if GetOwningPlayer(GetEnumUnit()) == udg_SetEnemy then
call GroupAddUnit(udg_UnitGroupArray3[udg_CountGroup3], GetEnumUnit())
endif
endfunction
function Trig_UnitsInitializationWay3_Actions takes nothing returns nothing
local group g
//local location l
local integer i
// Clear groups
set i = 0
loop
exitwhen i > udg_CountGroup3
call GroupClear(udg_UnitGroupArray3[i])
set i = i + 1
endloop
// Units Initialization
call TriggerExecute(gg_trg_AddUnitBuildingHero)
call PolledWait(0.01)
// Add units to group and order attack
set g = GetUnitsInRectOfPlayer(udg_SetZone, udg_SetEnemy)
//set l = GetRectCenter(gg_rct_EnemyWayAttackPoint)
call ForGroupBJ(g, function Trig_UnitsInitializationWay3_Func005A)
//call GroupPointOrderLocBJ(udg_UnitGroupArray3[udg_CountGroup3], "attack", l)
// Cleanup
//call RemoveLocation(l)
call DestroyGroup(g)
endfunction
function InitTrig_UnitsInitializationWay3 takes nothing returns nothing
set gg_trg_UnitsInitializationWay3 = CreateTrigger()
call TriggerAddAction(gg_trg_UnitsInitializationWay3, function Trig_UnitsInitializationWay3_Actions)
endfunction
function Trig_CreateSpecUnitWave_Actions takes nothing returns nothing
local real randomNum = GetRandomReal(0, 100.00)
if ( randomNum <= 33.00 ) then
call CreateNUnitsAtLoc( 1, 'n007', udg_SetEnemy, GetRectCenter(udg_SetZone), bj_UNIT_FACING )
elseif ( randomNum <= 66.00 ) then
call CreateNUnitsAtLoc( 1, 'n008', udg_SetEnemy, GetRectCenter(udg_SetZone), bj_UNIT_FACING )
else
call CreateNUnitsAtLoc( 1, 'n009', udg_SetEnemy, GetRectCenter(udg_SetZone), bj_UNIT_FACING )
endif
endfunction
//===========================================================================
function InitTrig_CreateSpecUnitWave takes nothing returns nothing
set gg_trg_CreateSpecUnitWave = CreateTrigger( )
call DisableTrigger( gg_trg_CreateSpecUnitWave )
call TriggerAddAction( gg_trg_CreateSpecUnitWave, function Trig_CreateSpecUnitWave_Actions )
endfunction
function Trig_CreateHero_Actions takes nothing returns nothing
local unit newHero
local real randValue
call CreateNUnitsAtLoc(1, 'h008', udg_SetEnemy, GetRectCenter(udg_SetZone), bj_UNIT_FACING)
set newHero = GetLastCreatedUnit()
set randValue = GetRandomReal(0, 100.00)
if (randValue <= 25.00) then
call SetUnitManaBJ(newHero, 1.00)
elseif (randValue <= 50.00) then
call SetUnitManaBJ(newHero, 2.00)
elseif (randValue <= 75.00) then
call SetUnitManaBJ(newHero, 3.00)
else
call SetUnitManaBJ(newHero, 4.00)
endif
set newHero = null
endfunction
//===========================================================================
function InitTrig_CreateHero takes nothing returns nothing
set gg_trg_CreateHero = CreateTrigger()
call DisableTrigger( gg_trg_CreateHero )
call TriggerAddAction(gg_trg_CreateHero, function Trig_CreateHero_Actions)
endfunction
function Trig_DeadEnemyHero_Conditions takes nothing returns boolean
local unit dyingUnit = GetDyingUnit()
local player dyingPlayer = GetOwningPlayer(dyingUnit)
if IsUnitType(dyingUnit, UNIT_TYPE_HERO) and not IsUnitType(dyingUnit, UNIT_TYPE_SAPPER) and (dyingPlayer == Player(4) or dyingPlayer == Player(5)) then
call ReplaceUnitBJ(dyingUnit, GetUnitTypeId(dyingUnit), bj_UNIT_STATE_METHOD_DEFAULTS)
call UnitAddTypeBJ(UNIT_TYPE_SAPPER, GetLastReplacedUnitBJ())
call KillUnit(GetLastReplacedUnitBJ())
return true
endif
return false
endfunction
function InitTrig_DeadEnemyHero takes nothing returns nothing
set gg_trg_DeadEnemyHero = CreateTrigger()
call DisableTrigger( gg_trg_DeadEnemyHero )
call TriggerRegisterAnyUnitEventBJ(gg_trg_DeadEnemyHero, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(gg_trg_DeadEnemyHero, Condition(function Trig_DeadEnemyHero_Conditions))
endfunction
function InitTrig_EnemyRandomSpawn takes nothing returns nothing
local real EnemyRandomWay = GetRandomReal(0, 100.00)
set gg_trg_EnemyRandomSpawn = CreateTrigger( )
call DisableTrigger( gg_trg_EnemyRandomSpawn )
if ( EnemyRandomWay <= 25.00 ) then
set udg_SetZone = udg_Way2[0]
elseif ( EnemyRandomWay <= 50.00 ) then
set udg_SetZone = udg_Way2[8]
elseif ( EnemyRandomWay <= 75.00 ) then
set udg_SetZone = udg_Way1[0]
else
set udg_SetZone = udg_Way1[9]
endif
endfunction
library RaceUnits initializer InitRaceUnits
globals
integer array Units_Human
integer array Units_Orc
integer array Units_Undead
integer array Units_Nightelf
integer array Buildings_Human
integer array Buildings_Orc
integer array Buildings_Undead
integer array Buildings_Nightelf
integer array Heroes_Human
integer array Heroes_Orc
integer array Heroes_Undead
integer array Heroes_Nightelf
endglobals
private function InitRaceUnits takes nothing returns nothing
set Units_Human[1] = 'hpea' // Peasant
set Units_Human[2] = 'hfoo' // Footman
set Units_Human[3] = 'hrif' // Rifleman
set Units_Human[4] = 'hmtm' // Mortar Team
set Units_Human[5] = 'hmpr' // Priest
set Units_Human[6] = 'hsor' // Sorceress
set Units_Human[7] = 'hspt' // Spellbreaker
set Units_Human[8] = 'hkni' // Knight
set Units_Human[9] = 'hgry' // Gryphon Knight
set Units_Human[10] = 'hdhw' // Dragonhawk Rider
set Units_Human[11] = 'hgyr' // Flying Machine
set Units_Human[12] = 'hmtt' // Siege Engine
set Units_Orc[1] = 'opeo' // Peon
set Units_Orc[2] = 'ogru' // Grunt
set Units_Orc[3] = 'ohun' // Headhunter
set Units_Orc[4] = 'ocat' // Demolisher
set Units_Orc[5] = 'oshm' // Shaman
set Units_Orc[6] = 'odoc' // Witch Doctor
set Units_Orc[7] = 'ospw' // Spirit Walker
set Units_Orc[8] = 'orai' // Raider
set Units_Orc[9] = 'oyau' // Tauren
set Units_Orc[10] = 'owyv' // Wind Rider
set Units_Orc[11] = 'otbr' // Batrider
set Units_Orc[12] = 'okod' // Kodo Beast
set Units_Undead[1] = 'uaco' // Acolyte
set Units_Undead[2] = 'ugho' // Ghoul
set Units_Undead[3] = 'ucry' // Crypt Fiend
set Units_Undead[4] = 'umtw' // Meat Wagon
set Units_Undead[5] = 'unec' // Necromancer
set Units_Undead[6] = 'uban' // Banshee
set Units_Undead[7] = 'uobs' // Obsidian Statue
set Units_Undead[8] = 'uabo' // Abomination
set Units_Undead[9] = 'ufro' // Frost Wyrm
set Units_Undead[10] = 'ubsp' // Destroyer
set Units_Undead[11] = 'ugar' // Gargoyle
set Units_Nightelf[1] = 'ewsp' // Wisp
set Units_Nightelf[2] = 'earc' // Archer
set Units_Nightelf[3] = 'esen' // Huntress
set Units_Nightelf[4] = 'ebal' // Glaive Thrower
set Units_Nightelf[5] = 'edry' // Dryad
set Units_Nightelf[6] = 'edot' // Druid of the Talon
set Units_Nightelf[7] = 'edoc' // Druid of the Claw
set Units_Nightelf[8] = 'emtg' // Mountain Giant
set Units_Nightelf[9] = 'echm' // Chimaera
set Units_Nightelf[10] = 'ehpr' // Hippogryph Rider
set Units_Nightelf[11] = 'efdr' // Faerie Dragon
set Buildings_Human[1] = 'htow' // Town Hall
set Buildings_Human[2] = 'hkee' // Keep
set Buildings_Human[3] = 'hcas' // Castle
set Buildings_Human[4] = 'hhou' // Farm
set Buildings_Human[5] = 'halt' // Altar of Kings
set Buildings_Human[6] = 'hbar' // Barracks
set Buildings_Human[7] = 'hars' // Arcane Sanctum
set Buildings_Human[8] = 'harm' // Workshop
set Buildings_Human[9] = 'hatw' // Arcane Tower
set Buildings_Human[10] = 'hgtw' // Guard Tower
set Buildings_Human[11] = 'hctw' // Cannon Tower
set Buildings_Human[12] = 'hlum' // Lumber Mill
set Buildings_Human[13] = 'hbla' // Blacksmith
set Buildings_Human[14] = 'hgra' // Gryphon Aviary
set Buildings_Orc[1] = 'ogre' // Great Hall
set Buildings_Orc[2] = 'ostr' // Stronghold
set Buildings_Orc[3] = 'ofrt' // Fortress
set Buildings_Orc[4] = 'otrb' // Burrow
set Buildings_Orc[5] = 'oalt' // Altar of Storms
set Buildings_Orc[6] = 'obar' // Barracks
set Buildings_Orc[7] = 'osld' // Spirit Lodge
set Buildings_Orc[8] = 'obea' // Beastiary
set Buildings_Orc[9] = 'owtw' // Watch Tower
set Buildings_Orc[10] = 'owtw' // Watch Tower
set Buildings_Orc[11] = 'owtw' // Watch Tower
set Buildings_Orc[12] = 'ofor' // War Mill
set Buildings_Orc[13] = 'ofor' // War Mill
set Buildings_Orc[14] = 'otto' // Tauren Totem
set Buildings_Undead[1] = 'unpl' // Necropolis
set Buildings_Undead[2] = 'unp1' // Halls of the Dead
set Buildings_Undead[3] = 'unp2' // Black Citadel
set Buildings_Undead[4] = 'uzig' // Ziggurat
set Buildings_Undead[5] = 'uaod' // Altar of Darkness
set Buildings_Undead[6] = 'usep' // Crypt
set Buildings_Undead[7] = 'utod' // Temple of the Damned
set Buildings_Undead[8] = 'uslh' // Slaughterhouse
set Buildings_Undead[9] = 'uzg2' // Nerubian Tower
set Buildings_Undead[10] = 'uzg1' // Spirit Tower
set Buildings_Undead[11] = 'uzg1' // Spirit Tower
set Buildings_Undead[12] = 'ugrv' // Graveyard
set Buildings_Undead[13] = 'ugrv' // Graveyard
set Buildings_Undead[14] = 'ubon' // Boneyard
set Buildings_Nightelf[1] = 'etol' // Tree of Life
set Buildings_Nightelf[2] = 'etoa' // Tree of Ages
set Buildings_Nightelf[3] = 'etoe' // Tree of Eternity
set Buildings_Nightelf[4] = 'emow' // Moon Well
set Buildings_Nightelf[5] = 'eate' // Altar of Elders
set Buildings_Nightelf[6] = 'eaow' // Ancient of War
set Buildings_Nightelf[7] = 'eaoe' // Ancient of Lore
set Buildings_Nightelf[8] = 'eaom' // Ancient of Wind
set Buildings_Nightelf[9] = 'etrp' // Ancient Protector
set Buildings_Nightelf[10] = 'etrp' // Ancient Protector
set Buildings_Nightelf[11] = 'etrp' // Ancient Protector
set Buildings_Nightelf[12] = 'edob' // Hunter’s Hall
set Buildings_Nightelf[13] = 'edob' // Hunter’s Hall
set Buildings_Nightelf[14] = 'edos' // Chimaera Roost
set Heroes_Human[1] = 'Hpal' // Paladin
set Heroes_Human[2] = 'Hamg' // Archmage
set Heroes_Human[3] = 'Hmkg' // Mountain King
set Heroes_Human[5] = 'Hblm' // Blood Mage
set Heroes_Orc[1] = 'Obla' // Blademaster
set Heroes_Orc[2] = 'Ofar' // Far Seer
set Heroes_Orc[3] = 'Otch' // Tauren Chieftain
set Heroes_Orc[4] = 'Oshd' // Shadow Hunter
set Heroes_Undead[1] = 'Udea' // Death Knight
set Heroes_Undead[2] = 'Ulic' // Lich
set Heroes_Undead[3] = 'Udre' // Dreadlord
set Heroes_Undead[4] = 'Ucrl' // Crypt Lord
set Heroes_Nightelf[1] = 'Ekee' // Keeper of the Grove
set Heroes_Nightelf[2] = 'Emoo' // Priestess of the Moon
set Heroes_Nightelf[3] = 'Edem' // Demon Hunter
set Heroes_Nightelf[4] = 'Ewar' // Warden
endfunction
endlibrary
function ApiEnemyGet takes race race1, string type1, integer index returns integer
if (type1 == "unit") then
if (race1 == RACE_HUMAN) then
return Units_Human[index]
elseif (race1 == RACE_ORC) then
return Units_Orc[index]
elseif (race1 == RACE_UNDEAD) then
return Units_Undead[index]
elseif (race1 == RACE_NIGHTELF) then
return Units_Nightelf[index]
endif
elseif (type1 == "building") then
if (race1 == RACE_HUMAN) then
return Buildings_Human[index]
elseif (race1 == RACE_ORC) then
return Buildings_Orc[index]
elseif (race1 == RACE_UNDEAD) then
return Buildings_Undead[index]
elseif (race1 == RACE_NIGHTELF) then
return Buildings_Nightelf[index]
endif
elseif (type1 == "hero") then
if (race1 == RACE_HUMAN) then
return Heroes_Human[index]
elseif (race1 == RACE_ORC) then
return Heroes_Orc[index]
elseif (race1 == RACE_UNDEAD) then
return Heroes_Undead[index]
elseif (race1 == RACE_NIGHTELF) then
return Heroes_Nightelf[index]
endif
endif
return 0
endfunction
function ApiEnemyGetDif takes race race1, string unitType, integer index, integer difficulty returns integer
local integer unitId
if (difficulty == udg_GAME_DIFFICULTY) then
set unitId = ApiEnemyGet(race1, unitType, index)
return unitId
else
return 0
endif
endfunction
function Trig_ApiEnemyCreate_Actions takes nothing returns nothing
local integer createUnit = ApiEnemyGet(udg_RACE_RANDOM, "unit", 3)
call CreateUnitAtLoc(Player(0), createUnit, GetRectCenter(bj_mapInitialPlayableArea), bj_UNIT_FACING)
endfunction
//===========================================================================
function InitTrig_ApiEnemyCreate takes nothing returns nothing
set gg_trg_ApiEnemyCreate = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_ApiEnemyCreate, 5 )
call TriggerAddAction( gg_trg_ApiEnemyCreate, function Trig_ApiEnemyCreate_Actions )
endfunction
globals
integer array GorehowlItems
endglobals
function InitGorehowlItems takes nothing returns nothing
set GorehowlItems[0] = 'I00Z'
set GorehowlItems[1] = 'I010'
set GorehowlItems[2] = 'I011'
set GorehowlItems[3] = 'I012'
set GorehowlItems[4] = 'I013'
set GorehowlItems[5] = 'I014'
set GorehowlItems[6] = 'I015'
set GorehowlItems[7] = 'I016'
set GorehowlItems[8] = 'I017'
set GorehowlItems[9] = 'I018'
set GorehowlItems[10] = 'I019'
endfunction
function Trig_ItemGorehowl_Actions takes nothing returns nothing
local unit killer = GetKillingUnit()
local item it
local integer i = 0
loop
exitwhen i > 9
set it = GetItemOfTypeFromUnitBJ(killer, GorehowlItems[i])
if it != null and GetItemTypeId(it) == GorehowlItems[i] then
call RemoveItem(it)
call UnitAddItemByIdSwapped(GorehowlItems[i + 1], killer)
return
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_ItemGorehowl takes nothing returns nothing
call InitGorehowlItems()
set gg_trg_ItemGorehowl = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ItemGorehowl, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(gg_trg_ItemGorehowl, function Trig_ItemGorehowl_Actions)
endfunction
function Trig_ItemAtieshTeleport_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A09W'
endfunction
function Trig_ItemAtieshTeleport_Func001Func004C takes nothing returns boolean
local integer unitId = GetUnitTypeId(GetSpellTargetUnit())
return unitId == 'h02C' or unitId == 'h02K'
endfunction
function Trig_ItemAtieshTeleport_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location casterLoc = GetUnitLoc(caster)
local location targetLoc = GetUnitLoc(target)
if Trig_ItemAtieshTeleport_Func001Func004C() then
call SetUnitPositionLoc(target, casterLoc)
call SetUnitPositionLoc(caster, targetLoc)
call IssuePointOrderLoc( caster, "unloadall", targetLoc )
endif
call RemoveLocation(casterLoc)
call RemoveLocation(targetLoc)
endfunction
//===========================================================================
function InitTrig_ItemAtieshTeleport takes nothing returns nothing
set gg_trg_ItemAtieshTeleport = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ItemAtieshTeleport, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(gg_trg_ItemAtieshTeleport, Condition(function Trig_ItemAtieshTeleport_Conditions))
call TriggerAddAction(gg_trg_ItemAtieshTeleport, function Trig_ItemAtieshTeleport_Actions)
endfunction
function Trig_ItemsBoxYoggSaron_Conditions takes nothing returns boolean
return GetItemTypeId(GetManipulatedItem()) == 'I00J'
endfunction
function Trig_ItemsBoxYoggSaron_Actions takes nothing returns nothing
local real randomValue1 = GetRandomReal(0, 100.00)
local real randomValue2 = GetRandomReal(0, 100.00)
local unit u = GetManipulatingUnit()
if randomValue1 <= 33.33 then
call UnitAddItemByIdSwapped('tstr', u)
elseif randomValue1 <= 66.66 then
call UnitAddItemByIdSwapped('tint', u)
else
call UnitAddItemByIdSwapped('tdex', u)
endif
if randomValue2 <= 33.33 then
call UnitAddItemByIdSwapped('tstr', u)
elseif randomValue2 <= 66.66 then
call UnitAddItemByIdSwapped('tint', u)
else
call UnitAddItemByIdSwapped('tdex', u)
endif
endfunction
//===========================================================================
function InitTrig_ItemsBoxYoggSaron takes nothing returns nothing
set gg_trg_ItemsBoxYoggSaron = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ItemsBoxYoggSaron, EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(gg_trg_ItemsBoxYoggSaron, Condition(function Trig_ItemsBoxYoggSaron_Conditions))
call TriggerAddAction(gg_trg_ItemsBoxYoggSaron, function Trig_ItemsBoxYoggSaron_Actions)
endfunction
function Trig_ItemsLoot_Func002A_Level takes unit u, integer level returns nothing
local integer item1 = ChooseRandomItemEx(ITEM_TYPE_ANY, level)
local integer item2 = 0
local integer item3 = 0
local integer i = 0
loop
set item2 = ChooseRandomItemEx(ITEM_TYPE_ANY, level)
set i = i + 1
exitwhen item2 != item1 or i >= 10
endloop
set i = 0
loop
set item3 = ChooseRandomItemEx(ITEM_TYPE_ANY, level)
set i = i + 1
exitwhen (item3 != item1 and item3 != item2) or i >= 10
endloop
call AddItemToStockBJ(item1, u, 1, 1)
call AddItemToStockBJ(item2, u, 1, 1)
call AddItemToStockBJ(item3, u, 1, 1)
endfunction
function AddLootForUnitType takes integer unitType, integer level returns nothing
local group g = GetUnitsOfTypeIdAll(unitType)
local unit u
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call Trig_ItemsLoot_Func002A_Level(u, level)
endloop
call DestroyGroup(g)
endfunction
function Trig_ChestLoot_Actions takes nothing returns nothing
call AddLootForUnitType('n00N', 6)
call AddLootForUnitType('n00L', 7)
call AddLootForUnitType('n00O', 8)
endfunction
function InitTrig_ChestLoot takes nothing returns nothing
set gg_trg_ChestLoot = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_ChestLoot, 0.10, false)
call TriggerAddAction(gg_trg_ChestLoot, function Trig_ChestLoot_Actions)
endfunction