//TESH.scrollpos=31
//TESH.alwaysfold=0
// Uh. I am lazy to type in GetRectCenterX for each time I use it.
// My cinematic is actually EXCEEDINGLY inefficient. Call 4 functions each time I use Slide or Walk LOL.
// Which is a lot of times.
function GRX takes rect r returns real
return GetRectCenterX( r )
endfunction
function GRY takes rect r returns real
return GetRectCenterY( r )
endfunction
// Incase I type in lower case accidentally and CBF backspace.
function grx takes rect r returns real
return GetRectCenterX( r )
endfunction
function gry takes rect r returns real
return GetRectCenterY( r )
endfunction
// Do I even use this?
function z255ToPercent takes real rea returns real
return rea / 2.55
endfunction
// For "MISS!".
function QTT takes string Message, real x, real y, real angle, real dur, real size returns nothing
local texttag tt = CreateTextTag()
local real vel = 90 * 0.071 / 128
local real xvel = vel * Cos( angle )
local real yvel = vel * Sin( angle )
call SetTextTagText( tt, Message, size * 0.0023 )
call SetTextTagPos( tt, x, y, 0 )
call SetTextTagPermanent( tt, false )
call SetTextTagVelocity( tt, xvel, yvel )
call SetTextTagFadepoint( tt, dur - 0.50 )
call SetTextTagLifespan( tt, dur )
set tt = null
endfunction
// THE ACTUAL CNIEMATIC SYSTEM.
// ****************************************************************************
// **
// ** CALIBRATION FUNCTIONS
// **
// ****************************************************************************
constant function ScriptSystemPeriod takes nothing returns real
return 0.02
endfunction
constant function ParticlePeriod takes nothing returns real
return 0.025
endfunction
constant function CameraPeriod takes nothing returns real
return 0.02
endfunction
constant function FadeFilterUnit takes nothing returns integer
return 'e000'
endfunction
// ****************************************************************************
// **
// ** GENERAL AND MISCELANEOUS FUNCTIONS
// **
// ****************************************************************************
function H2S takes handle h returns string
return I2S(GetHandleId(h))
endfunction
function GC takes nothing returns gamecache
if udg_cinS_GC == null then
call FlushGameCache(InitGameCache( "CinemaCache" ))
set udg_cinS_GC = InitGameCache( "CinemaCache" )
endif
return udg_cinS_GC
endfunction
function MakeUnitFlyable takes unit u returns nothing
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
endfunction
function ActorAssign takes unit u, integer actID returns nothing
call SetUnitUserData(u, actID)
call MakeUnitFlyable(u)
set udg_cinS_actor[actID] = u
set udg_cinS_act_colourR[actID] = 100.0
set udg_cinS_act_colourG[actID] = 100.0
set udg_cinS_act_colourB[actID] = 100.0
set udg_cinS_act_colourA[actID] = 100.0
endfunction
function ActorCreate takes player p, integer actID, integer unitType returns unit
local unit u = CreateUnit(p, unitType, 0.0, 0.0, 0.0)
call ActorAssign(u, actID)
return u
endfunction
function InitCinematicSystem takes nothing returns nothing
set udg_cinS_tempPoint=Location(0.0,0.0)
call ExecuteFunc("ScriptSystemInit")
call ExecuteFunc("CameraSystemInit")
call ExecuteFunc("ParticleInit")
call ExecuteFunc("SubtitlesInit")
endfunction
// ****************************************************************************
// **
// ** CAMERA SYSTEM
// **
// ****************************************************************************
function CinematicCameraEnable takes nothing returns nothing
call EnableTrigger(udg_cinS_cam_trigger)
endfunction
function CinematicCameraDisable takes nothing returns nothing
call DisableTrigger(udg_cinS_cam_trigger)
endfunction
function SetCameraZ takes real z returns nothing
//thanks to ToadCop for this function
set z = GetCameraField(CAMERA_FIELD_ZOFFSET)+z-GetCameraTargetPositionZ()
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,- 0.01)
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,0.01)
endfunction
function CameraMainLoop takes nothing returns nothing
local real array s
local location stupid = udg_cinS_tempPoint
local integer i = 0
local real ovrFactor
// camera motion
loop
exitwhen i == 18
set i = i + 1
set udg_cinS_cam_time[i] = udg_cinS_cam_time[i] + CameraPeriod()
set s[i] = udg_cinS_cam_startval[i] + ( udg_cinS_cam_startvel[i] * udg_cinS_cam_time[i] ) + ( udg_cinS_cam_accprim[i] * udg_cinS_cam_time[i] * udg_cinS_cam_time[i] / 2 )
if i > 3 and i < 7 then
loop
if s[i] > 360 then
set s[i] = s[i] - 360
elseif s[i] < 0 then
set s[i] = s[i] + 360
else
exitwhen true
endif
endloop
endif
if udg_cinS_cam_time[i] + CameraPeriod() >= udg_cinS_cam_endtime[i] then
if udg_cinS_cam_accsec[i] != 0 then
set udg_cinS_cam_startvel[i] = udg_cinS_cam_startvel[i] + ( udg_cinS_cam_accprim[i] * udg_cinS_cam_time[i] )
set udg_cinS_cam_accprim[i] = udg_cinS_cam_accsec[i]
set udg_cinS_cam_startval[i] = s[i]
set udg_cinS_cam_time[i] = 0.0
set udg_cinS_cam_accsec[i] = 0.0
else
if i>9 then
set udg_cinS_cam_startvel[i] = 0.0
set udg_cinS_cam_startval[i] = s[i]
set udg_cinS_cam_time[i] = 0.0
endif
endif
endif
endloop
// camera lock-to-unit override
if udg_cinS_cam_OvRxyzUnitPrim!=null or udg_cinS_cam_OvRxyzUnitSec!=null then
set udg_cinS_cam_OvRxyzTime = udg_cinS_cam_OvRxyzTime + CameraPeriod()
if udg_cinS_cam_OvRxyzTime > udg_cinS_cam_OvRxyzEndtime then
set udg_cinS_cam_OvRxyzTime = udg_cinS_cam_OvRxyzEndtime
endif
set ovrFactor = udg_cinS_cam_OvRxyzTime/udg_cinS_cam_OvRxyzEndtime
if udg_cinS_cam_OvRxyzSmooth then
set ovrFactor = (1.0 - Cos(ovrFactor*bj_PI)) / 2
endif
call MoveLocation(stupid, GetUnitX(udg_cinS_cam_OvRxyzUnitPrim),GetUnitY(udg_cinS_cam_OvRxyzUnitPrim))
set s[19] = GetLocationZ(stupid)
call MoveLocation(stupid, GetUnitX(udg_cinS_cam_OvRxyzUnitSec),GetUnitY(udg_cinS_cam_OvRxyzUnitSec))
set s[20] = GetLocationZ(stupid)
if udg_cinS_cam_OvRxyzUnitSec==null then //going from null to unit
set s[1] = s[1]*(1-ovrFactor) + (GetUnitX(udg_cinS_cam_OvRxyzUnitPrim)+udg_cinS_cam_OvRoffset[1])*ovrFactor
set s[2] = s[2]*(1-ovrFactor) + (GetUnitY(udg_cinS_cam_OvRxyzUnitPrim)+udg_cinS_cam_OvRoffset[2])*ovrFactor
set s[3] = s[3]*(1-ovrFactor) + (s[19]+GetUnitFlyHeight(udg_cinS_cam_OvRxyzUnitPrim)+udg_cinS_cam_OvRoffset[3])*ovrFactor
elseif udg_cinS_cam_OvRxyzUnitPrim==null then //going from unit to null
set s[1] = s[1]*ovrFactor + (GetUnitX(udg_cinS_cam_OvRxyzUnitSec)+udg_cinS_cam_OvRoffset[7])*(1.0-ovrFactor)
set s[2] = s[2]*ovrFactor + (GetUnitY(udg_cinS_cam_OvRxyzUnitSec)+udg_cinS_cam_OvRoffset[8])*(1.0-ovrFactor)
set s[3] = s[3]*ovrFactor + (s[20]+GetUnitFlyHeight(udg_cinS_cam_OvRxyzUnitSec)+udg_cinS_cam_OvRoffset[9])*(1.0-ovrFactor)
else //going from unit to unit
set s[1] = (GetUnitX(udg_cinS_cam_OvRxyzUnitSec)+udg_cinS_cam_OvRoffset[7])*(1-ovrFactor) + (GetUnitX(udg_cinS_cam_OvRxyzUnitPrim)+udg_cinS_cam_OvRoffset[1])*ovrFactor
set s[2] = (GetUnitY(udg_cinS_cam_OvRxyzUnitSec)+udg_cinS_cam_OvRoffset[8])*(1-ovrFactor) + (GetUnitY(udg_cinS_cam_OvRxyzUnitPrim)+udg_cinS_cam_OvRoffset[2])*ovrFactor
set s[3] = (s[20]+GetUnitFlyHeight(udg_cinS_cam_OvRxyzUnitSec)+udg_cinS_cam_OvRoffset[9])*(1-ovrFactor) + (s[19]+GetUnitFlyHeight(udg_cinS_cam_OvRxyzUnitPrim)+udg_cinS_cam_OvRoffset[3])*ovrFactor
endif
if udg_cinS_cam_OvRxyzTime == udg_cinS_cam_OvRxyzEndtime then
if udg_cinS_cam_OvRxyzUnitPrim==null then
set udg_cinS_cam_OvRxyzUnitSec = null
endif
endif
endif
// camera face-to-unit override
if udg_cinS_cam_OvRangUnitPrim!=null or udg_cinS_cam_OvRangUnitSec!=null then
set udg_cinS_cam_OvRangTime = udg_cinS_cam_OvRangTime + CameraPeriod()
if udg_cinS_cam_OvRangTime > udg_cinS_cam_OvRangEndtime then
set udg_cinS_cam_OvRangTime = udg_cinS_cam_OvRangEndtime
endif
set ovrFactor = udg_cinS_cam_OvRangTime/udg_cinS_cam_OvRangEndtime
if udg_cinS_cam_OvRangSmooth then
set ovrFactor = (1.0 - Cos(ovrFactor*bj_PI)) / 2
endif
call MoveLocation(stupid, GetUnitX(udg_cinS_cam_OvRangUnitPrim),GetUnitY(udg_cinS_cam_OvRangUnitPrim))
set s[19] = GetLocationZ(stupid)
call MoveLocation(stupid, GetUnitX(udg_cinS_cam_OvRangUnitSec),GetUnitY(udg_cinS_cam_OvRangUnitSec))
set s[20] = GetLocationZ(stupid)
if udg_cinS_cam_OvRangUnitPrim!=null then
set s[21]=(GetUnitX(udg_cinS_cam_OvRangUnitPrim)+udg_cinS_cam_OvRoffset[4])-s[1]
set s[22]=(GetUnitY(udg_cinS_cam_OvRangUnitPrim)+udg_cinS_cam_OvRoffset[5])-s[2]
set s[23]=(s[19]+GetUnitFlyHeight(udg_cinS_cam_OvRangUnitPrim)+udg_cinS_cam_OvRoffset[6])-s[3]
set s[24]=Atan2(s[22], s[21]) * bj_RADTODEG
set s[25]=Atan2(s[23], SquareRoot(s[21]*s[21]+s[22]*s[22])) * bj_RADTODEG
else
set s[24]=s[4]
set s[25]=s[5]
endif
if udg_cinS_cam_OvRangUnitSec!=null then
set s[21]=(GetUnitX(udg_cinS_cam_OvRangUnitSec)+udg_cinS_cam_OvRoffset[10])-s[1]
set s[22]=(GetUnitY(udg_cinS_cam_OvRangUnitSec)+udg_cinS_cam_OvRoffset[11])-s[2]
set s[23]=(s[20]+GetUnitFlyHeight(udg_cinS_cam_OvRangUnitSec)+udg_cinS_cam_OvRoffset[12])-s[3]
set s[26]=Atan2(s[22], s[21]) * bj_RADTODEG
set s[27]=Atan2(s[23], SquareRoot(s[21]*s[21]+s[22]*s[22])) * bj_RADTODEG
else
set s[26]=s[4]
set s[27]=s[5]
endif
if (s[26] - s[24]) > 180 then
set s[24] = s[24] + 360
elseif (s[26] - s[24]) < -180 then
set s[24] = s[24] - 360
endif
set s[4] = ovrFactor * s[24] + (1-ovrFactor) * s[26]
if (s[27] - s[25]) > 180 then
set s[25] = s[25] + 360
elseif (s[27] - s[25]) < -180 then
set s[25] = s[25] - 360
endif
set s[5] = ovrFactor * s[25] + (1-ovrFactor) * s[27]
if udg_cinS_cam_OvRangTime == udg_cinS_cam_OvRangEndtime then
if udg_cinS_cam_OvRangUnitPrim==null then
set udg_cinS_cam_OvRangUnitSec = null
endif
endif
endif
if s[9]<100.0 then
set s[9]=100.0
endif
// camera fade filter unit
if s[18]>0 then
set s[23]=Sin(s[5]*bj_DEGTORAD)
set s[20]=Cos(s[5]*bj_DEGTORAD)
set s[21]=Cos(s[4]*bj_DEGTORAD)*s[20]
set s[22]=Sin(s[4]*bj_DEGTORAD)*s[20]
set s[19]=(s[9]-128.0)
set s[20]=Tan(s[7]*bj_DEGTORAD/2) *40
set s[21]=s[1]-s[19]*s[21]
set s[22]=s[2]-s[19]*s[22]
set s[23]=s[3]-s[19]*s[23]
call MoveLocation(stupid, s[21], s[22])
set s[23]=s[23]-GetLocationZ(stupid)
call SetUnitX(udg_cinS_cam_fadeUnit, s[21])
call SetUnitY(udg_cinS_cam_fadeUnit, s[22])
call SetUnitFlyHeight(udg_cinS_cam_fadeUnit, s[23], 0.0)
call SetUnitScale(udg_cinS_cam_fadeUnit, s[20],s[20],s[20])
endif
call PanCameraToTimed( s[1], s[2], 0.0 )
call MoveLocation(stupid, s[1], s[2])
if udg_cinS_cam_ignoreTerrain then
call SetCameraZ(s[3])
else
call SetCameraField( CAMERA_FIELD_ZOFFSET, s[3]-GetLocationZ(stupid), 0.00 )
endif
call SetCameraField( CAMERA_FIELD_ROTATION, s[4], 0.00 )
call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, s[5], 0.00 )
call SetCameraField( CAMERA_FIELD_ROLL, s[6], 0.00 )
call SetCameraField( CAMERA_FIELD_FIELD_OF_VIEW, s[7], 0.00 )
call SetCameraField( CAMERA_FIELD_FARZ, s[8], 0.00 )
call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, s[9], 0.00 )
call SetUnitVertexColor(udg_cinS_cam_fadeUnit, R2I(s[15]*256), R2I(s[16]*256), R2I(s[17]*256), R2I(s[18]*256))
call SetTerrainFogEx(0, s[10], s[11], 0.0, s[12], s[13], s[14])
set stupid = null
endfunction
function CameraStatChangeLin takes integer stat, real endvalue, real time returns nothing
local real startvalue = udg_cinS_cam_startval[stat] + ( udg_cinS_cam_startvel[stat] * udg_cinS_cam_time[stat] ) + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] * udg_cinS_cam_time[stat] / 2 )
set udg_cinS_cam_startval[stat] = startvalue
set udg_cinS_cam_startvel[stat] = (endvalue - startvalue)/time
set udg_cinS_cam_accprim[stat] = 0.0
set udg_cinS_cam_accsec[stat] = 0.0
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = time
endfunction
function CameraStatChangeLinRad takes integer stat, real endvalue, real time returns nothing
local real startvalue = udg_cinS_cam_startval[stat] + ( udg_cinS_cam_startvel[stat] * udg_cinS_cam_time[stat] ) + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] * udg_cinS_cam_time[stat] / 2 )
local real distance = endvalue - startvalue
local real velocity1 = distance/time
local real velocity2 = -( RSignBJ(distance) * (360 - RAbsBJ(distance)) )/time
set udg_cinS_cam_startval[stat] = startvalue
if RAbsBJ(velocity1) < RAbsBJ(velocity2) then
set udg_cinS_cam_startvel[stat] = velocity1
else
set udg_cinS_cam_startvel[stat] = velocity2
endif
set udg_cinS_cam_accprim[stat] = 0.0
set udg_cinS_cam_accsec[stat] = 0.0
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = time
endfunction
function CameraStatChange takes integer stat, real endvalue, real time returns nothing
local real startvalue = udg_cinS_cam_startval[stat] + ( udg_cinS_cam_startvel[stat] * udg_cinS_cam_time[stat] ) + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] * udg_cinS_cam_time[stat] / 2 )
local real startvelocity = udg_cinS_cam_startvel[stat] + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] )
local real distance = endvalue - startvalue
local real accel = 2 * ( distance - startvelocity * time ) / ( time * time )
set udg_cinS_cam_startval[stat] = startvalue
set udg_cinS_cam_startvel[stat] = startvelocity
set udg_cinS_cam_accprim[stat] = accel
set udg_cinS_cam_accsec[stat] = 0.0
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = time
endfunction
function CameraStatChangeRad takes integer stat, real endvalue, real time returns nothing
local real startvalue = udg_cinS_cam_startval[stat] + ( udg_cinS_cam_startvel[stat] * udg_cinS_cam_time[stat] ) + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] * udg_cinS_cam_time[stat] / 2 )
local real startvelocity = udg_cinS_cam_startvel[stat] + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] )
local real distance = endvalue - startvalue
local real accel1 = 2 * ( distance - startvelocity * time ) / ( time * time )
local real accel2 = 2 * ( -( RSignBJ(distance) * (360 - RAbsBJ(distance)) ) - startvelocity * time ) / ( time * time )
set udg_cinS_cam_startval[stat] = startvalue
set udg_cinS_cam_startvel[stat] = startvelocity
if RAbsBJ(accel1) < RAbsBJ(accel2) then
set udg_cinS_cam_accprim[stat] = accel1
else
set udg_cinS_cam_accprim[stat] = accel2
endif
set udg_cinS_cam_accsec[stat] = 0.0
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = time
endfunction
function CameraStatChangeAdv takes integer stat, real endvalue, real endvelocity, real time returns nothing
local real startvalue = udg_cinS_cam_startval[stat] + ( udg_cinS_cam_startvel[stat] * udg_cinS_cam_time[stat] ) + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] * udg_cinS_cam_time[stat] / 2 )
local real startvelocity = udg_cinS_cam_startvel[stat] + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] )
local real distance = endvalue - startvalue
local real accel1 = 4 * ( distance ) / ( time * time ) - ( endvelocity + 3 * startvelocity ) / time
local real accel2 = ( 3 * endvelocity + startvelocity ) / time - 4 * ( distance ) / ( time * time )
set udg_cinS_cam_startval[stat] = startvalue
set udg_cinS_cam_startvel[stat] = startvelocity
set udg_cinS_cam_accprim[stat] = accel1
set udg_cinS_cam_accsec[stat] = accel2
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = time/2
endfunction
function CameraStatChangeAdvRad takes integer stat, real endvalue, real endvelocity, real time returns nothing
local real startvalue = udg_cinS_cam_startval[stat] + ( udg_cinS_cam_startvel[stat] * udg_cinS_cam_time[stat] ) + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] * udg_cinS_cam_time[stat] / 2 )
local real startvelocity = udg_cinS_cam_startvel[stat] + ( udg_cinS_cam_accprim[stat] * udg_cinS_cam_time[stat] )
local real distance = endvalue - startvalue
local real accel1 = 4 * ( distance ) / ( time * time ) - ( endvelocity + 3 * startvelocity ) / time
local real accel2 = ( 3 * endvelocity + startvelocity ) / time - 4 * ( distance ) / ( time * time )
local real accel3 = 4 * ( -( RSignBJ(distance) * (360 - RAbsBJ(distance)) ) ) / ( time * time ) - ( endvelocity + 3 * startvelocity ) / time
local real accel4 = ( 3 * endvelocity + startvelocity ) / time - 4 * ( -( RSignBJ(distance) * (360 - RAbsBJ(distance)) ) ) / ( time * time )
set udg_cinS_cam_startval[stat] = startvalue
set udg_cinS_cam_startvel[stat] = startvelocity
if (RAbsBJ(accel3) + RAbsBJ(accel4)) > (RAbsBJ(accel1) + RAbsBJ(accel2)) then
set udg_cinS_cam_accprim[stat] = accel1
set udg_cinS_cam_accsec[stat] = accel2
else
set udg_cinS_cam_accprim[stat] = accel3
set udg_cinS_cam_accsec[stat] = accel4
endif
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = time/2
endfunction
function CameraLockToUnitOverride takes unit u, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
set udg_cinS_cam_OvRxyzUnitSec = udg_cinS_cam_OvRxyzUnitPrim
set udg_cinS_cam_OvRxyzUnitPrim = u
set udg_cinS_cam_OvRxyzSmooth = smooth
set udg_cinS_cam_OvRoffset[7]=udg_cinS_cam_OvRoffset[1]
set udg_cinS_cam_OvRoffset[8]=udg_cinS_cam_OvRoffset[2]
set udg_cinS_cam_OvRoffset[9]=udg_cinS_cam_OvRoffset[3]
set udg_cinS_cam_OvRoffset[1]=xoff
set udg_cinS_cam_OvRoffset[2]=yoff
set udg_cinS_cam_OvRoffset[3]=zoff
set udg_cinS_cam_OvRxyzTime = 0.0
set udg_cinS_cam_OvRxyzEndtime = duration
endfunction
function CameraLockToUnitReset takes boolean smooth, real duration returns nothing
call CameraLockToUnitOverride(null, 0.0,0.0,0.0, smooth, duration)
endfunction
function CameraFaceToUnitOverride takes unit u, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
set udg_cinS_cam_OvRangUnitSec = udg_cinS_cam_OvRangUnitPrim
set udg_cinS_cam_OvRangUnitPrim = u
set udg_cinS_cam_OvRangSmooth = smooth
set udg_cinS_cam_OvRoffset[10]=udg_cinS_cam_OvRoffset[4]
set udg_cinS_cam_OvRoffset[11]=udg_cinS_cam_OvRoffset[5]
set udg_cinS_cam_OvRoffset[12]=udg_cinS_cam_OvRoffset[6]
set udg_cinS_cam_OvRoffset[4]=xoff
set udg_cinS_cam_OvRoffset[5]=yoff
set udg_cinS_cam_OvRoffset[6]=zoff
set udg_cinS_cam_OvRangTime = 0.0
set udg_cinS_cam_OvRangEndtime = duration
endfunction
function CameraFaceToUnitReset takes boolean smooth, real duration returns nothing
call CameraFaceToUnitOverride(null, 0.0,0.0,0.0, smooth, duration)
endfunction
function ApplyCameraInstantly takes camerasetup whichSetup returns nothing
local integer i = 0
set udg_cinS_cam_startval[1] = CameraSetupGetDestPositionX( whichSetup )
set udg_cinS_cam_startval[2] = CameraSetupGetDestPositionY( whichSetup )
call MoveLocation(udg_cinS_tempPoint, CameraSetupGetDestPositionX( whichSetup ), CameraSetupGetDestPositionY( whichSetup ))
set udg_cinS_cam_startval[3] = CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET) + GetLocationZ(udg_cinS_tempPoint)
set udg_cinS_cam_startval[4] = CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION )
set udg_cinS_cam_startval[5] = CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK )
set udg_cinS_cam_startval[6] = CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL )
set udg_cinS_cam_startval[7] = CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW )
set udg_cinS_cam_startval[8] = CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ )
set udg_cinS_cam_startval[9] = CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE )
loop
set i = i + 1
exitwhen i > 9
set udg_cinS_cam_startvel[i] = 0.0
set udg_cinS_cam_accprim[i] = 0.0
set udg_cinS_cam_accsec[i] = 0.0
set udg_cinS_cam_time[i] = 0.0
set udg_cinS_cam_endtime[i] = 0.0
endloop
endfunction
function ApplyCameraLinear takes camerasetup whichSetup, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
call CameraStatChangeLin(1, CameraSetupGetDestPositionX( whichSetup ), duration)
call CameraStatChangeLin(2, CameraSetupGetDestPositionY( whichSetup ), duration)
call MoveLocation(udg_cinS_tempPoint, CameraSetupGetDestPositionX( whichSetup ), CameraSetupGetDestPositionY( whichSetup ))
call CameraStatChangeLin(3, CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) + GetLocationZ(udg_cinS_tempPoint), duration)
call CameraStatChangeLinRad(4, CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ), duration)
call CameraStatChangeLinRad(5, CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ), duration)
call CameraStatChangeLinRad(6, CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ), duration)
call CameraStatChangeLin(7, CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ), duration)
call CameraStatChangeLin(8, CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ), duration)
call CameraStatChangeLin(9, CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ), duration)
endfunction
function ApplyCameraSmooth takes camerasetup whichSetup, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
call CameraStatChange(1, CameraSetupGetDestPositionX( whichSetup ), duration)
call CameraStatChange(2, CameraSetupGetDestPositionY( whichSetup ), duration)
call MoveLocation(udg_cinS_tempPoint, CameraSetupGetDestPositionX( whichSetup ), CameraSetupGetDestPositionY( whichSetup ))
call CameraStatChange(3, CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) + GetLocationZ(udg_cinS_tempPoint), duration)
call CameraStatChangeRad(4, CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ), duration)
call CameraStatChangeRad(5, CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ), duration)
call CameraStatChangeRad(6, CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ), duration)
call CameraStatChange(7, CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ), duration)
call CameraStatChange(8, CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ), duration)
call CameraStatChange(9, CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ), duration)
endfunction
function ApplyCameraSmoothStop takes camerasetup whichSetup, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
call CameraStatChangeAdv(1, CameraSetupGetDestPositionX( whichSetup ), 0.00, duration)
call CameraStatChangeAdv(2, CameraSetupGetDestPositionY( whichSetup ), 0.00, duration)
call MoveLocation(udg_cinS_tempPoint, CameraSetupGetDestPositionX( whichSetup ), CameraSetupGetDestPositionY( whichSetup ))
call CameraStatChangeAdv(3, CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) + GetLocationZ(udg_cinS_tempPoint), 0.00, duration)
call CameraStatChangeAdvRad(4, CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ), 0.00, duration)
call CameraStatChangeAdvRad(5, CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ), 0.00, duration)
call CameraStatChangeAdvRad(6, CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ), 0.00, duration)
call CameraStatChangeAdv(7, CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ), 0.00, duration)
call CameraStatChangeAdv(8, CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ), 0.00, duration)
call CameraStatChangeAdv(9, CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ), 0.00, duration)
endfunction
function ApplyFog takes real startZ, real endZ, real red, real green, real blue, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
call CameraStatChangeLin(10,startZ,duration)
call CameraStatChangeLin(11,endZ, duration)
call CameraStatChangeLin(12,red*0.01, duration)
call CameraStatChangeLin(13,green*0.01, duration)
call CameraStatChangeLin(14,blue*0.01, duration)
endfunction
function ApplyFade takes real red, real green, real blue, real opacity, real duration returns nothing
if duration < CameraPeriod() then
set duration = CameraPeriod()
endif
call CameraStatChangeLin(15,red*0.01, duration)
call CameraStatChangeLin(16,green*0.01, duration)
call CameraStatChangeLin(17,blue*0.01, duration)
call CameraStatChangeLin(18,opacity*0.01, duration)
endfunction
function CameraSystemInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventPeriodic( t, CameraPeriod() )
call TriggerAddAction( t, function CameraMainLoop )
set udg_cinS_cam_trigger = t
set t = null
call ApplyCameraInstantly( GetCurrentCameraSetup() )
call ApplyFog( 10000.0, 10000.0, 0.0,0.0,0.0, 0.0 )
set udg_cinS_cam_fadeUnit = CreateUnit(Player(12), FadeFilterUnit(), 0,0,0)
call MakeUnitFlyable(udg_cinS_cam_fadeUnit)
set udg_cinS_cam_ignoreTerrain = false
endfunction
// ****************************************************************************
// **
// ** PARTICLE SYSTEM
// **
// ****************************************************************************
function ParticleMove takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
local real h
local location stupid = udg_cinS_tempPoint
set udg_cinS_act_moveTime[i] = udg_cinS_act_moveTime[i] - ParticlePeriod()
set udg_cinS_act_moveX[i]=udg_cinS_act_moveX[i]+udg_cinS_act_moveVX[i]
set udg_cinS_act_moveY[i]=udg_cinS_act_moveY[i]+udg_cinS_act_moveVY[i]
if udg_cinS_act_moveAZ[i] != 0 then
set udg_cinS_act_moveVZ[i] = udg_cinS_act_moveVZ[i] + udg_cinS_act_moveAZ[i]
set udg_cinS_act_moveZ[i] = udg_cinS_act_moveZ[i] + udg_cinS_act_moveVZ[i]
call MoveLocation(stupid, udg_cinS_act_moveX[i],udg_cinS_act_moveY[i])
set h=udg_cinS_act_moveZ[i]-GetLocationZ(stupid)
call SetUnitFlyHeight( u, h, 0 )
if h <= 0.0 then
call GroupRemoveUnit(udg_cinS_act_groups[0], u)
set udg_cinS_act_moveZ[i] = 0.0
endif
elseif udg_cinS_act_moveTime[i]<=0.0 then
call GroupRemoveUnit(udg_cinS_act_groups[0], u)
endif
call SetUnitX(u,udg_cinS_act_moveX[i])
call SetUnitY(u,udg_cinS_act_moveY[i])
set stupid=null
set u = null
endfunction
function ParticleTurn takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
set udg_cinS_act_turnTime[i] = udg_cinS_act_turnTime[i] - ParticlePeriod()
set udg_cinS_act_turnFi[i] = udg_cinS_act_turnFi[i] + udg_cinS_act_turnVFi[i]
call SetUnitFacing( u, udg_cinS_act_turnFi[i] )
if udg_cinS_act_turnTime[i]<=0.0 then
call GroupRemoveUnit(udg_cinS_act_groups[1], u)
endif
set u = null
endfunction
function ParticleColour takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
set udg_cinS_act_colourTime[i] = udg_cinS_act_colourTime[i] - ParticlePeriod()
set udg_cinS_act_colourR[i] = udg_cinS_act_colourR[i] + udg_cinS_act_colourVR[i]
set udg_cinS_act_colourG[i] = udg_cinS_act_colourG[i] + udg_cinS_act_colourVG[i]
set udg_cinS_act_colourB[i] = udg_cinS_act_colourB[i] + udg_cinS_act_colourVB[i]
set udg_cinS_act_colourA[i] = udg_cinS_act_colourA[i] + udg_cinS_act_colourVA[i]
call SetUnitVertexColor(u, PercentTo255(udg_cinS_act_colourR[i]), PercentTo255(udg_cinS_act_colourG[i]), PercentTo255(udg_cinS_act_colourB[i]), PercentTo255(udg_cinS_act_colourA[i]))
if udg_cinS_act_colourTime[i]<=0.0 then
call GroupRemoveUnit(udg_cinS_act_groups[2], u)
endif
set u = null
endfunction
function ParticleSize takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
set udg_cinS_act_sizeTime[i] = udg_cinS_act_sizeTime[i] - ParticlePeriod()
set udg_cinS_act_sizeS[i] = udg_cinS_act_sizeS[i] + udg_cinS_act_sizeVS[i]
call SetUnitScale(u,udg_cinS_act_sizeS[i],udg_cinS_act_sizeS[i],udg_cinS_act_sizeS[i])
if udg_cinS_act_sizeTime[i]<=0.0 then
call GroupRemoveUnit(udg_cinS_act_groups[3], u)
endif
set u = null
endfunction
function ParticleMain takes nothing returns nothing
call GroupAddUnit(udg_cinS_act_groups[0], null)
call ForGroup(udg_cinS_act_groups[0], function ParticleMove )
call GroupAddUnit(udg_cinS_act_groups[1], null)
call ForGroup(udg_cinS_act_groups[1], function ParticleTurn )
call GroupAddUnit(udg_cinS_act_groups[2], null)
call ForGroup(udg_cinS_act_groups[2], function ParticleColour )
call GroupAddUnit(udg_cinS_act_groups[3], null)
call ForGroup(udg_cinS_act_groups[3], function ParticleSize )
endfunction
function UnitMove takes unit u, real destX, real destY, real duration, real g returns nothing
local real x = GetUnitX( u )
local real y = GetUnitY( u )
local integer i = GetUnitUserData( u )
local location stupid = udg_cinS_tempPoint
local real z
if duration < ParticlePeriod() then
set duration = ParticlePeriod()
endif
if g != 0 then
if udg_cinS_act_moveZ[i] == 0.0 then
call MoveLocation(stupid, x,y)
set z = GetLocationZ(stupid)
set udg_cinS_act_moveZ[i] = z
else
set z = udg_cinS_act_moveZ[i]
endif
call MoveLocation(stupid, destX, destY)
set z = GetLocationZ(stupid)-z
set udg_cinS_act_moveVZ[i] = ((g*duration/2)+(z/duration))*ParticlePeriod()
set udg_cinS_act_moveAZ[i] = (-g*ParticlePeriod()*ParticlePeriod())
else
set udg_cinS_act_moveAZ[i] = 0.0
endif
set udg_cinS_act_moveX[i] = x
set udg_cinS_act_moveY[i] = y
set udg_cinS_act_moveVX[i] = (destX - x)/duration*ParticlePeriod()
set udg_cinS_act_moveVY[i] = (destY - y)/duration*ParticlePeriod()
set udg_cinS_act_moveTime[i] = duration
call GroupAddUnit( udg_cinS_act_groups[0], u )
set stupid = null
endfunction
function UnitTurn takes unit u, real destAng, real duration, integer clockwise returns nothing
// input angle between 0.00 and 360.00 please
local real angle = GetUnitFacing(u)
local integer i = GetUnitUserData(u)
local real turnspeed
if duration < ParticlePeriod() then
set duration = ParticlePeriod()
endif
if clockwise > 0 and angle > destAng then
set destAng = destAng + 360.0
elseif clockwise < 0 and angle < destAng then
set destAng = destAng - 360.0
elseif clockwise == 0 then
if (angle - destAng) > 180 then
set destAng = destAng + 360
elseif (angle - destAng) < -180 then
set destAng = destAng - 360
endif
endif
set turnspeed = (destAng - angle)/duration*ParticlePeriod()
set udg_cinS_act_turnFi[i] = angle
set udg_cinS_act_turnVFi[i] = turnspeed
set udg_cinS_act_turnTime[i] = duration
call GroupAddUnit( udg_cinS_act_groups[1], u )
endfunction
function UnitColour takes unit u, real red, real green, real blue, real opacity, real duration returns nothing
local integer i = GetUnitUserData(u)
if duration < ParticlePeriod() then
set duration = ParticlePeriod()
endif
set red = red - udg_cinS_act_colourR[i]
set udg_cinS_act_colourVR[i] = red / duration * ParticlePeriod()
set green = green - udg_cinS_act_colourG[i]
set udg_cinS_act_colourVG[i] = green / duration * ParticlePeriod()
set blue = blue - udg_cinS_act_colourB[i]
set udg_cinS_act_colourVB[i] = blue / duration * ParticlePeriod()
set opacity = opacity - udg_cinS_act_colourA[i]
set udg_cinS_act_colourVA[i] = opacity / duration * ParticlePeriod()
set udg_cinS_act_colourTime[i] = duration
call GroupAddUnit( udg_cinS_act_groups[2], u )
endfunction
function UnitSize takes unit u, real size, real duration returns nothing
local integer i = GetUnitUserData(u)
if duration < ParticlePeriod() then
set duration = ParticlePeriod()
endif
set size = size - udg_cinS_act_sizeS[i]
set udg_cinS_act_sizeVS[i] = size / duration * ParticlePeriod()
set udg_cinS_act_sizeTime[i] = duration
call GroupAddUnit( udg_cinS_act_groups[3], u )
endfunction
function ParticleInit takes nothing returns nothing
local trigger t = CreateTrigger()
set udg_cinS_act_groups[0]=CreateGroup()
set udg_cinS_act_groups[1]=CreateGroup()
set udg_cinS_act_groups[2]=CreateGroup()
set udg_cinS_act_groups[3]=CreateGroup()
call TriggerRegisterTimerEventPeriodic( t, ParticlePeriod() )
call TriggerAddAction( t, function ParticleMain )
set t = null
endfunction
// ****************************************************************************
// **
// ** SUBTITLE ENGINE
// **
// ****************************************************************************
constant function DefaultCharWidth takes nothing returns real
return 1.56
endfunction
function DisplaySubtitle takes string line1 returns nothing
local string char
local integer i
local real charwidth
local real totalwidth
local gamecache g = GC()
set i = 0
set totalwidth = 0
loop
set char = SubString(line1, i, i+1)
exitwhen char == ""
if StringCase(char, false)==char then
set charwidth = GetStoredReal(g, "subtitles", "low"+char)
else
set charwidth = GetStoredReal(g, "subtitles", "upp"+char)
endif
if charwidth == 0.0 then
set charwidth = DefaultCharWidth()
endif
set totalwidth=totalwidth+charwidth
set i = i + 1
endloop
set i = R2I((50.0-totalwidth/2)/GetStoredReal(g, "subtitles", "low "))
set char = ""
loop
exitwhen i <= 3
set char=char+" "
set i = i-1
endloop
set line1=char+line1
// call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.25,0.0, 1000.0, line1)
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0.25, 0.0, 1000.0, "\n\n\n\n\n\n" + line1 + "\n\n\n\n\n\n\n\n\n\n\n\n")
set g = null
endfunction
function ClearSubtitles takes nothing returns nothing
call ClearTextMessages()
endfunction
function SubtitlesInit takes nothing returns nothing
local gamecache g=GC()
call StoreReal(g, "subtitles", "uppa", 2.06)
call StoreReal(g, "subtitles", "uppb", 1.62)
call StoreReal(g, "subtitles", "uppc", 1.83)
call StoreReal(g, "subtitles", "uppd", 1.93)
call StoreReal(g, "subtitles", "uppe", 1.53)
call StoreReal(g, "subtitles", "uppf", 1.22)
call StoreReal(g, "subtitles", "uppg", 2.04)
call StoreReal(g, "subtitles", "upph", 2.00)
call StoreReal(g, "subtitles", "uppi", 0.77)
call StoreReal(g, "subtitles", "uppj", 0.80)
call StoreReal(g, "subtitles", "uppk", 1.83)
call StoreReal(g, "subtitles", "uppl", 1.48)
call StoreReal(g, "subtitles", "uppm", 2.64)
call StoreReal(g, "subtitles", "uppn", 2.00)
call StoreReal(g, "subtitles", "uppo", 2.25)
call StoreReal(g, "subtitles", "uppp", 1.56)
call StoreReal(g, "subtitles", "uppq", 2.37)
call StoreReal(g, "subtitles", "uppr", 1.79)
call StoreReal(g, "subtitles", "upps", 1.56)
call StoreReal(g, "subtitles", "uppt", 1.51)
call StoreReal(g, "subtitles", "uppu", 1.87)
call StoreReal(g, "subtitles", "uppv", 1.83)
call StoreReal(g, "subtitles", "uppw", 2.82)
call StoreReal(g, "subtitles", "uppx", 2.04)
call StoreReal(g, "subtitles", "uppy", 1.79)
call StoreReal(g, "subtitles", "uppz", 1.79)
call StoreReal(g, "subtitles", "lowa", 1.51)
call StoreReal(g, "subtitles", "lowb", 1.59)
call StoreReal(g, "subtitles", "lowc", 1.47)
call StoreReal(g, "subtitles", "lowd", 1.62)
call StoreReal(g, "subtitles", "lowe", 1.59)
call StoreReal(g, "subtitles", "lowf", 0.98)
call StoreReal(g, "subtitles", "lowg", 1.76)
call StoreReal(g, "subtitles", "lowh", 1.59)
call StoreReal(g, "subtitles", "lowi", 0.65)
call StoreReal(g, "subtitles", "lowj", 0.77)
call StoreReal(g, "subtitles", "lowk", 1.47)
call StoreReal(g, "subtitles", "lowl", 0.68)
call StoreReal(g, "subtitles", "lowm", 2.27)
call StoreReal(g, "subtitles", "lown", 1.56)
call StoreReal(g, "subtitles", "lowo", 1.66)
call StoreReal(g, "subtitles", "lowp", 1.62)
call StoreReal(g, "subtitles", "lowq", 1.62)
call StoreReal(g, "subtitles", "lowr", 0.98)
call StoreReal(g, "subtitles", "lows", 1.26)
call StoreReal(g, "subtitles", "lowt", 1.00)
call StoreReal(g, "subtitles", "lowu", 1.59)
call StoreReal(g, "subtitles", "lowv", 1.59)
call StoreReal(g, "subtitles", "loww", 2.29)
call StoreReal(g, "subtitles", "lowx", 1.59)
call StoreReal(g, "subtitles", "lowy", 1.59)
call StoreReal(g, "subtitles", "lowz", 1.47)
call StoreReal(g, "subtitles", "low.", 0.51)
call StoreReal(g, "subtitles", "low,", 0.55)
call StoreReal(g, "subtitles", "low ", 0.80)
call StoreReal(g, "subtitles", "low-", 1.04)
set g = null
endfunction
// ****************************************************************************
// **
// ** SOUND ENGINE
// **
// ****************************************************************************
function AllocateSound takes string path, integer id, integer volume, real pitch returns nothing
endfunction
// ****************************************************************************
// **
// ** SCRIPT SYSTEM
// **
// ****************************************************************************
function PlayScene takes integer scene returns nothing
call StoreInteger( GC(), "Interpreter", "Scene", scene )
call StoreReal( GC(), "Interpreter", "SceneTime", 0.00 )
call StoreInteger( GC(), "Interpreter", "PendingAction", GetStoredInteger( GC(), "Scene"+I2S(scene), "FirstSpot" ) )
endfunction
function PlaySceneFromTime takes integer scene, real time returns nothing
local string s
local integer previous = GetStoredInteger( GC(), "Scene"+I2S(scene), "LastSpot" )
if time < 0.00 then
call BJDebugMsg( "User error: negative action time" )
return
endif
loop
set s = "S"+I2S(scene)+"A"+I2S(previous)
exitwhen time > GetStoredReal( GC(), s, "Time" )
set previous = GetStoredInteger( GC(), s, "PrevAction" )
endloop
call StoreInteger( GC(), "Interpreter", "Scene", scene )
call StoreReal( GC(), "Interpreter", "SceneTime", time )
// Commented out is original
call StoreInteger( GC(), "Interpreter", "PendingAction", GetStoredInteger( GC(), "Scene"+I2S(scene), "FirstSpot" ) )
//call StoreInteger( GC(), "Interpreter", "PendingAction", GetStoredInteger( GC(), "Scene"+I2S(scene), "FirstSpot" ) )
//call StoreInteger( GC(), "Interpreter", "PendingAction", GetStoredInteger( GC(), s, "NextAction" ) )
if udg_DEBUGMODE then
call BJDebugMsg( "Scene " + I2S( scene ) + " has been played from " + R2S( time ) + " / " + s )
endif
endfunction
function ScriptInterpreter takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local real time = GetStoredReal( g, "Interpreter", "SceneTime" ) + ScriptSystemPeriod()
local string s
if scene == 0 then
return
endif
loop
set s = "S"+I2S(scene)+"A"+I2S(action)
exitwhen time < GetStoredReal( g, s, "Time" )
if action == 0 then
return
endif
call ExecuteFunc( GetStoredString( g, s, "ActionType" ) )
if scene != GetStoredInteger( g, "Interpreter", "Scene" ) then
return
endif
set action = GetStoredInteger( g, s, "NextAction" )
call StoreInteger( g, "Interpreter", "PendingAction", action )
endloop
if udg_DEBUGMODE then
call BJDebugMsg( "Scene = " + I2S( scene ) + " / time = " + R2S( time ) + " / action = " +I2S( action ) )
endif
call StoreReal( g, "Interpreter", "SceneTime", time )
endfunction
function WriteToScene takes integer scene returns nothing
call StoreInteger( GC(), "Scripter", "Scene", scene )
endfunction
function GetActionSpot takes integer scene, real time returns integer
local gamecache g = GC()
local string s
local integer previous = GetStoredInteger( g, "Scene"+I2S(scene), "LastSpot" )
local integer length = GetStoredInteger( g, "Scene"+I2S(scene), "Length" ) + 1
local integer next = 0
if time < 0.00 then
call BJDebugMsg( "User error: negative action time" )
return -1
endif
call StoreInteger( g, "Scene"+I2S(scene), "Length", length )
loop
if previous == 0 then
call StoreInteger( g, "Scene"+I2S(scene), "FirstSpot", length )
endif
set s = "S"+I2S(scene)+"A"+I2S(previous)
exitwhen time >= GetStoredReal( g, s, "Time" )
set previous = GetStoredInteger( g, s, "PrevAction" )
endloop
if previous == GetStoredInteger( g, "Scene"+I2S(scene), "LastSpot" ) then
call StoreInteger( g, "Scene"+I2S(scene), "LastSpot", length )
call StoreInteger( g, s, "NextAction", length )
else
set next = GetStoredInteger(g, s, "NextAction" )
call StoreInteger( g, s, "NextAction", length )
set s = "S"+I2S(scene)+"A"+I2S(next)
call StoreInteger( g, s, "PrevAction", length )
endif
set s = "S"+I2S(scene)+"A"+I2S(length)
call StoreInteger( g, s, "PrevAction", previous )
call StoreInteger( g, s, "NextAction", next )
if udg_DEBUGMODE then
call BJDebugMsg( I2S( length ) + " / " + s )
endif
return length
endfunction
// next scene
function NextScene takes nothing returns nothing
local integer scene = GetStoredInteger( GC(), "Interpreter", "Scene" )
call PlayScene(scene+1)
endfunction
function ScriptNextScene takes real time returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "NextScene" )
call StoreReal( g, s, "Time", time )
set g = null
endfunction
// external function
function ScriptExternalFunc takes real time, string funcName returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", funcName )
call StoreReal( g, s, "Time", time )
set g = null
endfunction
// special effect
function SpecialEffectDestroy takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer i = GetStoredInteger( GC(), H2S(t), "effect" )
call DestroyEffect( udg_cinS_effect[i] )
set udg_cinS_effect[i]=null
set udg_cinS_effectFree[i]=udg_cinS_effectCount
set udg_cinS_effectCount=i
call FlushStoredMission( GC(), H2S(t) )
call DestroyTimer( t )
set t = null
endfunction
function SpecialEffectDestroyOverTime takes effect eff, real duration returns nothing
local timer t = CreateTimer()
local integer i=udg_cinS_effectCount
if udg_cinS_effectFree[i]!=0 then
set udg_cinS_effectCount=udg_cinS_effectFree[i]
set udg_cinS_effectFree[i]=0
else
set udg_cinS_effectCount=udg_cinS_effectCount+1
endif
set udg_cinS_effect[i]=eff
call StoreInteger( GC(), H2S(t), "effect", i )
call TimerStart(t, duration, false, function SpecialEffectDestroy)
set t = null
endfunction
function SpecialEffectPoint takes nothing returns nothing
local gamecache g = GC()
local effect eff = null
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local real x = GetStoredReal( g, s, "real1" )
local real y = GetStoredReal( g, s, "real2" )
local real z = GetStoredReal( g, s, "real3" )
local real duration = GetStoredReal( g, s, "real4" )
local string path = GetStoredString( g, s, "str1" )
local destructable d = CreateDestructableZ( 'OTip', x, y, z, 0.00, 1, 0 )
set eff = AddSpecialEffect(path, x, y)
call RemoveDestructable( d )
call SpecialEffectDestroyOverTime(eff, duration)
set d = null
set eff = null
set g = null
endfunction
function ScriptPointEffect takes real time, real x, real y, real z, string path, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "SpecialEffectPoint" )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", x )
call StoreReal( g, s, "real2", y )
call StoreReal( g, s, "real3", z )
call StoreReal( g, s, "real4", duration )
call StoreString( g, s, "str1", path )
set g = null
endfunction
function SpecialEffectActor takes nothing returns nothing
local gamecache g = GC()
local effect eff = null
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real duration = GetStoredReal( g, s, "real1" )
local string path = GetStoredString( g, s, "str1" )
local string attPoint = GetStoredString( g, s, "str2" )
set eff = AddSpecialEffectTarget(path, udg_cinS_actor[actID], attPoint)
call SpecialEffectDestroyOverTime(eff, duration)
set eff = null
set g = null
endfunction
function ScriptActEffect takes real time, integer actor, string path, string attachpoint, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "SpecialEffectActor" )
call StoreReal( g, s, "Time", time )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "real1", duration )
call StoreString( g, s, "str1", path )
call StoreString( g, s, "str2", attachpoint )
set g = null
endfunction
// play sound
function PlaySoundPath takes nothing returns nothing
local gamecache g = GC()
local sound snd = null
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer volume = GetStoredInteger( g, s, "int1" )
local real pitch = GetStoredReal( g, s, "real1" )
local string path = GetStoredString( g, s, "str1" )
set snd = CreateSound(path, false, false, false, 10, 10, "")
call SetSoundPitch(snd, pitch)
call SetSoundVolume(snd, volume)
call StartSound(snd)
call KillSoundWhenDone(snd)
set snd = null
set g = null
endfunction
function PreloadSoundPath takes nothing returns nothing
local gamecache g = GC()
local timer t = GetExpiredTimer()
local string path = GetStoredString( g, H2S(t), "path" )
local sound snd = CreateSound(path, false, false, false, 10, 10, "")
call SetSoundVolume(snd, 0)
call StartSound(snd)
call KillSoundWhenDone(snd)
set snd = null
call FlushStoredMission( g, H2S(t) )
call DestroyTimer(t)
set t = null
set g = null
endfunction
function ScriptPlaySound takes real time, string path, real pitch, integer volume returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local timer t
if not(GetStoredBoolean(g, "preloading", path)) then
set t = CreateTimer()
call StoreString( g, H2S(t), "path", path )
call TimerStart(t, 1.00, false, function PreloadSoundPath)
call StoreBoolean(g, "preloading", path, true)
set t = null
endif
call StoreString( g, s, "ActionType", "PlaySoundPath" )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", pitch )
call StoreInteger( g, s, "int1", volume )
call StoreString( g, s, "str1", path )
set g = null
endfunction
// ability level
function ActorAbilityLevel takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local integer abilityID = GetStoredInteger( g, s, "int1" )
local integer level = GetStoredInteger( g, s, "int2" )
call UnitRemoveAbility( udg_cinS_actor[actID], abilityID )
call UnitAddAbility( udg_cinS_actor[actID], abilityID )
call SetUnitAbilityLevel( udg_cinS_actor[actID], abilityID, level )
set g = null
endfunction
function ScriptActAbilityLvl takes real time, integer actor, integer abilityID, integer level returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorAbilityLevel" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreInteger( g, s, "int1", abilityID )
call StoreInteger( g, s, "int2", level )
set g = null
endfunction
// play animation
function ActorPlayAnimation takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local integer animationID = GetStoredInteger( g, s, "int1" )
local real animationBlend = GetStoredReal( g, s, "real1" )
call SetUnitBlendTime(udg_cinS_actor[actID], animationBlend)
call SetUnitAnimationByIndex( udg_cinS_actor[actID], animationID )
set g = null
endfunction
function ScriptActAnimPlay takes real time, integer actor, integer animationID, real animationBlend returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorPlayAnimation" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreInteger( g, s, "int1", animationID )
call StoreReal( g, s, "real1", animationBlend )
set g = null
endfunction
function ActorResetAnimation takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
call ResetUnitAnimation( udg_cinS_actor[actID] )
set g = null
endfunction
function ScriptActAnimReset takes real time, integer actor returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorResetAnimation" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
set g = null
endfunction
// animation speed
function ActorSpeedAnimation takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real animationSpeed = GetStoredReal( g, s, "real1" )
call SetUnitTimeScale( udg_cinS_actor[actID], animationSpeed )
set g = null
endfunction
function ScriptActAnimSpeed takes real time, integer actor, real speed returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorSpeedAnimation" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", speed )
set g = null
endfunction
// slide unit
function ActorSlide takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real destX = GetStoredReal( g, s, "real1" )
local real destY = GetStoredReal( g, s, "real2" )
local real duration = GetStoredReal( g, s, "real3" )
local real gr = GetStoredReal( g, s, "real4" )
call UnitMove( udg_cinS_actor[actID], destX, destY, duration, gr )
set g = null
endfunction
function ScriptActSlide takes real time, integer actor, real x, real y, real duration, real gr returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorSlide" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", x )
call StoreReal( g, s, "real2", y )
call StoreReal( g, s, "real3", duration )
call StoreReal( g, s, "real4", gr )
set g = null
endfunction
// walk unit
function ActorWalkProperties takes integer unitID, integer walkAnimID, real walkAnimDuration, real walkSpeed returns nothing
local real speed = walkSpeed / walkAnimDuration
local string s = "ActorStats "+I2S(unitID)
call StoreReal( GC(), s, "speed", speed )
call StoreInteger( GC(), s, "animation", walkAnimID )
endfunction
function ActorWalk takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real destX = GetStoredReal( g, s, "real1" )
local real destY = GetStoredReal( g, s, "real2" )
local real duration = GetStoredReal( g, s, "real3" )
local real animationBlend = GetStoredReal( g, s, "real4" )
call UnitMove( udg_cinS_actor[actID], destX, destY, duration, 0 )
set s = "ActorStats "+I2S(GetUnitTypeId(udg_cinS_actor[actID]))
set destX=destX-GetUnitX(udg_cinS_actor[actID])
set destY=destY-GetUnitY(udg_cinS_actor[actID])
call UnitTurn( udg_cinS_actor[actID], bj_RADTODEG * Atan2(destY , destX), animationBlend, 0 )
call SetUnitBlendTime(udg_cinS_actor[actID], animationBlend)
call SetUnitTimeScale( udg_cinS_actor[actID], (SquareRoot(destX*destX+destY*destY) / (duration+0.01) / (GetStoredReal(GC(), s, "speed"))+0.01) )
call SetUnitAnimationByIndex( udg_cinS_actor[actID], GetStoredInteger(GC(), s, "animation") )
set g = null
endfunction
function ScriptActWalk takes real time, integer actor, real x, real y, real duration, real animationBlend returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorWalk" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", x )
call StoreReal( g, s, "real2", y )
call StoreReal( g, s, "real3", duration )
call StoreReal( g, s, "real4", animationBlend )
set g = null
endfunction
// turn unit
function ActorTurn takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real destAng = GetStoredReal( g, s, "real1" )
local real duration = GetStoredReal( g, s, "real2" )
local integer clockwise = GetStoredInteger( g, s, "int1" )
call UnitTurn( udg_cinS_actor[actID], destAng, duration, clockwise )
set g = null
endfunction
function ScriptActTurn takes real time, integer actor, real destAng, real duration, integer clockwise returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorTurn" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", destAng )
call StoreReal( g, s, "real2", duration )
call StoreInteger( g, s, "int1", clockwise )
set g = null
endfunction
function ActorFace takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local integer targetID = GetStoredInteger( g, s, "int1" )
local integer headORchest = GetStoredInteger( g, s, "int2" )
local real x = GetStoredReal( g, s, "real1" )
local real y = GetStoredReal( g, s, "real2" )
local real z = GetStoredReal( g, s, "real3" )
local real animationBlend = GetStoredReal( g, s, "real4" )
if headORchest == 0 then
set s = "Bone_Head"
else
set s = "Bone_Chest"
endif
call SetUnitBlendTime(udg_cinS_actor[actID], animationBlend)
call SetUnitLookAt( udg_cinS_actor[actID], s, udg_cinS_actor[targetID], x,y,z )
set g = null
endfunction
function ScriptActFace takes real time, integer actor, integer destActor, integer headORchest, real xoff, real yoff, real zoff, real animationBlend returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorFace" )
call StoreInteger( g, s, "actor", actor )
call StoreInteger( g, s, "int1", destActor )
call StoreInteger( g, s, "int2", headORchest )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", xoff )
call StoreReal( g, s, "real2", yoff )
call StoreReal( g, s, "real3", zoff )
call StoreReal( g, s, "real4", animationBlend )
set g = null
endfunction
function ActorFaceReset takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real animationBlend = GetStoredReal( g, s, "real1" )
call SetUnitBlendTime(udg_cinS_actor[actID], animationBlend)
call ResetUnitLookAt( udg_cinS_actor[actID] )
set g = null
endfunction
function ScriptActFaceReset takes real time, integer actor, real animationBlend returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorFaceReset" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", animationBlend )
set g = null
endfunction
// vertex colouring
function ActorColour takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real red = GetStoredReal( g, s, "real1" )
local real green = GetStoredReal( g, s, "real2" )
local real blue = GetStoredReal( g, s, "real3" )
local real opacity = GetStoredReal( g, s, "real4" )
local real duration = GetStoredReal( g, s, "real5" )
call UnitColour( udg_cinS_actor[actID], red, green, blue, opacity, duration )
set g = null
endfunction
function ScriptActColour takes real time, integer actor, real red, real green, real blue, real opacity, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorColour" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", red )
call StoreReal( g, s, "real2", green )
call StoreReal( g, s, "real3", blue )
call StoreReal( g, s, "real4", opacity )
call StoreReal( g, s, "real5", duration )
set g = null
endfunction
// size unit
function ActorSize takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real size = GetStoredReal( g, s, "real1" )
local real duration = GetStoredReal( g, s, "real2" )
call UnitSize( udg_cinS_actor[actID], size, duration )
set g = null
endfunction
function ScriptActSize takes real time, integer actor, real size, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorSize" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", size )
call StoreReal( g, s, "real2", duration )
set g = null
endfunction
// camera scripting
function CameraAction takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer camID = GetStoredInteger( g, s, "actor" )
local integer changeType = GetStoredInteger( g, s, "int1" )
local real duration = GetStoredReal( g, s, "real1" )
if changeType == 1 then
call ApplyCameraInstantly( udg_cinS_camera[camID] )
elseif changeType == 2 then
call ApplyCameraLinear( udg_cinS_camera[camID], duration )
elseif changeType == 3 then
call ApplyCameraSmooth( udg_cinS_camera[camID], duration )
elseif changeType == 4 then
call ApplyCameraSmoothStop( udg_cinS_camera[camID], duration )
endif
set g = null
endfunction
function ScriptCamera takes real time, integer camera, real duration, integer changeType returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "CameraAction" )
debug call BJDebugMsg( "Camera #"+I2S(camera)+ " started up. / " + s )
call StoreInteger( g, s, "actor", camera )
call StoreInteger( g, s, "int1", changeType )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
set g = null
endfunction
function CameraStatChangeInst takes integer stat, real endvalue returns nothing
set udg_cinS_cam_startval[stat] = endvalue
set udg_cinS_cam_startvel[stat] = 0.0
set udg_cinS_cam_accprim[stat] = 0.0
set udg_cinS_cam_accsec[stat] = 0.0
set udg_cinS_cam_time[stat] = 0.0
set udg_cinS_cam_endtime[stat] = 0.0
endfunction
function CameraStatAction takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer statID = GetStoredInteger( g, s, "actor" )
local integer changeType = GetStoredInteger( g, s, "int1" )
local real duration = GetStoredReal( g, s, "real1" )
local real endValue = GetStoredReal( g, s, "real2" )
local real endSpeed = GetStoredReal( g, s, "real3" )
if statID==4 or statID==5 or statID==6 then
if changeType == 1 then
call CameraStatChangeInst( statID, endValue )
elseif changeType == 2 then
call CameraStatChangeLinRad( statID, endValue, duration )
elseif changeType == 3 then
call CameraStatChangeRad( statID, endValue, duration )
elseif changeType == 4 then
call CameraStatChangeAdvRad( statID, endValue, endSpeed, duration )
endif
else
if changeType == 1 then
call CameraStatChangeInst( statID, endValue )
elseif changeType == 2 then
call CameraStatChangeLin( statID, endValue, duration )
elseif changeType == 3 then
call CameraStatChange( statID, endValue, duration )
elseif changeType == 4 then
call CameraStatChangeAdv( statID, endValue, endSpeed, duration )
endif
endif
set g = null
endfunction
function ScriptCameraStat takes real time, integer statID, real duration, real endValue, real endSpeed, integer changeType returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "CameraStatAction" )
call StoreInteger( g, s, "actor", statID )
call StoreInteger( g, s, "int1", changeType )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
call StoreReal( g, s, "real2", endValue )
call StoreReal( g, s, "real3", endSpeed )
set g = null
endfunction
// camera statID list
// 1 - x coordinate; 2 - y coordinate; 3 - z coordinate;
// 4 - facing angle; 5 - angle of attack; 6 - roll angle;
// 7 - field ov view; 8 - far z; 9 - distance to target
function CameraIgnoreTerrain takes nothing returns nothing
set udg_cinS_cam_ignoreTerrain = true
endfunction
function CameraUnignoreTerrain takes nothing returns nothing
set udg_cinS_cam_ignoreTerrain = false
endfunction
function ScriptCameraIgnoreTerrain takes real time, boolean ignore returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
if ignore then
call StoreString( g, s, "ActionType", "CameraIgnoreTerrain" )
else
call StoreString( g, s, "ActionType", "CameraUnignoreTerrain" )
endif
set g = null
endfunction
function ActorCameraLock takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real duration = GetStoredReal( g, s, "real1" )
local real xoff = GetStoredReal( g, s, "real2" )
local real yoff = GetStoredReal( g, s, "real3" )
local real zoff = GetStoredReal( g, s, "real4" )
local boolean smooth = GetStoredInteger( g, s, "int1" )==1
call CameraLockToUnitOverride(udg_cinS_actor[actID], xoff, yoff, zoff, smooth, duration )
set g = null
endfunction
function ScriptActCameraLock takes real time, integer actor, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorCameraLock" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "real2", xoff )
call StoreReal( g, s, "real3", yoff )
call StoreReal( g, s, "real4", zoff )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
if smooth then
call StoreInteger( g, s, "int1", 1 )
else
call StoreInteger( g, s, "int1", 0 )
endif
set g = null
endfunction
function ActorCameraLockReset takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local real duration = GetStoredReal( g, s, "real1" )
local boolean smooth = GetStoredInteger( g, s, "int1" )==1
call CameraLockToUnitReset( smooth, duration )
set g = null
endfunction
function ScriptActCameraLockReset takes real time, boolean smooth, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorCameraLockReset" )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
if smooth then
call StoreInteger( g, s, "int1", 1 )
else
call StoreInteger( g, s, "int1", 0 )
endif
set g = null
endfunction
function ActorCameraFace takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local integer actID = GetStoredInteger( g, s, "actor" )
local real duration = GetStoredReal( g, s, "real1" )
local real xoff = GetStoredReal( g, s, "real2" )
local real yoff = GetStoredReal( g, s, "real3" )
local real zoff = GetStoredReal( g, s, "real4" )
local boolean smooth = GetStoredInteger( g, s, "int1" )==1
call CameraFaceToUnitOverride(udg_cinS_actor[actID], xoff, yoff, zoff, smooth, duration )
set g = null
endfunction
function ScriptActCameraFace takes real time, integer actor, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorCameraFace" )
call StoreInteger( g, s, "actor", actor )
call StoreReal( g, s, "real2", xoff )
call StoreReal( g, s, "real3", yoff )
call StoreReal( g, s, "real4", zoff )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
if smooth then
call StoreInteger( g, s, "int1", 1 )
else
call StoreInteger( g, s, "int1", 0 )
endif
set g = null
endfunction
function ActorCameraFaceReset takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local real duration = GetStoredReal( g, s, "real1" )
local boolean smooth = GetStoredInteger( g, s, "int1" )==1
call CameraFaceToUnitReset( smooth, duration )
set g = null
endfunction
function ScriptActCameraFaceReset takes real time, boolean smooth, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "ActorCameraFaceReset" )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
if smooth then
call StoreInteger( g, s, "int1", 1 )
else
call StoreInteger( g, s, "int1", 0 )
endif
set g = null
endfunction
function FogChange takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local real duration = GetStoredReal( g, s, "real1" )
local real startZ = GetStoredReal( g, s, "real2" )
local real endZ = GetStoredReal( g, s, "real3" )
local real red = GetStoredReal( g, s, "real4" )
local real green = GetStoredReal( g, s, "real5" )
local real blue = GetStoredReal( g, s, "real6" )
call ApplyFog(startZ, endZ, red, green, blue, duration)
endfunction
function ScriptFog takes real time, real startZ, real endZ, real red, real green, real blue, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "FogChange" )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
call StoreReal( g, s, "real2", startZ )
call StoreReal( g, s, "real3", endZ )
call StoreReal( g, s, "real4", red )
call StoreReal( g, s, "real5", green )
call StoreReal( g, s, "real6", blue )
set g = null
endfunction
function FadeChange takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local real duration = GetStoredReal( g, s, "real1" )
local real red = GetStoredReal( g, s, "real2" )
local real green = GetStoredReal( g, s, "real3" )
local real blue = GetStoredReal( g, s, "real4" )
local real opacity = GetStoredReal( g, s, "real5" )
call ApplyFade(red, green, blue, opacity, duration)
endfunction
function ScriptFade takes real time, real red, real green, real blue, real opacity, real duration returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "FadeChange" )
call StoreReal( g, s, "Time", time )
call StoreReal( g, s, "real1", duration )
call StoreReal( g, s, "real2", red )
call StoreReal( g, s, "real3", green )
call StoreReal( g, s, "real4", blue )
call StoreReal( g, s, "real5", opacity )
set g = null
endfunction
function SubtitleDisplay takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
local string line = GetStoredString( g, s, "string1" )
if udg_cinS_displaySubtitles then
call DisplaySubtitle(line)
endif
set g = null
endfunction
function ScriptSubtitleLine takes real time, string line returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "SubtitleDisplay" )
call StoreReal( g, s, "Time", time )
call StoreString( g, s, "string1", line )
set g = null
endfunction
function SubtitleClear takes nothing returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Interpreter", "Scene" )
local integer action = GetStoredInteger( g, "Interpreter", "PendingAction" )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call ClearSubtitles()
set g = null
endfunction
function ScriptSubtitleClear takes real time returns nothing
local gamecache g = GC()
local integer scene = GetStoredInteger( g, "Scripter", "Scene" )
local integer action = GetActionSpot( scene, time )
local string s = "S"+I2S(scene)+"A"+I2S(action)
call StoreString( g, s, "ActionType", "SubtitleClear" )
call StoreReal( g, s, "Time", time )
set g = null
endfunction
function ScriptSystemInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventPeriodic( t, ScriptSystemPeriod() )
call TriggerAddAction( t, function ScriptInterpreter )
set t = null
endfunction
Name | Type | is_array | initial_value |
BloodAngle | real | No | |
BloodLoc | location | Yes | |
BloodTarget | location | No | |
BloodUnit | unit | No | |
BOOLEAN_PlayFromTime | boolean | No | false |
BSEffect | effect | Yes | |
cinS_act_colourA | real | Yes | |
cinS_act_colourB | real | Yes | |
cinS_act_colourG | real | Yes | |
cinS_act_colourR | real | Yes | |
cinS_act_colourTime | real | Yes | |
cinS_act_colourVA | real | Yes | |
cinS_act_colourVB | real | Yes | |
cinS_act_colourVG | real | Yes | |
cinS_act_colourVR | real | Yes | |
cinS_act_groups | group | Yes | |
cinS_act_moveAZ | real | Yes | |
cinS_act_moveTime | real | Yes | |
cinS_act_moveVX | real | Yes | |
cinS_act_moveVY | real | Yes | |
cinS_act_moveVZ | real | Yes | |
cinS_act_moveX | real | Yes | |
cinS_act_moveY | real | Yes | |
cinS_act_moveZ | real | Yes | |
cinS_act_sizeS | real | Yes | |
cinS_act_sizeTime | real | Yes | |
cinS_act_sizeVS | real | Yes | |
cinS_act_turnFi | real | Yes | |
cinS_act_turnTime | real | Yes | |
cinS_act_turnVFi | real | Yes | |
cinS_actor | unit | Yes | |
cinS_cam_accprim | real | Yes | |
cinS_cam_accsec | real | Yes | |
cinS_cam_endtime | real | Yes | |
cinS_cam_fadeUnit | unit | No | |
cinS_cam_ignoreTerrain | boolean | No | |
cinS_cam_OvRangEndtime | real | No | |
cinS_cam_OvRangSmooth | boolean | No | |
cinS_cam_OvRangTime | real | No | |
cinS_cam_OvRangUnitPrim | unit | No | |
cinS_cam_OvRangUnitSec | unit | No | |
cinS_cam_OvRoffset | real | Yes | |
cinS_cam_OvRxyzEndtime | real | No | |
cinS_cam_OvRxyzSmooth | boolean | No | |
cinS_cam_OvRxyzTime | real | No | |
cinS_cam_OvRxyzUnitPrim | unit | No | |
cinS_cam_OvRxyzUnitSec | unit | No | |
cinS_cam_startval | real | Yes | |
cinS_cam_startvel | real | Yes | |
cinS_cam_time | real | Yes | |
cinS_cam_trigger | trigger | No | |
cinS_camera | camerasetup | Yes | |
cinS_displaySubtitles | boolean | No | true |
cinS_effect | effect | Yes | |
cinS_effectCount | integer | No | |
cinS_effectFree | integer | Yes | |
cinS_GC | gamecache | No | |
cinS_tempPoint | location | No | |
DEBUGMODE | boolean | No | |
EB_AoE | real | No | |
EB_Arc_Dist | real | No | |
EB_Arc_Str | real | No | |
EB_Blade_Speed | real | No | |
EB_Caster | unit | No | |
EB_Damage | real | No | |
EB_Location | location | No | |
EB_Mana_Drain | real | No | |
EB_Offset_Loc | location | Yes | |
EB_Order | string | No | |
EB_Part | unit | Yes | |
EB_Part_Amount | integer | No | |
EB_SFX | modelfile | No | |
EB_Timer | timer | No | |
EB_Timer_Delay | real | No | |
FadeLightning | boolean | No | |
g | group | No | |
i | integer | No | |
LightningAlpha | real | No | 0.70 |
LightningHeight | real | No | 120.00 |
real | real | No | |
RedLightning | lightning | Yes | |
TempAngle | real | No | |
timer | real | No | |
Volume | real | No | 0.00 |
xx | real | No | |
yy | real | No |
//TESH.scrollpos=8
//TESH.alwaysfold=0
This map contains a set of Jass functions that make a system for cinematic composition and playback.
It is a tool intended for advanced cinematic makers, built to allow them better precission in timing, give
them more control over the actions taking place in their cinematic and more fluid execution of those
actions than could be achieved with regular triggers. At the same time, the system establishes a working
environment where you can easily input large ammounts of cinematic actions data. The use of this system
only requires the minimal knowledge of the Warcraft's scripting language, Jass. Reading through Vexorian's
Introduction to Jass (you can find it at wc3campaigns.net) should give you more than enough knowledge to
be able to use this system.
The system is built out of three main components:
THE SCRIPT SYSTEM
This is the core of everything. It is a system designed to overcome the limitations of the "Wait" trigger
action. That action is not precisely acurate, especially on very short waits. In fact, it is uncapable of
waiting for less than about a tenth of a second. Because of this limitation, it is very difficult to
impossible to get any kind of detailed action to happen accurately. The system gets around that by using
no waits at all. Instead, all actions that are to happen during the cinematic are stored when the map
starts, and then executed at exactly the right time by an accurate periodic trigger. This way, you can use
a lot more actions in short time intervals, improving the quality of your cinematic.
THE CAMERA SYSTEM
The smooth camera system overcomes another limitation of the warcraft engine that can be most annoying
when making cinematics, the straight-line movement of warcraft cameras. With the regular triggers, smooth
motion can only be approximated by placing many camera objects one after another, but that is a lot of
work and the movement will be choppy even if you spend a lot of time on it. This system allows linear as
well as parabolic movement, and can use the later to change the movement direction and speed of the
camera gradually while moving from one camera setup to the next, rather than instantly changing direction
when sent to another position.
THE PARTICLE SYSTEM
This last system is used for gradual changing of some things that can otherwise only be changed instantly.
It's initial focus was to allow sliding and jumping of units, and that's where it got it's name. Now, it's
also used for turning units slowly, gradually changing their vertex colouring and their scaling value.
//TESH.scrollpos=26
//TESH.alwaysfold=0
Since version 1.4, the system requires many global variables to be set up in the map that wants to use
it. To make the creation of all these variables easier, a trigger has been supplied in the support
section that can be used to auto-generate them. Note that some new variables were added in 1.5b so if
you are updating a map with an earlier version of the cinematic system you need to regenerate the
variables.
Once the variables are set up, just copy the entire content of this map's custom script section to the
same place in your map. You can get to the custom script section of the map by clicking it's name in the
treewiev to the left of the trigger editor.
After that, you need to set up the camera object unit. This is the unit that is used to display the
unshaded fade filter in front of the camera. First, export the Plane.mdx custom model form this map
and import it into your map. Then, copy the camera object unit from this map to your map. The camera
object unit may be given a new object ID in the new map, make sure you check what it is and update
the FadeFilterUnit function in the calibration section of the cinematic system to correspond with that.
Also, you may need to update the unit's model path after you copy it in case the Plane.mdx model has a
different path in your map than it had in this map.
In a trigger running at map initialization, call the following function to set the systems up:
//function InitCinematicSystem takes nothing returns nothing
There, the systems are up and running.
Then, you must set all the units and cameras you want the script system to use to the two corresponding
variable arrays: cinS_actor for units and cinS_camera for, you guessed it, cameras. The script system
can only use units and camera objects that are stored there. You can store preplaced camera objects
there with GUI, while units must be assigned there with one of the following functions:
//function ActorAssign takes unit u, integer actID returns nothing
//function ActorCreate takes player p, integer actID, integer unitType returns unit
The first function is used for preplaced units, while the second one is used for creating a new unit.
These functions will store the unit to the cinS_actor array under the index that you specify with the
actID integer parameter. They will also set the unit's custom value to this integer. This is neccessary
for the script system and the particle system to use the unit, so do not change the custom value of actors!
Besides this, these functions also initialize some particle data for the unit. Since there's no way to get
a unit's vertex colouring or scaling value, the engine assumes that all the unit's colour values are equal
to 100.0 and that it's scaling value is equal to 1.0.
The function ActorCreate creates the unit in the middle of the map, but you can easily move it with the
script system or through other means.
To be able to use the ScriptActWalk function on actors, you must first tell the system some properties
of the model the actor uses. You do this by calling the following function for each of your unit types
at map initialization:
//function ActorWalkProperties takes integer unitID, integer walkAnimID, real walkAnimDuration, real walkSpeed returns nothing
The unitID parameter is the unit type's object editor id, walkAnimID is the id of the walk animation for
the unit's model, walkAnimDuration is the duration of this animation in seconds and walkSpeed is the model's
walk speed, which you can read fom the .mdl version of the model or from a unit in the object editor that
uses that model in the case of ingame models.
That's it, once you have everything set up like this, you are ready to start writing your cinematic's
script.
//TESH.scrollpos=210
//TESH.alwaysfold=0
THE SCRIPT SYSTEM
The script system is used, as the name implies, to script your cinematic. It is an assortment of functions
that you use for scripting different actions, like sliding units and playing their animations. When one of
the scripting functions is used, it stores to the system's database when and what action should be executed.
Normaly, all scripting should be done at map initialization. Just make a trigger that runs at Map Init,
convert it to custom text, and start filling in script functions. You can break it up into more triggers
for organisational purposes. It is also advised that you add a lot of comments to your script, so you can
easily find your way around it, it is very difficult to find what you want to change in an uncommented
script.
//function WriteToScene takes integer scene returns nothing
This function comes first. It tells the system which scene you want to write into. This way, you don't need
to specify that for each action individually; simply use this function to start writing to the first scene,
once you store all the actions for it, move to the next scene, again with this function. Use values above 0
for scene numbers.
Once you select which scene you want to write to with the WriteToScene function, it's time to start scripting.
Here are all the functions avaliable:
//function ScriptNextScene takes real time returns nothing
//function ScriptExternalFunc takes real time, string funcName returns nothing
//function ScriptPlaySound takes real time, string path, real pitch, integer volume returns nothing
//function ScriptPointEffect takes real time, real x, real y, real z, string path, real duration returns nothing
//function ScriptActEffect takes real time, integer actor, string path, string attachpoint, real duration returns nothing
//function ScriptActAbilityLvl takes real time, integer actor, integer abilityID, integer level returns nothing
//function ScriptActAnimPlay takes real time, integer actor, integer animationID, real animationBlend returns nothing
//function ScriptActAnimReset takes real time, integer actor returns nothing
//function ScriptActAnimSpeed takes real time, integer actor, real speed returns nothing
//function ScriptActSlide takes real time, integer actor, real x, real y, real duration, real g returns nothing
//function ScriptActWalk takes real time, integer actor, real x, real y, real duration, real animationBlend returns nothing
//function ScriptActTurn takes real time, integer actor, real destAng, real duration, integer clockwise returns nothing
//function ScriptActFace takes real time, integer actor, integer destActor, integer headORchest, real xoff, real yoff, real zoff, real animationBlend returns nothing
//function ScriptActFaceReset takes real time, integer actor, real animationBlend returns nothing
//function ScriptActColour takes real time, integer actor, real red, real green, real blue, real opacity, real duration returns nothing
//function ScriptActSize takes real time, integer actor, real size, real duration returns nothing
//function ScriptCamera takes real time, integer camera, real duration, integer changeType returns nothing
//function ScriptCameraStat takes real time, integer statID, real duration, real endValue, real endSpeed, integer changeType returns nothing
//function ScriptCameraIgnoreTerrain takes real time, boolean ignore returns nothing
//function ScriptActCameraLock takes real time, integer actor, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
//function ScriptActCameraLockReset takes real time, boolean smooth, real duration returns nothing
//function ScriptActCameraFace takes real time, integer actor, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
//function ScriptActCameraFaceReset takes real time, boolean smooth, real duration returns nothing
//function ScriptFog takes real time, real startZ, real endZ, real red, real green, real blue, real duration returns nothing
//function ScriptFade takes real time, real red, real green, real blue, real opacity, real duration returns nothing
//function ScriptSubtitleLine takes real time, string line returns nothing
//function ScriptSubtitleClear takes real time returns nothing
Notice how all these functions take a real named "time" as their first parameter. This tells the system how
much time after the start of the scene you are writing to the action you are writing should occur. Normaly,
for organisational purposes as well as for efficiency, you would write actions in consecutive order: the ones
that happen later should also be scripted later.
Note that when writing down your initialization functions, they can get quite long as you add more and more
length and detail to your cinematic. They may get so long that they reach the threadlimit (especially if you
mix the order a lot, like first scripting a part of the scene that happens towards it's end and then a part
that comes before it, since in that case the system wastes a lot of function calls looking backwards through
the database searching for where to insert the new action) and end without executing fully. In such a case,
use short waits to break the function up.
Now let's look at the functions one by one to see what actions they script:
- ScriptExternalFunc
As the name implies, this function allows you to run functions from outside the system, functions you
create yourself. This is useful when you want to do an effect at some point that is too rare to have
it's own script system function. You can make your own external function even if you don't know Jass;
just make a trigger with all the actions you want to execute, then convert it to custom text. All the
trigger's actions will be put into one function named "Trig_TriggerName_Actions", use that function name
as the argument for the ScriptExternalFunc function.
Note: Be sure to type the function name exactly, Jass is case sensitive. Mistyping it will cause a crash.
Note: If you are typing your external functions in Jass, remember that they must take and return nothing.
-ScriptNextScene
This is used in multi-scene cinematics to go from one scene to the next. It causes the system to start
playing the next scene from the beginning when it gets to this action, no matter if there are any actions
after this one left in the scene. If a scene finishes without having an action like this in it, the system
goes into idle mode.
-ScriptPlaySound
This function scripts the playing of a sound. The "path" parameter is, like with special effect functions,
the path to the file, only this time it's a sound file. The volume goes from 0 to 127, while pitch can be
any real value, 1.0 means normal speed, 0.5 halved speed, 2 double sound speed.
- ScriptPointEffect
This function is used to create special effects at a point for a given duration. The x, y and z parameters
are the coordinates at which the special effect is to be created, z being the vertical distance from the
ground. The string parameter named path is the filename of the special effect model you want to use.
Duration is given in seconds.
- ScriptActEffect
This is similar to the other special effect function, only this one creates it on a unit. Like all other
scripting functions that work with units, it can only work with units that are stored in the "actor" unit
variable array. The integer parameter named actor that the function takes represents the array index
under which the unit you want to attach the special effect to is stored. path and duration parameters are
the same as with the previous function, and the string attachpoint is the attachment point where you want
the effect to be (for example, "origin" or "overhead").
-ScriptActAbilityLevel
I mainly used this function for changing the level of a chaos-based ability which switched between
different versions of the unit. This way, I could have more different models in one unit, so I didn't have
to swap a bunch of actors all the time, but just change this single one. I suppose this could also be used
with some passive abilities as an alternate way of attaching special effects to a unit.
-ScriptActAnimPlay
This is used for playing actor animations. It takes an integer argument (the one named animationID) to
determine what animation to play. The reason the function uses animation IDs instead of strings is that
with strings, you can only specify a "stand" or an "attack" animation, but you can't specify which one if
the unit has more. With animation IDs, you can do that, but you need to first determine which ID the
animation you want to play has. The real parameter named animationBlend is the blend time, it determines
the duration over which the unit model moves from the previous animation to the new one. Note that this
time scales along with animation speed.
-ScriptActAnimReset
Resets the animation of an actor. Useful when a unit is in the background and you don't want to bother with
it, but just want it to stand there like it does in regular games, randomly choosing between it's stand
animations.
-ScriptActAnimSpeed
Changes the animation speed of the unit. It was made seperate from ScriptActAnimPlay, so you can change
animation speed mid-animation, not just at start. However, animations aren't as accurate as we would want,
if you have a quickly moving model and then try to completely pause it, it doesn't seem to always pause at
the exact same spot in the animation, so this isn't precise enough to do things like stopping attack
animations in an action scene right when the blades clash.
-ScriptActSlide
Slides the actor from it's current location to the new coordinates over the given duration. The real
parameter named g should be 0 for sliding on the ground, but above 0 for jumping. The higher the value,
the higher the arc in which the unit flies (the height of the arc also depends on the duration). Normal
values for this parameters are around a few hundred.
-ScriptActWalk
Slides the actor from it's current location to the new coordinates over the given duration. The actor
will also turn in the direction of movement and play it's walk animation at the speed required to match
his actual movement speed. Note that the walk animation will continue to play after the move finishes
unless you tell it to do otherwise with another action. You must first call the ActorWalkProperties
function for your actor before you can use this action, read the "Setting things up" section of the
documentation to see how to do that.
-ScriptActTurn
This causes an actor to turn to a certain angle over the given duration. The real parameter destAng is
the new angle, it's value should be between 0 and 360, with 0 being East and 90 North. The integer
parameter named clockwise determines in which direction the actor should rotate, values above 0 mean to
the left (counter clockwise), values below 0 to the right (clockwise). The size of the integer doesn't
matter, only if it's positive or negative. If it's 0, the unit will turn in the direction where the
turn is shorter.
-ScriptActFace
Causes the actor to face another actor with either it's head or chest bone. With which is determined by
the headORchest parameter, a value of 0 means head while anything else means chest. Note that only one
bone can rotate at a time, whenever this action is used it will first reset all facings, this is a
limitation of the Warcraft engine and might be adressed in future versions. The xoff, yoff and zoff
parameters determine the offset of the facing point from the origin point of the facing destination
actor. The animationBlend parameter determines the duration over which the head will turn, 0 is instant.
-ScriptActFaceReset
Resets the facing of the actor, all bones face forward. The animationBlend parameter again determines the
duration over which the head or chest face forward again.
-ScriptActColour
Changes the vertex colouring of the target unit over the given duration. The red, green and blue real
parameters range from 0 to 100, 0 being no colour and 100 full colour. The real parameter named opacity
determines the transparency of the unit, 0 means invisible while 100 means non-transparent.
-ScriptActSize
Changes the scaling value of the target unit over the given duration. The size real parameter determines
how big the unit's model will be at the end of the transition, 1.0 being the normal size.
-ScriptCamera
Used for scripting camera movement. The integer parameter named camera specifies the array index of the
camera global array, the camera that's stored there will be applied over the given duration. The integer
changeType specifies how the camera should move. 1 means instant change, in that case the duration
parameter is ignored. 2 means linear change, that is equal to the regular Warcraft camera movement. 3 is
a curved change, in that case the camera will keep it's starting movement speed and change it gradually
as it moves instead. 4 is another curved movement, but it is calculated so that the camera movement comes
to a halt just when it reaches it's destination.
Note that all camera movements (except the type 1, which isn't movement but an instant change) continiue
even after the duration passes, use the instant camera change to stop all movement. For more details on
camera movement, consult the next part of this readme.
-ScriptCameraStat
Another function for manipulating cameras. With it, you can modify a single aspect of your camera, the
statID integer parameter defines which one. This way, you do not need to have multiple camera objects for
very simple moves like a static camera that only changes it's field of view. The duration parameter
determines how long the camera stat change should last, the endValue parameter specifies what the value
of the camera stat should be at the end of the move, the units being standard Warcraft III distance units
or degrees, depending on the statID. The integer changeType works in the same way as in the ScriptCamera
function, except when set to a value of 4, in that case the camera stat movement speed at the end of the
transition doesn't have to be 0, but can be any value that you specify with the endSpeed parameter, which
is measured in distance units per second or degrees per second, again depending on the statID. This
parameter has no effect with any other changeType.
camera statID list
1 - x coordinate; 2 - y coordinate; 3 - z coordinate;
4 - facing angle; 5 - angle of attack; 6 - roll angle;
7 - field ov view; 8 - far z; 9 - distance to target
-ScriptCameraIgnoreTerrain
With this function you can turn the special camera mode that ignores terrain height on or off. When on,
the camera will not correct it's z offset for surrounding terrain, meaning it will be able to much more
accurately lock to units regardless of the terrain they're moving across. On the other side, the camera
with this mode activated will not match the cameras you set in the world editor, so sometimes the system
is easier to use with this mode disabled. Note that you should only enable or disable this mode at the
same time you do an instant camera change, else the change in the mode will be noticeable. By default,
this mode is turned off.
-ScriptActCameraLock
Locks the camera's position to an actor over a duration, overriding regular camera movement. This only
affects the camera's position, other parameters such as facing angle or distance to target are unaffected.
The xoff, yoff and zoff real parameters determine at what offset from the unit's origin should the
camera's origin get locked to, the duration real parameter specifies how long should it take for the
camera to lock on the unit, and the smooth boolean parameter is used to determine how the camera should
switch between it's default motion and locked motion - false means a linear change while true gives a
smoother transition. For more details on camera movement, consult the next part of this readme.
-ScriptActCameraLockReset
Resets the camera lock over a duration. The smooth boolean parameter works the same as in the
ScriptActCameraLock function. For more details on camera movement, consult the next part of this readme.
-ScriptActCameraFace
Similar to the ScriptActCameraLock function, except that it doesn't lock the camera's position, but it's
facing angle and angle of attack so that the camera faces an actor. For more details on camera movement,
consult the next part of this readme.
-ScriptActCameraFaceReset
Similar to the ScriptActCameraLockReset function, except that it resets the camera's angle lock instead of
it's position lock. For more details on camera movement, consult the next part of this readme.
-ScriptFog
Used for scripting fog changes, instant or gradual. The startZ parameter determines how far from the
camera the fog begins, while the endZ parameter marks the distance at which the fog reaches full opacity.
The colour parameters range from 0 to 100, 0 being no colour and 100 full colour. The duration determines
how long it will take for the fog to reach the given parameters.
-ScriptFade
Used for scripting unshaded fade filter changes. The opacity parameter ranges from 0 to 100, 0 being
invisible and 100 being completely opaque. The colour parameters range from 0 to 100, 0 being no colour
and 100 full colour. The duration determines how long it will take for the fade filter to reach the
given parameters.
-ScriptSubtitleLine
Displays a centered subtitle at the bottom of the visible area. Any previous subtitles are moved one line
up. The subtitles will persist until ScriptSubtitleClear is used.
-ScriptSubtitleClear takes real time returns nothing
Clears all subtitles (and any other game messages) off the screen.
//TESH.scrollpos=42
//TESH.alwaysfold=0
THE CAMERA SYSTEM
The camera system is in charge of moving the camera. To explain how it works, I will first briefly explain
some camera basics.
Each camera setup is defined by nine parameters: the x, y and z position of the camera target; facing
angle, angle of attack and roll angle; and field of view, drawing distance and distance to target. When
modifying the camera with the usual triggers, the engine changes these values linearly over time until
they reach the desired value, the value set for the camera that's being applied. The problem with linear
transition is that it becomes choppy at "waypoints". Let's say your camera is in position A and you move
it to position B and from there to position C. If position B is above A and C, then the camera will be
climbing up when going from A to B, but the moment it reaches B and starts going towards C, it has to
start falling again, so at that point, it's height-changing speed suddenly changes, and we notice that
as a "chop" in the camera's movement.
The camera system avoids this by changing the camera's parameters over time, rather than letting the
warcraft engine to do it. Because of this, it is not limited to only the linear motion that the game
engine is otherwise capable of. The system is also capable of parabolic motion. Instead of changing a
camera parameter with a constant speed, it can have a linearly changing speed. This means there's an
infinite number of pairs of starting speed and acceleration that will get the camera's parameter from
one value to another over a given time.
This means the system can match the starting camera speed of a new camera move with the ending speed of
the previous move. this way, there's no more choppy behaviour at camera "waypoints"; when a new camera
move begins, it will at the beggining still be moving in the same direction as before, and only gradually
change it's movement speed in order to reach the target camera's parameters over the given time.
Of course, if the camera's current movement speed is way bigger or smaller than the average speed required
for it to get to the next waypoint, it will have to move with great acceleration, resulting in the end
velocity being in another extreme. This can lead to camera constantly accelerating and decellerating from
waypoint to waypoint, which, although smooth, can still look wierd. To fix that, you have to spend some time
calibrating the waypoint positions and the times required for the camera to get from one to the other. This
gets increasingly difficult the more waypoints you have in your camera move, but thanks to the smooth motion
you can generaly use much less waypoints than you would with the normal Warcraft III camera triggers and get
much better results.
Another treat offered by the system is a "composed" camera move, which is divided into two curved moves,
each with it's own acceleration. This allows the camera move to not only adapt to the starting velocity, but
also to a requested end velocity. This way, you can make the camera get from point A to B in the given time
so that it's speed drops to 0 right when it reaches point B.
The system still supports the regular linear camera move with no acceleration, if you ever need it for
simpler camera moves. It can also be used at starts of smooth camera movements so the camera has some
starting speed, rather than having to accelerate from 0 first.
Note that all camera movement continues even after the target point is reached. To stop a camera, use the
instant camera move function. It sets all camera parameter speeds and accelerations to 0.
The wc3 camera's position can get offset vertically when it's above uneven terrain - the game engine doesn't
measure the z offset from the terrain height at the camera target point, but from an average terrain height
around the point. That's why, when you put a camera with 0 z offset on top of a hill where the surrounding
terrain is lower, the camera will end up inside the hill. The camera system has a special mode where it's
able to bypass this behaviour and set the camera's z position precisely - in this mode, the camera can be
much more accurately locked to units when they move over uneven terrain. On the other hand, cameras have in
this mode a different z offset from cameras you place in the world editor, also sometimes a flicker occurs
briefly when you instantly change the camera in this mode, for that reason this mode is optional so you can
turn it on only when you need it.
The last treat offered by the camera system is smoothly locking cameras to units. There are two ways to lock
a camera to a unit, you can either lock the camera's position to the position of a unit, or you can lock the
camera's facing angle and angle of attack to face the position of a unit. In both cases you can specify an
offset from the unit's origin onto which the camera should lock. The camera can also lock it's position and
angle at the same time, either both to a single unit or two different units. The system can smoothly move
between normal camera motion and locking the camera to a unit over a duration, as well as locking the camera
from one unit to another. The system continiues to calculate normal camera motion while the camera is locked
to a unit, so you can still modify the camera properties that aren't affected by the lock, like the distance
to target for example, and adapt the properties that are overriden by the lock so once you de-lock the
camera, it goes to the position/angle you want.
Normaly, you would use the camera system through the script system, but you can also call the camera system's
functions directly if you would wish to use it outside the script system, like for example in menus or
anywhere like that. The functions are:
//function ApplyCameraInstantly takes camerasetup whichSetup returns nothing
//function ApplyCameraLinear takes camerasetup whichSetup, real duration returns nothing
//function ApplyCameraSmooth takes camerasetup whichSetup, real duration returns nothing
//function ApplyCameraSmoothStop takes camerasetup whichSetup, real duration returns nothing
//function CameraIgnoreTerrain takes nothing returns nothing
//function CameraUnignoreTerrain takes nothing returns nothing
//function CameraLockToUnitOverride takes unit u, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
//function CameraLockToUnitReset takes boolean smooth, real duration returns nothing
//function CameraFaceToUnitOverride takes unit u, real xoff, real yoff, real zoff, boolean smooth, real duration returns nothing
//function CameraFaceToUnitReset takes boolean smooth, real duration returns nothing
While the camera system is running, it assumes total control over the camera, so players cannot move it.
If you want the system to be used for cinematics inside playable maps, you have to turn off the camera
trigger when you want the players to have control of the camera. You can turn the trigger on and off with
the following functions:
//function CinematicCameraEnable takes nothing returns nothing
//function CinematicCameraDisable takes nothing returns nothing
Note that when you initialise the cinematic system, the camera trigger will initialy be enabled.
Also, turning off the camera trigger will disable everything it does, not just the camera motion, but also
the fog engine and the unshaded fade filter subsystem.
THE PARTICLE SYSTEM
This is a very efficient system for doing any kind of unit movement. It's most useful for sliding and
jumping, but you can do regular walking with it as well, just turn the unit in the direction it's sliding
and play it's walk animation. That way, you get most accurate results, as the unit will definitely be at
the destination in the given time, as opposed to the normal unit walking, where Warcraft's pathifinding
engine might cause units to not take the direct route and thus not arrive at it's destination in expected
time.
Additionaly, the system took over other "sliding" function, meaning, gradual changes of unit properties that
can otherwise only be changed instantly. At the moment, it also supports unit turning (which isn't instant,
but it still has a fixed speed and with this system, you can turn units slower than that), changes to
vertex colouring and unit scale (which can otherwise only be done instantly).
Normaly, you would use the particle system through the script system, but you can also use it independantly
with the following functions:
//function UnitSlide takes unit u, real destX, real destY, real duration, real g returns nothing
//function UnitTurn takes unit u, real destAng, real duration, integer clockwise returns nothing
//function UnitColour takes unit u, real red, real green, real blue, real opacity, real duration returns nothing
//function UnitSize takes unit u, real size, real duration returns nothing
The functions are used the same way as the script functions that deal with unit sliding.
Note that since 1.4, due to optimization, the particle engine can no longer work with any unit, but only
with actors, see the chapter Setting things up for information about how to initialize actors.
//TESH.scrollpos=6
//TESH.alwaysfold=0
THE FOG ENGINE
The fog engine allows you to gradualy alter the fog in wc3. It only works while the camera system is active.
The default starting values for the fog are 0 for red, green and blue and 10000 for startZ and endZ, that
way the fog should no logner make the screen black like it did in earlier versions of the cinematic system.
You can use it outside the script system with the following function, which will cause the engine to change
the fog from it's current condition to the desired values over a given duration. As with the script system's
function, the colour parameters should be between 0.0 and 100.0.
//function ApplyFog takes real startZ, real endZ, real red, real green, real blue, real duration returns nothing
THE UNSHADED FADE FILTER
Since the WC3 fade filters are affected by global lightning, you can't get a white fade during the night
or if you're using custom daynightmodels. To get around this, the unshaded fade filter engine was created.
It only works if the camera is working, so it can only be used within cinematics. It works by always
keeping a unit in front of the camera with a custom unshaded white plane model and changing the unit's
vertex colouring. To set that unit up, read the "Setting things up" section of the documentation. This unit
has limitations, it may not manage to follow the camera always, for example it cannot go below ground.
Since it doesn't work when the camera isn't active, it is mostly used through the script system, but you
can use the following function as well. As with the script system's function, the colour parameters should
be between 0.0 and 100.0.
//function ApplyFade takes real red, real green, real blue, real opacity, real duration returns nothing
THE SUBTITLE ENGINE
This engine allows for more movie-like subtitles. Using game messages, it displays subtitles at the bottom
of the visible area. The subtitles displayed this way are automaticaly centered no matter how long the
line is (unless it's too long for the game to fit into one line). You can use this engine outside the script
system as well, using the following functions:
//function DisplaySubtitle takes string line1 returns nothing
//function ClearSubtitles takes nothing returns nothing
You can prevent the script system from displaying subtitles by setting the cinS_displaySubtitles variable
to false. The default value of the variable is true. This variable only affects the script system, if you
call the above mentioned functions externally they will not be affected.
//TESH.scrollpos=0
//TESH.alwaysfold=0
To run the cinematic, use the following function:
//function PlayScene takes integer scene returns nothing
This allows you to run any scene from it's beginning. The script system will then follow the script from
that point on, executing consecutive scenes if each of them is properly scripted and includes a "next scene"
action. You can interrupt the system by using this function to play "scene 0", this throws the system into
idle mode. The system also goes into idle mode automaticaly if a scene ends without a "next scene" action.
When testing your cinematic, you might want to test only the most recent additions to a scene, not watch
it entirely. For testing purposes, there is another function that allows this. It makes the system start
playing a scene from a certain point, only executing actions after that point. This means it doesn't do
any of the previous actions, though, so some actors might not be where you want them, if you move them
there before the time when you choose to start playing your scene from. The function to do this is:
//function PlaySceneFromTime takes integer scene, real time returns nothing
//TESH.scrollpos=0
//TESH.alwaysfold=0
This system was first used in The Spirit of Vengeance, a cinematic
made by iNfraNe and Anitarf for the Blizzard's cinematic contest.
Please give credit to Anitarf and iNfraNe if you use this system.
If you have any comments, questions or suggestions for this system,
you can contact Anitarf at www.wc3campaigns.net.
//TESH.scrollpos=0
//TESH.alwaysfold=0
Version 1.5b
- Made the system compatible with Warcraft patch 1.24
Version 1.5
- Added subtitle display function for movie-like subtitles
- Added unshaded fade filters, see the "other engines" chapter for more detail
- Added a lock-camera-on-unit feature for camera position and camera facing
- Added a function to the script system for changing individual camera properties
- Tweaked the camera movement to be more precise over uneven terrain
- Did some more optimisation on the particle system
Version 1.4
- Added a fog engine for gradual changes of fog distance and colour
- Redid the particle and camera systems so they should run faster
- the particle system can now only work with units that are actors
- you mustn't change the unit custom value of actors for the system to work
- Added unit scaling support to the particle and scripting systems
- The camera trigger can now be turned on or off, for use in playable maps
- Did some more optimisation to the script system functions
Version 1.3
- Did some performance optimisation; thanks to Vexorian for pointing some things out
Version 1.2
- First public release
//TESH.scrollpos=0
//TESH.alwaysfold=0
-Loading Screen by SaMmM/hellohihi
-Cinematic System by Anitarf and Infrane
-BlazingWind by JetFangInferno
-Various Grass/Tree models from Ultimate Terraining Map (UTD)
-DotA Allstars by IceFrog
-Anti-mage SFX
-Zack
-TheWrongVine
//TESH.scrollpos=0
//TESH.alwaysfold=0
library QuickTextTag
//================================================
// QuickTextTag (QTT)
//
// Just playing around with TextTags, so I made this
// while testing around with libraries and this.
//
// call QTT( msg, x, y, angle, duration, size )
//
//================================================
function QTT takes string Message, real x, real y, real angle, real dur, real size returns nothing
local texttag tt = CreateTextTag()
local real vel = 90 * 0.071 / 128
local real xvel = vel * Cos( angle )
local real yvel = vel * Sin( angle )
call SetTextTagText( tt, Message, size * 0.0023 )
call SetTextTagPos( tt, x, y, 0 )
call SetTextTagPermanent( tt, false )
call SetTextTagVelocity( tt, xvel, yvel )
call SetTextTagFadepoint( tt, dur - 0.50 )
call SetTextTagLifespan( tt, dur )
set tt = null
endfunction
endlibrary
//TESH.scrollpos=11
//TESH.alwaysfold=0
//scope AnimIndexes initializer Init
//globals
//===
//private group g = CreateGroup()
//private integer i = 0
//endglobals
// FUCK SAVING THEN TEST BUTTON, SAVES ME 5 SECONDS, OR MORE
function Animate takes nothing returns nothing
call SetUnitAnimationByIndex(GetEnumUnit(),udg_i)
endfunction
function Actionszz takes nothing returns nothing
set udg_i = 0
call DisableTrigger(GetTriggeringTrigger())
call GroupClear(udg_g)
call GroupEnumUnitsSelected(udg_g,Player(0),null)
loop
exitwhen udg_i>25
call ForGroup(udg_g,function Animate)
call BJDebugMsg("|cffffcc00"+I2S(udg_i))
call TriggerSleepAction(2)
set udg_i = udg_i + 1
endloop
call EnableTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Anim_Indexs takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterPlayerChatEvent( trig, Player(0), "-anim", true )
call TriggerAddAction( trig, function Actionszz )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_MovieInit_Actions takes nothing returns nothing
call CinematicModeBJ( true, bj_FORCE_ALL_PLAYERS )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0., "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
call FogEnableOff()
call FogMaskEnableOff()
call SetGameSpeed( MAP_SPEED_SLOWEST )
call InitCinematicSystem()
//call CinematicCameraDisable()
call SetTimeOfDayScale(0)
call SuspendTimeOfDay(not false)
// Main CHAR
call ActorCreate( Player(0), 1, 'o000' )
call ActorCreate( Player(0), 0, 'E000' )
call ActorCreate( Player(0), 3, 'E000' ) // Blinker
call ActorCreate( Player(0), 4, 'E000' ) // Blinker
call ActorAssign( gg_unit_earc_0008, 10 )
call ActorAssign( gg_unit_earc_0012, 11 )
call ActorAssign( gg_unit_earc_0013, 12 )
// Dummioes
call ActorCreate( Player(0), 7, 'e003' )
call SetUnitPosition( udg_cinS_actor[3], GRX( gg_rct_AM_Start ) + 2000, 0 )
call SetUnitPosition( udg_cinS_actor[0], GRX( gg_rct_AM_Start ), GRY( gg_rct_AM_Start ) )
call SetUnitPosition( udg_cinS_actor[1], GRX( gg_rct_BS_Rape ), GRY( gg_rct_BS_Rape ) )
call SetUnitColor( udg_cinS_actor[0], PLAYER_COLOR_BLUE )
call SetUnitColor( udg_cinS_actor[1], PLAYER_COLOR_RED )
call SetUnitColor( udg_cinS_actor[3], PLAYER_COLOR_BLUE )
call SetUnitColor( udg_cinS_actor[4], PLAYER_COLOR_BLUE )
call ActorWalkProperties( 'o000', 7, 0.866, 275 )
call ActorWalkProperties( 'E000', 8, 0.867, 320 )
call SetUnitFacing( udg_cinS_actor[0], 0 )
call SetUnitFacing( udg_cinS_actor[1], 180 )
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 0)
call SetSkyModel( "Environment\\Sky\\FelwoodSky\\FelwoodSky.mdl" )
call ShowUnit( udg_cinS_actor[0], false )
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_MovieInit takes nothing returns nothing
set gg_trg_MovieInit = CreateTrigger( )
call TriggerAddAction( gg_trg_MovieInit, function Trig_MovieInit_Actions )
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function Trig_Scene2_Actions takes nothing returns nothing
local real t = 0.00
call WriteToScene(1)
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 2000, 7000, z255ToPercent( 0), z255ToPercent( 100 ), z255ToPercent( 255 ), 2 )
call ScriptActTurn( t, 1, 225, 1, 1 )
call ScriptActAnimPlay( t+8, 1, 4, 0.14 )
call ScriptActSlide( t+7.4, 1, 5200, -3650, 1.2, 500 )
call ScriptCamera( t+0.00, 100, 0, 1 )
call ScriptCamera( t+0.01, 101, 6, 4 )
call ScriptCamera( t+6.01, 101, 6, 1 )
call ScriptActAnimPlay( t+8.3, 10, 4, 0.14 )
call ScriptCamera( t+7.6, 102, 2, 4 )
call ScriptCamera( t+9.6, 102, 1, 1 )
call ScriptCamera( t+9.7, 103, .7, 4 )
call ScriptCamera( t+10.4, 103, 1, 1 )
call ScriptExternalFunc( t+8.5, "STOPMOVING" )
call ScriptActSlide( t+8.4, 1, GRX(gg_rct_BS_Image), GRY(gg_rct_BS_Image), 0.5, 800 )
call ScriptActAnimPlay( t+6, 1, 5, 0.14 )
call ScriptActAnimPlay( t+8.67, 11, 4, 0.14 )
call ScriptActAnimPlay( t+8.77, 12, 4, 0.14 )
call ScriptActAnimPlay( t+8.87, 10, 4, 0.14 )
call ScriptActTurn( t+9.1, 1, 90, .5, 0 )
call ScriptActAnimPlay( t+9.7, 1, 0, 0.14 )
call ScriptActTurn( t+11.7, 1, 180, .8, 1 )
call ScriptActWalk( t+13.7, 1, GRX( gg_rct_BS_Start ), GRY( gg_rct_BS_Start ), 1, 0.14 )
call ScriptActAnimReset( t+14.71, 1 )
call ScriptActTurn( t+14.81, 1, 180, 0.20, 1 )
call ScriptPlaySound( t+8.67, "Units\\NightElf\\Archer\\ArcherDeath1.wav", 1, 127 )
call ScriptPlaySound( t+8.77, "Units\\NightElf\\Archer\\ArcherDeath1.wav", 1, 127 )
call ScriptPlaySound( t+8.87, "Units\\NightElf\\Archer\\ArcherDeath1.wav", 1, 127 )
call ScriptCamera( t+12, 104, 2, 4 )
call ScriptCamera( t+14, 104, 1, 1 )
call ScriptExternalFunc( t+12, "Unhide" )
call ScriptCamera( t+14.9, 105, 1, 4 )
call ScriptNextScene( t+14.90 )
endfunction
// Order Archers to stop moving.
function STOPMOVING takes nothing returns nothing
call IssueImmediateOrder( udg_cinS_actor[10], "stop" )
call IssueImmediateOrder( udg_cinS_actor[11], "stop" )
call IssueImmediateOrder( udg_cinS_actor[12], "stop" )
endfunction
// Unhide Magina.
function Unhide takes nothing returns nothing
call ShowUnit( udg_cinS_actor[0], true )
endfunction
//===========================================================================
function InitTrig_Scene1 takes nothing returns nothing
set gg_trg_Scene1 = CreateTrigger( )
call TriggerAddAction( gg_trg_Scene1, function Trig_Scene2_Actions )
endfunction
//TESH.scrollpos=666
//TESH.alwaysfold=0
constant function PART_2 takes nothing returns real
return 18.75
endfunction
constant function PART_3 takes nothing returns real
return 31.75
endfunction
constant function PART_4 takes nothing returns real
return PART_3()+12.7
endfunction
function S2P1 takes nothing returns nothing
local real t = 0.00
call WriteToScene( 2 )
call ScriptCamera( t+.9, 105, 1, 1 )
// Setup fog and play sound because it bugs up for some reason.
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 2000, 7000, z255ToPercent( 0), z255ToPercent( 100 ), z255ToPercent( 255 ), 2 )
call ScriptPlaySound( t+17, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 0 )
// Jump and clash.
call ScriptActAnimSpeed( t+0.90, 1, 0.8 )
call ScriptActAnimSpeed( t+1.5, 0, 0.8 )
call ScriptActAnimPlay( t+1.3, 1, 5, 0.14 )
call ScriptActAnimPlay( t+1.4, 0, 5, 0.14 )
call ScriptActSlide( t+1, 1, GRX( gg_rct_BS_Jump ), GRY( gg_rct_BS_Jump ), 1.9, 900 )
call ScriptActSlide( t+1, 0, GRX( gg_rct_AM_Jump ), GRY( gg_rct_AM_Jump ), 2, 900 )
//call ScriptCamera(t+1.25, 1, .5, 3 )
//call ScriptCamera(t+1.75, 1, 1, 1 )
// Fall down. KB each other.
call ScriptPlaySound( t+1.9, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", .5, 120 )
call ScriptActSlide( t+1.85, 0, GRX( gg_rct_BS_Jump ), GRY( gg_rct_BS_Jump ),.7, 600 )
call ScriptActSlide( t+1.85, 1, GRX( gg_rct_AM_Jump ), GRY( gg_rct_AM_Jump ),.7, 600 )
// Blink to him.
call ScriptActColour( t+2.85, 3, 100, 100, 100, 0, 1 )
call ScriptActSlide( t+2.84, 3, GRX( gg_rct_BS_Jump ), GRY( gg_rct_BS_Jump ), 0, 0 )
call ScriptActAnimPlay( t+2.85, 3, 9, 0.01 ) // Dummy animation
call ScriptActAnimPlay( t+2.84, 0, 9, 0.14 ) // Real animation
call ScriptCamera(t+1.9, 2, 1, 3 ) // CAMERA CHANGE: 4
call ScriptCamera(t+2.9, 2, 1, 1 )
call ScriptActTurn( t+3.2, 0, 180, 0.01, 0 )
call ScriptActSlide( t+2.99, 0, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), 0, 0 )
// AM hits BS twice in a row. First attack.
call ScriptPlaySound( t+3.6, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+3.5, 0, 6, 0.2 )
call ScriptPlaySound( t+3.9, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 127 )
call ScriptActEffect( t+3.9, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+3.9, 1, GRX( gg_rct_BS_Feedbacked ), GRY( gg_rct_BS_Feedbacked ), .4, 600 )
// Second attack.
call ScriptActSlide( t+4.2, 0, GRX( gg_rct_BS_Feedbacked ) + 90 * Cos( bj_DEGTORAD * 180 ), GRY( gg_rct_BS_Feedbacked ) + 90 * Sin( bj_DEGTORAD * 180 ), .7, 100 )
call ScriptPlaySound( t+4.3, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+4.35, 0, 5, 0.2 )
call ScriptActTurn( t+4.6, 1, 0, 0.1, 1 )
call ScriptActSlide( t+4.62, 1, GRX( gg_rct_BS_Feedbacked ) + 150 * Cos( bj_DEGTORAD * 180 ), GRY( gg_rct_BS_Feedbacked ) + 150 * Sin( bj_DEGTORAD * 180 ), .5, 600 )
call ScriptPlaySound( t+4.6, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 127 )
call ScriptActEffect( t+4.6, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
// BS pushes AM away.
call ScriptActAnimPlay( t+4.8, 1, 5, 0.14 )
call ScriptPlaySound( t+5.2, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .6, 120 )
call ScriptActSlide( t+5.2, 0, GRX( gg_rct_AM_KB ), GRY( gg_rct_AM_KB ), .6, 600 )
// Charge again, but end up KB each other again.
call ScriptActWalk( t+5.3, 1, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptActWalk( t+5.7, 0, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptActAnimPlay( t+6.1, 1, 5, 0.14 )
call ScriptActAnimPlay( t+6.1, 0, 6, 0.14 )
call ScriptPlaySound( t+6.4, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .8, 120 )
call ScriptActSlide( t+6.5, 0, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), .8, 000 )
call ScriptActSlide( t+6.5, 1, GRX( gg_rct_BS_KB ), GRY( gg_rct_BS_KB ), .7, 000 )
call ScriptCamera(t+5.9, 3, .7, 1 )
// Ot oh, BS jumps attack, but misses :D
call ScriptActWalk( t+7.4, 1, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptActWalk( t+7.4, 0, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptCamera(t+7.3, 4, 1, 3 )
call ScriptCamera(t+8.3, 4, 1, 1 )
call ScriptActSlide(t+7.9, 1, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 1100 )
call ScriptActAnimPlay( t+8, 1, 4, 0.14 )
call ScriptActAnimPlay( t+8.4, 0, 9, 0.14 )
call ScriptActSlide(t+8.5, 0, GRX( gg_rct_BS_Start ), GRY( gg_rct_BS_Start ), .3, 0 )
call ScriptExternalFunc(t+8.4, "Miss" )
// BS does an uppercut move on AM.
call ScriptActTurn( t+8.5, 1, 180, 0.10, 0 )
call ScriptActAnimPlay( t+8.7, 1, 11, 0.1 ) // BS uppercut move
call ScriptActAnimReset( t+10.1, 1 )
call ScriptPlaySound( t+8.9, "Sound\\Units\\Combat\\MetalHeavySliceFlesh1.wav", .9, 120 )
call ScriptActSlide(t+8.8, 1, GRX( gg_rct_BS_Start ), GRY( gg_rct_BS_Start ), 1.9, 400 )
call ScriptActAnimPlay( t+8.95, 0, 6, 0.01 ) // AM hurt
call ScriptActAnimSpeed(t+8.9, 0, .5 )
call ScriptActTurn( t+9, 0, 0, 0.1, 0 ) // AM turn
call ScriptActSlide(t+9.05, 0, GRX( gg_rct_BS_KB ), GRY( gg_rct_BS_KB ), 2.2, 600 ) // AM push
// Play half of AM death sound.
call ScriptExternalFunc( t+9.4, "Trig_StopSound_Actions" )
// Blood FX.
call ScriptActEffect( t+9.3, 0, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "origin", 0 )
call ScriptActEffect( t+9.05, 0, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "origin", 0 )
call ScriptActEffect( t+9.2, 1, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "weapon", 0 )
call ScriptActEffect( t+9.7, 1, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "weapon", 0 )
call ScriptActAnimSpeed(t+10.3, 0, .95 )
call ScriptActAnimPlay (t+10.4, 0, 6, 0.02 )
call ScriptActSlide( t+10.5, 0, GRX( gg_rct_AM_UC ), GRY( gg_rct_AM_UC ), 1.05, 1200 )
// Camera focuses on AM on the ground. Blood squirts. RAGE.
call ScriptCamera(t+11.5, 6, 1, 1 )
call ScriptCamera(t+12, 7, 2, 2 )
call ScriptCamera(t+14, 7, 1, 1 )
call ScriptActEffect( t+12.5, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
// Suddenly AM fades out. AM has Blinked.
call ScriptActSlide( t+15, 0, GRX( gg_rct_AM_Rage ), GRY( gg_rct_AM_Rage ), 0, 0 )
call ScriptActSlide( t+15, 3, GRX( gg_rct_AM_UC ), GRY( gg_rct_AM_UC ), 0, 0 )
call ScriptActAnimPlay( t+14.9, 3, 9, 0.14 )
call ScriptActColour( t+14.9, 3, 100, 100, 100, 100, 0.00 )
call ScriptActColour( t+15, 3, 100, 100, 100, 0, 1 )
call ScriptActAnimSpeed(t+16, 0, 1 )
call ScriptActAnimPlay( t+16, 0, 9, 0.14 ) // Blink anim.
// AM is on a frenzy and strikes.
call ScriptActSlide( t+16.6, 0, GRX( gg_rct_AM_KB ), GRY( gg_rct_AM_KB ), 3, 0 )
call ScriptActSlide( t+16.3, 1, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), 2.7, 0 ) // Push BS
call ScriptCamera(t+16, 8, 1, 1 )
// Strike.
call ScriptPlaySound( t+16.7, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+16.6, 0, 5, 0.14 ) // Attack
call ScriptPlaySound( t+17.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+17.1, 0, 6, 0.14 ) // Attack
call ScriptPlaySound( t+17.8, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+17.6, 0, 5, 0.11 ) // Attack
call ScriptActAnimPlay( t+16.7, 1, 5, 0.1 ) // BS counter
call ScriptActAnimPlay( t+17.3, 1, 4, 0.1 ) // BS counter
call ScriptPlaySound( t+16.7, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .7, 120 ) // CLASH
call ScriptPlaySound( t+17.3, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .6, 120 ) // CLASH
call ScriptActAnimPlay( t+17.5, 1, 3, 0.15 ) // BS struck.
call ScriptPlaySound( t+17.7, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+17.7, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+17.6, 0, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), 1.1, 500 )
call ScriptActSlide( t+17.65, 1, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), .8, 900 )
call ExecuteFunc( "S2P2" )
endfunction
// Used in Scene 1.
function Miss takes nothing returns nothing
call QTT( "|cffff0000miss!|r", GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), bj_DEGTORAD * 90.00, 2, 13 )
endfunction
function S2P2 takes nothing returns nothing
local real t = PART_2()
// PLAY FROM SCENE SETUP
call ScriptActSlide( t, 0, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), 0, 0 )
call ScriptActSlide( t, 1, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 0, 0 )
call ScriptCamera( t, 8, 1, 1 )
// SCENE 1 - PART 2 - ACTION
// MANA VOID, BUT MISS.
call ScriptActAnimPlay( t+0.3, 0, 9, 0.14 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 60, "Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdx", 0.01 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 60, "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl", 0.01 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 0, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 90, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 180, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 270, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 360, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 450, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 540, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 630, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 720, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 810, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 920, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPlaySound( t+.3, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 120 )
call ScriptPlaySound( t+.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 120 )
call ScriptPlaySound( t+.5, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 120 )
// BS dodges.
call ScriptActAnimPlay(t+0.10, 1, 5, 0.15 )
call ScriptActSlide( t+.2, 1, GRX( gg_rct_BS_EVADE ), GRY( gg_rct_BS_EVADE ), .5, 300 )
call ScriptCamera( t+.1, 9, .3, 2 )
call ScriptCamera( t+.4, 9, .3, 1 )
// Bloodrage.
call ScriptActSlide( t+.4, 0, GRX( gg_rct_AM_UltiRetract ), GRY( gg_rct_AM_UltiRetract ), 2, 0 )
call ScriptActAnimPlay( t+.7, 0, 6, 0.5 )
call ScriptActAnimSpeed( t+.6, 0, 0.7 )
call ScriptActAnimPlay( t+1, 1, 2, 0.5 )
call ScriptActEffect( t+1.5, 1, "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdx", "hand, left", 5 )
call ScriptActEffect( t+1.5, 1, "war3mapImported\\HeadhunterWEAPONSRight_NoSound.mdx", "hand, right", 5 )
// BS charges.
call ScriptActAnimSpeed( t+1.7, 0, 1 )
call ScriptActWalk( t+2.1, 0, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 2, 0.2 )
call ScriptActWalk( t+ 2.3, 1, GRX( gg_rct_AM_KB ), GRY( gg_rct_AM_KB ), 1.4, 0.2 )
// Initial block.
call ScriptActAnimPlay( t+3, 1, 4, 0.14 )
call ScriptActAnimPlay( t+3.5, 1, 5, 0.14 )
call ScriptActSlide( t+ 3.3, 0, GRX( gg_rct_AM_UltiRetract ), GRY( gg_rct_AM_UltiRetract ), .9, 0 )
call ScriptPlaySound( t+3.4, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", .9, 120 ) // CLASH
call ScriptActAnimPlay( t+3.3, 0, 2, 0.14 )
// AM KB'd
call ScriptActSlide( t+ 3.7, 0, GRX( gg_rct_AM_BSRageKB ), GRY( gg_rct_AM_BSRageKB ), 2, 0 )
call ScriptCamera( t+3.4, 10, 0.30, 3 )
call ScriptCamera( t+3.7, 10, 1, 1 )
// BS strikes AM hard.
call ScriptActSlide( t+4, 0, GRX( gg_rct_AM_BSRageKB ), GRY( gg_rct_AM_BSRageKB ), 2, 700 )
call ScriptPlaySound( t+3.8, "Sound\\Units\\Combat\\MetalHeavySliceFlesh2.wav", .9, 120 )
call ScriptExternalFunc( t+4, "Trig_StopSound_Actions" )
call ScriptActEffect( t+4.3, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptActEffect( t+4.9, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptActEffect( t+5.4, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptCamera( t+4, 11, 1, 1 )
call ScriptActAnimSpeed( t+6, 0, 0.7 )
call ScriptActAnimPlay( t+6, 0, 7, 0.2 )
call ScriptActAnimSpeed( t+8, 0, 0.01 )
call ScriptCamera( t+6, 12, 1, 1 )
call ScriptActFace( t+8.5, 0, 1, 1, 0, 0, 30, .7 )
call ScriptActFaceReset( t+11, 0, 0.00 )
call ScriptActSlide( t+8.5, 1, GRX( gg_rct_AM_BSRageKB ) + 128 * Cos( 0 ), GRY( gg_rct_AM_BSRageKB ) + 128 * Sin( 0 ), 2, 600 )
call ScriptActAnimSpeed(t+10.2, 1, 0.7 )
call ScriptActAnimPlay( t+10.4, 1, 4, 0.14 )
// AM Blinks away.
call ScriptPlaySound( t+11, "Sound\\Units\\Combat\\EtherealMediumHit2.wav", 1, 127 )
call ScriptActColour( t+10.9, 0, 100, 100, 100, 0, 1 )
call ScriptActSlide( t+11.9, 0, GRX( gg_rct_AM_BleedHere ), GRY( gg_rct_AM_BleedHere ), 0, 0 )
call ScriptCamera( t+10, 11, 1, 1 )
call ExecuteFunc( "S2P3" )
endfunction
function S2P3 takes nothing returns nothing
local real t = PART_3()
local real looper = 0
local real timerx = 0
local real tt
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 1000, 6000, z255ToPercent( 0), z255ToPercent( 100 ), z255ToPercent( 255 ), 2 )
// WRITE TO SCENE STUFF
call ScriptCamera( t, 13, 1, 1 )
call ScriptActSlide( t, 0, GRX( gg_rct_AM_BleedHere ), GRY( gg_rct_AM_BleedHere ), 0, 0 )
call ScriptActSlide( t, 1, GRX( gg_rct_BS_Lightning ), GRY( gg_rct_BS_Lightning ), 0, 600 )
call ScriptActTurn( t, 1, 180, 1, 1 )
// SETUP STRYGYRE VISION. Vision is dealt with MoveLighning, RaiseLightningHun mainly.
call ScriptActColour( t, 0, 100, 100, 100, 0, 1 )
call ScriptExternalFunc( t+0.01, "Trig_ThirstVision_Actions" )
call ScriptExternalFunc( t+0.01, "VisionStuff" )
//call ScriptActTurn( t+2, 1, AngleBetweenPoints( GetRectCenter( gg_rct_BS_Lightning ), GetRectCenter( gg_rct_BS_LookHere ) ), 2, 0 )
call ScriptActTurn( t+1.25, 1, 90, 0.80, 0 ) // From 180 to 90 is 90.
call ScriptActTurn( t+2.10, 1, 135, 0.50, 1 ) // From 90 to 135 is 45.
call ScriptActTurn( t+2.95, 1, 65, 1, 0 ) // From 135 to 65 is 70.
call ScriptActTurn( t+4, 1, 5, 1, 0 ) // From 65 to 1 is 64.
call ScriptActTurn( t+5.25, 1, 305, .5, 0 ) // +56
call ScriptActTurn( t+6.1, 1, 255, 1.5, 0 ) // +50
call ScriptActTurn( t+7.8, 1, 225, .3, 0 ) // +50
// Face AM invis loc - 360 degrees
//call ScriptActTurn( t+4.8, 1, 0, 1.4, 0 )
// Face AM invis loc - 225 degrees
//call ScriptActTurn( t+6.3, 1, 225, 1, 0 )
call ScriptExternalFunc( t+8.1, "RaiseLightning" )
//function ScriptCameraStat takes real time, integer statID, real duration, real endValue, real endSpeed, integer changeType returns nothing
call ScriptActTurn( t+8.2, 1, -121, .8, 0 )
set tt = 8.2+2.2
call ScriptCameraIgnoreTerrain( t+9.91, true )
//camera statID list
//1 - x coordinate; 2 - y coordinate; 3 - z coordinate;
//4 - facing angle; 5 - angle of attack; 6 - roll angle;
//7 - field ov view; 8 - far z; 9 - distance to target
call ScriptCameraStat( t+tt, 1, 0, GRX( gg_rct_BS_Lightning ), 0, 1 ) // x
call ScriptCameraStat( t+tt, 2, 0, GRY( gg_rct_BS_Lightning ), 0, 1 ) // y
call ScriptCameraStat( t+tt, 3, 0, 110, 0, 1 ) // z
call ScriptCameraStat( t+tt, 4, 0, -125, 0, 1 ) // angle
call ScriptCameraStat( t+tt, 5, 0, 360, 0, 1 ) // AoA
call ScriptCameraStat( t+tt, 6, 0, 0, 0, 1 ) // rotation roll angle
call ScriptCameraStat( t+tt, 7, 0, 65, 0, 1 ) // field of view
call ScriptCameraStat( t+tt, 8, 0, 6500, 0, 1 ) // far z
call ScriptCameraStat( t+tt, 9, 0, 10, 0, 1 ) // dist to target
call ScriptExternalFunc( t+tt-0.01, "CinematicCameraEnable" )
call ScriptCamera( t+tt+.1, 18, 1, 2 )
call ScriptCamera( t+tt+1, 18, 1, 1 )
// Camera finds AM, he just blinked in.
//call ScriptActTurn( t+tt+-2, 0, 340, .5, 1 )
call ScriptActColour( t+tt+1, 0, 100, 100, 100, 100, .8 ) // Fade
//call ScriptActAnimSpeed( t+tt+1.1, 0, .5 )
call ScriptActAnimSpeed( t+9, 0, 1 )
call ScriptActAnimPlay( t+9.3, 0, 21, 0.01 )
call ScriptActAnimSpeed( t+10.5, 0, 0 )
call ScriptActEffect( t+tt+1, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
//call ScriptActAnimPlay( t+tt+1.2, 0, 20, 0.00 )
//call ScriptActAnimSpeed( t+tt+2, 0, 0 )
call ScriptCameraIgnoreTerrain( t+tt+2.3, false )
call ExecuteFunc( "S2P4" )
endfunction
function S2P4 takes nothing returns nothing
local real t = PART_4()
// FROM SCENE
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 1000, 6000, z255ToPercent( 0), z255ToPercent( 0), z255ToPercent( 128 ), 2 )
call ScriptActAnimSpeed( t, 1, 1 )
call ScriptExternalFunc( t, "OutThirst" )
call ScriptCamera( t, 19, 1, 1 )
//call ScriptActSlide( t, 0, GRX( gg_rct_AM_BleedHere ), GRY( gg_rct_AM_BleedHere ), 0, 0 )
//call ScriptActAnimSpeed( t, 0, 55 )
//call ScriptActTurn( t, 0, 225, 0.50, 0 )
// Scene 1 Part 4 --- Action
// BS Charges then jumps upwards.
//call ScriptActAnimSpeed( t+4.1, 0, 1 )
//call ScriptActAnimPlay( t+0.6, 0, 1, 0.3 )
//call ScriptActTurn( t+4.2, 0, 45, 0.8, 0 )
call MakeUnitFlyable( udg_cinS_actor[1] )
call ScriptActWalk( t+1.00, 1, GRX( gg_rct_zBS_Run ), GRY( gg_rct_zBS_Run ), 3, 1 )
call ScriptActAnimSpeed( t+4.3, 1, 1.3 )
call ScriptActAnimPlay( t+4.40, 1, 11, 0.3 )
call ScriptActSlide( t+4.20, 1, GRX( gg_rct_zBS_Jump ), GRY( gg_rct_zBS_Jump ), 1.00, 2000 )
// AM STANDS UP AND THEN HOLDS BLADES UP TO DEFEND.
call ScriptActTurn( t+4.7, 0, 45, 0.8, 0 )
call ScriptActAnimPlay( t+4.8, 1, 4, 0.0 )
call ScriptActAnimSpeed( t+4.7, 0, 1 )
call ScriptActAnimPlay( t+4.8, 0, 11, 0.14 )
call ScriptActSlide( t+5.2, 0, GRX( gg_rct_zAM_Evade ), GRY( gg_rct_zAM_Evade ), 0.9, 0 )
call ScriptPlaySound( t+5.1, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .6, 120 )
call ScriptCamera( t+5.1, 20, .9, 3 )
call ScriptCamera( t+6.0, 20, 1, 1 ) // End camera pan.
// AM TAKES THE OFFENSIVE - Attack 1.
call ScriptActTurn( t+4.7, 0, 315, 0.8, 0 )
call ScriptActSlide( t+5.7, 0, GRX( gg_rct_zBS_Jump ), GRY( gg_rct_zBS_Jump ), 1, 0 )
call ScriptPlaySound( t+6.1, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+5.9, 0, 6, 0.14 )
call ScriptCamera( t+6.2, 21, 1, 1 )
call ScriptExternalFunc( t+6.2, "Trig_ResetTree_Actions" )
// Blade crash
call ScriptPlaySound( t+6.4, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .7, 120 )
// BS counter
call ScriptActTurn( t+6, 1, 150, 0.5, 1 )
call ScriptActAnimPlay( t+6, 1, 5, 0.14 )
call ScriptActSlide( t+6.15, 1, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 1, 0 )
call ScriptCamera( t+6.9, 22, 2, 1 )
call ScriptCamera( t+7.9, 22, 1, 1 )
// Run at each other again.
call ScriptActSlide( t+7, 1, GRX( gg_rct_zBS_Jump ), GRY( gg_rct_zBS_Jump ), 1, 0 )
call ScriptActSlide( t+7, 0, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 1, 0 )
call ScriptActAnimPlay( t+7.2, 0, 5, 0.14 )
call ScriptActAnimPlay( t+7.2, 1, 5, 0.14 )
call ScriptPlaySound( t+7.4, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+7.5, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", 1, 120 )
call ScriptActSlide( t+7.5, 1, GRX( gg_rct_zAM_Attack ), GRY( gg_rct_zAM_Attack ), 0.70, 0 )
// AM assaults.
call ScriptActSlide( t+7.80, 0, GRX( gg_rct_zAM_Attack ), GRY( gg_rct_zAM_Attack ), 1, 0 )
call ScriptActAnimPlay( t+8.00, 0, 6, 0.04 )
call ScriptPlaySound( t+8.20, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
// AM hits BS succesfully.
call ScriptActSlide( t+8.6, 1, GRX( gg_rct_zBS_KB ), GRY( gg_rct_zBS_KB ), 0.9, 0 )
call ScriptPlaySound( t+8.6, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+8.6, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
// BS retreat
call ScriptCamera( t+9, 23, 1, 2 )
call ScriptCamera( t+10, 23, 1, 1 )
// No more vision.
call ScriptExternalFunc( t+10, "NoMoreVision" )
call ScriptActWalk( t+9.3, 1, GRX( gg_rct_zBS_Retreat ), GRY( gg_rct_zBS_Retreat ), 2, 0.8 )
call ScriptCamera( t+10.5, 24, 0.5, 3 )
call ScriptCamera( t+11., 24, 1, 1 )
// Blink harrass 1.
call ScriptActSlide( t+10, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 0, 0 )
call ScriptActTurn( t+10.1, 0, 180, 0.1, 1 )
call ScriptActColour( t+9.9, 0, 100, 100, 100, 0, 0 )
call ScriptActColour( t+11, 0, 100, 100, 100, 100, 1 )
call ScriptActAnimPlay( t+11, 0, 9, 0.14 )
call ScriptPlaySound( t+11.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+11.4, 0, 5, 0.14 )
call ScriptPlaySound( t+11.7, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+11.7, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+11.7, 1, GRX( gg_rct_zBS_MB ) + 200 * Cos( bj_DEGTORAD * 180 ), GRY( gg_rct_zBS_MB ) + 200 * Sin( bj_DEGTORAD * 180 ), 0.5, 0 )
call ScriptActAnimReset( t+11.7, 1 )
// BS Bloodrage.
call ScriptActEffect( t+12.3, 1, "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdx", "hand, left", 7 )
call ScriptActEffect( t+12.3, 1, "war3mapImported\\HeadhunterWEAPONSRight_NoSound.mdx", "hand, right", 7 )
call ScriptActSlide( t+12.4, 1, GRX( gg_rct_zBS_Retreat ), GRY( gg_rct_zBS_Retreat ), 0.9, 1300 )
call ScriptActAnimPlay( t+13., 1, 4, 0.14 )
// BS attack.
call ScriptPlaySound( t+13, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+12.8, 0, 6, 0.14 )
call ScriptPlaySound( t+13.4, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .8, 120 )
// Force off.
call ScriptActSlide( t+13.4, 0, GRX( gg_rct_zAM_BSCounter ), GRY( gg_rct_zAM_BSCounter ),0.5, 0 )
call ScriptActSlide( t+13.4, 1, GRX( gg_rct_zBS_MB ), GRY( gg_rct_zBS_MB ), 0.5, 0 )
// BS not idle.
call ScriptActTurn( t+14.1, 1, 180, 0.3, 1 )
call ScriptActAnimPlay( t+14, 1, 10, 0.14 )
// AM Blink behind.
call ScriptActTurn( t+13.95, 0, 180, 0, 0 ) // Face 180 at BS
call ScriptActColour( t+13.95, 3, 100, 100, 100, 100, 0 ) // Prepare color for dummy
call ScriptActColour( t+13.98, 3, 100, 100, 100, 0, 1 )
// Instant move dummy
call ScriptActSlide( t+13.98, 3, GRX( gg_rct_zAM_BSCounter ), GRY( gg_rct_zAM_BSCounter ), 0, 0 )
call ScriptActAnimPlay( t+13.99, 3, 9, 0.14 ) // play dummy spell anim
call ScriptActColour( t+14.0, 0, 100, 100, 100, 0, 0 ) // REAL coloring
call ScriptActColour( t+14.03, 0, 100, 100, 100, 100, 0.8 )
// Instant move to BS spot for REAL and play animation
call ScriptActSlide( t+14., 0, GRX( gg_rct_zAM_BH2 ), GRY( gg_rct_zAM_BH2 ), 0, 0 )
call ScriptActAnimPlay( t+14., 0, 9, 0.14 )
call ScriptPlaySound( t+14.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay(t+14.2, 0, 6, 0.14 )
call ScriptPlaySound( t+14.23, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+14.23, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+14.23, 1, GRX( gg_rct_zBS_Retreat ), GRY( gg_rct_zBS_Retreat ), 0.9, 0 )
// AND ONCE MORE.
call ScriptActTurn( t+15, 0, 180, 0, 0 )
call ScriptActColour( t+14.9, 4, 100, 100, 100, 100, 0 )
call ScriptActColour( t+14.9, 4, 100, 100, 100, 0, 1 )
call ScriptActSlide( t+14.8, 4, GRX( gg_rct_zAM_BH2 ), GRY( gg_rct_zAM_BH2 ), 0, 0 )
call ScriptActAnimPlay( t+14.4, 4, 9, 0.14 )
call ScriptActColour( t+14.9, 0, 100, 100, 100, 0, 0 )
call ScriptActColour( t+14.93, 0, 100, 100, 100, 100, 0.8 )
call ScriptActSlide( t+14.9, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 0, 0 )
call ScriptActAnimPlay( t+15., 0, 9, 0.14 )
call ScriptPlaySound( t+15.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+15.4, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 115 )
call ScriptActEffect( t+15.4, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptPlaySound( t+15.3, "Units\\Orc\\Shaman\\ShamanDeath.wav", 1, 127 )
call ScriptPlaySound( t+15.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 110 )
call ScriptPlaySound( t+15.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 110 )
call ScriptPlaySound( t+15.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 110 )
call ScriptActSlide( t+15.3, 1, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 1.5, 600 )
call ScriptCamera( t+15.9, 25, 1, 1 )
//call BJDebugMsg( R2S((t+15.9+1.5)-PART_4()))
call ExecuteFunc( "S2P5" )
endfunction
function S2P5 takes nothing returns nothing
local real t = PART_4() + 17.4
local integer i = 0
local real tt = 0.4
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 1000, 6000, z255ToPercent( 0), z255ToPercent( 0), z255ToPercent( 128 ), 2 )
// Setting up positions for Play Scene From Time.
call ScriptActSlide( t, 1, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 0, 0 )
call ScriptActSlide( t, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 0, 0 )
call ScriptActAnimSpeed( t, 1, 1 )
call ScriptCamera( t, 25, 1, 1 )
call ScriptActTurn( t, 0, 180, 0.01, 0 )
// AM charges at the Raged BS.
call ScriptActSlide( t+0.5, 0, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 2, 600 )
call ScriptActAnimPlay( t+1.9, 0, 6, 0.14 )
call ScriptPlaySound( t+2.1, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
// AM bounces off the Level-Up SFX.
call ScriptActSlide( t+2.3, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 3.5, 350 )
call ScriptPlaySound( t+2.3, "Sound\\Units\\Combat\\EtherealMediumHit3.wav", 1, 127 )
call ScriptActTurn( t+5.85, 0, 161, 0.5, 1 )
call ScriptActAnimPlay( t+5.9, 0, 21, 0.14 )
call ScriptActAnimSpeed( t+7.1, 0, 0 )
// RAGE :D
call ScriptActColour( t+1.05, 1, z255ToPercent( 40 ), z255ToPercent( 40 ), z255ToPercent( 40 ), 100, 0.9 )
call ScriptActAnimPlay( t+1.05, 1, 9, 0.3 )
loop
exitwhen i == 10
call ScriptPlaySound( t+1.3+tt, "abilities\\Spells\\Other\\Levelup\\Levelupcaster.wav", 1, 117 )
call ScriptActEffect( t+1.3+tt, 1, "Abilities\\Spells\\Other\\Levelup\\Levelupcaster.mdx", "origin", 0 )
set tt = tt + 0.15
set i = i + 1
endloop
// Unleash Blood Wave. And Silence AM.
call ScriptActEffect( t+3.7, 0, "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdx", "hand, left", 7 )
call ScriptActEffect( t+3.7, 0, "war3mapImported\\HeadhunterWEAPONSRight_NoSound.mdx", "hand, right", 7 )
call ScriptActTurn( t+3.1, 1, udg_BloodAngle, 0.5, 0 )
call ScriptActAnimPlay( t+3.7, 1, 8, 0.5 )
call ScriptExternalFunc( t+4, "BloodPath" )
set i = 0
set tt = 0
loop
exitwhen i == 15
call ScriptPlaySound( t+4+tt, "Sound\\Units\\Death\\ArtilleryCorpseExplodeDeath1.wav", 1, 117 )
set tt = tt + 0.1
set i = i + 1
endloop
call ScriptCamera( t+4.4, 26, 3, 4 )
//call ScriptCamera( t+(4.4+5), 26, 1, 1 )
// Camera finds AM gone?
call ScriptCamera( t+7, 28, 1, 1 )
call ScriptActColour( t+7, 1, z255ToPercent( 255 ), z255ToPercent( 150 ), z255ToPercent( 100 ), 100, 0.01 )
call ScriptActSlide( t+6.5, 0, GRX( gg_rct_zAM_UltiKB ), GRY( gg_rct_zAM_UltiKB ), 1.6, 0 )
call ScriptActAnimSpeed( t+7.9, 0, 1 )
call ScriptActAnimPlay( t+8.1, 0, 1, 0.14 )
// Attack from BS to AM, which causes his SUPER ULTI.
call ScriptActSlide( t+8.2, 1, GRX( gg_rct_zAM_UltiKB ), GRY( gg_rct_zAM_UltiKB ), 1.8, 500 )
call ScriptActAnimPlay( t+9.5, 1, 4, 0.14 )
call ScriptPlaySound(t+9.9, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", 0.50, 100)
call ScriptActSlide( t+9.9, 0, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 0.9, 0 )
call ScriptPointEffect(t+8.2, 5295, -7535.0, 50.0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl", 3)
call ScriptPointEffect(t+8.4, 5305, -7545.0, 50.0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl", 3)
call ScriptActSlide( t+10.3, 1, GRX( gg_rct_zBS_Redraw ), GRY( gg_rct_zBS_Redraw ), 0.6, 0 )
call ScriptActAnimPlay( t+10.4, 1, 1, 0.14 )
call ScriptActSlide( t+11, 1, GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), 0.8, 0 )
call ScriptActAnimPlay( t+11.5, 1, 5, 0.14 )
// Second attack before AM PSYCHO
call ScriptCamera( t+11.0, 29, 1, 3 )
call ScriptCamera( t+12.0, 29, 1, 1 )
call ScriptExternalFunc( t+11.7, "Trig_StopSound_Actions" )
call ScriptPlaySound(t+11.7, "Sound\\Units\\Combat\\MetalHeavySliceFlesh2.wav", 0.85, 100)
call ScriptActSlide( t+11.7, 0, GRX( gg_rct_BLOODPATH_TARGET ), GRY( gg_rct_BLOODPATH_TARGET ), 0.9, 0 )
call ScriptActAnimPlay( t+11.8, 0, 7, 0.14 )
call ScriptActAnimSpeed( t+13.8, 0, 0 )
call ScriptCamera( t+13.2, 30, 1, 3 )
call ScriptCamera( t+14.2, 30, 1, 1 )
set i = 0
set tt = 0
//call ScriptActAnimPlay( t+14.6, 0, 3, 0.14 )
//call ScriptActAnimSpeed( t+14.5, 0, 1 )
call ScriptActColour( t+14.5, 0, z255ToPercent( 40 ), z255ToPercent( 40 ), z255ToPercent( 40 ), 100, 0.9 )
loop
exitwhen i == 10
call ScriptPlaySound( t+15.5+tt, "abilities\\Spells\\Other\\Levelup\\Levelupcaster.wav", 1, 117 )
call ScriptActEffect( t+15.5+tt, 0, "Abilities\\Spells\\Other\\Levelup\\Levelupcaster.mdx", "origin", 0 )
set tt = tt + 0.15
set i = i + 1
endloop
call ScriptExternalFunc( t+16.8, "UltiVoid" )
call ScriptActAnimSpeed( t+16.7, 0, 1 )
call ScriptActAnimPlay( t+16.7, 0, 9, 0.14 )
call ScriptCamera( t+17, 31, 1, 1 )
set tt = 0
set i = 0
loop
exitwhen i == 11
call ScriptPointEffect( t+17., GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), tt, "war3mapImported\\Enchantment.mdx", 0 )
set tt = tt + 90
set i = i + 1
endloop
call ScriptActAnimPlay( t+16, 1, 6, 0.14 ) //~BS death animation.
call ScriptActSlide( t+17.5, 1, GRX( gg_rct_zBS_ManaVoided ), GRY( gg_rct_zBS_ManaVoided ), 2,700 )
//call ScriptActAnimPlay( t+17.7, 1, 6, 0.14 )
call ScriptActAnimSpeed( t+17.1, 1, 0.50 )
call ScriptPointEffect( t+17., GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), 60, "Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdx", 0 )
call ScriptPointEffect( t+17., GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), 60, "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl", 0 )
call ScriptPlaySound( t+17, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 127 )
call ScriptPlaySound( t+17.1, "Sound\\Buildings\\Death\\NightElfBuildingDeathLarge1.wav", 1, 127 )
call ScriptPlaySound( t+17.2, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 127 )
call ScriptActAnimPlay( t+19.5, 1, 8, 0.14 )
call ScriptActTurn( t+19.6, 1, 180, 0.5, 1 )
call ScriptActTurn( t+20.11, 1, 0, 0.5, 1 )
//call ScriptActAnimPlay( t+18.6, 0, dead, 0.14 )
call ScriptActColour( t+23.2, 0, z255ToPercent( 255 ), z255ToPercent( 255 ), z255ToPercent( 255 ), 100, 0.9 )
call ScriptActAnimReset( t+17.5, 0 )
call ScriptActAnimReset( t+20, 1 )
call ScriptCamera( t+21.1, 32, 0.7, 3 )
call ScriptCamera( t+21.8, 32, 1, 1 )
call ScriptCamera( t+22.7, 33, .7, 3 )
call ScriptCamera( t+23.4, 33, .6, 1 )
// Now run for the final clash soon.
call ScriptActSlide( t+24.3, 0, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 0.02, 100 )
call ScriptActWalk( t+24.3, 0, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 1.00, 1.5 )
call ScriptActWalk( t+24.3, 1, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 1.00, 1.5 )
call ScriptCamera( t+24, 40, 1, 3 )
call ScriptCamera( t+25, 40, 1, 1 )
call ScriptActAnimSpeed( t+25, 1, 1 )
call ScriptActAnimSpeed (t+24, 0, 1 )
call ScriptActAnimPlay( t+25.31, 0, 6, 0.14 )
call ScriptActAnimPlay( t+25.31, 1, 4, 0.14 )
call ScriptActSlide( t+25.3, 1, GRX( gg_rct_zBS_ManaVoided ), GRY( gg_rct_zBS_ManaVoided ), 0.5, 0 )
//call ScriptExternalFunc( t+26, "UltiVoid" )
call ScriptExternalFunc( t+25.6, "FadeOutEverything" )
endfunction
function FadeOutEverything takes nothing returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.00, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction( 1.00 )
call BJDebugMsg( "This cinematic is NEARLY finished. Just need to complete ending and all this other things." )
call BJDebugMsg( "Thanks for watching it so far." )
call BJDebugMsg( "-BlackRose/Indrosion" )
endfunction
// Used in Scene 5.
function UltiVoid takes nothing returns nothing
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
call PolledWait( 0.01 )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
call PolledWait( 0.01 )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
call PolledWait( 0.01 )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
endfunction
// Used in Scene 3.
function BloodPath takes nothing returns nothing
call EnableTrigger( gg_trg_BloodPath )
call TriggerSleepAction( 1.9 )
call EnableTrigger( gg_trg_BloodCont )
endfunction
// Used in Scene 3.
function NoMoreVision takes nothing returns nothing
set udg_FadeLightning = true
endfunction
// Used in Scene 3.
function RaiseLightning takes nothing returns nothing
call EnableTrigger( gg_trg_RaiseLightningHun )
endfunction
// Used in Scene 3.
function OutThirst takes nothing returns nothing
call ShowUnit( udg_cinS_actor[1], true )
call DisableTrigger( gg_trg_MoveLightning )
call EnableTrigger( gg_trg_MoveLightningExtra )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.02, "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp", 100.00, 0, 0, 0.00 )
endfunction
// Used in Scene 3.
function VisionStuff takes nothing returns nothing
call ShowUnit( udg_cinS_actor[1], false )
set udg_BSEffect[3] = AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdl", udg_cinS_actor[1], "overhead" )
call CinematicCameraDisable()
call EnableTrigger( gg_trg_MoveCamera )
call SetLightningColor( udg_RedLightning[1], 1, 0, 0, 1 )
call SetLightningColor( udg_RedLightning[2], 1, 0, 0, 1 )
call DisableTrigger( gg_trg_MoveLightningExtra )
call EnableTrigger( gg_trg_MoveLightning )
endfunction
//===========================================================================
function InitTrig_Scene2 takes nothing returns nothing
set gg_trg_Scene2 = CreateTrigger()
call TriggerAddAction( gg_trg_Scene2, function S2P1 )
endfunction
//TESH.scrollpos=298
//TESH.alwaysfold=0
function S2P1 takes nothing returns nothing
local real t = 0.00
call WriteToScene( 2 )
call ScriptCamera( t+.9, 105, 1, 1 )
// Setup fog and play sound because it bugs up for some reason.
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 2000, 7000, z255ToPercent( 0), z255ToPercent( 100 ), z255ToPercent( 255 ), 2 )
call ScriptPlaySound( t+17, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 0 )
// Jump and clash.
call ScriptActAnimSpeed( t+0.90, 1, 0.8 )
call ScriptActAnimSpeed( t+1.5, 0, 0.8 )
call ScriptActAnimPlay( t+1.3, 1, 5, 0.14 )
call ScriptActAnimPlay( t+1.4, 0, 5, 0.14 )
call ScriptActSlide( t+1, 1, GRX( gg_rct_BS_Jump ), GRY( gg_rct_BS_Jump ), 1.9, 900 )
call ScriptActSlide( t+1, 0, GRX( gg_rct_AM_Jump ), GRY( gg_rct_AM_Jump ), 2, 900 )
//call ScriptCamera(t+1.25, 1, .5, 3 )
//call ScriptCamera(t+1.75, 1, 1, 1 )
// Fall down. KB each other.
call ScriptPlaySound( t+1.9, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", .5, 120 )
call ScriptActSlide( t+1.85, 0, GRX( gg_rct_BS_Jump ), GRY( gg_rct_BS_Jump ),.7, 600 )
call ScriptActSlide( t+1.85, 1, GRX( gg_rct_AM_Jump ), GRY( gg_rct_AM_Jump ),.7, 600 )
// Blink to him.
call ScriptActColour( t+2.85, 3, 100, 100, 100, 0, 1 )
call ScriptActSlide( t+2.84, 3, GRX( gg_rct_BS_Jump ), GRY( gg_rct_BS_Jump ), 0, 0 )
call ScriptActAnimPlay( t+2.85, 3, 9, 0.01 ) // Dummy animation
call ScriptActAnimPlay( t+2.84, 0, 9, 0.14 ) // Real animation
call ScriptCamera(t+1.9, 2, 1, 3 ) // CAMERA CHANGE: 4
call ScriptCamera(t+2.9, 2, 1, 1 )
call ScriptActTurn( t+3.2, 0, 180, 0.01, 0 )
call ScriptActSlide( t+2.99, 0, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), 0, 0 )
// AM hits BS twice in a row. First attack.
call ScriptPlaySound( t+3.6, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+3.5, 0, 6, 0.2 )
call ScriptPlaySound( t+3.9, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 127 )
call ScriptActEffect( t+3.9, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+3.9, 1, GRX( gg_rct_BS_Feedbacked ), GRY( gg_rct_BS_Feedbacked ), .4, 600 )
// Second attack.
call ScriptActSlide( t+4.2, 0, GRX( gg_rct_BS_Feedbacked ) + 90 * Cos( bj_DEGTORAD * 180 ), GRY( gg_rct_BS_Feedbacked ) + 90 * Sin( bj_DEGTORAD * 180 ), .7, 100 )
call ScriptPlaySound( t+4.3, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+4.35, 0, 5, 0.2 )
call ScriptActTurn( t+4.6, 1, 0, 0.1, 1 )
call ScriptActSlide( t+4.62, 1, GRX( gg_rct_BS_Feedbacked ) + 150 * Cos( bj_DEGTORAD * 180 ), GRY( gg_rct_BS_Feedbacked ) + 150 * Sin( bj_DEGTORAD * 180 ), .5, 600 )
call ScriptPlaySound( t+4.6, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 127 )
call ScriptActEffect( t+4.6, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
// BS pushes AM away.
call ScriptActAnimPlay( t+4.8, 1, 5, 0.14 )
call ScriptPlaySound( t+5.2, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .6, 120 )
call ScriptActSlide( t+5.2, 0, GRX( gg_rct_AM_KB ), GRY( gg_rct_AM_KB ), .6, 600 )
// Charge again, but end up KB each other again.
call ScriptActWalk( t+5.3, 1, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptActWalk( t+5.7, 0, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptActAnimPlay( t+6.1, 1, 5, 0.14 )
call ScriptActAnimPlay( t+6.1, 0, 6, 0.14 )
call ScriptPlaySound( t+6.4, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .8, 120 )
call ScriptActSlide( t+6.5, 0, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), .8, 000 )
call ScriptActSlide( t+6.5, 1, GRX( gg_rct_BS_KB ), GRY( gg_rct_BS_KB ), .7, 000 )
call ScriptCamera(t+5.9, 3, .7, 1 )
// Ot oh, BS jumps attack, but misses :D
call ScriptActWalk( t+7.4, 1, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptActWalk( t+7.4, 0, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 0.2 )
call ScriptCamera(t+7.3, 4, 1, 3 )
call ScriptCamera(t+8.3, 4, 1, 1 )
call ScriptActSlide(t+7.9, 1, GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), .9, 1100 )
call ScriptActAnimPlay( t+8, 1, 4, 0.14 )
call ScriptActAnimPlay( t+8.4, 0, 9, 0.14 )
call ScriptActSlide(t+8.5, 0, GRX( gg_rct_BS_Start ), GRY( gg_rct_BS_Start ), .3, 0 )
call ScriptExternalFunc(t+8.4, "Miss" )
// BS does an uppercut move on AM.
call ScriptActTurn( t+8.5, 1, 180, 0.10, 0 )
call ScriptActAnimPlay( t+8.7, 1, 11, 0.1 ) // BS uppercut move
call ScriptActAnimReset( t+10.1, 1 )
call ScriptPlaySound( t+8.9, "Sound\\Units\\Combat\\MetalHeavySliceFlesh1.wav", .9, 120 )
call ScriptActSlide(t+8.8, 1, GRX( gg_rct_BS_Start ), GRY( gg_rct_BS_Start ), 1.9, 400 )
call ScriptActAnimPlay( t+8.95, 0, 6, 0.01 ) // AM hurt
call ScriptActAnimSpeed(t+8.9, 0, .5 )
call ScriptActTurn( t+9, 0, 0, 0.1, 0 ) // AM turn
call ScriptActSlide(t+9.05, 0, GRX( gg_rct_BS_KB ), GRY( gg_rct_BS_KB ), 2.2, 600 ) // AM push
// Play half of AM death sound.
call ScriptExternalFunc( t+9.4, "Trig_StopSound_Actions" )
// Blood FX.
call ScriptActEffect( t+9.3, 0, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "origin", 0 )
call ScriptActEffect( t+9.05, 0, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "origin", 0 )
call ScriptActEffect( t+9.2, 1, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "weapon", 0 )
call ScriptActEffect( t+9.7, 1, "Objects\\Spawnmodels\\Orc\\OrcBlood\\OrdBloodWyvernRider.mdx", "weapon", 0 )
call ScriptActAnimSpeed(t+10.3, 0, .95 )
call ScriptActAnimPlay (t+10.4, 0, 6, 0.02 )
call ScriptActSlide( t+10.5, 0, GRX( gg_rct_AM_UC ), GRY( gg_rct_AM_UC ), 1.05, 1200 )
// Camera focuses on AM on the ground. Blood squirts. RAGE.
call ScriptCamera(t+11.5, 6, 1, 1 )
call ScriptCamera(t+12, 7, 2, 2 )
call ScriptCamera(t+14, 7, 1, 1 )
call ScriptActEffect( t+12.5, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
// Suddenly AM fades out. AM has Blinked.
call ScriptActSlide( t+15, 0, GRX( gg_rct_AM_Rage ), GRY( gg_rct_AM_Rage ), 0, 0 )
call ScriptActSlide( t+15, 3, GRX( gg_rct_AM_UC ), GRY( gg_rct_AM_UC ), 0, 0 )
call ScriptActAnimPlay( t+14.9, 3, 9, 0.14 )
call ScriptActColour( t+14.9, 3, 100, 100, 100, 100, 0.00 )
call ScriptActColour( t+15, 3, 100, 100, 100, 0, 1 )
call ScriptActAnimSpeed(t+16, 0, 1 )
call ScriptActAnimPlay( t+16, 0, 9, 0.14 ) // Blink anim.
// AM is on a frenzy and strikes.
call ScriptActSlide( t+16.6, 0, GRX( gg_rct_AM_KB ), GRY( gg_rct_AM_KB ), 3, 0 )
call ScriptActSlide( t+16.3, 1, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), 2.7, 0 ) // Push BS
call ScriptCamera(t+16, 8, 1, 1 )
// Strike.
call ScriptPlaySound( t+16.7, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+16.6, 0, 5, 0.14 ) // Attack
call ScriptPlaySound( t+17.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+17.1, 0, 6, 0.14 ) // Attack
call ScriptPlaySound( t+17.8, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+17.6, 0, 5, 0.11 ) // Attack
call ScriptActAnimPlay( t+16.7, 1, 5, 0.1 ) // BS counter
call ScriptActAnimPlay( t+17.3, 1, 4, 0.1 ) // BS counter
call ScriptPlaySound( t+16.7, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .7, 120 ) // CLASH
call ScriptPlaySound( t+17.3, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .6, 120 ) // CLASH
call ScriptActAnimPlay( t+17.5, 1, 3, 0.15 ) // BS struck.
call ScriptPlaySound( t+17.7, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+17.7, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+17.6, 0, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), 1.1, 500 )
call ScriptActSlide( t+17.65, 1, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), .8, 900 )
call ExecuteFunc( "S2P2" )
endfunction
// Used in Scene 1.
function Miss takes nothing returns nothing
call QTT( "|cffff0000miss!|r", GRX( gg_rct_AM_Blink ), GRY( gg_rct_AM_Blink ), bj_DEGTORAD * 90.00, 2, 13 )
endfunction
function S2P2 takes nothing returns nothing
local real t = 18.75
// PLAY FROM SCENE SETUP
call ScriptActSlide( t, 0, GRX( gg_rct_AM_KB2 ), GRY( gg_rct_AM_KB2 ), 0, 0 )
call ScriptActSlide( t, 1, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 0, 0 )
call ScriptCamera( t, 8, 1, 1 )
// SCENE 1 - PART 2 - ACTION
// MANA VOID, BUT MISS.
call ScriptActAnimPlay( t+0.3, 0, 9, 0.14 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 60, "Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdx", 0.01 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 60, "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl", 0.01 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 0, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 90, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 180, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 270, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 360, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 450, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 540, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 630, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 720, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 810, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPointEffect( t+0.3, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 920, "war3mapImported\\Enchantment.mdx", 0 )
call ScriptPlaySound( t+.3, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 120 )
call ScriptPlaySound( t+.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 120 )
call ScriptPlaySound( t+.5, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 120 )
// BS dodges.
call ScriptActAnimPlay(t+0.10, 1, 5, 0.15 )
call ScriptActSlide( t+.2, 1, GRX( gg_rct_BS_EVADE ), GRY( gg_rct_BS_EVADE ), .5, 300 )
call ScriptCamera( t+.1, 9, .3, 2 )
call ScriptCamera( t+.4, 9, .3, 1 )
// Bloodrage.
call ScriptActSlide( t+.4, 0, GRX( gg_rct_AM_UltiRetract ), GRY( gg_rct_AM_UltiRetract ), 2, 0 )
call ScriptActAnimPlay( t+.7, 0, 6, 0.5 )
call ScriptActAnimSpeed( t+.6, 0, 0.7 )
call ScriptActAnimPlay( t+1, 1, 2, 0.5 )
call ScriptActEffect( t+1.5, 1, "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdx", "hand, left", 5 )
call ScriptActEffect( t+1.5, 1, "war3mapImported\\HeadhunterWEAPONSRight_NoSound.mdx", "hand, right", 5 )
// BS charges.
call ScriptActAnimSpeed( t+1.7, 0, 1 )
call ScriptActWalk( t+2.1, 0, GRX( gg_rct_BS_FB ), GRY( gg_rct_BS_FB ), 2, 0.2 )
call ScriptActWalk( t+ 2.3, 1, GRX( gg_rct_AM_KB ), GRY( gg_rct_AM_KB ), 1.4, 0.2 )
// Initial block.
call ScriptActAnimPlay( t+3, 1, 4, 0.14 )
call ScriptActAnimPlay( t+3.5, 1, 5, 0.14 )
call ScriptActSlide( t+ 3.3, 0, GRX( gg_rct_AM_UltiRetract ), GRY( gg_rct_AM_UltiRetract ), .9, 0 )
call ScriptPlaySound( t+3.4, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", .9, 120 ) // CLASH
call ScriptActAnimPlay( t+3.3, 0, 2, 0.14 )
// AM KB'd
call ScriptActSlide( t+ 3.7, 0, GRX( gg_rct_AM_BSRageKB ), GRY( gg_rct_AM_BSRageKB ), 2, 0 )
call ScriptCamera( t+3.4, 10, 0.30, 3 )
call ScriptCamera( t+3.7, 10, 1, 1 )
// BS strikes AM hard.
call ScriptActSlide( t+4, 0, GRX( gg_rct_AM_BSRageKB ), GRY( gg_rct_AM_BSRageKB ), 2, 700 )
call ScriptPlaySound( t+3.8, "Sound\\Units\\Combat\\MetalHeavySliceFlesh2.wav", .9, 120 )
call ScriptExternalFunc( t+4, "Trig_StopSound_Actions" )
call ScriptActEffect( t+4.3, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptActEffect( t+4.9, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptActEffect( t+5.4, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptCamera( t+4, 11, 1, 1 )
call ScriptActAnimSpeed( t+6, 0, 0.7 )
call ScriptActAnimPlay( t+6, 0, 7, 0.2 )
call ScriptActAnimSpeed( t+8, 0, 0.01 )
call ScriptCamera( t+6, 12, 1, 1 )
call ScriptActFace( t+8.5, 0, 1, 1, 0, 0, 30, .7 )
call ScriptActFaceReset( t+11, 0, 0.00 )
call ScriptActSlide( t+8.5, 1, GRX( gg_rct_AM_BSRageKB ) + 128 * Cos( 0 ), GRY( gg_rct_AM_BSRageKB ) + 128 * Sin( 0 ), 2, 600 )
call ScriptActAnimSpeed(t+10.2, 1, 0.7 )
call ScriptActAnimPlay( t+10.4, 1, 4, 0.14 )
// AM Blinks away.
call ScriptPlaySound( t+11, "Sound\\Units\\Combat\\EtherealMediumHit2.wav", 1, 127 )
call ScriptActColour( t+10.9, 0, 100, 100, 100, 0, 1 )
call ScriptActSlide( t+11.9, 0, GRX( gg_rct_AM_BleedHere ), GRY( gg_rct_AM_BleedHere ), 0, 0 )
call ScriptCamera( t+10, 11, 1, 1 )
call ExecuteFunc( "S2P3" )
endfunction
function S2P3 takes nothing returns nothing
local real t = 31.75
local real looper = 0
local real timerx = 0
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 1000, 6000, z255ToPercent( 0), z255ToPercent( 100 ), z255ToPercent( 255 ), 2 )
// WRITE TO SCENE STUFF
call ScriptCamera( t, 13, 1, 1 )
call ScriptActSlide( t, 0, GRX( gg_rct_AM_BleedHere ), GRY( gg_rct_AM_BleedHere ), 0, 0 )
call ScriptActSlide( t, 1, GRX( gg_rct_BS_Lightning ), GRY( gg_rct_BS_Lightning ), 0, 600 )
call ScriptActTurn( t, 1, 180, 1, 1 )
// SETUP STRYGYRE VISION. Vision is dealt with MoveLighning, RaiseLightningHun mainly.
call ScriptActColour( t, 0, 100, 100, 100, 0, 1 )
call ScriptExternalFunc( t+0.01, "Trig_ThirstVision_Actions" )
call ScriptExternalFunc( t+0.01, "VisionStuff" )
call ScriptActTurn( t+2, 1, AngleBetweenPoints( GetRectCenter( gg_rct_BS_Lightning ), GetRectCenter( gg_rct_BS_LookHere ) ), 2, 0 )
// Face AM invis loc - 360 degrees
call ScriptActTurn( t+4.8, 1, 0, 1.4, 0 )
// Face AM invis loc - 225 degrees
call ScriptActTurn( t+6.3, 1, 225, 1, 0 )
call ScriptExternalFunc( t+7.3, "RaiseLightning" )
//function ScriptCameraStat takes real time, integer statID, real duration, real endValue, real endSpeed, integer changeType returns nothing
call ScriptActTurn( t+7.7, 1, -121, .8, 0 )
call ScriptCameraIgnoreTerrain( t+9.91, true )
//camera statID list
//1 - x coordinate; 2 - y coordinate; 3 - z coordinate;
//4 - facing angle; 5 - angle of attack; 6 - roll angle;
//7 - field ov view; 8 - far z; 9 - distance to target
call ScriptCameraStat( t+9.9, 1, 0, GRX( gg_rct_BS_Lightning ), 0, 1 ) // x
call ScriptCameraStat( t+9.9, 2, 0, GRY( gg_rct_BS_Lightning ), 0, 1 ) // y
call ScriptCameraStat( t+9.9, 3, 0, 110, 0, 1 ) // z
call ScriptCameraStat( t+9.9, 4, 0, -125, 0, 1 ) // angle
call ScriptCameraStat( t+9.9, 5, 0, 360, 0, 1 ) // AoA
call ScriptCameraStat( t+9.9, 6, 0, 0, 0, 1 ) // rotation roll angle
call ScriptCameraStat( t+9.9, 7, 0, 65, 0, 1 ) // field of view
call ScriptCameraStat( t+9.9, 8, 0, 6500, 0, 1 ) // far z
call ScriptCameraStat( t+9.9, 9, 0, 10, 0, 1 ) // dist to target
call ScriptExternalFunc( t+9.89, "CinematicCameraEnable" )
call ScriptCamera( t+10, 18, 1, 2 )
call ScriptCamera( t+11, 18, 1, 1 )
// Camera finds AM, he just blinked in.
call ScriptActTurn( t+10.7, 0, 45, 1, 1 )
call ScriptActColour( t+11.2, 0, 100, 100, 100, 100, .8 ) // Fade
call ScriptActAnimSpeed( t+11.5, 0, 1 )
call ScriptActAnimPlay(t+11.2, 0, 9, 0.14 )
call ScriptActEffect( t+11.00, 0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidBear.mdx", "origin", 0 )
call ScriptActAnimPlay( t+12, 0, 20, 0.14 )
call ScriptActAnimSpeed( t+12.3, 0, 0 )
call ScriptCameraIgnoreTerrain( t+12.3, false )
call ExecuteFunc( "S2P4" )
endfunction
function S2P4 takes nothing returns nothing
local real t = 44.15
// FROM SCENE
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 1000, 6000, z255ToPercent( 0), z255ToPercent( 0), z255ToPercent( 128 ), 2 )
call ScriptActAnimSpeed( t, 1, 1 )
call ScriptExternalFunc( t, "OutThirst" )
call ScriptCamera( t, 19, 1, 1 )
call ScriptActSlide( t, 0, GRX( gg_rct_AM_BleedHere ), GRY( gg_rct_AM_BleedHere ), 0, 0 )
call ScriptActAnimSpeed( t, 0, 1 )
call ScriptActTurn( t, 0, 225, 0.50, 0 )
// Scene 1 Part 4 --- Action
// BS Charges then jumps upwards.
call ScriptActAnimPlay( t+0.6, 0, 1, 0.3 )
call ScriptActTurn( t+4.2, 0, 45, 0.8, 0 )
call MakeUnitFlyable( udg_cinS_actor[1] )
call ScriptActWalk( t+1.00, 1, GRX( gg_rct_zBS_Run ), GRY( gg_rct_zBS_Run ), 3, 1 )
call ScriptActAnimSpeed( t+4.3, 1, 1.3 )
call ScriptActAnimPlay( t+4.40, 1, 11, 0.3 )
call ScriptActSlide( t+4.20, 1, GRX( gg_rct_zBS_Jump ), GRY( gg_rct_zBS_Jump ), 1.00, 2000 )
// AM STANDS UP AND THEN HOLDS BLADES UP TO DEFEND.
call ScriptActTurn( t+4.7, 0, 45, 0.8, 0 )
call ScriptActAnimPlay( t+4.8, 1, 4, 0.14 )
call ScriptActAnimSpeed( t+4.7, 0, 1 )
call ScriptActAnimPlay( t+4.8, 0, 11, 0.14 )
call ScriptActSlide( t+5.2, 0, GRX( gg_rct_zAM_Evade ), GRY( gg_rct_zAM_Evade ), 0.9, 0 )
call ScriptPlaySound( t+5.1, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .6, 120 )
call ScriptCamera( t+5.1, 20, .9, 3 )
call ScriptCamera( t+6.0, 20, 1, 1 ) // End camera pan.
// AM TAKES THE OFFENSIVE - Attack 1.
call ScriptActTurn( t+4.7, 0, 315, 0.8, 0 )
call ScriptActSlide( t+5.7, 0, GRX( gg_rct_zBS_Jump ), GRY( gg_rct_zBS_Jump ), 1, 0 )
call ScriptPlaySound( t+6.1, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+5.9, 0, 6, 0.14 )
call ScriptCamera( t+6.2, 21, 1, 1 )
call ScriptExternalFunc( t+6.2, "Trig_ResetTree_Actions" )
// Blade crash
call ScriptPlaySound( t+6.4, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .7, 120 )
// BS counter
call ScriptActTurn( t+6, 1, 150, 0.5, 1 )
call ScriptActAnimPlay( t+6, 1, 5, 0.14 )
call ScriptActSlide( t+6.4, 1, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 1, 0 )
call ScriptCamera( t+6.9, 22, 2, 1 )
call ScriptCamera( t+7.9, 22, 1, 1 )
// Run at each other again.
call ScriptActSlide( t+7, 1, GRX( gg_rct_zBS_Jump ), GRY( gg_rct_zBS_Jump ), 1, 0 )
call ScriptActSlide( t+7, 0, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 1, 0 )
call ScriptActAnimPlay( t+7.2, 0, 5, 0.14 )
call ScriptActAnimPlay( t+7.2, 1, 5, 0.14 )
call ScriptPlaySound( t+7.4, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+7.5, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", 1, 120 )
call ScriptActSlide( t+7.5, 1, GRX( gg_rct_zAM_Attack ), GRY( gg_rct_zAM_Attack ), 0.70, 0 )
// AM assaults.
call ScriptActSlide( t+7.80, 0, GRX( gg_rct_zAM_Attack ), GRY( gg_rct_zAM_Attack ), 1, 0 )
call ScriptActAnimPlay( t+8.00, 0, 6, 0.04 )
call ScriptPlaySound( t+8.20, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
// AM hits BS succesfully.
call ScriptActSlide( t+8.6, 1, GRX( gg_rct_zBS_KB ), GRY( gg_rct_zBS_KB ), 0.9, 0 )
call ScriptPlaySound( t+8.6, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+8.6, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
// BS retreat
call ScriptCamera( t+9, 23, 1, 2 )
call ScriptCamera( t+10, 23, 1, 1 )
// No more vision.
call ScriptExternalFunc( t+10, "NoMoreVision" )
call ScriptActWalk( t+9.3, 1, GRX( gg_rct_zBS_Retreat ), GRY( gg_rct_zBS_Retreat ), 2, 0.8 )
call ScriptCamera( t+10.5, 24, 0.5, 3 )
call ScriptCamera( t+11., 24, 1, 1 )
// Blink harrass 1.
call ScriptActSlide( t+10, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 0, 0 )
call ScriptActTurn( t+10.1, 0, 180, 0.1, 1 )
call ScriptActColour( t+9.9, 0, 100, 100, 100, 0, 0 )
call ScriptActColour( t+11, 0, 100, 100, 100, 100, 1 )
call ScriptActAnimPlay( t+11, 0, 9, 0.14 )
call ScriptPlaySound( t+11.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+11.4, 0, 5, 0.14 )
call ScriptPlaySound( t+11.7, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+11.7, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+11.7, 1, GRX( gg_rct_zBS_MB ) + 200 * Cos( bj_DEGTORAD * 180 ), GRY( gg_rct_zBS_MB ) + 200 * Sin( bj_DEGTORAD * 180 ), 0.5, 0 )
call ScriptActAnimReset( t+11.7, 1 )
// BS Bloodrage.
call ScriptActEffect( t+12.3, 1, "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdx", "hand, left", 7 )
call ScriptActEffect( t+12.3, 1, "war3mapImported\\HeadhunterWEAPONSRight_NoSound.mdx", "hand, right", 7 )
call ScriptActSlide( t+12.4, 1, GRX( gg_rct_zBS_Retreat ), GRY( gg_rct_zBS_Retreat ), 0.9, 1300 )
call ScriptActAnimPlay( t+13., 1, 4, 0.14 )
// BS attack.
call ScriptPlaySound( t+13, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay( t+12.8, 0, 6, 0.14 )
call ScriptPlaySound( t+13.4, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .8, 120 )
// Force off.
call ScriptActSlide( t+13.4, 0, GRX( gg_rct_zAM_BSCounter ), GRY( gg_rct_zAM_BSCounter ),0.5, 0 )
call ScriptActSlide( t+13.4, 1, GRX( gg_rct_zBS_MB ), GRY( gg_rct_zBS_MB ), 0.5, 0 )
// BS not idle.
call ScriptActTurn( t+14.1, 1, 180, 0.3, 1 )
call ScriptActAnimPlay( t+14, 1, 10, 0.14 )
// AM Blink behind.
call ScriptActTurn( t+13.95, 0, 180, 0, 0 ) // Face 180 at BS
call ScriptActColour( t+13.95, 3, 100, 100, 100, 100, 0 ) // Prepare color for dummy
call ScriptActColour( t+13.98, 3, 100, 100, 100, 0, 1 )
// Instant move dummy
call ScriptActSlide( t+13.98, 3, GRX( gg_rct_zAM_BSCounter ), GRY( gg_rct_zAM_BSCounter ), 0, 0 )
call ScriptActAnimPlay( t+13.99, 3, 9, 0.14 ) // play dummy spell anim
call ScriptActColour( t+14.0, 0, 100, 100, 100, 0, 0 ) // REAL coloring
call ScriptActColour( t+14.03, 0, 100, 100, 100, 100, 0.8 )
// Instant move to BS spot for REAL and play animation
call ScriptActSlide( t+14., 0, GRX( gg_rct_zAM_BH2 ), GRY( gg_rct_zAM_BH2 ), 0, 0 )
call ScriptActAnimPlay( t+14., 0, 9, 0.14 )
call ScriptPlaySound( t+14.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptActAnimPlay(t+14.2, 0, 6, 0.14 )
call ScriptPlaySound( t+14.23, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 135 )
call ScriptActEffect( t+14.23, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptActSlide( t+14.23, 1, GRX( gg_rct_zBS_Retreat ), GRY( gg_rct_zBS_Retreat ), 0.9, 0 )
// AND ONCE MORE.
call ScriptActTurn( t+15, 0, 180, 0, 0 )
call ScriptActColour( t+14.9, 4, 100, 100, 100, 100, 0 )
call ScriptActColour( t+14.9, 4, 100, 100, 100, 0, 1 )
call ScriptActSlide( t+14.8, 4, GRX( gg_rct_zAM_BH2 ), GRY( gg_rct_zAM_BH2 ), 0, 0 )
call ScriptActAnimPlay( t+14.4, 4, 9, 0.14 )
call ScriptActColour( t+14.9, 0, 100, 100, 100, 0, 0 )
call ScriptActColour( t+14.93, 0, 100, 100, 100, 100, 0.8 )
call ScriptActSlide( t+14.9, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 0, 0 )
call ScriptActAnimPlay( t+15., 0, 9, 0.14 )
call ScriptPlaySound( t+15.2, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+15.4, "abilities\\Spells\\Human\\Feedback\\Feedback.wav", 1, 115 )
call ScriptActEffect( t+15.4, 1, "Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdx", "chest", 0 )
call ScriptPlaySound( t+15.3, "Units\\Orc\\Shaman\\ShamanDeath.wav", 1, 127 )
call ScriptPlaySound( t+15.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 110 )
call ScriptPlaySound( t+15.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 110 )
call ScriptPlaySound( t+15.4, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 110 )
call ScriptActSlide( t+15.3, 1, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 1.5, 600 )
call ScriptCamera( t+15.9, 25, 1, 1 )
call ExecuteFunc( "S2P5" )
endfunction
function S2P5 takes nothing returns nothing
local real t = 61.05
local integer i = 0
local real tt = 0.4
call ScriptFog( t, 1000, 3000, z255ToPercent( 0 ), z255ToPercent( 50 ), z255ToPercent( 200), 1 )
call ScriptFog( t+2, 1000, 6000, z255ToPercent( 0), z255ToPercent( 0), z255ToPercent( 128 ), 2 )
// Setting up positions for Play Scene From Time.
call ScriptActSlide( t, 1, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 0, 0 )
call ScriptActSlide( t, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 0, 0 )
call ScriptActAnimSpeed( t, 1, 1 )
call ScriptCamera( t, 25, 1, 1 )
call ScriptActTurn( t, 0, 180, 0.01, 0 )
// AM charges at the Raged BS.
call ScriptActSlide( t+0.5, 0, GRX( gg_rct_zBS_Evade ), GRY( gg_rct_zBS_Evade ), 2, 600 )
call ScriptActAnimPlay( t+1.9, 0, 6, 0.14 )
call ScriptPlaySound( t+2.1, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
// AM bounces off the Level-Up SFX.
call ScriptActSlide( t+2.3, 0, GRX( gg_rct_zAM_BH1 ), GRY( gg_rct_zAM_BH1 ), 3.5, 350 )
call ScriptPlaySound( t+2.3, "Sound\\Units\\Combat\\EtherealMediumHit3.wav", 1, 127 )
call ScriptActTurn( t+5.85, 0, 161, 0.5, 1 )
call ScriptActAnimPlay( t+5.9, 0, 21, 0.14 )
call ScriptActAnimSpeed( t+7.1, 0, 0 )
// RAGE :D
call ScriptActColour( t+1.05, 1, z255ToPercent( 40 ), z255ToPercent( 40 ), z255ToPercent( 40 ), 100, 0.9 )
call ScriptActAnimPlay( t+1.05, 1, 9, 0.3 )
loop
exitwhen i == 10
call ScriptPlaySound( t+1.3+tt, "abilities\\Spells\\Other\\Levelup\\Levelupcaster.wav", 1, 117 )
call ScriptActEffect( t+1.3+tt, 1, "Abilities\\Spells\\Other\\Levelup\\Levelupcaster.mdx", "origin", 0 )
set tt = tt + 0.15
set i = i + 1
endloop
// Unleash Blood Wave. And Silence AM.
call ScriptActEffect( t+3.7, 0, "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdx", "hand, left", 7 )
call ScriptActEffect( t+3.7, 0, "war3mapImported\\HeadhunterWEAPONSRight_NoSound.mdx", "hand, right", 7 )
call ScriptActTurn( t+3.1, 1, udg_BloodAngle, 0.5, 0 )
call ScriptActAnimPlay( t+3.7, 1, 8, 0.5 )
call ScriptExternalFunc( t+4, "BloodPath" )
set i = 0
set tt = 0
loop
exitwhen i == 15
call ScriptPlaySound( t+4+tt, "Sound\\Units\\Death\\ArtilleryCorpseExplodeDeath1.wav", 1, 117 )
set tt = tt + 0.1
set i = i + 1
endloop
call ScriptCamera( t+4.4, 26, 3, 4 )
//call ScriptCamera( t+(4.4+5), 26, 1, 1 )
// Camera finds AM gone?
call ScriptCamera( t+7, 28, 1, 1 )
call ScriptActColour( t+7, 1, z255ToPercent( 255 ), z255ToPercent( 150 ), z255ToPercent( 100 ), 100, 0.01 )
call ScriptActSlide( t+6.5, 0, GRX( gg_rct_zAM_UltiKB ), GRY( gg_rct_zAM_UltiKB ), 1.6, 0 )
call ScriptActAnimSpeed( t+7.9, 0, 1 )
call ScriptActAnimPlay( t+8.1, 0, 1, 0.14 )
// Attack from BS to AM, which causes his SUPER ULTI.
call ScriptActSlide( t+8.2, 1, GRX( gg_rct_zAM_UltiKB ), GRY( gg_rct_zAM_UltiKB ), 1.8, 500 )
call ScriptActAnimPlay( t+9.5, 1, 4, 0.14 )
call ScriptPlaySound(t+9.9, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", 0.50, 100)
call ScriptActSlide( t+9.9, 0, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 0.9, 0 )
call ScriptPointEffect(t+8.2, 5295, -7535.0, 50.0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl", 3)
call ScriptPointEffect(t+8.4, 5305, -7545.0, 50.0, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl", 3)
call ScriptActSlide( t+10.3, 1, GRX( gg_rct_zBS_Redraw ), GRY( gg_rct_zBS_Redraw ), 0.6, 0 )
call ScriptActAnimPlay( t+10.4, 1, 1, 0.14 )
call ScriptActSlide( t+11, 1, GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), 0.8, 0 )
call ScriptActAnimPlay( t+11.5, 1, 5, 0.14 )
// Second attack before AM PSYCHO
call ScriptCamera( t+11.0, 29, 1, 3 )
call ScriptCamera( t+12.0, 29, 1, 1 )
call ScriptExternalFunc( t+11.7, "Trig_StopSound_Actions" )
call ScriptPlaySound(t+11.7, "Sound\\Units\\Combat\\MetalHeavySliceFlesh2.wav", 0.85, 100)
call ScriptActSlide( t+11.7, 0, GRX( gg_rct_BLOODPATH_TARGET ), GRY( gg_rct_BLOODPATH_TARGET ), 0.9, 0 )
call ScriptActAnimPlay( t+11.8, 0, 7, 0.14 )
call ScriptActAnimSpeed( t+13.8, 0, 0 )
call ScriptCamera( t+13.2, 30, 1, 3 )
call ScriptCamera( t+14.2, 30, 1, 1 )
set i = 0
set tt = 0
//call ScriptActAnimPlay( t+14.6, 0, 3, 0.14 )
//call ScriptActAnimSpeed( t+14.5, 0, 1 )
call ScriptActColour( t+14.5, 0, z255ToPercent( 40 ), z255ToPercent( 40 ), z255ToPercent( 40 ), 100, 0.9 )
loop
exitwhen i == 10
call ScriptPlaySound( t+15.5+tt, "abilities\\Spells\\Other\\Levelup\\Levelupcaster.wav", 1, 117 )
call ScriptActEffect( t+15.5+tt, 0, "Abilities\\Spells\\Other\\Levelup\\Levelupcaster.mdx", "origin", 0 )
set tt = tt + 0.15
set i = i + 1
endloop
call ScriptExternalFunc( t+16.8, "UltiVoid" )
call ScriptActAnimSpeed( t+16.7, 0, 1 )
call ScriptActAnimPlay( t+16.7, 0, 9, 0.14 )
call ScriptCamera( t+17, 31, 1, 1 )
set tt = 0
set i = 0
loop
exitwhen i == 11
call ScriptPointEffect( t+17., GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), tt, "war3mapImported\\Enchantment.mdx", 0 )
set tt = tt + 90
set i = i + 1
endloop
call ScriptActAnimPlay( t+16, 1, 6, 0.14 ) //~BS death animation.
call ScriptActSlide( t+17.5, 1, GRX( gg_rct_zBS_ManaVoided ), GRY( gg_rct_zBS_ManaVoided ), 2,700 )
//call ScriptActAnimPlay( t+17.7, 1, 6, 0.14 )
call ScriptActAnimSpeed( t+17.1, 1, 0.50 )
call ScriptPointEffect( t+17., GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), 60, "Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdx", 0 )
call ScriptPointEffect( t+17., GRX( gg_rct_zBS_Atk2 ), GRY( gg_rct_zBS_Atk2 ), 60, "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl", 0 )
call ScriptPlaySound( t+17, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 127 )
call ScriptPlaySound( t+17.1, "Sound\\Buildings\\Death\\NightElfBuildingDeathLarge1.wav", 1, 127 )
call ScriptPlaySound( t+17.2, "Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav", 1, 127 )
call ScriptActAnimPlay( t+19.5, 1, 8, 0.14 )
call ScriptActTurn( t+19.6, 1, 180, 0.5, 1 )
call ScriptActTurn( t+20.11, 1, 0, 0.5, 1 )
//call ScriptActAnimPlay( t+18.6, 0, dead, 0.14 )
call ScriptActColour( t+23.2, 0, z255ToPercent( 255 ), z255ToPercent( 255 ), z255ToPercent( 255 ), 100, 0.9 )
call ScriptActAnimReset( t+17.5, 0 )
call ScriptActAnimReset( t+20, 1 )
call ScriptCamera( t+21.1, 32, 0.7, 3 )
call ScriptCamera( t+21.8, 32, 1, 1 )
call ScriptCamera( t+22.7, 33, .7, 3 )
call ScriptCamera( t+23.4, 33, .6, 1 )
// Now run for the final clash soon.
call ScriptActSlide( t+24.3, 0, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 0.02, 100 )
call ScriptActWalk( t+24.3, 0, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 1.00, 1.5 )
call ScriptActWalk( t+24.3, 1, GRX( gg_rct_zAM_DMG ), GRY( gg_rct_zAM_DMG ), 1.00, 1.5 )
call ScriptCamera( t+24, 40, 1, 3 )
call ScriptCamera( t+25, 40, 1, 1 )
call ScriptActAnimSpeed( t+25, 1, 1 )
call ScriptActAnimSpeed (t+24, 0, 1 )
call ScriptActAnimPlay( t+25.31, 0, 6, 0.14 )
call ScriptActAnimPlay( t+25.31, 1, 4, 0.14 )
call ScriptActSlide( t+25.3, 1, GRX( gg_rct_zBS_ManaVoided ), GRY( gg_rct_zBS_ManaVoided ), 0.5, 0 )
//call ScriptExternalFunc( t+26, "UltiVoid" )
endfunction
// Used in Scene 5.
function UltiVoid takes nothing returns nothing
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
call PolledWait( 0.01 )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
call PolledWait( 0.01 )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
call PolledWait( 0.01 )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\PolarisSurgeExplode.mdx", GetUnitX( udg_cinS_actor[1] ), GetUnitY(udg_cinS_actor[1] ) ) )
endfunction
// Used in Scene 3.
function BloodPath takes nothing returns nothing
call EnableTrigger( gg_trg_BloodPath )
call TriggerSleepAction( 1.9 )
call EnableTrigger( gg_trg_BloodCont )
endfunction
// Used in Scene 3.
function NoMoreVision takes nothing returns nothing
set udg_FadeLightning = true
endfunction
// Used in Scene 3.
function RaiseLightning takes nothing returns nothing
call EnableTrigger( gg_trg_RaiseLightningHun )
endfunction
// Used in Scene 3.
function OutThirst takes nothing returns nothing
call ShowUnit( udg_cinS_actor[1], true )
call DisableTrigger( gg_trg_MoveLightning )
call EnableTrigger( gg_trg_MoveLightningExtra )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.02, "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp", 100.00, 0, 0, 0.00 )
endfunction
// Used in Scene 3.
function VisionStuff takes nothing returns nothing
call ShowUnit( udg_cinS_actor[1], false )
set udg_BSEffect[3] = AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdl", udg_cinS_actor[1], "overhead" )
call CinematicCameraDisable()
call EnableTrigger( gg_trg_MoveCamera )
call SetLightningColor( udg_RedLightning[1], 1, 0, 0, 1 )
call SetLightningColor( udg_RedLightning[2], 1, 0, 0, 1 )
call DisableTrigger( gg_trg_MoveLightningExtra )
call EnableTrigger( gg_trg_MoveLightning )
endfunction
//===========================================================================
function InitTrig_Scene2_Copy takes nothing returns nothing
set gg_trg_Scene2_Copy = CreateTrigger()
call TriggerAddAction( gg_trg_Scene2_Copy, function S2P1 )
endfunction
//TESH.scrollpos=92
//TESH.alwaysfold=0
scope SpellName initializer Init
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// CONFIGURABLE GLOBALS
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
globals
private constant integer SPELL_ID = 'A000'
private constant integer DUMMY_ID = 'e000'
private constant real TIMER_INTERVAL = 0.04
private constant real TOSS_DURATION = 1.5
private constant real MAX_HEIGHT = 500.
private group ENUM_GROUP = CreateGroup()
private boolexpr UNIT_FILTER
private unit TEMP_UNIT
private player TEMP_PLAYER
endglobals
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
private function GetParabolaZ takes real x,real d,real h returns real
return 4 * h * x * (d - x) / (d * d)
endfunction
private function F_UNIT_FILTER takes nothing returns boolean
set TEMP_UNIT = GetFilterUnit()
return IsUnitEnemy( TEMP_UNIT, TEMP_PLAYER ) and /*
*/ IsUnitType( TEMP_UNIT, UNIT_TYPE_STRUCTURE ) == false /*
*/ and GetWidgetLife( TEMP_UNIT ) > 0.405
endfunction
private struct xxData
unit Caster
unit Target
unit Dummy
player Owner
real Angle
real Seconds = 0.00
real MPS
real x = 0.00
real y
real z = 0.00
real d
real tx
real ty
real Cosine
real Sine
real zfacing = 0.00
effect AttachmentSFX
static method create takes nothing returns xxData
local xxData d = xxData.allocate()
local real x
local real y
local string s
local integer i = 0
local real scale
set d.Caster = GetTriggerUnit()
set x = GetUnitX( d.Caster )
set y = GetUnitY( d.Caster )
set d.Owner = GetOwningPlayer( d.Caster )
set d.tx = GetSpellTargetX()
set d.ty = GetSpellTargetY()
set TEMP_PLAYER = d.Owner
call GroupEnumUnitsInRange( ENUM_GROUP, x, y, 200.00, UNIT_FILTER )
set d.Target = GroupPickRandomUnit( ENUM_GROUP )
call SetUnitVertexColorBJ( d.Target, 100, 100, 100, 100 )
call SetUnitPathing( d.Target, false )
call GroupClear( ENUM_GROUP )
set d.d = DistanceBetweenPoints( Location( x, y ), GetSpellTargetLoc() )
set d.Angle = Atan2( d.ty - y, d.tx - x )
loop
exitwhen i == MAX_AMOUNT
if GetUnitTypeId( d.Target ) == TYPE[i] then
set s = MODELS[i]
set scale = SCALE[i]
endif
set i = i + 1
endloop
set d.Dummy = CreateUnit( GetOwningPlayer( d.Target ), DUMMY_ID, x, y, GetUnitFacing( d.Target ) )
call SetUnitColor( d.Dummy, GetPlayerColor( GetOwningPlayer(d.Target) ) )
call SetUnitScale( d.Dummy, scale, scale, scale )
set d.AttachmentSFX = AddSpecialEffectTarget( s, d.Dummy, "origin" )
call SetUnitPathing( d.Dummy, false )
call UnitAddAbility( d.Target, 'Amrf' )
call UnitRemoveAbility( d.Target, 'Amrf' )
set d.MPS = d.d / ( TOSS_DURATION / TIMER_INTERVAL )
set d.Cosine = d.MPS * Cos( d.Angle )
set d.Sine = d.MPS * Sin( d.Angle )
return d
endmethod
endstruct
private function SetUnitZFacing takes unit whichUnit, real facingAngle returns nothing
local integer i = R2I((facingAngle+0)*0.7+0.5)
if i>0 then
call SetUnitAnimationByIndex(whichUnit, i)
else
call SetUnitAnimationByIndex(whichUnit, i+252)
endif
endfunction
private function Callback takes nothing returns boolean
local xxData d = KT_GetData()
local real x = GetUnitX( d.Target ) + d.Cosine
local real y = GetUnitY( d.Target ) + d.Sine
set d.x = d.x + d.MPS
set d.z = GetParabolaZ( d.x, d.d, MAX_HEIGHT )
call SetUnitFlyHeight( d.Target, d.z, 0 )
call SetUnitPosition( d.Target, x, y )
call SetUnitFlyHeight( d.Dummy, d.z, 0 )
call SetUnitPosition( d.Dummy, x, y )
if d.zfacing < -360 then
set d.zfacing = d.zfacing + 360
endif
set d.zfacing = d.zfacing - 14
call SetUnitZFacing( d.Dummy, d.zfacing )
if d.x >= d.d then
call DestroyEffect( d.AttachmentSFX )
call RemoveUnit( d.Dummy )
call SetUnitPathing( d.Target, true )
call SetUnitVertexColorBJ( d.Target, 100, 100, 100, 0 )
call d.destroy()
return true
endif
return false
endfunction
private function Cond takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function Action takes nothing returns nothing
call KT_Add( function Callback, xxData.create(), TIMER_INTERVAL )
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Cond ) )
call TriggerAddAction( t, function Action )
set UNIT_FILTER = Condition( function F_UNIT_FILTER )
endfunction
endscope
//TESH.scrollpos=4
//TESH.alwaysfold=0
//=====================================================================================
// Lightning:
// ----------
//
// Makes the lightning effects at start, and hides them with 0 alpha (transparency).
//
//=====================================================================================
function Trig_Lightning_Actions takes nothing returns nothing
local real x = GRX( gg_rct_BS_Lightning ) + 30 * Cos( bj_DEGTORAD * 90 )
local real y = GRY( gg_rct_BS_Lightning ) + 30 * Sin( bj_DEGTORAD * 90 )
local real xx = x + 2000 * Cos( bj_DEGTORAD * 180 )
local real yy = y + 2000 * Sin( bj_DEGTORAD * 180 )
set udg_RedLightning[1] = AddLightningEx( "DRAL", true, x, y, 90, xx, yy, udg_LightningHeight )
set x = GRX( gg_rct_BS_Lightning ) + 30 * Cos( bj_DEGTORAD * 270 )
set y = GRY( gg_rct_BS_Lightning ) + 30 * Sin( bj_DEGTORAD * 270 )
set xx = x + 2000 * Cos( bj_DEGTORAD * 180 )
set yy = y + 2000 * Sin( bj_DEGTORAD * 180 )
set udg_RedLightning[2] = AddLightningEx( "DRAL", true, x, y, 90, xx, yy, udg_LightningHeight )
call SetLightningColor( udg_RedLightning[1], 1, 0, 0, 0 )
call SetLightningColor( udg_RedLightning[2], 1, 0, 0, 0 )
endfunction
//===========================================================================
function InitTrig_Lightning takes nothing returns nothing
set gg_trg_Lightning = CreateTrigger( )
call TriggerAddAction( gg_trg_Lightning, function Trig_Lightning_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
//=====================================================================================
// MoveLightning:
// --------------
//
// Moves the lightnings offset 3200 in BS facing angle.
//
//=====================================================================================
function Trig_MoveLightning_Actions takes nothing returns nothing
local real distSep = 50.
local real facing = GetUnitFacing( udg_cinS_actor[1] )
local real facingCon = facing * bj_DEGTORAD
local real bsx = GetUnitX( udg_cinS_actor[1] )
local real bsy = GetUnitY( udg_cinS_actor[1] )
local real x = bsx + distSep * Cos( bj_DEGTORAD * ( facing + 90 ) )
local real y = bsy + distSep * Sin( bj_DEGTORAD * ( facing + 90 ) )
//local real x = GRX( gg_rct_BS_Lightning ) + distSep * Cos( bj_DEGTORAD * 90 )
//local real y = GRY( gg_rct_BS_Lightning ) + distSep * Sin( bj_DEGTORAD * 90 )
set udg_xx = x + 3200 * Cos( facingCon )
set udg_yy = y + 3200 * Sin( facingCon )
call MoveLightningEx( udg_RedLightning[1], true, x, y, 90, udg_xx, udg_yy, udg_LightningHeight )
set x = bsx + distSep * Cos( bj_DEGTORAD * ( facing + 270 ) )
set y = bsy + distSep * Sin( bj_DEGTORAD * ( facing + 270 ) )
set udg_xx = x + 3200 * Cos( facingCon )
set udg_yy = y + 3200 * Sin( facingCon )
call MoveLightningEx( udg_RedLightning[2], true, x, y, 90, udg_xx, udg_yy, udg_LightningHeight)
endfunction
//===========================================================================
function InitTrig_MoveLightning takes nothing returns nothing
set gg_trg_MoveLightning = CreateTrigger( )
call DisableTrigger( gg_trg_MoveLightning )
call TriggerRegisterTimerEvent(gg_trg_MoveLightning, 0.03, true)
call TriggerAddAction( gg_trg_MoveLightning, function Trig_MoveLightning_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
//=====================================================================================
// MoveLightningExtra:
// -------------------
//
// Moves the lightnings so the height is appropiate from BS eyes to AM's chest/head.
//
//=====================================================================================
function MoveLightningExtra takes nothing returns nothing
local location l = GetUnitLoc( udg_cinS_actor[0] )
local location cl = GetUnitLoc( udg_cinS_actor[1] )
local real z = ( GetLocationZ( l ) + GetUnitFlyHeight( udg_cinS_actor[0] ) ) + 90
local real cz = ( GetLocationZ( cl ) + GetUnitFlyHeight( udg_cinS_actor[1] ) ) + 110
local real angle = AngleBetweenPoints( cl, l ) * bj_DEGTORAD
local real x = GetUnitX( udg_cinS_actor[1] ) +50 * Cos( bj_DEGTORAD * 90 )
local real y = GetUnitY( udg_cinS_actor[1] ) + 50 * Sin( bj_DEGTORAD * 90 )
local real distance = DistanceBetweenPoints( cl, l )
set udg_xx = x + distance * Cos( angle )
set udg_yy = y + distance * Sin( angle )
//call BJDebugMsg( "Rememeber to update the Healthy Eating Record :D" )
call MoveLightningEx( udg_RedLightning[1], true, x, y, cz, udg_xx, udg_yy, z )
call SetLightningColor( udg_RedLightning[1], 1, 0, 0, udg_LightningAlpha )
set x = GetUnitX( udg_cinS_actor[1] ) + 50 * Cos( bj_DEGTORAD * 270 )
set y = GetUnitY( udg_cinS_actor[1] ) + 50 * Sin( bj_DEGTORAD * 270 )
set udg_xx = x + distance * Cos( angle )
set udg_yy = y + distance * Sin( angle )
call MoveLightningEx( udg_RedLightning[2], true, x, y, cz, udg_xx, udg_yy, z )
call SetLightningColor( udg_RedLightning[2], 1, 0, 0, udg_LightningAlpha )
call RemoveLocation( l )
call RemoveLocation( cl )
set l = null
set cl = null
if udg_FadeLightning then
set udg_LightningAlpha = udg_LightningAlpha - 0.01
if udg_LightningAlpha <= 0 then
call DisableTrigger( gg_trg_MoveLightningExtra )
endif
endif
endfunction
//===========================================================================
function InitTrig_MoveLightningExtra takes nothing returns nothing
set gg_trg_MoveLightningExtra = CreateTrigger( )
call DisableTrigger( gg_trg_MoveLightningExtra )
call TriggerRegisterTimerEvent( gg_trg_MoveLightningExtra, 0.03, true)
call TriggerAddAction( gg_trg_MoveLightningExtra, function MoveLightningExtra )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function z255ToPercent takes real r returns real
return r / 2.55
endfunction
function setl takes nothing returns nothing
local integer i = 0
local location l = GetUnitLoc( udg_actor[1] )
local location ndl
local location loc = GetUnitLoc( udg_actor[0] )
local real r = AngleBetweenPoints( l, loc )
local real time = udg_xTIME
loop
exitwhen i == 11
call BJDebugMsg( R2S( r ) )
set l = PolarProjectionBJ( l, 90.00, r )
call ScriptPlaySound( time, "abilities\\Spells\\Human\\HolyBolt\\HolyBolt.wav", 1, 127 )
call ScriptPointEffect( time, GetLocationX( l ), GetLocationY( l ), 0, "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdx", 0.00 )
set i = i + 1
set time = time + 0.04
//call RemoveLocation( ndl )
endloop
call RemoveLocation( l )
call RemoveLocation( loc )
set ndl = null
set l = null
set loc = null
endfunction
function GRX takes rect r returns real
return GetRectCenterX( r )
endfunction
function GRY takes rect r returns real
return GetRectCenterY( r )
endfunction
function SetupTime takes nothing returns nothing
set udg_xTIME = 12.00
endfunction
//---------------------------------------------------------------------
function WallShoot takes nothing returns nothing
local location JainaLoc = GetUnitLoc( udg_actor[1] )
local location Wall = Location(GetRectCenterX(gg_rct_JainaPropelOff), GetRectCenterY(gg_rct_JainaPropelOff))
local location NewLoc = JainaLoc
local real height = GetUnitFlyHeight( udg_actor[1] ) + 150
local integer i = 0
local real time
set udg_xTIME = 14.4
set time = udg_xTIME
call ScriptActAnimPlay( time, 1, 4, 1 )
loop
exitwhen i == 13
set NewLoc = PolarProjectionBJ( NewLoc, 50, AngleBetweenPoints( JainaLoc, Wall ) )
call ScriptPlaySound( time, "abilities\\Spells\\Human\\HolyBolt\\HolyBolt.wav", 1, 127 )
call ScriptPointEffect( time, GetLocationX( NewLoc ), GetLocationY( NewLoc ), height, "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", 0.00 )
set time = time + 0.05
set height = height - 17
set i = i + 1
endloop
call RemoveLocation( Wall )
call RemoveLocation( JainaLoc )
call RemoveLocation( NewLoc )
set Wall = null
set JainaLoc = null
set NewLoc = null
endfunction
function Scene1Part1 takes nothing returns nothing
local real x
local real y
local real t = 0.00
local real lw = 0.00
local integer i = 0
local location l = Location( udg_slidex1, udg_slidey1 )
call WriteToScene( 1 )
set x = GetUnitX( udg_actor[0] ) + 900 * Cos( bj_DEGTORAD * 270 )
set y = GetUnitY( udg_actor[0] ) + 900 * Sin( bj_DEGTORAD * 270 )
call ScriptActTurn( t + 0.01, 0, 270., 0.05, 1 )
call ScriptCamera( t + 0.01, 1, 2.50, 1 )
call ScriptCamera( t + 1.50, 2, 2.50, 4 )
// Illidan jumps and spins.
call ScriptActSlide( t+2.00, 0, x, y, 2.57, 300 )
// ITS 5, 5 YOU DAMN BITCH
call ScriptActAnimPlay( t+2.50, 0, 5, 0.01 )
call ScriptActAnimPlay( t+3.2, 0, 5, 0.01 )
call ScriptActAnimPlay( t+3.8, 0, 5, 0.01 )
call ScriptCamera( t+4.00, 2, 0, 1 )
// Illidan turns to Jaina.
call ScriptActTurn( t+5, 0, 180, 0.5, 1 )
call ScriptActAnimReset( t+5, 0 )
// Illidan jumps to Jaina.
set x = GetUnitX( udg_actor[1] ) + 100 * Cos( bj_DEGTORAD * AngleBetweenPoints( GetUnitLoc( udg_actor[0] ), GetUnitLoc( udg_actor[1] ) ) )
set y = GetUnitY( udg_actor[1] ) + 100 * Sin( bj_DEGTORAD * 180 )
call ScriptActSlide( t+5.6, 0, x, y, 2.2, 500 )
call ScriptActAnimPlay( t+5.6, 0, 12, 100 )
call ScriptActAnimSpeed( t+5.6, 0, 2 )
call ScriptCamera( t+5.8, 3, 2.0, 4 )
call ScriptCamera( t+7.8, 3, 2.50, 1 )
call ScriptActAnimSpeed( t+6.00, 0, 0 )
call ScriptActAnimSpeed( t+8.2, 0, 1.00 )
// Illidan faces Jaina, and ATTACK!
call ScriptActTurn( t+8.2, 0, 90, 0.25, 0 )
call ScriptActAnimPlay( t+8.4, 0, 5, 1 )
// Jaina is KB'ed.
call ScriptPlaySound( t+8.9, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", 1, 120 )
call ScriptActEffect( t+8.9, 1, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl", "origin", 0 )
call ScriptActSlide( t+8.9, 1, udg_slidex1, udg_slidey1, 0.7, 0 )
call ScriptCamera( t+8.0, 1, 2.50, 1 )
// Jaina cast holy line.
loop
exitwhen i == 14
call ScriptPlaySound( t+10+lw, "abilities\\Spells\\Human\\HolyBolt\\HolyBolt.wav", 1, 127 )
call ScriptPointEffect( t+10+lw, GetLocationX( l ), GetLocationY( l ), 0, "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdx", 0.00 )
set l = PolarProjectionBJ( l, 90, -96 )
set i = i + 1
set lw = lw + 0.04
endloop
//call ScriptExternalFunc( t+10, "setl" )
// Jaina spell animation.
call ScriptActAnimPlay( t+9.7, 1, 4, 1 )
call ScriptActTurn( t+9.5, 1, 270, 0.25, 0 )
// Illidan dodge and spin.
call ScriptCamera(t+10., 4, 0.9, 3 )
call ScriptCamera(t+10.9, 4, 2.50, 1 )
call ScriptActSlide( t+10.1, 0, udg_slidex2, udg_slidey2, 0.5, 200 )
call ScriptActAnimPlay( t+10.21, 0, 5, 0.01 )
// Another blast.
call ScriptActAnimPlay( t+9.7, 1, 4, 1 )
call ScriptActTurn( t+10.5, 1, 315, 0.25, 0 )
call RemoveLocation( l )
set l = Location( udg_slidex1, udg_slidey1 )
set i = 0
set lw = 0
loop
exitwhen i == 20
call ScriptPlaySound( t+12+lw, "abilities\\Spells\\Human\\HolyBolt\\HolyBolt.wav", 1, 127 )
call ScriptPointEffect( t+12+lw, GetLocationX( l ), GetLocationY( l ), 0, "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdx", 0.00 )
set l = PolarProjectionBJ( l, 90, -85 )
set i = i + 1
set lw = lw + 0.04
endloop
//call ScriptExternalFunc( t+11.5, "SetupTime" )
//call ScriptExternalFunc( t+12, "setl" )
call ScriptActSlide( t+12.02, 0, udg_slidex[3], udg_slidey[3], 0.5, 200 )
call ScriptActAnimPlay( t+12.11, 0, 5, 0.01 )
// Kill her.
call ScriptCamera(t+13., 1, 0.9, 1 )
call ScriptActSlide( t+13.5, 0, udg_slidex[4], udg_slidey[4], 0.5, 1500 )
// Time, actor[0], animIndex, blend.
call ScriptPlaySound( t+14.00, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", 1, 120 )
call ScriptActAnimPlay( t+14.00, 0, 5, 1 )
call ScriptActSlide( t+14.35, 1, udg_slidex[5], udg_slidey[5], 0.9, 1300 )
call ScriptCamera(t+14., 5, 1., 2 )
call ScriptExternalFunc( t+14.4, "WallShoot" )
// Shoot back off.
call ScriptActSlide( t+15.05, 1, udg_slidex[6], udg_slidey[6], 1.1, 1500 )
call ScriptCamera( t+15.05, 6, 1, 4 )
call ScriptCamera( t+16.05, 6, 1, 1 )
call ScriptCamera(t+15., 6, 1., 2 )
call ScriptCamera(t+16., 6, 1., 1 )
call ScriptActAnimPlay( 15.8, 0, 23, 100 )
call ScriptActAnimSpeed( 15.8, 0, .4 )
call ScriptActAnimPlay( 17, 0, 12, 0.01 )
call ScriptActSlide( 16.8, 0, udg_slidex[7], udg_slidey[7], 1.4, 1750 )
call ScriptActAnimSpeed( 17, 0, 2 )
call ScriptActAnimSpeed( 17.1, 0, 0.00 )
call ExecuteFunc( "Scene1Part2" )
endfunction
function UPDATE_LIGHTNING takes nothing returns nothing
local real lx = GetRectCenterX( gg_rct_JainaPropelOffDest )
local real ly = GetRectCenterY( gg_rct_JainaPropelOffDest )
local real newx
local real newy
set udg__TempLoc = PolarProjectionBJ( udg__TempLoc, udg_LL_Speed, 270 )
set udg_LL_Speed = udg_LL_Speed - udg_LL_Slow
set newx = GetLocationX( udg__TempLoc )// + 30.00 * Cos( 0 )
set newy = GetLocationY( udg__TempLoc )// + 30.00 * Sin( 0 )
call SetUnitPosition( udg_actor[0], newx, newy )
call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdx", newx, newy ) )
call MoveLightningEx( udg_Lightning, true, lx, ly, 0, newx, newy, 150 )
endfunction
function TyrandeMove takes nothing returns nothing
call IssuePointOrderLoc( udg_actor[3], "move", GetRectCenter( gg_rct_TyrandeMove01 ) )
endfunction
function NagaLightningBolt takes nothing returns nothing
call IssueTargetOrder( udg_actor[2], "forkedlightning", udg_actor[3] )
endfunction
function EndLightning takes nothing returns nothing
call DestroyLightning( udg_Lightning )
endfunction
function ShadowStrike takes nothing returns nothing
call IssueTargetOrder( udg_actor[4], "firebolt", udg_actor[0] )
call PolledWait( 1.00 )
call IssuePointOrder( udg_actor[4], "blink", udg_slidex[11], udg_slidey[11] )
endfunction
function CreateLightning takes nothing returns nothing
local real lx = GetRectCenterX( gg_rct_JainaPropelOffDest )
local real ly = GetRectCenterY( gg_rct_JainaPropelOffDest )
set udg_Lightning = AddLightningEx( "HWPB", true, lx, ly, 90, lx, ly, 164 )
endfunction
function Scene1Part2 takes nothing returns nothing
local real time = 18.4
local real lx = GetRectCenterX( gg_rct_JainaPropelOffDest )
local real ly = GetRectCenterY( gg_rct_JainaPropelOffDest )
local lightning l
local integer i = 0
//--------------------------\\
// PlaySceneFromTime stuff. \\
//--------------------------\\
call ScriptActSlide( time+0.00, 0, udg_slidex[4], udg_slidey[4], 0, 0 ) // Illidan jump spot.
call ScriptActSlide( time+0.00, 1, udg_slidex[6], udg_slidey[6], 0, 0 ) // Jaina cast spot.
call ScriptActTurn( time+0.00, 0, 90, 0, 0 ) // Illidan turn.
call ScriptActTurn( time+0.00, 1, 315, 0, 0 ) // Jaina turn.
call ScriptActAnimPlay( time+0.00, 0, 12, 0.01 ) // Illidan hands in air.
call ScriptActAnimSpeed( time+0.00, 0, 0.00 ) // Hands frozen.
// Create light beam.
call ScriptExternalFunc( time+0.00, "CreateLightning" )
call ScriptActEffect( time+0.00, 0, "Abilities\\Spells\\Items\\StaffOfSanctuary\\Staff_Sanctuary_Target.mdl", "chest", 5.00 )
// Animation of Jaina.
call ScriptActAnimPlay( time + 0.00, 1, 4, 1 )
call ScriptActAnimPlay( time + 2.73, 1, 4, .01 )
call ScriptActAnimPlay( time + 5.4, 1, 4, .01 )
call ScriptActAnimPlay( time + 8.5, 1, 4, .01 )
// Move position beam.
set udg__TempLoc = Location( lx, ly )
loop
exitwhen i >= udg_LL_Duration / udg_LL_TimerInterval
set time = time + 0.04
call ScriptPlaySound( time, "abilities\\Spells\\Human\\HolyBolt\\HolyBolt.wav", 1, 127 )
call ScriptExternalFunc( time, "UPDATE_LIGHTNING" )
set i = i + 1
endloop
// Tyrande leaps inwards. Help to capture Illidan.
call ScriptActSlide( 20, 3, udg_slidex[8], udg_slidey[8], 1.5, 2000 )
call ScriptExternalFunc( 21.5, "TyrandeMove" )
call ScriptCamera( 20, 7, 1.2, 2 )
call ScriptCamera( 21.20, 7, 1.2, 1 )
// Play Tyrande spell.
call ScriptActAnimPlay( 23.20, 3, 1, .01 )
call ScriptPlaySound( 23, "abilities\\Spells\\NightElf\\Starfall\\StarfallCaster1.wav", 1, 127 )
call ScriptActEffect( 23.00, 0, "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdx", "origin", 2.5 )
call ScriptCamera( 22, 8, 1.2, 4 )
call ScriptCamera( 23.2, 8, 1.2, 1 )
// BANG BOLT
call ScriptPlaySound( 25, "abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav", 1, 127 )
call ScriptExternalFunc( 25, "NagaLightningBolt" )
call ScriptActSlide( 25, 3, udg_slidex[9], udg_slidey[9], 1, 0 )
call ScriptActSlide( 25, 1, udg_slidex[10], udg_slidey[10], 1, 0 )
call ScriptExternalFunc( 25, "EndLightning" )
call ScriptCamera( 24, 9, 1.2, 4 )
call ScriptCamera( 25.2, 9, 1.2, 1 )
call ScriptActTurn( 26, 0, 135, .8, 0 )
call ScriptActAnimSpeed( 25.7, 0, .8 )
call ScriptActAnimPlay( 25.7, 0, 1, .6 )
// Maiev comes.
call ScriptCamera( 26, 10, 1.2, 2 )
call ScriptExternalFunc( 26, "ShadowStrike" )
call ScriptCamera( 27.2, 10, 1.2, 1 )
call ScriptPlaySound( 28, "abilities\\Spells\\NightElf\\shadowstrike\\ShadowStrikeBirth1.wav", 1, 127 )
// Attack.
call ScriptActAnimPlay( 28.7, 4, 9, .01 )
call ScriptActAnimSpeed( 28, 4, .40 )
// Illidan braces himself.
call ScriptActAnimSpeed( 29, 0, 1.4 )
call ScriptActAnimSpeed( 29.7, 0, 0 )
call ScriptActTurn( 28.2, 0, 270, .4, 0 )
call ScriptActAnimPlay( 28, 0,12, 1 )
// Face him, now jump!
call ScriptActTurn( 28, 4, 90, .1, 1 )
call ScriptActSlide( 28, 4, udg_slidex[12], udg_slidey[12], 1.5, 500 )
// Vashj protect him!.. and dispel SS.
call ScriptPlaySound( 29, "abilities\\Spells\\Human\\ManaShield\\ManaShieldCaster1.wav", 1, 100 )
call ScriptActEffect( 29, 0, "war3mapImported\\GaiaShield.mdx", "origin", 3.30 )
// Ethereal hit.
call ScriptPlaySound( 29,"Sound\\Units\\Combat\\EtherealMediumHit3.wav" , 1, 127 )
// Spin attack.
call ScriptActAnimSpeed( 29, 4, 0.70 )
call ScriptActAnimPlay( 29.8, 4, 5 , 0.50 )
call ScriptActTurn( 30, 4, 70, .5, 1 )
call ScriptPlaySound( 30.00,"Sound\\Units\\Combat\\EtherealMediumHit2.wav" , 1, 127 )
call ScriptPlaySound( 30.9,"Sound\\Units\\Combat\\EtherealMediumHit1.wav" , 1, 127 )
// Slice through him.
call ScriptActSlide( 30, 4, udg_slidex[12] + 200 * Cos( bj_DEGTORAD * 90 ), udg_slidey[12] + 200 * Sin( bj_DEGTORAD * 90 ), .25, 300 )
call ScriptPlaySound( 29,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 127 )
// Illidan retreat!
call ScriptActTurn( 32, 0, 315, .4, 0 ) // Jump backwards, face direction.
call ScriptActSlide( 33, 0, udg_slidex[13], udg_slidey[13], 1.4, 350 )
call ScriptActAnimPlay( 32, 0,3, .05 ) // Prepare.
call ScriptActAnimSpeed( 32.5, 0, .5 )
// Maiev turns.
call ScriptActTurn( 33.5, 4, 135, .09, 0 )
call ScriptActAnimPlay( 33.6, 4, 1, .05 )
call ScriptActAnimSpeed( 33.4, 4, .5 )
call ScriptActAnimReset( 37.0, 4 ) // Reset.
call ScriptCamera( 32, 11, 1.2, 3 )
call ScriptCamera( 33.2, 11, 1.2, 1 )
call ScriptActAnimPlay( 32.8, 0,12, .5 ) // Hands in air betch!
call ScriptActAnimSpeed( 33.4, 0, 0 )
// Jaina + Tyrande walk and reset.
call ScriptActWalk( 33, 1, udg_jx[1], udg_jy[1], 1.5, .7 )
call ScriptActWalk( 33.5, 3, udg_tx[1], udg_ty[1], 1.5, .7 )
call ScriptActAnimReset( 34.5, 1 )
call ScriptActAnimReset( 35.0, 3 )
// Illidan reset.
call ScriptActAnimSpeed( 34.3, 0, 1 )
call ScriptActAnimReset( 34.4, 0 )
call ScriptExternalFunc( 35.5, "Run" )
call ScriptCamera( 36, 12, 5, 4 )
call ScriptCamera( 41, 12, 1, 1 )
// Maiev persues alone.
call ScriptCamera( 41.5, 13, 1, 1 )
call ScriptCamera( 41.5, 14, 2, 3 )
call ScriptCamera( 43.5, 14, 2, 1 )
// Prepare bitch scene.
call ExecuteFunc( "Scene1Part3")
endfunction
function Run takes nothing returns nothing
call IssuePointOrderLoc( udg_actor[0], "move", GetRectCenter( gg_rct_Run01 ) )
call IssuePointOrderLoc( udg_actor[2], "move", GetRectCenter( gg_rct_Run02 ) )
endfunction
function SetupScene1Part3 takes nothing returns nothing
call SetUnitPositionLoc( udg_actor[4], GetRectCenter( gg_rct_MaievChase_Pre ) )
call SetUnitPosition( udg_actor[3], udg_slidex[9], udg_slidey[9] )
call SetUnitPosition( udg_actor[1], udg_slidex[10], udg_slidey[10] )
endfunction
function DOSTUFF takes nothing returns nothing
call IssueImmediateOrder( udg_actor[0], "stop" )
call SetUnitPositionLoc( udg_actor[4], GetRectCenter( gg_rct_MaievChase_Pre ) )
call SetUnitFacing( udg_actor[4], 180.00 )
call PolledWait( 1.25 ) // 43.5 + 1.25 = 44.75 - 1.25 = 1.5
call IssuePointOrderLoc( udg_actor[4], "move", GetRectCenter( gg_rct_MaievChase ) )
call PolledWait( 1.50 ) // 44.75 + 1.50 = 46.25 - 43.5 = 2.75
endfunction
function Scene1Part3 takes nothing returns nothing
local real t = 43.5
local real time = 0
local integer i = 0
local integer ii = 0
local real x
local real y
local real d = 0
// PlaySceneFromTime stuff.
call ScriptActSlide( t+0.00, 0, GetRectCenterX( gg_rct_Run01 ), GetRectCenterY( gg_rct_Run01 ), 0, 0 )
call ScriptActSlide( t+0.00, 2, GetRectCenterX( gg_rct_Run02 ), GetRectCenterY( gg_rct_Run02 ), 0, 0 )
call ScriptExternalFunc( t + 0.00, "DOSTUFF" )
call ScriptActAnimPlay( t + 2.9, 4, 5, 0.45 )
call ScriptActWalk( t + 3.00, 4, udg_slidex[14], udg_slidey[14], 1.5, 1 )
call ScriptCamera( t + 4.00, 15, 1, 1 )
call ScriptActSlide( t + 4.50, 4, GetRectCenterX( gg_rct_S1P3_Attack ), GetRectCenterY( gg_rct_S1P3_Attack ), 1.9, 500 )
call ScriptActAnimSpeed( t + 5.30, 4, 0.45 )
call ScriptActAnimPlay( t + 5.40, 4, 5, 0.2 )
call ScriptPlaySound( t + 5.9,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 120 ) // SOUND
call ScriptPlaySound( t+6.45, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", 1, 120 )
call ScriptPlaySound( t+6.48, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", 1, 120 )
call ScriptActEffect( t+6.37, 4, "war3mapImported\\GaiaShield.mdx", "weapon", 0 ) // Weapon clash.
call ScriptActAnimPlay( t+6.10, 0, 5, 0.50 ) // Illidan parry
call ScriptActTurn( t+5.7, 0, 0, .5, 0 ) // Illidan turn
call ScriptCamera(t+6.00, 16, 1, 4 )
call ScriptCamera(t+7, 16, 1, 1 )
call ScriptActSlide( t+6.2, 0, 514, -4993, 0.7, 0 ) // Illidan KBed
call ScriptCamera(t+7.5, 17, 1, 1 )
//call ScriptCamera(t+8.5, 17, 1, 4 ) // swapped
call ScriptActSlide( t+7.5, 4, 712, -4967, 0.7, 0 ) // Maiev attacks again.
call ScriptActAnimPlay(t+7.4, 4, 2, 0.50 ) // Maiev walk.
//call ScriptActAnimPlay(t+7.8, 4, 2, 0.05 ) // Maiev attack.
//call ScriptActAnimSpeed(t+8.9, 4, 0.00 )
call ScriptActSlide( t+8.2, 4, GRX( gg_rct_S1P3_EndSpin ) , GRY( gg_rct_S1P3_EndSpin ), 2, 0 ) // Maiev attacks again.
call ScriptActSlide( t+8.2, 0, GRX( gg_rct_S1P3_IllidanPushed ) , GRY( gg_rct_S1P3_IllidanPushed ), 2, 0 ) // Illidan back.
//call ScriptActTurn( t+8.3, 4, 0, 0.50, 1 )
///call ScriptActTurn( t+8.8, 4, 180, 0.50, 1 )
call ScriptActAnimSpeed(t+8.25, 4, 1 )
// MAIEV SPINNING ATTACK.
call ScriptActAnimPlay( t+8.3, 4, 6, 0.14 ) // Maiev walk.
call ScriptPlaySound( t+8.3,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 ) // SOUND
call ScriptPlaySound( t+8.4, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", .7, 120 )
call ScriptActAnimPlay(t+8.65, 4, 6, 0.14 ) // Maiev walk.
call ScriptPlaySound( t+8.65,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 )
call ScriptPlaySound( t+8.75, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .6, 120 )
call ScriptActAnimPlay(t+9.0, 4, 6, 0.14 ) // Maiev walk.
call ScriptPlaySound( t+9.0,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 )
call ScriptPlaySound( t+9.1, "Sound\\Units\\Combat\\MetalLightSliceMetal1.wav", .5, 120 )
call ScriptActAnimPlay( t+9.35, 4, 6, 0.14 ) // Maiev walk.
call ScriptPlaySound( t+9.35,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 )
call ScriptPlaySound( t+9.4, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .5, 120 )
call ScriptActAnimPlay( t+9.7, 4, 6, 0.14 ) // Maiev walk.
call ScriptPlaySound( t+9.70,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 )
call ScriptPlaySound( t+9.80, "Sound\\Units\\Combat\\MetalLightSliceMetal2.wav", .6, 120 )
call ScriptActAnimPlay( t+10.05, 4, 6, 0.14 ) // Maiev walk.
call ScriptPlaySound( t+10.05,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 )
call ScriptPlaySound( t+10.15, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .4, 120 )
call ScriptActAnimPlay( t+8.0, 0, 2, 0.2 )
call ScriptActAnimPlay( t+8.6, 0, 2, 0.2 )
call ScriptActAnimPlay( t+9.2, 0, 2, 0.2 )
call ScriptActAnimPlay( t+9.8, 0, 2, 0.2 )
call ScriptActAnimPlay( t+11.4, 0, 2, 0.2 )
call ScriptExternalFunc( t+10.0, "HitOnce" )
call ScriptPlaySound( t+10.73, "abilities\\Spells\\Other\\FrostArrows\\FrostArrowLaunch1.wav", 1, 120 )
call ScriptActAnimPlay( t+11.4, 4, 8, 0.20 )
call ScriptPlaySound( t+11.4, "abilities\\Spells\\NightElf\\Blink\\BlinkBirth1.wav", 1, 120 )
call ScriptPointEffect( t+11.4, GRX( gg_rct_S1P3_EndSpin ), GRY( gg_rct_S1P3_EndSpin ), 0, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdx", 0 )
// Illidan KB from Arrow
call ScriptActAnimPlay( t+11.95, 0, 5, 0.10 )
call ScriptPlaySound( t+11.95, "abilities\\Spells\\Other\\FrostArrows\\FrostArrowHit1.wav", 1, 120 )
call ScriptActSlide( t+11.95, 0, GRX( gg_rct_S1P3_ArrowPush ), GRY( gg_rct_S1P3_ArrowPush ), 0.70, 0.00 )
// Blink to Naga.
call ScriptExternalFunc( t+12.9, "BlinkToNaga" )
call ScriptPlaySound( t+13.6, "abilities\\Spells\\NightElf\\Blink\\BlinkArrival1.wav", .85, 120 )
call ScriptCamera( t+12.9, 18, 1, 1 )
// Slow motion attack, and move slowly to her spot.
call ScriptActAnimSpeed( t+12.9, 4, 0.10 )
call ScriptActAnimPlay( t+13.4, 4, 5, 0.20 )
call ScriptActTurn( t+13.2, 2, 320, 4.2, 1 )
// Slide
call ScriptActSlide(t+15, 4, GRX( gg_rct_Run02 ), GRY( gg_rct_Run02 ), 4, 0 )
call ScriptPlaySound( t+17.6,"Sound\\Units\\Combat\\MetalLightSliceFlesh3.wav" , .7, 110 )
call ScriptPlaySound( t+16.9,"Units\\NightElf\\HeroWarden\\WardenAttackEffort1.wav" , 1, 70 )
call ScriptActAnimSpeed( t+18, 4, 1 ) // Reset anim
call ScriptActTurn( t+18, 2, 0, 1, 1 ) // Naga spin.
// Naga KB
call ScriptActSlide( t+18.3, 2, GRX( gg_rct_NagaSlide ), GRY( gg_rct_NagaSlide ), 0.60, 0.00 )
call ScriptActEffect(t+18.3, 2, "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl", "origin", 0 )
call ScriptCamera(t+18.2, 19, .4, 3 )
call ScriptCamera(t+18.6, 19, 1, 1)
// Illidan fire hand
call ScriptCamera(t+19.5, 20, 1, 1 )
call ScriptActAnimSpeed(t+19.8, 0, 0.75 )
call ScriptActAnimPlay(t+19.9, 0, 5, 0.20 )
call ScriptActAnimReset( t+20.9, 0 )
call ScriptPlaySound( t+20.4, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", .85, 120 )
call ScriptPlaySound( t+20.4, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", .85, 120 )
call ScriptPlaySound( t+20.4, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", .85, 120 )
call ScriptExternalFunc(t+20.4, "FireHands" )
call ScriptActEffect(t+20.4, 0, "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdx", "hand, right", 0 )
call ScriptActEffect(t+20.4, 0, "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdx", "hand, left", 0 )
call ScriptActEffect(t+20.4, 0, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl", "hand, right", 10.00 )
call ScriptActEffect(t+20.4, 0, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl", "hand, left", 10.00 )
call ScriptActAnimSpeed(t+21.4, 0, 1 )
call ScriptActAnimPlay( t+21.5, 0, 4, 0.14 )
call ScriptExternalFunc( t+21.5, "FadeIn" )
call ScriptActTurn(t+21.5, 4, 270, 0.05, 1 )
call ScriptCamera(t+21.6, 18, 1, 1 )
call ScriptPlaySound( t+22.3, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+22.3, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", .85, 120 )
call ScriptActAnimPlay( t+22.2, 0, 4, 0.14 )
call ScriptPlaySound( t+22.6, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+22.6, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", .85, 120 )
// Maiev counter.
call ScriptActAnimSpeed( t+22, 4, 0.6 )
call ScriptActSlide(t+22.5, 4, GRX( gg_rct_BlinkAtk ) + 190 * Cos( 0 ), GRY( gg_rct_BlinkAtk ) + 190 * Sin(0), .5, 0 )
call ScriptActAnimPlay( t+22.5, 0, 4, 0.14 )
call ScriptPlaySound( t+22.45, "abilities\\Weapons\\PhoenixMissile\\PhoenixAttack.wav", 1, 120 )
call ScriptPlaySound( t+22.45, "Sound\\Units\\Combat\\MetalLightSliceMetal3.wav", .4, 100 )
call ScriptActEffect(t+22.6, 4, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdx", "weapon", 10.00 )
call ScriptActAnimPlay(t+22., 4, 1, 0.15 )
call ScriptPlaySound( t+23.0, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", 1, 120 )
call ScriptPlaySound( t+23.0, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", 1, 120 )
// Fire slash.
call ScriptActAnimPlay( t+22.9, 0, 4, 0.14 )
call ScriptPlaySound( t+23, "Units\\NightElf\\HeroDemonHunter\\HeroDemonHunterAttack1.wav", 1, 70 )
call ScriptPlaySound( t+23.0, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", .85, 120 )
// REPLACE THE FUCKING GAIA SHIELD WITH A WATER TYPE ONE.
call ScriptActAnimPlay(t+23.5, 2, 5, 0.15 )
call ScriptActAnimReset(t+24.667, 2 )
call ScriptActEffect( t+24, 2, "war3mapImported\\watershield.mdx", "origin", 5 )
call ScriptActEffect( t+24, 0, "war3mapImported\\watershield.mdx", "origin", 5 )
call ScriptExternalFunc( t+24, "StartFireRing" )
call ScriptExternalFunc( t+25, "FireTree" )
set x = GRX( gg_rct_BlinkAtk ) + 190 * Cos( 0 )
set y = GRY( gg_rct_BlinkAtk ) + 190 * Sin(0)
call ScriptActSlide(t+23.9, 4, x + 350 * Cos( bj_DEGTORAD * 0 ), y + 350 * Sin( bj_DEGTORAD * 0 ) , 1.5, 700 )
loop
exitwhen i == 25
call ScriptPlaySound(t+24+time, "abilities\\Weapons\\FireBallMissile\\FireBallMissileDeath.wav", 1, 120 )
set i = i + 1
set time = time + 0.1
endloop
set i = 0
set time = 0
//loop
//exitwhen i == 2
call ScriptPlaySound(t+24+time, "Sound\\Buildings\\Fire\\OrcHumanMediumBuildingFire1.wav", 1, 127 )
// set i = i + 1
//set time = time + 3.5
//endloop
call ScriptCamera(t+24, 21, 2.2, 4 )
call ScriptCamera(t+26.2, 21, 1, 1 )
call ExecuteFunc( "Scene1Part4" )
endfunction
function StartFireRing takes nothing returns nothing
call SetDoodadAnimationRectBJ( "show", 'D00C', bj_mapInitialPlayableArea ) // SEXY WIND.
call EnableTrigger( gg_trg_FireRing )
endfunction
function FireTree takes nothing returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 5, 20, 60.00 )
call SetDoodadAnimationRectBJ( "hide", 'D00B', bj_mapInitialPlayableArea ) // Blue fog.
call SetDoodadAnimationRectBJ( "hide", 'D000', bj_mapInitialPlayableArea ) // Grey fog.
call SetDoodadAnimationRectBJ( "show", 'D00A', bj_mapInitialPlayableArea ) // Real fire
call SetDoodadAnimationRectBJ( "show", 'D007', bj_mapInitialPlayableArea ) // Flames.
call SetDoodadAnimationRectBJ( "show", 'YOf3', bj_mapInitialPlayableArea ) // Fire Gust?
call SetDoodadAnimationRectBJ( "show", 'D009', bj_mapInitialPlayableArea ) // FireLight.
call PolledWait( 1.00 )
call SetDoodadAnimationRectBJ( "show", 'YOtf', bj_mapInitialPlayableArea ) // Fire.
call SetDoodadAnimationRectBJ( "show", 'D008', bj_mapInitialPlayableArea ) // Red lights.
endfunction
function FadeIn takes nothing returns nothing
//call UFSYS_CreateFadeUnitAnimation( Player(3), 'Eevi', 0, GetUnitX( udg_actor[0] ), GetUnitY( udg_actor[0] ), GetUnitFacing( udg_actor[0] ), 1, 4 )
//call AddSpecialEffectTarget( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl", bj_lastCreatedUnit, "hand, left" )
//call AddSpecialEffectTarget( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl", bj_lastCreatedUnit, "hand, right" )
call TriggerSleepAction( 0.25 )
call SetUnitPositionLoc( udg_actor[1], PolarProjectionBJ( GetUnitLoc( udg_actor[0] ), 3000, 90 ) )
call SetUnitPosition( udg_actor[0], GRX( gg_rct_FireAtk ), GRY( gg_rct_FireAtk ) )
endfunction
function FireHands takes nothing returns nothing
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdx", udg_actor[0], "hand, right" ) )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdx", udg_actor[0], "hand, left" ) )
endfunction
function BlinkToNaga takes nothing returns nothing
call EnableWeatherEffect( udg__Rain, false )
call SetUnitTimeScale( udg_actor[4], 1.00 )
call SetUnitAnimation( udg_actor[4], "stand" )
call SetUnitPosition( udg_actor[4], GRX( gg_rct_BlinkAtk ), GRY( gg_rct_BlinkAtk ) )
call SetUnitFacing( udg_actor[4], 180 )
call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdx", GRX( gg_rct_BlinkAtk ), GRY( gg_rct_BlinkAtk ) ) )
endfunction
function HitOnce takes nothing returns nothing
call IssueTargetOrder( udg_actor[2], "attackonce", gg_unit_h000_0005 )
endfunction
function Scene1Part4 takes nothing returns nothing
local real t = 69.50
local real x
local real y
call ScriptActEffect( t, 2,"war3mapImported\\watershield.mdx", "origin", 5 )
call ScriptActEffect( t, 0, "war3mapImported\\watershield.mdx", "origin", 5 )
call ScriptCamera( t, 21, 1, 1 )
//call ScriptExternalFunc( t, "FireTree" )
call ScriptExternalFunc( t, "StartFireRing" )
set x = GRX( gg_rct_BlinkAtk ) + 190 * Cos( 0 )
set y = GRY( gg_rct_BlinkAtk ) + 190 * Sin( 0 )
call ScriptActSlide( t, 2, GRX( gg_rct_NagaSlide ), GRY( gg_rct_NagaSlide ), 0, 0 )
call ScriptActSlide( t, 0, GRX( gg_rct_FireAtk ), GRY( gg_rct_FireAtk ), 0, 0 )
call ScriptActSlide( t, 4, x + 350 * Cos( bj_DEGTORAD * 0 ), y + 350 * Sin( bj_DEGTORAD * 0 ) , 0, 0 )
call ScriptCamera(t+0.01, 22, .6, 4 )
call ScriptCamera(t+0.61, 22, .6, 1 )
call ScriptExternalFunc(t+0.5, "BlinkAway" )
call ScriptPlaySound( t+0.5, "abilities\\Spells\\NightElf\\Blink\\BlinkBirth1.wav", 1, 127 )
call ScriptExternalFunc(t+3.5, "MaievBlinkFade" )
call ScriptPlaySound( t+5.3, "Sound\\Music\\mp3Music\\SadMystery.mp3", 1, 100 )
call ScriptExternalFunc(t+5.5, "FireCameraStuff" )
call ScriptFog(t+5.5, 1500, 6000, 81, 41, 23, 0.01 )
call ScriptCamera( t+5.5, 23, 1, 1 )
call ScriptCamera( t+5.6, 24, 8, 2 )
call ScriptExternalFunc( t+13.6, "ForestFade" )
endfunction
function BlinkAway takes nothing returns nothing
call IssuePointOrderLoc( udg_actor[4], "move", Location(GetRectCenterX(gg_rct_Moonray), GetRectCenterY(gg_rct_Moonray)) )
call TriggerSleepAction( 0.4 )
call IssuePointOrder( udg_actor[4], "blink", GRX( gg_rct_Moonray ), GRY( gg_rct_Moonray ) )
endfunction
function FireCameraStuff takes nothing returns nothing
call StopSound(gg_snd_Street_Fighter_2_RyuforFourPianos_OC_ReMix__Short_Version2_u, false, true)
call SetDoodadAnimationRectBJ( "hide", 'D005', bj_mapInitialPlayableArea ) // Angle light.
call ShowUnit( udg_actor[4], false )
//call SetTerrainFogExBJ( 0, 2000.00, 5000.00, 1, 83.00, 41.00, 19.00 )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
endfunction
//===========================================================================
function InitTrig_Scene1STO takes nothing returns nothing
set gg_trg_Scene1STO = CreateTrigger()
call TriggerAddAction( gg_trg_Scene1STO, function Scene1Part1 )
endfunction
function MaievBlinkFade takes nothing returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
endfunction
function ForestFade takes nothing returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 4, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
endfunction