//TESH.scrollpos=-1
//TESH.alwaysfold=1
globals
integer t = 1
integer array agility
integer array strength
integer array intelligence
integer array Agility
integer array Strength
real array xp
real array XP
real XPD = 1.1
real XPd = 1.1
integer s = 1
boolean b = true
destructable d
integer i = 10
integer I = 0
integer T = 0
integer Seconds = 0
integer Minutes = 0
integer hp = 74
integer HP = 382
integer LifeGlitchFix = 98
real D
rect G
rect array l
sound h
timer AI
trigger FadeUnit
trigger Cinematic
trigger SkipCinematic
trigger BeginMatch
trigger BeginCast
trigger DamageReduction
trigger Finish
trigger DefendOffPushAway
trigger Defeat
trigger Victory
trigger Time
trigger Every03
trigger Experience
trigger GainALevel
triggeraction Difficualty
triggeraction PushAway
code Inter
code InterSmall
timer IntervallTimer
triggeraction Camera
real angle
triggeraction IntervallCamera
unit A
unit c
unit C
unit m
unit M
unit F
unit array R
endglobals
library Abilities
function defendOffPushAway takes nothing returns nothing
local unit U = M
local real r = D
local real x = GetUnitX(U) + 15 * Cos(r)
local real y = GetUnitY(U) + 15 * Sin(r)
if IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) or T == 12 then
set T = 0
call TriggerRemoveAction(Every03, PushAway)
else
set T = T + 1
call SetUnitPosition(U, x, y)
endif
endfunction
function beginCast takes nothing returns nothing
local effect e
local effect E
local real x
local real y
local real r
local real d
local unit u = m
local unit U = M
local location l
if GetSpellAbilityId() == 'A002' then
call SetUnitAbilityLevel(u, 'A000', 1)
set e = AddSpecialEffectTarget("Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl", u, "chest")
set x = GetUnitX(U) - GetUnitX(u)
set y = GetUnitY(U) - GetUnitY(u)
set d = GetUnitAbilityLevel(u, 'A002') * 2
set D = Atan2(y, x)
if D < 0 then
set D = D + 6.283
endif
set r = GetUnitFacing(u) - bj_RADTODEG * D
if SquareRoot(x * x + y * y) < 228 + d and r < 90 and -90 < r then
set E = AddSpecialEffectTarget("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl", U, "chest")
call SetUnitState(U, UNIT_STATE_LIFE, GetUnitState(U, UNIT_STATE_LIFE) - (25 + d))
set PushAway = TriggerAddAction(Every03, function defendOffPushAway)
endif
call TriggerSleepAction(.48)
call DestroyEffect(e)
call TriggerSleepAction(.72)
call SetUnitAbilityLevel(u, 'A000', R2I(GetHeroAgi(u, true) * .4))
call DestroyEffect(E)
elseif GetSpellAbilityId() == 'A004' then
set x = GetUnitX(u)
set y = GetUnitY(u)
set U = c
call SetUnitPosition(U, x, y)
call SetUnitFacing(U, GetUnitFacing(u))
set l = GetSpellTargetLoc()
set r = Atan2(GetLocationY(l) - y, GetLocationX(l) - x)
call RemoveLocation(l)
set d = 440 + (GetUnitAbilityLevel(u, 'A004') * 10)
call SetUnitPosition(C, x + d * Cos(r), y + d * Sin(r))
call IssueTargetOrder(U, "attackonce", C)
endif
endfunction
function Finish_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A005'
endfunction
function finish takes nothing returns nothing
local unit u = m
local unit U = M
local location l = GetSpellTargetLoc()
local real x = GetLocationX(l)
local real y = GetLocationY(l)
local real a = bj_RADTODEG * Atan2(GetUnitY(U) - y, GetUnitX(U) - x)
local real f = bj_RADTODEG * Atan2(y - GetUnitY(u), x - GetUnitX(u)) - a
call RemoveLocation(l)
set x = x - GetUnitX(U)
set y = y - GetUnitY(U)
if SquareRoot(x * x + y * y) < 230 and f < 90 and -90 < f then
call SetUnitFacing(u, a)
call SetUnitState(U, UNIT_STATE_LIFE, GetUnitState(U, UNIT_STATE_LIFE) - (32 + (GetUnitAbilityLevel(u, 'A005') * 3)))
endif
endfunction
function damageReduction takes nothing returns nothing
call SetUnitAbilityLevel(M, 'A000', R2I(GetHeroAgi(M, true) * .4))
endfunction
function AbilityUsed takes nothing returns nothing
local integer i = GetSpellAbilityId()
call SetUnitAbilityLevel(m, i, GetUnitAbilityLevel(m, i) + 1)
endfunction
function gainALevel takes nothing returns nothing
local unit u = m
call SetUnitAbilityLevel(u, 'A000', R2I(GetHeroAgi(u, true) * .4))
call SetUnitAbilityLevel(u, 'A005', GetUnitAbilityLevel(u, 'A005') + 1)
call SetUnitAbilityLevel(u, 'A004', GetUnitAbilityLevel(u, 'A004') + 1)
call SetUnitAbilityLevel(u, 'A002', GetUnitAbilityLevel(u, 'A002') + 1)
endfunction
endlibrary
library PerioticComplex
function aI takes nothing returns nothing
local unit u = m
local unit U = M
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real X = GetRandomReal(x - 992, x + 992)
local real Y = GetRandomReal(y - 992, y + 992)
loop
exitwhen IsVisibleToPlayer(X, Y, Player(6))
set X = GetRandomReal(x - 992, x + 992)
set Y = GetRandomReal(y - 992, y + 992)
endloop
call SetUnitPosition(U, X, Y)
call SetUnitFacing(U, bj_RADTODEG * Atan2(y - Y, x - X))
call IssueTargetOrder(U, "attack", u)
endfunction
function aIStops takes nothing returns nothing
call IssueTargetOrder(M, "attack", m)
endfunction
function aI_Conditions takes nothing returns nothing
call TimerStart(AI, GetRandomReal(2.4, 4.8) - s, false, function aI_Conditions)
if not IsUnitVisible(M, Player(6)) then
call aI()
elseif GetUnitCurrentOrder(M) == 0 then
call aIStops()
endif
endfunction
function health takes nothing returns nothing
local integer h = R2I(GetUnitState(M, UNIT_STATE_LIFE))
local integer H = R2I(GetUnitState(m, UNIT_STATE_LIFE))
if h != HP then
if h < HP then
call AddHeroXP(m, R2I((HP - h) * XPd), false)
endif
set HP = h
call SetPlayerState(Player(6), PLAYER_STATE_RESOURCE_GOLD, R2I(HP))
endif
set h = R2I((hp - H) * XPD)
if h != hp then
if H < hp then
call AddHeroXP(M, h, false)
call AddHeroXP(m, -h*2/3, false)
endif
set hp = H
endif
endfunction
function time takes nothing returns nothing
if Seconds == 59 then
set Seconds = 0
set Minutes = Minutes + 1
call SetPlayerState(Player(6), PLAYER_STATE_RESOURCE_LUMBER, Minutes)
else
set Seconds = Seconds + 1
endif
call SetPlayerState(Player(6), PLAYER_STATE_RESOURCE_FOOD_USED, Seconds)
endfunction
function experience takes nothing returns nothing
call AddHeroXP(m, 1, false)
endfunction
endlibrary
library Camera
function CameraConstants takes nothing returns nothing
call SetCameraField(CAMERA_FIELD_ZOFFSET, 30, .03)
call SetCameraField(CAMERA_FIELD_ROTATION, 112, .03)
endfunction
function intervallSmallCamera takes nothing returns nothing
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 720 - ((GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) - 5.306) * 500), .09)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 100, .09)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, angle, .09)
set angle = angle + .66
endfunction
function intervallCamera takes nothing returns nothing
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 720, .09)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 120, .09)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, angle, .09)
set angle = angle - .65
endfunction
function cameraSmall takes nothing returns nothing
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 720 - ((GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) - 5.306) * 500), .09)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 100, .03)
if GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) < 5.307 then
call TriggerRemoveAction(Every03, Camera)
set angle = 305
set IntervallCamera = TriggerAddAction(Every03, function intervallCamera)
call TimerStart(IntervallTimer, .6, false, Inter)
endif
endfunction
function camera takes nothing returns nothing
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 720, .09)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 120, .03)
if GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) > 5.133 then
call TriggerRemoveAction(Every03, Camera)
set angle = 293
set IntervallCamera = TriggerAddAction(Every03, function intervallSmallCamera)
call TimerStart(IntervallTimer, .6, false, InterSmall)
endif
endfunction
function IntervallSmall takes nothing returns nothing
set Camera = TriggerAddAction(Every03, function cameraSmall)
call TriggerRemoveAction(Every03, IntervallCamera)
endfunction
function Intervall takes nothing returns nothing
set Camera = TriggerAddAction(Every03, function camera)
call TriggerRemoveAction(Every03, IntervallCamera)
endfunction
endlibrary
library begin
function BlendFilter takes real d, integer R, integer G, integer B, integer T, integer r, integer g, integer b, integer t returns nothing
call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\Black_mask.blp")
call SetCineFilterBlendMode(BLEND_MODE_BLEND)
call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
call SetCineFilterStartUV(0, 0, 0, 0)
call SetCineFilterEndUV(0, 0, 0, 0)
call SetCineFilterStartColor(R, G, B, T)
call SetCineFilterEndColor(r, g, b, t)
call SetCineFilterDuration(d)
call DisplayCineFilter(true)
endfunction
function fadeUnit takes nothing returns nothing
set I = I + i
call SetUnitVertexColor(F, 0, 110, 90, I)
if I < 0 or I > 255 then
call DisableTrigger(FadeUnit)
endif
endfunction
function EndCinematic takes nothing returns nothing
call ShowInterface(true, .87)
call EnableUserControl(true)
call SetPlayerAlliance(Player(11), Player(6), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(6), Player(11), ALLIANCE_PASSIVE, false)
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 720, 1.2)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 120, 1.2)
call SetCameraField(CAMERA_FIELD_ZOFFSET, 30, 1.2)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, 294, 1.2)
call TriggerSleepAction(1.25)
call EnableTrigger(Every03)
endfunction
function cinematic takes nothing returns nothing
local unit u = m
//Collapse Stay
call SelectUnit(u, true)
call DestroyTrigger(Cinematic)
call SetDestructableAnimationSpeed(d, .0001)
if b == true then
call SetUnitTimeScale(u, .0001)
//Fade
call TriggerSleepAction(1.02)
if b == true then
call BlendFilter(1.11, 255, 76, 90, 210, 230, 194, 170, 252)
call TriggerSleepAction(1.12)
if b == true then
call BlendFilter(.63, 230, 194, 170, 252, 230, 194, 170, 190)
call TriggerSleepAction(.49)
if b == true then
call BlendFilter(3.21, 230, 230, 230, 190, 252, 252, 252, 254)
call TriggerSleepAction(3.37)
if b == true then
call BlendFilter(.9, 230, 230, 230, 254, 252, 252, 252, 240)
call TriggerSleepAction(.89)
if b == true then
call BlendFilter(2.88, 230, 230, 230, 240, 252, 252, 252, 254)
//Wake
call TriggerSleepAction(1.28)
if b == true then
call DisplayTextToPlayer(Player(6), 0, 0, "(...phh)")
call TriggerSleepAction(1.16)
if b == true then
call StopSound(bj_nightAmbientSound, true, true)
set bj_nightAmbientSound = CreateMIDISound("AshenvaleNight", 20, 20)
call StartSound(bj_nightAmbientSound)
call SetDoodadAnimationRect(G, 'D024', "show", false)
call BlendFilter(1.23, 252, 252, 252, 254, 222, 245, 214, 180)
call TriggerSleepAction(1.16)
if b == true then
call BlendFilter(2.19, 222, 245, 214, 180, 227, 247, 224, 13)
call TriggerSleepAction(2.19)
if b == true then
call SetUnitTimeScale(u, .37)
call BlendFilter(.72, 227, 247, 224, 13, 200, 220, 200, 250)
call TriggerSleepAction(.72)
if b == true then
call SetUnitFlyHeight(u, -4.2, 4.3)
call SetUnitAnimation(u, "stand")
call BlendFilter(.59, 200, 220, 200, 250, 232, 250, 245, 13)
call TriggerSleepAction(.57)
if b == true then
call BlendFilter(.57, 232, 250, 245, 13, 200, 220, 200, 250)
call TriggerSleepAction(.59)
if b == true then
call BlendFilter(.45, 200, 220, 200, 250, 250, 195, 200, 195)
call TriggerSleepAction(.06)
if b == true then
call TriggerAddAction(FadeUnit, function fadeUnit)
call TriggerRegisterTimerEvent(FadeUnit, .03, true)
call SetUnitTimeScale(u, 1.11)
set F = M
//Fade In
call TriggerSleepAction(.72)
if b == true then
call BlendFilter(.45, 250, 195, 200, 195, 250, 170, 170, 85)
set i = -10
call EnableTrigger(FadeUnit)
//Fade Out
call TriggerSleepAction(1.42)
if b == true then
call SetUnitPosition(M, 420, -270)
call BlendFilter(.45, 250, 170, 170, 85, 250, 195, 195, 240)
call SetSoundDuration(h, 305398)
call SetSoundChannel(h, 13)
call SetSoundVolume(h, 127)
call SetSoundPitch(h, 0.9)
call StartSound(h)
call SetSoundPlayPosition(h, 22490)
set i = 18
set F = A
call EnableTrigger(FadeUnit)
//Fade In Large
call TriggerSleepAction(.6)
if b == true then
call SetDoodadAnimationRect(bj_mapInitialCameraBounds, 'D024', "show", false)
call BlendFilter(.33, 250, 195, 195, 240, 250, 190, 190, 80)
call TriggerSleepAction(.3)
if b == true then
call StopSound(h, true, true)
set i = -19
call EnableTrigger(FadeUnit)
//Fade Out Large
call TriggerSleepAction(.27)
if b == true then
call BlendFilter(.33, 250, 190, 190, 80, 250, 240, 245, 245)
call TriggerSleepAction(.36)
if b == true then
call BlendFilter(.33, 250, 240, 245, 245, 250, 250, 250, 5)
call SetUnitExploded(A, true)
call KillUnit(A)
//Talk
call TriggerSleepAction(.61)
if b == true then
call DisplayTextToPlayer(Player(6), 0, 0, "(...Aww.. My head...)")
call TriggerSleepAction(3.69)
if b == true then
call BlendFilter(2.66, 250, 250, 250, 5, 175, 175, 175, 195)
call TriggerSleepAction(2.66)
if b == true then
call DisplayTextToPlayer(Player(6), 0, 0, "(...Not this again...)" )
call BlendFilter(2.16, 175, 175, 175, 195, 250, 250, 255, 5)
call TriggerSleepAction(3.24)
if b == true then
call SetUnitFacingTimed(u, 133.16, .3)
call TriggerSleepAction(1.48)
if b == true then
call DisplayTextToPlayer(Player(6), 0, 0, "(...This fence even says a simular description...)")
call TriggerSleepAction(1.6)
if b == true then
call DisplayTextToPlayer(Player(6), 0, 0, "(...Although it looks like there is alot more blood splattered all over it...)")
call TriggerSleepAction(2.7)
call DestroyTrigger(SkipCinematic)
if b == true then
call DisplayTextToPlayer(Player(6), 0, 0, "...It says as described...
...For those who are fast sharp eyed enough to see this message are those that can proseed to be able to have their second challenge in the arena of Vendula. For you to be able to beat your second challenge you will need to be swift, mobile and smart with what skills you shall bee provided with. Although don't expect anything like before....")
call EndCinematic()
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endfunction
function skipCinematic takes nothing returns nothing
local unit u = m
local unit U = M
local unit o = A
set b = false
call DestroyTrigger(FadeUnit)
call DestroyTrigger(SkipCinematic)
call BlendFilter(1.34, 200, 220, 200, 240, 250, 250, 255, 5)
call SetDoodadAnimationRect(G, 'D024', "show", false)
call StopSound(bj_nightAmbientSound, true, true)
set bj_nightAmbientSound = CreateMIDISound("AshenvaleNight", 20, 20)
call StartSound(bj_nightAmbientSound)
call SetUnitExploded(A, true)
call KillUnit(A)
call SetUnitPosition(U, 420, -270)
call SetUnitVertexColor(U, 0, 110, 90, 250)
call SetUnitTimeScale(u, 1.11)
call SetUnitFlyHeight(u, -4.2, 4.3)
call SetUnitAnimation(u, "stand")
call ShowUnit(o, false)
call SetUnitExploded(o, true)
call KillUnit(o)
call EndCinematic()
endfunction
function difficualty takes nothing returns nothing
local integer i = 0
local unit u = m
local unit U = M
loop
if GetSpellAbilityId() == 'A010' + i then
set s = i
call SetUnitOwner(R[i], Player(15), false)
call SetHeroStr(u, strength[i], true)
call SetHeroAgi(u, agility[i], true)
call SetHeroInt(u, intelligence[i], true)
call SetHeroStr(U, Strength[i], true)
call SetHeroAgi(U, Agility[i], true)
set XPd = xp[i]
set XPD = XP[i]
set hp = R2I(GetHeroStr(u, false) * 3.5)
set HP = 340 + R2I(GetHeroStr(U, false) * 3.5)
set t = i
call SetPlayerState(Player(6), PLAYER_STATE_RESOURCE_GOLD, HP)
else
call SetUnitOwner(R[i], Player(6), false)
endif
exitwhen i == 2
set i = i + 1
endloop
if GetSpellAbilityId() != 'A010' + s then
call SetUnitOwner(R[s], Player(15), false)
endif
endfunction
function beginMatch takes nothing returns nothing
local integer i = 0
if GetTriggerUnit() == m then
call DestroyTrigger(BeginMatch)
loop
call RemoveRect(l[i])
exitwhen i == 9
set i = i + 1
endloop
call SetMusicPlayPosition(0)
call SetMusicVolume(116)
call ClearTextMessages()
call SetDoodadAnimationRect(G, 'D024', "death", false)
call RemoveRect(G)
call IssueTargetOrder(M, "attack", m)
call TimerStart(AI, GetRandomReal(.4, 4.4 - s), false, function aI_Conditions)
set Time = CreateTrigger()
call TriggerRegisterTimerEvent(Time, 1, true)
call TriggerAddAction(Time, function time)
set Experience = CreateTrigger()
call TriggerRegisterTimerEvent(Experience, .56, true)
call TriggerAddAction(Experience, function experience)
call TriggerAddAction(Every03, function health)
call TriggerAddAction(BeginCast, function AbilityUsed)
call UnitRemoveAbility(m, 'A003')
call UnitRemoveAbility(m, 'A010')
call UnitRemoveAbility(m, 'A011')
call UnitRemoveAbility(m, 'A012')
call TriggerRemoveAction(BeginCast, Difficualty)
endif
endfunction
endlibrary
library end
function Restart takes nothing returns nothing
call RestartGame(false)
endfunction
function Quit takes nothing returns nothing
call EndGame(false)
endfunction
function End takes string a, sound s returns nothing
local trigger t = CreateTrigger()
local dialog d = DialogCreate()
local integer i = Seconds
if Seconds < 10 then
call DialogSetMessage(d, a + I2S(Minutes) + ":0" + I2S(Seconds))
else
call DialogSetMessage(d, a + I2S(Minutes) + ":" + I2S(Seconds))
endif
call TriggerRegisterDialogButtonEvent(t, DialogAddButton(d, "Restart", GetLocalizedHotkey("GAMEOVER_RESTART")))
call TriggerAddAction(t, function Restart)
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent(t, DialogAddButton(d, "Quit", GetLocalizedHotkey("GAMEOVER_QUIT_MISSION")))
call TriggerAddAction(t, function Quit)
call EnableUserUI(true)
call DialogDisplay(Player(6), d, true)
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_UI, 1)
call StartSound(s)
endfunction
function defeat takes nothing returns nothing
call DestroyTimer(AI)
call PauseUnit(M, true)
call BlendFilter(3.24, 252, 250, 254, 250, 3, 194, 173, 242)
call DestroyTrigger(Time)
call TriggerSleepAction(3.3)
call End("Defeat at ", bj_defeatDialogSound)
endfunction
function victory takes nothing returns nothing
call DestroyTimer(AI)
call PauseUnit(m, true)
call AddSpecialEffectTarget("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", m, "feet")
call BlendFilter(2.44, 252, 250, 254, 5, 176, 245, 224, 242)
call DestroyTrigger(Time)
call TriggerSleepAction(2.5)
if t == 2 then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Victory on Hard difficualty!")
endif
call End("Victory at ", bj_victoryDialogSound)
endfunction
endlibrary
library init initializer Initglobals
function EnterRegion takes nothing returns region
local region r = CreateRegion()
local integer i = 0
loop
call RegionAddRect(r, l[i])
exitwhen i == 9
set i = i + 1
endloop
return r
endfunction
function InitTriggers takes nothing returns nothing
local unit u = m
local unit U = M
//Cinematic
call TriggerAddAction(Cinematic, function cinematic)
call TriggerAddAction(SkipCinematic, function skipCinematic)
call TriggerAddAction(BeginMatch, function beginMatch)
call TriggerRegisterPlayerEvent(SkipCinematic, Player(6), EVENT_PLAYER_END_CINEMATIC)
call TriggerRegisterTimerEvent(Cinematic, 1.17, false)
call TriggerRegisterEnterRegion(BeginMatch, EnterRegion(), null)
//Ability
set Difficualty = TriggerAddAction(BeginCast, function difficualty)
call TriggerAddAction(BeginCast, function beginCast)
call TriggerAddAction(DamageReduction, function damageReduction)
call TriggerAddAction(Finish, function finish)
call TriggerRegisterUnitEvent(BeginCast, u, EVENT_UNIT_SPELL_CAST)
call TriggerRegisterUnitEvent(GainALevel, u, EVENT_UNIT_HERO_LEVEL)
call TriggerRegisterUnitEvent(DamageReduction, U, EVENT_UNIT_HERO_LEVEL)
call TriggerRegisterUnitEvent(Finish, u, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Finish, Condition(function Finish_Conditions))
//Periodic
call TriggerRegisterTimerEvent(Every03, .03, true)
call TriggerAddAction(Every03, function CameraConstants)
set Camera = TriggerAddAction(Every03, function camera)
call DisableTrigger(Every03)
/*
I did this to avoid yet another one of Wc3's bugs.
From testing it appears that if a trigger is running
an if function with waits to wait for the next if
condition to be excecuted, actions can't be added with
wait before it in a seperate trigger. Strange...
It's what I experienced when trying this in the
SkipCinematic trigger anyway. Even when I
tried to run it in a seperate function
with a 'call'.
It's what happned with these functions anyway.
I don't know about any other.
*/
//Death
call TriggerAddAction(Defeat, function defeat)
call TriggerAddAction(Victory, function victory)
call TriggerRegisterUnitEvent(Defeat, u, EVENT_UNIT_DEATH)
call TriggerRegisterUnitEvent(Victory, U, EVENT_UNIT_DEATH)
endfunction
function Quest takes boolean b, string t, string d, string i returns quest
local quest q = CreateQuest()
call QuestSetTitle(q, t)
call QuestSetDescription(q, d)
call QuestSetIconPath(q, i)
call QuestSetRequired(q, b)
call QuestSetDiscovered(q, true)
call QuestSetCompleted(q, false)
return q
endfunction
function Initialization takes nothing returns nothing
local quest q
local sound s = CreateMIDISound("AshenvaleDay", 20, 20)
local unit u = m
local unit U = M
call SetUnitColor(C , ConvertPlayerColor(12))
call SetUnitColor(c , ConvertPlayerColor(12))
call StartSound(s)
call PlayMusic("izna - Alice Trial.mp3")
call SetMusicVolume(0)
set s = null
call CameraSetSmoothingFactor(.12)
call EnableWorldFogBoundary(false)
call AddUnitAnimationProperties(U, "despite", false)
call SetUnitAnimation(u, "decay flesh")
call SetDestructableAnimation(d, "death")
call SetSkyModel("Environment\\Sky\\FoggedSky\\FoggedSky.mdl")
call EnableMinimapFilterButtons(false, false)
call EnableSelect(false, false)
call EnableDragSelect(false, false)
call EnablePreSelect(false, false)
call SetDoodadAnimationRect(G, 'D024', "hide", false)
call SetPlayerAlliance(Player(0), Player(11), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(0), Player(6), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(6), Player(0), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(6), Player(11), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(11), Player(0), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(11), Player(6), ALLIANCE_PASSIVE, true)
call FogMaskEnable(false)
call SetCameraPosition(2181.98, -2723.99)
call SetCameraField(CAMERA_FIELD_ZOFFSET, 0, 0)
call SetCameraField(CAMERA_FIELD_ROTATION, 112, 0)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, 319.6, 0)
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 658, 0)
call SetCameraField(CAMERA_FIELD_ROLL, 0, 0)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 70, 0)
call SetCameraField(CAMERA_FIELD_FARZ, 4000, 0)
call ShowInterface(false, 0)
call EnableUserControl(false)
call SetPlayerState(Player(6), PLAYER_STATE_RESOURCE_GOLD, 382)
call BlendFilter(1.21, 100, 100, 100, 255, 255, 76, 90, 210)
call SetUnitVertexColor(A, 0, 110, 90, 0)
call SetUnitVertexColor(U, 0, 110, 90, 0)
call SetPlayerAbilityAvailable(Player(6), 'A001', false)
call UnitRemoveAbility(u, 'Amrf')
call SetUnitAbilityLevel(U,'A000', 7)
set U = null
call SetUnitAbilityLevel(u,'A000', 7)
set u = null
call Quest(true, "Difficualty", "If you aren't doing to well on normal difficulty(the default difficulty) then switch the difficulty with ability that you are given before the start of your match. It is removed when your match begins.", "ReplaceableTextures\\CommandButtons\\BTNShadowPact.blp")
call Quest(true, "Tips", "This map was created to be made for you to experiment with how to beat your enemy. Lots of practice and theorizing may be needed if you want to be able to beat the hard difficulty. This map is well customized so don't expect the gameplay to be totally predictable and bland at first sight of playing.", "ReplaceableTextures\\CommandButtons\\BTNBansheeAdept.blp")
set q = Quest(false, "Credits", "Hellish Hybrid:|nAxeInGround|n|nFrom The Ultimate Terraining Map 3.0:|nBarrensTree0, BarrensTree1, Custom Rocks, plants|n|nUncle Fester:|nManDrake|n|nDraknyte1:|nPile Of Wood|n|nMc !:|nPlantCrate|n|nCavman:|nSpiderCook|n|nBuster:|nWaterfall FX|n|nBorn²Modificate|nFarns, Fences, newbushes|n|nBlizzard:|nhighresbarrenstree, Azsharas", "ReplaceableTextures\\CommandButtons\\BTNRegenerationAura.blp")
call QuestItemSetDescription(QuestCreateItem(q), "Map Creator: DeathChef")
call QuestItemSetDescription(QuestCreateItem(q), "Enemy Model(butchergirl2): Pyramidhe@d")
call QuestItemSetDescription(QuestCreateItem(q), "Music(Alice Trial): izna")
call QuestItemSetDescription(QuestCreateItem(q), "Terrain art models below")
set q = Quest(false, "Contact", "Also if you are into this map enough and want your name heard for being victorias on hard difficulty contact me with your replay. As sending me a replay would be the only way to officially prove that you did what you did with you doing it with the original map. Your score will be uploaded to the leaderboard if approved. The leaderboard will be apart of this maps description back at the Hive Workshops map section and will consist of a top 10. You may only have one score recorded(your top) that is submitted. If the map is updated with updates that may effect the gameplay the old learderboard will be locked and will open a new one for the new version of this map. Remember, I will be able to tell if you didn't set it on hard difficulty! Enjoy. :)", "ReplaceableTextures\\CommandButtons\\BTNUltravision.blp")
call QuestItemSetDescription(QuestCreateItem(q), "Forum Home: hiveworkshop.com")
call QuestItemSetDescription(QuestCreateItem(q), "Email: [email protected]")
call Quest(true, "Story", "You started off in a forest, being bashed into a wooden fence, being knocked unconscious. You then remember how it happened with a vivid image of an attack, haunting you. You realize some text behind you, reading it. It saying something about you being in an arena, realizing that you where in a kill or die situation. You slay your enemy. The day has past(as you though think). You end up being knocked back into the same position with the same memory taunting you. Although the text behind you seemed updated as although you where meant to come back! Now you have to prove again to be worthy to be alive again!", "ReplaceableTextures\\CommandButtons\\BTNSpellBookBLS.blp")
set q = Quest(false, "History", "Update from v2.0 to v2.0a|n- Minor pathing issues fixed|n- Minor terrain polishing|n- Thew useless model deletions|n- Text shows when you beat hard difficulty", "ReplaceableTextures\\CommandButtons\\BTNStaffOfTeleportation.blp")
call QuestItemSetDescription(QuestCreateItem(q), "Grammatical errors fixes")
call InitTriggers()
endfunction
function function_bj_FORCE_PLAYER takes nothing returns nothing
local integer i = 0
loop
call DestroyForce(bj_FORCE_PLAYER[i])
exitwhen i == 15
set i = i + 1
endloop
endfunction
function Initglobals takes nothing returns nothing
set AI = CreateTimer()
set IntervallTimer = CreateTimer()
set d = CreateDeadDestructableZ('B005', 1984, - 1152, 56.1, 170.537, 1.198, 0)
//2222, -2670
//-992, -992, 992, 992
set G = Rect(1230, -3662, 3214, 1678)
set l[0] = Rect(2112, -2624, 2240, -2496)
set l[1] = Rect(2240, -2688, 2688, -2144)
set l[2] = Rect(2208, -2656, 2240, -2624)
set l[3] = Rect(2304, -2976, 2336, -2944)
set l[4] = Rect(2272, -3008, 2336, -2976)
set l[5] = Rect(2336, -3520, 2976, -2880)
set l[6] = Rect(2368, -2880, 2432, -2816)
set l[7] = Rect(1152, -3584, 2336, -3040)
set l[8] = Rect(1152, -2496, 2240, -2144)
set l[9] = Rect(1152, -3040, 1568, -2496)
set FadeUnit = CreateTrigger()
set Cinematic = CreateTrigger()
set SkipCinematic = CreateTrigger()
set BeginMatch = CreateTrigger()
set BeginCast = CreateTrigger()
set DamageReduction = CreateTrigger()
set Finish = CreateTrigger()
set DefendOffPushAway = CreateTrigger()
set Defeat = CreateTrigger()
set Victory = CreateTrigger()
set GainALevel = CreateTrigger()
set Every03 = CreateTrigger()
set Inter = function Intervall
set InterSmall = function IntervallSmall
set A = CreateUnit(Player(15), 'e002', 2331.2, - 3085.6, 291.61)
set c = CreateUnit(Player(0) , 'e004' , 1160.1 , - 2705.9 , 256.13)
set C = CreateUnit(Player(0) , 'e004' , 1159.6 , - 2705.7 , 256.13)
set m = CreateUnit(Player(6), 'E000', 2058.4, - 2724.3, 328.49)
set M = CreateUnit(Player(11), 'E001', 2223.7, - 2734.5, 244.76)
set R[0] = CreateUnit(Player(6), 'n010', 0, 0, 0)
set R[1] = CreateUnit(Player(15), 'n011', 0, 0, 0)
set R[2] = CreateUnit(Player(6), 'n012', 0, 0, 0)
set strength[0] = 35
set strength[1] = 28
set strength[2] = 22
set agility[0] = 15
set agility[1] = 17
set agility[2] = 20
set intelligence[0] = 16
set intelligence[1] = 18
set intelligence[2] = 21
set Strength[0] = 7
set Strength[1] = 12
set Strength[2] = 15
set Agility[0] = 14
set Agility[1] = 17
set Agility[2] = 23
set xp[0] = 1.2
set xp[1] = 1.1
set xp[2] = 1
set XP[0] = .9
set XP[1] = 1.1
set XP[2] = 1.3
set h = CreateSound("izna - Alice Trial.mp3", false, false, false, 8, 12, "KotoDrumsEAX")
set filterIssueHauntOrderAtLocBJ = null
set filterEnumDestructablesInCircleBJ = null
set filterGetUnitsInRectOfPlayer = null
set filterGetUnitsOfTypeIdAll = null
set filterGetUnitsOfPlayerAndTypeId = null
set filterMeleeTrainedUnitIsHeroBJ = null
set filterLivingPlayerUnitsOfTypeId = null
set bj_cineModePriorSpeed = null
call KillSoundWhenDone(bj_questCompletedSound)
call KillSoundWhenDone(bj_questDiscoveredSound)
call KillSoundWhenDone(bj_questFailedSound)
call KillSoundWhenDone(bj_questHintSound)
call KillSoundWhenDone(bj_questItemAcquiredSound)
call KillSoundWhenDone(bj_questSecretSound)
call KillSoundWhenDone(bj_questCompletedSound)
call KillSoundWhenDone(bj_questWarningSound)
call KillSoundWhenDone(bj_rescueSound)
call RemoveRect(bj_mapInitialPlayableArea)
call RemoveRect(bj_mapInitialCameraBounds)
call DestroyForce(bj_FORCE_ALL_PLAYERS)
call DestroyTimer(bj_stockUpdateTimer)
call DestroyTimer(bj_gameStartedTimer)
call DestroyTrigger(bj_delayedSuspendDecayTrig)
call DestroyTrigger(bj_queuedExecTimeout)
call DestroyTrigger(bj_dncSoundsDawn)
call DestroyTrigger(bj_dncSoundsDusk)
call DestroyTrigger(bj_dncSoundsDay)
call DestroyTrigger(bj_dncSoundsNight)
call DestroyTrigger(bj_stockItemPurchased)
call function_bj_FORCE_PLAYER()
call Initialization()
endfunction
endlibrary
Name | Type | is_array | initial_value |