//TESH.scrollpos=310
//TESH.alwaysfold=0
constant function WarStomp takes nothing returns string
return "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"
endfunction
constant function StompSound takes nothing returns sound
return gg_snd_ThunderClapCaster
endfunction
constant function C takes integer i returns unit
return udg_C[i]
endfunction
constant function Ahh takes nothing returns sound
return gg_snd_PeasantWarcry1
endfunction
//prosecutor, trial, TerrainArt\Cityscape\City_GrassTrim.blp -1450
// **********************
// ** VECTOR SYSTEM **
// **********************
// Original concept by iNfraNe
// Made by Anitarf
// Required global variables:
// vectorMaxIndex integer
// vectorUnusedAmount integer
// vectorUnusedIndex integer array
// vectorX real array
// vectorY real array
// vectorZ real array
// vectorTaken boolean aray
constant function VectorGetX takes integer vector returns real
return udg_vectorX[vector]
endfunction
constant function VectorGetY takes integer vector returns real
return udg_vectorY[vector]
endfunction
constant function VectorGetZ takes integer vector returns real
return udg_vectorZ[vector]
endfunction
function VectorGetLength takes integer vector returns real
return SquareRoot(udg_vectorX[vector]*udg_vectorX[vector] + udg_vectorY[vector]*udg_vectorY[vector] + udg_vectorZ[vector]*udg_vectorZ[vector])
endfunction
function VectorCreate takes real x, real y, real z returns integer
local integer i = 1
if udg_vectorUnusedAmount == 0 then
set udg_vectorMaxIndex = udg_vectorMaxIndex + 1
set i = udg_vectorMaxIndex
else
set i = udg_vectorUnusedIndex[udg_vectorUnusedAmount]
set udg_vectorUnusedAmount = udg_vectorUnusedAmount - 1
endif
set udg_vectorX[i] = x
set udg_vectorY[i] = y
set udg_vectorZ[i] = z
set udg_vectorTaken[i] = true
return i
endfunction
function VectorDestroy takes integer vector returns boolean
if not udg_vectorTaken[vector] then
return false
endif
set udg_vectorTaken[vector] = false
set udg_vectorUnusedAmount = udg_vectorUnusedAmount + 1
set udg_vectorUnusedIndex[udg_vectorUnusedAmount] = vector
return true
endfunction
function VectorSum takes integer augendV, integer addendV returns integer
if udg_vectorTaken[augendV] and udg_vectorTaken[addendV] then
return VectorCreate(udg_vectorX[augendV]+udg_vectorX[addendV], udg_vectorY[augendV]+udg_vectorY[addendV], udg_vectorZ[augendV]+udg_vectorZ[addendV])
endif
return 0
endfunction
function VectorAdd takes integer increasedV, integer addedV returns boolean
if udg_vectorTaken[increasedV] and udg_vectorTaken[addedV] then
set udg_vectorX[increasedV] = udg_vectorX[increasedV] + udg_vectorX[addedV]
set udg_vectorY[increasedV] = udg_vectorY[increasedV] + udg_vectorY[addedV]
set udg_vectorZ[increasedV] = udg_vectorZ[increasedV] + udg_vectorZ[addedV]
return true
endif
return false
endfunction
function VectorDifference takes integer minuendV, integer subtrahendV returns integer
if udg_vectorTaken[minuendV] and udg_vectorTaken[subtrahendV] then
return VectorCreate(udg_vectorX[minuendV]-udg_vectorX[subtrahendV], udg_vectorY[minuendV]-udg_vectorY[subtrahendV], udg_vectorZ[minuendV]-udg_vectorZ[subtrahendV])
endif
return 0
endfunction
function VectorSubtract takes integer decreasedV, integer subtractedV returns boolean
if udg_vectorTaken[decreasedV] and udg_vectorTaken[subtractedV] then
set udg_vectorX[decreasedV] = udg_vectorX[decreasedV] - udg_vectorX[subtractedV]
set udg_vectorY[decreasedV] = udg_vectorY[decreasedV] - udg_vectorY[subtractedV]
set udg_vectorZ[decreasedV] = udg_vectorZ[decreasedV] - udg_vectorZ[subtractedV]
return true
endif
return false
endfunction
function VectorAmplify takes integer vector1, real factor returns integer
if udg_vectorTaken[vector1] then
return VectorCreate(factor*udg_vectorX[vector1],factor*udg_vectorY[vector1],factor*udg_vectorZ[vector1])
endif
return 0
endfunction
function VectorScale takes integer vector1, real factor returns boolean
if udg_vectorTaken[vector1] then
set udg_vectorX[vector1] = udg_vectorX[vector1] * factor
set udg_vectorY[vector1] = udg_vectorY[vector1] * factor
set udg_vectorZ[vector1] = udg_vectorZ[vector1] * factor
return true
endif
return false
endfunction
function VectorProductScalar takes integer vector1, integer vector2 returns real
if udg_vectorTaken[vector1] and udg_vectorTaken[vector2] then
return udg_vectorX[vector1] * udg_vectorX[vector2] + udg_vectorY[vector1] * udg_vectorY[vector2] + udg_vectorZ[vector1] * udg_vectorZ[vector2]
endif
return 0.00
endfunction
function VectorProductVector takes integer vector1, integer vector2 returns integer
local real x = udg_vectorY[vector1]*udg_vectorZ[vector2] - udg_vectorZ[vector1]*udg_vectorY[vector2]
local real y = udg_vectorZ[vector1]*udg_vectorX[vector2] - udg_vectorX[vector1]*udg_vectorZ[vector2]
local real z = udg_vectorX[vector1]*udg_vectorY[vector2] - udg_vectorY[vector1]*udg_vectorX[vector2]
if udg_vectorTaken[vector1] and udg_vectorTaken[vector2] then
return VectorCreate(x,y,z)
endif
return 0
endfunction
function VectorProjectVector takes integer projectedV, integer directionV returns integer
local real r = VectorProductScalar(projectedV, directionV)
local real l = VectorProductScalar(directionV, directionV)
if l == 0.0 then
return 0
endif
if udg_vectorTaken[projectedV] and udg_vectorTaken[directionV] then
return VectorAmplify(directionV, r/l)
endif
return 0
endfunction
function VectorProjectPlane takes integer projectedV, integer planeNormalV returns integer
local integer vect = VectorProjectVector(projectedV, planeNormalV)
local integer vect2 = VectorDifference(projectedV, vect)
call VectorDestroy(vect)
return vect2
endfunction
function VectorSetLength takes integer vector1, real length returns boolean
local real l = VectorGetLength(vector1)
if l == 0 then
return false
endif
return VectorScale(vector1, (length/l))
endfunction
function VectorGetAngle takes integer vector1, integer vector2 returns real
local real l1 = VectorGetLength(vector1)
local real l2 = VectorGetLength(vector2)
if l1 == 0 or l2 == 0 then
return 0.0
endif
if udg_vectorTaken[vector1] and udg_vectorTaken[vector2] then
return Acos(VectorProductScalar(vector1, vector2)/(l1*l2))
endif
return 0.00
endfunction
function VectorGetAngleDeg takes integer vector1, integer vector2 returns real
return VectorGetAngle(vector1, vector2)*bj_RADTODEG
endfunction
function VectorRotate takes integer rotatedV, integer axisV, real angle returns integer
local integer locX
local integer locY
local integer locZ
local integer result
if udg_vectorTaken[rotatedV] and udg_vectorTaken[axisV] then
set locZ = VectorProjectVector(rotatedV, axisV)
if locZ == 0 then
return 0
endif
set locX = VectorDifference(rotatedV, locZ)
set locY = VectorProductVector(axisV, locX)
call VectorSetLength(locY, VectorGetLength(locX))
call VectorScale(locX, Cos(angle))
call VectorScale(locY, Sin(angle))
set result = VectorSum(locX, locY)
call VectorAdd(result, locZ)
call VectorDestroy(locX)
call VectorDestroy(locY)
call VectorDestroy(locZ)
return result
endif
return 0
endfunction
function VectorRotateDeg takes integer rotatedV, integer axisV, real angle returns integer
return VectorRotate(rotatedV, axisV, (angle*bj_DEGTORAD))
endfunction
function VectorGetTerrainPosition takes real x, real y returns integer
local location stupid = Location(x,y)
local real z = GetLocationZ(stupid)
call RemoveLocation(stupid)
set stupid = null
return VectorCreate(x,y,z)
endfunction
function VectorGetTerrainNormal takes real x, real y, real sampleRadius returns integer
local location stupid = Location(x,y)
local real array z
local integer xvect
local integer yvect
local integer normvect
call MoveLocation(stupid, x-sampleRadius, y)
set z[1]=GetLocationZ(stupid)
call MoveLocation(stupid, x+sampleRadius, y)
set z[2]=GetLocationZ(stupid)
call MoveLocation(stupid, x, y-sampleRadius)
set z[3]=GetLocationZ(stupid)
call MoveLocation(stupid, x, y+sampleRadius)
set z[4]=GetLocationZ(stupid)
call RemoveLocation(stupid)
set xvect = VectorCreate(2*sampleRadius, 0.0, z[2]-z[1])
set yvect = VectorCreate(0.00, 2*sampleRadius, z[4]-z[3])
set normvect = VectorProductVector(xvect, yvect)
call VectorDestroy(xvect)
call VectorDestroy(yvect)
set stupid = null
return normvect
endfunction
function IsPointInCylinder takes integer pointV, integer cylinderOriginV, integer cylinderHeightV, real cylinderRadius returns boolean
local integer array vectors
local boolean b = false
local real l = VectorGetLength(cylinderHeightV)
if udg_vectorTaken[pointV] and udg_vectorTaken[cylinderOriginV] and udg_vectorTaken[cylinderHeightV] and l > 0.0 then
set vectors[1]=VectorDifference(pointV, cylinderOriginV)
set vectors[2]=VectorDifference(vectors[1], cylinderHeightV)
set vectors[3]=VectorProjectPlane(vectors[1], cylinderHeightV)
if VectorProductScalar(vectors[1], cylinderHeightV)>=0 and VectorProductScalar(vectors[2], cylinderHeightV)<=0 and VectorProductScalar(vectors[3], vectors[3])<=cylinderRadius*cylinderRadius then
set b = true
endif
call VectorDestroy(vectors[1])
call VectorDestroy(vectors[2])
call VectorDestroy(vectors[3])
endif
return b
endfunction
function IsPointInCone takes integer pointV, integer coneOriginV, integer coneHeightV, real coneRadius returns boolean
local integer array vectors
local boolean b = false
local real r
local real l = VectorGetLength(coneHeightV)
if udg_vectorTaken[pointV] and udg_vectorTaken[coneOriginV] and udg_vectorTaken[coneHeightV] and l>0.0 then
set vectors[1]=VectorDifference(pointV, coneOriginV)
set vectors[2]=VectorDifference(vectors[1], coneHeightV)
set vectors[3]=VectorProjectVector(vectors[1], coneHeightV)
set vectors[4]=VectorDifference(vectors[1], vectors[3])
set r = 1.0-( VectorGetLength(vectors[3])/l )
if VectorProductScalar(vectors[1], coneHeightV)>=0 and VectorGetLength(vectors[4])<=(coneRadius*r) then
set b = true
endif
call VectorDestroy(vectors[1])
call VectorDestroy(vectors[2])
call VectorDestroy(vectors[3])
call VectorDestroy(vectors[4])
endif
return b
endfunction
function IsPointInSphere takes integer pointV, integer sphereOriginV, real sphereRadius returns boolean
local integer vectors
local boolean b = false
if udg_vectorTaken[pointV] and udg_vectorTaken[sphereOriginV] then
set vectors=VectorDifference(pointV, sphereOriginV)
if VectorProductScalar(vectors, vectors)<= sphereRadius*sphereRadius then
set b = true
endif
call VectorDestroy(vectors)
endif
return b
endfunction
// *****************
// * Linked List *
// *****************
//ReturnBugFuncs
function LL_ly takes location l returns location
return udg_LL[R2I(GetLocationY(l)) - 0x100000]
endfunction
function LL_r2i takes real r returns integer
return R2I(r)
endfunction
function LL_i2r takes integer i returns real
return I2R(i)
endfunction
function LL_h2r takes location h returns real
set udg_LL[GetHandleId(h)-0x100000] = h
return I2R(GetHandleId(h))
endfunction
function LL_GetLocationY_Loc takes location loc returns location
set bj_enumDestructableCenter=LL_ly(loc)
return udg_LL[GetHandleId(bj_enumDestructableCenter)-0x100000]
endfunction
//ListFuncs
function LL_NewList takes integer value returns location
return Location(LL_i2r(value),0.)
endfunction
function LL_GetListSize takes location list returns integer
local integer i = 1
loop
exitwhen LL_GetLocationY_Loc(list) == null
set list = LL_GetLocationY_Loc(list)
set i = i + 1
endloop
return i
endfunction
function LL_AddListItemInBackOf takes location list, integer listitem, integer value returns nothing
local location loc
local integer i = 0
loop
exitwhen listitem == i
set list = LL_ly(list)
set i = i + 1
endloop
set loc = Location(LL_i2r(value),GetLocationY(list))
call MoveLocation(list, GetLocationX(list), LL_h2r(loc))
set loc = null
endfunction
function LL_AddListItemBack takes location list, integer value returns nothing
call LL_AddListItemInBackOf(list, LL_GetListSize(list)-1, value)
endfunction
function LL_AddListItemInFrontOf takes location list, integer listitem, integer value returns nothing
local location loc
local integer i = 0
loop
exitwhen listitem == i
set list = LL_ly(list)
if list == null then
call BJDebugMsg("|cffff0000Error:|r Linked List failure, listitem does not exist in function |cffffcc00LL_AddListItemBefore|r.")
return
endif
set i = i + 1
endloop
set loc = Location(GetLocationX(list),GetLocationY(list))
call MoveLocation(list, LL_i2r(value), LL_h2r(loc))
set loc = null
endfunction
function LL_AddListItemFront takes location list, integer value returns nothing
call LL_AddListItemInFrontOf(list, 0, value)
endfunction
function LL_GetListItem takes location list, integer listitem returns integer
local integer i = 0
loop
exitwhen i == listitem
set list = LL_ly(list)
if list == null then
call BJDebugMsg("|cffff0000Error:|r Linked List failure, listitem does not exist in function |cffffcc00LL_GetListItem|r.")
return -1
endif
set i = i + 1
endloop
set i = LL_r2i(GetLocationX(list))
return i
endfunction
function LL_FindListItem takes location list, integer value, integer ignores returns integer
local integer i = 0
local integer j
loop
set j = LL_r2i(GetLocationX(list))
if j == value then
set ignores = ignores - 1
endif
exitwhen ignores == -1
set list = LL_ly(list)
if list == null then
return -1
endif
set i = i + 1
endloop
return i
endfunction
function LL_UpdateListItem takes location list, integer listitem, integer value returns nothing
local integer i = 0
loop
exitwhen i == listitem
set list = LL_ly(list)
if list == null then
call BJDebugMsg("|cffff0000Error:|r Linked List failure, listitem does not exist in function |cffffcc00LL_UpdateListItem|r.")
return
endif
set i = i + 1
endloop
call MoveLocation(list, LL_i2r(value), GetLocationY(list))
endfunction
function LL_RemoveListItem takes location list, integer listitem returns nothing
local integer i = 0
local location loc
if listitem == 0 then
set loc = LL_ly(list)
if loc != null then
call MoveLocation(list, GetLocationX(loc), GetLocationY(list))
set listitem = 1
endif
set loc = null
endif
loop
exitwhen i == listitem
set loc = list
set list = LL_ly(list)
if list == null then
call BJDebugMsg("|cffff0000Error:|r Linked List failure, listitem does not exist in function |cffffcc00LL_RemoveListItem|r.")
return
endif
set i = i + 1
endloop
if GetLocationY(loc) > 0. and list != null then
call MoveLocation(loc, GetLocationX(loc), GetLocationY(list))
else
call MoveLocation(loc, GetLocationX(loc), 0)
endif
call RemoveLocation(list)
set loc = null
endfunction
function LL_DestroyList takes location list returns nothing
local location loc
loop
exitwhen GetLocationY(list) == 0.
set loc = list
set list = LL_ly(list)
call RemoveLocation(loc)
if list == null then
call BJDebugMsg("|cffff0000Error:|r Linked List critical failure, unable to succesfully destroy list in function |cffffcc00LL_DestroyList|r.")
return
endif
endloop
call RemoveLocation(list)
set loc = null
endfunction
// ******************
// * End of Funcs *
// ******************
Name | Type | is_array | initial_value |
BoolArray | boolean | Yes | |
C | unit | Yes | |
clsParticleConditions | location | Yes | |
clsParticleConditionStrings | location | Yes | |
clsParticleDummyEffect | effect | Yes | |
clsParticleForces | location | Yes | |
clsParticlePlace | integer | Yes | |
clsParticleSpeed | integer | Yes | |
clsParticleTaken | boolean | Yes | |
clsStringIndexString | string | Yes | |
conditionDeath | trigger | No | |
conditionGroundHit | trigger | No | |
forceGravity | integer | No | |
forceWind | integer | No | |
Int | integer | Yes | |
LL | location | Yes | |
MapSize | real | Yes | |
particleGroup | group | No | |
particleSpawnOffset | integer | No | |
Real | real | Yes | |
Tr | trigger | Yes | |
tt | texttag | Yes | |
vectorFac | boolean | Yes | false |
vectorFacSec | real | Yes | |
vectorMaxIndex | integer | No | |
vectorReal | real | Yes | |
vectorTaken | boolean | Yes | |
vectorUnusedAmount | integer | No | |
vectorUnusedIndex | integer | Yes | |
vectorX | real | Yes | |
vectorY | real | Yes | |
vectorZ | real | Yes | |
vectorZCurrentFac | real | Yes | |
vectorZFac | boolean | Yes | |
vectorZFacSec | integer | Yes | |
W | unit | Yes |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//sounds
constant function Music1 takes nothing returns sound
return gg_snd_ArthasTheme
endfunction
constant function Music2 takes nothing returns sound
return gg_snd_PursuitTheme
endfunction
constant function Music3 takes nothing returns sound
return gg_snd_HeroicVictory
endfunction
constant function HorseKickSound takes nothing returns sound
return gg_snd_PeasantPissed4
endfunction
constant function Bump takes nothing returns sound
return gg_snd_Bump
endfunction
constant function Slash takes nothing returns sound
return gg_snd_Slash
endfunction
constant function Parry takes nothing returns sound
return gg_snd_Parry
endfunction
constant function CannonHitSound takes nothing returns sound
return gg_snd_CatapultMissile1
endfunction
constant function ShotgunSound takes nothing returns sound
return gg_snd_m3_1
endfunction
constant function Doh takes nothing returns sound
return gg_snd_PeasantPissed5
endfunction
constant function ImDead takes nothing returns sound
return gg_snd_PeasantYesAttack4
endfunction
constant function EngineStart takes nothing returns sound
return gg_snd_EngineStart
endfunction
constant function Drive takes nothing returns sound
return gg_snd_Drive
endfunction
constant function CarCrash takes nothing returns sound
return gg_snd_CarCrash
endfunction
function True takes nothing returns boolean
return true
endfunction
constant function HorseBashSound takes nothing returns sound
return gg_snd_RockHeavyBashFlesh1
endfunction
constant function OIG takes nothing returns sound
return gg_snd_PeasantYes4
endfunction
constant function PeasantDeath takes nothing returns sound
return gg_snd_PeasantDeath
endfunction
constant function W takes integer i returns unit
return udg_W[i]
endfunction
constant function Slam takes nothing returns sound
return gg_snd_MetalHeavyBashMetal2
endfunction
constant function CommercialSound takes nothing returns sound
return gg_snd_PriestPissed6
endfunction
constant function SecretFoundSound takes nothing returns sound
return gg_snd_SecretFound
endfunction
constant function ScreamSound takes nothing returns sound
return gg_snd_WardenDeath1
endfunction
constant function Crickets takes nothing returns sound
return gg_snd_cricket1
endfunction
constant function Boing takes nothing returns sound
return gg_snd_Boing
endfunction
constant function Falling takes nothing returns sound
return gg_snd_Falling
endfunction
constant function Tralala takes nothing returns sound
return gg_snd_Tralala
endfunction
constant function Load takes nothing returns sound
return gg_snd_Loading
endfunction
function AddTextTag takes string s, real x, real y, real zOffset, real size, integer red, integer green, integer blue, integer trans returns texttag
set bj_lastCreatedTextTag=CreateTextTag()
call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, zOffset)
call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, trans)
return bj_lastCreatedTextTag
endfunction
function Fart takes nothing returns nothing
local sound s
set s=CreateSound("Units\\Creeps\\Ogre\\OgrePissed5.wav", false, false, false, 0, 0, "")
call SetSoundVolume(s, 127)
call StartSound(s)
set s=null
endfunction
function MakeUnitFaceWidget takes unit u, widget w, real time returns nothing
call SetUnitFacingTimed(u, Atan2BJ(GetWidgetY(w) - GetUnitY(u), GetWidgetX(w) - GetUnitX(u)), time)
endfunction
function DistanceBetweenUnits takes unit u1, unit u2 returns real
local real x=GetUnitX(u2)-GetUnitX(u1)
local real y=GetUnitY(u2)-GetUnitY(u1)
return SquareRoot(x*x+y*y)
endfunction
function AddTrans takes unit u, string title, string text, real dur returns nothing
call SetCinematicScene(GetUnitTypeId(u), GetPlayerColor(GetOwningPlayer(u)), title, text, dur, dur-0.8)
call UnitAddIndicator(u, bj_TRANSMISSION_IND_RED, bj_TRANSMISSION_IND_BLUE, bj_TRANSMISSION_IND_GREEN, bj_TRANSMISSION_IND_ALPHA)
endfunction
function TimedCall takes real time, code func returns nothing
call TimerStart(CreateTimer(), time, false, func)
endfunction
//Credits
// www.grsites.com
function Credits takes nothing returns nothing
local real x=GetRectCenterX(gg_rct_Black_Screen)
local real y=GetRectCenterY(gg_rct_Black_Screen)-800
call StartSound(Music3())
call CameraSetupApplyForceDuration(gg_cam_Black_Screen, true, 0.00)
call AddTextTag("Made by:", x-200, y, 0, 12, 30, 50, 30, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(1.50)
call AddTextTag("Diablo-dk", x-200, y, 0, 10, 255, 100, 100, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(2.00)
call AddTextTag("Dummy Model and Particle System:", x, y, 0, 10, 255, 255, 255, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(1.50)
call AddTextTag("Infrane", x, y, 0, 10, 205, 255, 205, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(3.00)
call AddTextTag("Thanks to:", x, y, 0, 10, 155, 255, 255, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(2.00)
call AddTextTag("grsites.com", x-200, y, 0, 10, 255, 255, 255, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call AddTextTag("Sounds", x+300, y, 0, 10, 255, 255, 255, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(1.10)
call AddTextTag("Purgeandfire", x-200, y, 0, 10, 255, 255, 255, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call AddTextTag("Hosting the cinematic contest", x+300, y, 0, 10, 255, 255, 255, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
call TriggerSleepAction(5.00)
call AddTextTag("THE END", x, y, 0, 15, 255, 100, 100, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(80))
endfunction
function InitTrig_Functions takes nothing returns nothing
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
// ************************************************************************************************************************
// ** **
// ** Particle Engine, moving objects dynamically **
// ** Created by iNfraNe **
// ** **
// ************************************************************************************************************************
// USER CHANGABLE CONSTANTS
constant function ParticlePeriod takes nothing returns real
return 0.02 //Warning: changing this value may cause lag.
endfunction
constant function DummyRawCode takes nothing returns integer
return 'e000' //Special dummy unit, having animations for changing angle on projectiles
endfunction
function SpawnPlaceOffset takes nothing returns integer
if udg_particleSpawnOffset == 0 then
set udg_particleSpawnOffset = VectorCreate(0,0,0) //X is parallel to the model, Y is perpendicular to the model
endif
return udg_particleSpawnOffset
endfunction
// INTERNAL FUNCTIONS
function H2I takes handle h returns integer
return GetHandleId(h)
endfunction
function TR2I takes trigger t returns integer
set udg_Tr[GetHandleId(t)-0x100000] = t
return GetHandleId(t)
endfunction
function I2TR takes integer i returns trigger
//return i
return udg_Tr[i-0x100000]
endfunction
function GetZ takes real x, real y returns real
local location loc = Location(x,y)
local real r = GetLocationZ(loc)
call RemoveLocation(loc)
set loc = null
return r
endfunction
function CreateEvalTrig takes code cb returns trigger
local trigger t = CreateTrigger()
call TriggerAddCondition(t,Condition(cb))
return t
endfunction
function MakeUnitFlyable takes unit u returns nothing
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
endfunction
function MapSizeXLow takes nothing returns real
if udg_MapSize[0] == 0. then
set udg_MapSize[0] = GetRectMinX(GetWorldBounds())
endif
return udg_MapSize[0]
endfunction
function MapSizeXHigh takes nothing returns real
if udg_MapSize[1] == 0. then
set udg_MapSize[1] = GetRectMaxX(GetWorldBounds())
endif
return udg_MapSize[1]
endfunction
function MapSizeYLow takes nothing returns real
if udg_MapSize[2] == 0. then
set udg_MapSize[2] = GetRectMinY(GetWorldBounds())
endif
return udg_MapSize[2]
endfunction
function MapSizeYHigh takes nothing returns real
if udg_MapSize[3] == 0. then
set udg_MapSize[3] = GetRectMaxY(GetWorldBounds())
endif
return udg_MapSize[3]
endfunction
//Do not try to init an empty string ("") it will lose its index.
function clsStringIndexInitString takes string s returns integer
local integer i = 0
local integer j = -1
loop
exitwhen i > 8191
if udg_clsStringIndexString[i] == "" or udg_clsStringIndexString[i] == null or udg_clsStringIndexString[i] == s then
set j = i
set i = 8192
endif
set i = i + 1
endloop
if j < 0 then
call BJDebugMsg("|cffff0000Critical Error:|r Could not add string to array, last added condition will fail.")
return -1
endif
set udg_clsStringIndexString[j] = s
return j
endfunction
function clsStringIndexGetString takes integer i returns string
return udg_clsStringIndexString[i]
endfunction
function clsParticleCreate takes unit u returns boolean
local integer i = 0
local integer j = -1
loop
exitwhen i > 8191
if not udg_clsParticleTaken[i] then
set j = i
set i = 8192
endif
set i = i + 1
endloop
if j < 0 then
return false
endif
set udg_clsParticleTaken[j] = true
set udg_clsParticlePlace[j] = VectorCreate(GetUnitX(u), GetUnitY(u), GetZ(GetUnitX(u), GetUnitY(u)) + VectorGetZ(SpawnPlaceOffset()))
set udg_clsParticleSpeed[j] = VectorCreate(0,0,0)
set udg_clsParticleForces[j] = LL_NewList(0)
set udg_clsParticleConditions[j] = LL_NewList(0)
set udg_clsParticleConditionStrings[j] = LL_NewList(0)
call SetUnitUserData(u,j)
return true
endfunction
function clsParticleDestroy takes unit u returns nothing
local integer i = GetUnitUserData(u)
if not udg_clsParticleTaken[i] then
return
endif
call VectorDestroy(udg_clsParticlePlace[i])
call VectorDestroy(udg_clsParticleSpeed[i])
call LL_DestroyList(udg_clsParticleForces[i])
call LL_DestroyList(udg_clsParticleConditions[i])
call LL_DestroyList(udg_clsParticleConditionStrings[i])
set udg_clsParticleTaken[i] = false
endfunction
function GetAttachedDummyEffect takes integer i returns effect
return udg_clsParticleDummyEffect[i]
endfunction
// USER USABLE FUNCTIONS
function CreateParticle takes player p, integer utype, real x, real y, real facing returns unit
local unit u = CreateUnit(p, utype, x, y, facing)
set x = x+CosBJ(facing)*VectorGetX(SpawnPlaceOffset())+SinBJ(facing)*VectorGetY(SpawnPlaceOffset())
set y = y+SinBJ(facing)*VectorGetX(SpawnPlaceOffset())+CosBJ(facing)*VectorGetY(SpawnPlaceOffset())
call SetUnitX(u, x)
call SetUnitY(u, y)
if not clsParticleCreate(u) then
call BJDebugMsg("|cffff0000Error:|r could not initialize particle class in function |cffffcc00CreateParticle|r, see the documentation for help.")
call RemoveUnit(u)
return null
endif
call MakeUnitFlyable(u)
call GroupAddUnit(udg_particleGroup, u)
return u
endfunction
function CreateProjectile takes player p, string path, real x, real y, real facing returns unit
local unit u = CreateUnit(p, DummyRawCode(), x, y, facing)
local integer i
set x = x+CosBJ(facing)*VectorGetX(SpawnPlaceOffset())+SinBJ(facing)*VectorGetY(SpawnPlaceOffset())
set y = y+SinBJ(facing)*VectorGetX(SpawnPlaceOffset())+CosBJ(facing)*VectorGetY(SpawnPlaceOffset())
call SetUnitX(u, x)
call SetUnitY(u, y)
if not clsParticleCreate(u) then
call BJDebugMsg("|cffff0000Error:|r could not initialize particle class in function |cffffcc00CreateProjectile|r, see the documentation for help.")
call RemoveUnit(u)
return null
endif
set i = GetUnitUserData(u)
set udg_clsParticleDummyEffect[i] = AddSpecialEffectTarget(path, u, "origin")
call MakeUnitFlyable(u)
call GroupAddUnit(udg_particleGroup, u)
return u
endfunction
function MakeParticle takes unit u returns nothing
local integer p
if not clsParticleCreate(u) then
call BJDebugMsg("|cffff0000Error:|r could not initialize particle class in function |cffffcc00MakeParticle|r, see the documentation for help.")
return
endif
set p = udg_clsParticlePlace[GetUnitUserData(u)]
set udg_vectorZ[p] = udg_vectorZ[p] - udg_vectorZ[SpawnPlaceOffset()] + 1
call MakeUnitFlyable(u)
call GroupAddUnit(udg_particleGroup, u)
endfunction
function RemoveParticle takes unit u, boolean removeunit returns nothing
local effect e = GetAttachedDummyEffect(GetUnitUserData(u))
if e != null then
call DestroyEffect(e)
endif
//Destroy class, VERY important
call clsParticleDestroy(u)
call GroupRemoveUnit(udg_particleGroup, u)
if removeunit then
call KillUnit(u)
call RemoveUnit(u)
endif
set e = null
endfunction
function ParticleSetSpeed takes unit u, real x, real y, real z returns nothing
local integer i = GetUnitUserData(u)
local integer v = udg_clsParticleSpeed[i]
set udg_vectorX[v] = x
set udg_vectorY[v] = y
set udg_vectorZ[v] = z
if GetAttachedDummyEffect(i) != null then
set i = R2I(Atan2BJ(udg_vectorZ[v], SquareRoot(udg_vectorX[v]*udg_vectorX[v]+udg_vectorY[v]*udg_vectorY[v]))+0.5)+90
call SetUnitAnimationByIndex(u, i)
endif
endfunction
function ParticleLinkConditionTrigger2Func takes unit u, trigger t, string s returns nothing
local integer i = GetUnitUserData(u)
local integer hi = TR2I(t)
if LL_GetListItem(udg_clsParticleConditions[i], 0) == 0 then
call LL_UpdateListItem(udg_clsParticleConditions[i], 0, hi)
call LL_UpdateListItem(udg_clsParticleConditionStrings[i], 0, clsStringIndexInitString(s))
else
call LL_AddListItemFront(udg_clsParticleConditions[i], hi)
call LL_AddListItemFront(udg_clsParticleConditionStrings[i], clsStringIndexInitString(s))
endif
endfunction
function ParticleUnlinkCondition takes unit u, trigger t returns nothing
local integer i = GetUnitUserData(u)
local integer hi = TR2I(t)
local location list = udg_clsParticleConditions[i]
local integer j = LL_FindListItem(list,hi,0)
call LL_RemoveListItem(list, j)
call LL_RemoveListItem(udg_clsParticleConditionStrings[i], j)
set list = null
endfunction
function ParticleAddForce takes unit u, integer vector returns nothing
local integer i = GetUnitUserData(u)
if LL_GetListItem(udg_clsParticleForces[i], 0) == 0 then
call LL_UpdateListItem(udg_clsParticleForces[i], 0, vector)
else
call LL_AddListItemFront(udg_clsParticleForces[i], vector)
endif
endfunction
function ParticleRemoveForce takes unit u, integer vector returns nothing
local integer i = GetUnitUserData(u)
local location list = udg_clsParticleForces[i]
local integer j = LL_FindListItem(list,vector,0)
call LL_RemoveListItem(list, j)
set list = null
endfunction
// INTERNAL FUNCTIONS
function CheckConditions takes integer i returns nothing
local location condlist = udg_clsParticleConditions[i]
local location strlist = udg_clsParticleConditionStrings[i]
local trigger t
local string s
loop
exitwhen condlist == null
set t = I2TR(LL_r2i(GetLocationX(condlist)))
if TriggerEvaluate(t) then
set s = clsStringIndexGetString(LL_r2i(GetLocationX(strlist)))
if s != "" and s != null then
call ExecuteFunc(s)
endif
endif
set condlist = LL_ly(condlist)
set strlist = LL_ly(strlist)
endloop
set t = null
set condlist = null
set strlist = null
endfunction
function CalcForces takes integer i returns integer
local location list = udg_clsParticleForces[i]
local integer a
local integer tv
local integer totv = VectorCreate(0,0,0)
loop
set a = LL_r2i(GetLocationX(list))
if a > 0 then
set tv = VectorAmplify(a, ParticlePeriod())
call VectorAdd(totv,tv)
call VectorDestroy(tv)
endif
set list = LL_ly(list)
exitwhen list == null
endloop
set list = null
return totv
endfunction
function MoveParticle takes unit u, integer i, integer dp returns nothing
local integer p = udg_clsParticlePlace[i]
local integer v = udg_clsParticleSpeed[i]
local integer tv
local integer j
set tv = VectorAmplify(v, ParticlePeriod())
call VectorAdd(p,tv)
call VectorAdd(p,dp)
call VectorDestroy(tv)
if udg_vectorX[p] < MapSizeXLow() or udg_vectorX[p] > MapSizeXHigh() or udg_vectorY[p] < MapSizeYLow() or udg_vectorY[p] > MapSizeYHigh() then
//Remove the particle before it is moved outside the map to stop crashes from happening
call RemoveParticle(u,true)
return
endif
call SetUnitX(u,udg_vectorX[p])
call SetUnitY(u,udg_vectorY[p])
call SetUnitFlyHeight(u,udg_vectorZ[p]-GetZ(udg_vectorX[p], udg_vectorY[p]),0.)
if GetAttachedDummyEffect(i) != null and not udg_vectorZFac[i] then
set j = R2I(Atan2BJ(udg_vectorZ[v], SquareRoot(udg_vectorX[v]*udg_vectorX[v]+udg_vectorY[v]*udg_vectorY[v]))+0.5)+90
call SetUnitAnimationByIndex(u, j+udg_vectorZFacSec[i])
endif
if udg_vectorFac[i] then
call SetUnitFacing(u, GetUnitFacing(u)+udg_vectorFacSec[i])
else
call SetUnitFacing(u, Atan2BJ(udg_vectorY[v], udg_vectorX[v]))
endif
endfunction
function CalcSpeed takes integer i, integer dv returns nothing
local integer v = udg_clsParticleSpeed[i]
call VectorAdd(v, dv)
endfunction
function particleMainLoop takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
local integer forces = CalcForces(i)
local integer tv = VectorAmplify(forces, ParticlePeriod())
call VectorScale(tv, 0.5)
call MoveParticle(u,i,tv)
call CalcSpeed(i,forces)
call VectorDestroy(tv)
call VectorDestroy(forces)
call CheckConditions(i)
set u = null
endfunction
function Trig_ParticleMain_Actions takes nothing returns nothing
call ForGroup(udg_particleGroup, function particleMainLoop)
endfunction
function InitTrig_ParticleMain takes nothing returns nothing
set gg_trg_ParticleMain = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(gg_trg_ParticleMain, ParticlePeriod())
call TriggerAddAction(gg_trg_ParticleMain, function Trig_ParticleMain_Actions)
endfunction
//TESH.scrollpos=75
//TESH.alwaysfold=0
// ************************************************************************************************************************
// ** **
// ** Particle Engine supplement functions **
// ** **
// ************************************************************************************************************************
//
// Functions in here are for you to change. Depending on what you want your projectile to do, or what constant forces you
// want on it, these functions will be different. This is the hardest part of the system to learn, but I hope that it will
// be understandable enough to use.
// Notice how the functions G and ParticleGroundHit will check if the object already exists and if not create it. This way
// the function will always return the correct object and it will stay constant, which is exactly what is needed for
// constant forces and conditions.
// Remember to always use GetEnumUnit() in the Conditions (conditions used for conditiontriggers) and ConditionFuncs (the
// functions ran when the conditiontrigger is validated) when refering to the particle.
//
// Forces
function G takes nothing returns integer
if udg_forceGravity == 0 then
set udg_forceGravity = VectorCreate(0,0,-2200)
endif
return udg_forceGravity
endfunction
function Wind takes nothing returns integer
if udg_forceWind == 0 then
set udg_forceWind = VectorCreate(0,0,-1100) //half power gravity
endif
return udg_forceWind
endfunction
// Conditions
function ParticleGroundHitCond takes nothing returns boolean
local unit u = GetEnumUnit()
local location loc = GetUnitLoc(u)
local integer i = udg_clsParticlePlace[GetUnitUserData(u)]
if GetLocationZ(loc) > udg_vectorZ[i] then
call RemoveLocation(loc)
set loc = null
return true
endif
call RemoveLocation(loc)
set loc = null
return false
endfunction
function ParticleGroundHit takes nothing returns trigger
if udg_conditionGroundHit == null then
set udg_conditionGroundHit = CreateEvalTrig(function ParticleGroundHitCond)
endif
return udg_conditionGroundHit
endfunction
function ParticleDeathCond takes nothing returns boolean
return GetWidgetLife(GetEnumUnit()) < 0.405
endfunction
function ParticleDeath takes nothing returns trigger
if udg_conditionDeath == null then
set udg_conditionDeath = CreateEvalTrig(function ParticleDeathCond)
endif
return udg_conditionDeath
endfunction
// ConditionFuncs
function GroundHit_Remove takes nothing returns nothing
local unit u = GetEnumUnit()
call KillUnit(u)
call RemoveParticle(u,true)
endfunction
function GroundHit_CarlHitWall takes nothing returns nothing
local unit u = GetEnumUnit()
set udg_Int[1] = 27
call SetUnitX(u, -7074)
call StartSound(StompSound())
call RemoveParticle(u, false)
call TriggerSleepAction(0.15)
call IssuePointOrder(u, "move", GetUnitX(C(8))-25, GetUnitY(u))
set u=null
endfunction
// This function works on both flat and angled terrain.
function GroundHit_Bounce takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
local integer p = udg_clsParticlePlace[i]
local integer v = udg_clsParticleSpeed[i]
local integer vector1 = VectorGetTerrainNormal(udg_vectorX[p], udg_vectorY[p], 25.0)
local integer vector2 = VectorProjectVector(v,vector1)
set udg_vectorX[p] = udg_vectorX[p] - udg_vectorX[v]*ParticlePeriod()
set udg_vectorY[p] = udg_vectorY[p] - udg_vectorY[v]*ParticlePeriod()
set udg_vectorZ[p] = udg_vectorZ[p] - udg_vectorZ[v]*ParticlePeriod()
call VectorScale(vector2, -2)
call VectorAdd(v, vector2)
call VectorScale(v, 0.65)
call VectorDestroy(vector1)
call VectorDestroy(vector2)
set u = null
endfunction
function GroundHit_Splash takes nothing returns nothing
local unit u=GetEnumUnit()
call UnitApplyTimedLife(CreateUnit(Player(15), 'e004', GetUnitX(u)-50, GetUnitY(u), 270), 0, 3.00)
call RemoveUnit(u)
set u = null
endfunction
function GroundHit_BounceStopLow takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
local integer p = udg_clsParticlePlace[i]
local integer v = udg_clsParticleSpeed[i]
local integer vector1 = VectorGetTerrainNormal(udg_vectorX[p], udg_vectorY[p], 25.0)
local integer vector2 = VectorProjectVector(v,vector1)
set udg_vectorX[p] = udg_vectorX[p] - udg_vectorX[v]*ParticlePeriod()
set udg_vectorY[p] = udg_vectorY[p] - udg_vectorY[v]*ParticlePeriod()
set udg_vectorZ[p] = udg_vectorZ[p] - udg_vectorZ[v]*ParticlePeriod()
call VectorScale(vector2, -2)
call VectorAdd(v, vector2)
call VectorScale(v, 0.65)
call VectorDestroy(vector1)
call VectorDestroy(vector2)
if VectorGetLength(v) < 50 then
call RemoveParticle(u, false)
endif
set u = null
endfunction
function Death_Remove takes nothing returns nothing
call RemoveParticle(GetEnumUnit(),true)
endfunction
function RemoveFrom_Joe takes nothing returns nothing
local unit u=GetEnumUnit()
call RemoveParticle(u,false)
call StartSound(Ahh())
call IssuePointOrder(u, "move", -5860, 5100)
set u=null
endfunction
function InitTrig_Particle_Supplement_Functions takes nothing returns nothing
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Init_Actions takes nothing returns nothing
set udg_C[1]=gg_unit_nmed_0001
set udg_C[2]=gg_unit_hpea_0041
set udg_C[3]=gg_unit_zmar_0039
set udg_C[4]=gg_unit_hmpr_0044
set udg_C[5]=gg_unit_nvl2_0038
set udg_C[6]=gg_unit_nvlw_0007
set udg_C[7]=gg_unit_nvl2_0032
set udg_C[8]=gg_unit_h000_0045
set udg_C[9]=gg_unit_nvl2_0047
set udg_C[10]=gg_unit_n000_0046
set udg_C[11]=gg_unit_nvil_0049
set udg_C[12]=gg_unit_hspt_0051
set udg_C[13]=gg_unit_hfoo_0054
set udg_C[14]=gg_unit_hpea_0053
set udg_C[15]=gg_unit_hhes_0056
set udg_C[16]=gg_unit_hpea_0057
set udg_C[17]=gg_unit_hmtm_0058
set udg_C[18]=gg_unit_hmtt_0059
set udg_C[20]=gg_unit_nvlk_0030
set udg_C[21]=gg_unit_nvl2_0024
set udg_C[22]=gg_unit_nvlw_0037
set udg_C[23]=gg_unit_nvl2_0036
set udg_C[24]=gg_unit_nvlw_0020
set udg_C[25]=gg_unit_nvk2_0013
set udg_C[26]=gg_unit_hpea_0057
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 6)
call SetTimeOfDayScale(0)
call CreateFogModifierRectBJ( true, Player(0), FOG_OF_WAR_VISIBLE, GetPlayableMapRect() )
call ShowUnit(C(4), false)
call CinematicModeBJ(true, GetPlayersAll())
call ShowInterfaceForceOff(GetPlayersAll(), 0)
call ForceCinematicSubtitlesBJ(true)
call SetUserControlForceOff(GetPlayersAll())
call ClearMapMusicBJ()
call StopMusicBJ(false)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call VolumeGroupSetVolumeBJ(SOUND_VOLUMEGROUP_AMBIENTSOUNDS, 0.00)
call StopSound(bj_nightAmbientSound, true, true)
call StopSound(bj_dayAmbientSound, true, true)
//call SetSkyModel( "Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl" )
call SetTerrainFogEx(0, 500, 8000, 1, 3, 1, 1)
endfunction
//===========================================================================
function InitTrig_Init takes nothing returns nothing
set gg_trg_Init = CreateTrigger( )
call TriggerAddAction( gg_trg_Init, function Trig_Init_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function GroupHideWP takes nothing returns nothing
call ShowUnit(GetEnumUnit(), false)
endfunction
function GFilter takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit()) == 'e005'
endfunction
//Init WayPoints
function Trig_Init2_Actions takes nothing returns nothing
local integer i=1
local group g=CreateGroup()
// Time for configuring the waypoint for the tank:
// There's 2 ways. the easy one, and the safe one.
// I'll pick the safe one.
// Took about 15 mins to write this
set udg_W[i] = gg_unit_e005_0060
set i=i+1
set udg_W[i] = gg_unit_e005_0061
set i=i+1
set udg_W[i] = gg_unit_e005_0062
set i=i+1
set udg_W[i] = gg_unit_e005_0063
set i=i+1
set udg_W[i] = gg_unit_e005_0064
set i=i+1
set udg_W[i] = gg_unit_e005_0065
set i=i+1
set udg_W[i] = gg_unit_e005_0066
set i=i+1
set udg_W[i] = gg_unit_e005_0067
set i=i+1
set udg_W[i] = gg_unit_e005_0068
set i=i+1
set udg_W[i] = gg_unit_e005_0069
set i=i+1
set udg_W[i] = gg_unit_e005_0070
set i=i+1
set udg_W[i] = gg_unit_e005_0071
set i=i+1
set udg_W[i] = gg_unit_e005_0072
set i=i+1
set udg_W[i] = gg_unit_e005_0073
set i=i+1
set udg_W[i] = gg_unit_e005_0074
set i=i+1
set udg_W[i] = gg_unit_e005_0075
set i=i+1
set udg_W[i] = gg_unit_e005_0076
set i=i+1
set udg_W[i] = gg_unit_e005_0077
set i=i+1
set udg_W[i] = gg_unit_e005_0078
set i=i+1
set udg_W[i] = gg_unit_e005_0079
set i=i+1
set udg_W[i] = gg_unit_e005_0080
set i=i+1
set udg_W[i] = gg_unit_e005_0081
set i=i+1
set udg_W[i] = gg_unit_e005_0082
set i=i+1
set udg_W[i] = gg_unit_e005_0083
set i=i+1
set udg_W[i] = gg_unit_e005_0084
set i=i+1
set udg_W[i] = gg_unit_e005_0085
set i=i+1
set udg_W[i] = gg_unit_e005_0086
set i=i+1
set udg_W[i] = gg_unit_e005_0087
set i=i+1
set udg_W[i] = gg_unit_e005_0088
set i=i+1
set udg_W[i] = gg_unit_e005_0089
set i=i+1
set udg_W[i] = gg_unit_e005_0090
set i=i+1
set udg_W[i] = gg_unit_e005_0091
set i=i+1
set udg_W[i] = gg_unit_e005_0092
set i=i+1
set udg_W[i] = gg_unit_e005_0093
set i=i+1
set udg_W[i]= gg_unit_e005_0094
set i=i+1
set udg_W[i] = gg_unit_e005_0095
set i=i+1
set udg_W[i] = gg_unit_e005_0096
set i=i+1
set udg_W[i] = gg_unit_e005_0097
set i=i+1
set udg_W[i] = gg_unit_e005_0098
set i=i+1
set udg_W[i] = gg_unit_e005_0099
set i=i+1
set udg_W[i] = gg_unit_e005_0100
set i=i+1
set udg_W[i] = gg_unit_e005_0101
set i=i+1
set udg_W[i] = gg_unit_e005_0102
set i=i+1
set udg_W[i] = gg_unit_e005_0103
set i=i+1
set udg_W[i] = gg_unit_e005_0104
set i=i+1
set udg_W[i] = gg_unit_e005_0105
set i=i+1
set udg_W[i] = gg_unit_e005_0106
set i=i+1
set udg_W[i] = gg_unit_e005_0107
set i=i+1
set udg_W[i] = gg_unit_e005_0108
set i=i+1
set udg_W[i] = gg_unit_e005_0109
set i=i+1
set udg_W[i] = gg_unit_e005_0110
set i=i+1
set udg_W[i] = gg_unit_e005_0111
set i=i+1
set udg_W[i] = gg_unit_e005_0112
set i=i+1
set udg_W[i] = gg_unit_e005_0113
set i=i+1
set udg_W[i] = gg_unit_e005_0114
set i=i+1
set udg_W[i] = gg_unit_e005_0115
set i=i+1
set udg_W[i] = gg_unit_e005_0116
set i=i+1
set udg_W[i] = gg_unit_e005_0117
set i=i+1
set udg_W[i] = gg_unit_e005_0118
set i=i+1
set udg_W[i] = gg_unit_e005_0119
set i=i+1
set udg_W[i] = gg_unit_e005_0120
set i=i+1
set udg_W[i] = gg_unit_e005_0121
set i=i+1
set udg_W[i] = gg_unit_e005_0122
set i=i+1
set udg_W[i] = gg_unit_e005_0123
set i=i+1
set udg_W[i] = gg_unit_e005_0124
set i=i+1
set udg_W[i] = gg_unit_e005_0125
set i=i+1
set udg_W[i] = gg_unit_e005_0126
set i=i+1
set udg_W[i] = gg_unit_e005_0127
set i=i+1
set udg_W[i] = gg_unit_e005_0128
set i=i+1
set udg_W[i] = gg_unit_e005_0129
set i=i+1
set udg_W[i] = gg_unit_e005_0130
set i=i+1
set udg_W[i] = gg_unit_e005_0131
set i=i+1
set udg_W[i] = gg_unit_e005_0132
set i=i+1
set udg_W[i] = gg_unit_e005_0133
set i=i+1
set udg_W[i] = gg_unit_e005_0134
set i=i+1
set udg_W[i] = gg_unit_e005_0135
set i=i+1
set udg_W[i] = gg_unit_e005_0136
set i=i+1
set udg_W[i] = gg_unit_e005_0137
set i=i+1
set udg_W[i] = gg_unit_e005_0138
set i=i+1
set udg_W[i] = gg_unit_e005_0139
set i=i+1
set udg_W[i] = gg_unit_e005_0140
set i=i+1
set udg_W[i] = gg_unit_e005_0141
set i=i+1
set udg_W[i] = gg_unit_e005_0142
set i=i+1
set udg_W[i] = gg_unit_e005_0143
set i=i+1
set udg_W[i] = gg_unit_e005_0144
set i=i+1
set udg_W[i] = gg_unit_e005_0145
set i=i+1
set udg_W[i] = gg_unit_e005_0146
set i=i+1
set udg_W[i] = gg_unit_e005_0147
set i=i+1
set udg_W[i] = gg_unit_e005_0148
set i=i+1
set udg_W[i] = gg_unit_e005_0149
set i=i+1
set udg_W[i] = gg_unit_e005_0150
set i=i+1
set udg_W[i] = gg_unit_e005_0151
set i=i+1
set udg_W[i] = gg_unit_e005_0152
set i=i+1
set udg_W[i] = gg_unit_e005_0153
set i=i+1
set udg_W[i] = gg_unit_e005_0154
set i=i+1
set udg_W[i] = gg_unit_e005_0155
set i=i+1
set udg_W[i] = gg_unit_e005_0156
set i=i+1
set udg_W[i] = gg_unit_e005_0157
set i=i+1
set udg_W[i] = gg_unit_e005_0158
set i=i+1
set udg_W[i] = gg_unit_e005_0159
set i=i+1
set udg_W[i] = gg_unit_e005_0160
set i=i+1
set udg_W[i] = gg_unit_e005_0161
set i=i+1
set udg_W[i] = gg_unit_e005_0162
set i=i+1
set udg_W[i] = gg_unit_e005_0163
set i=i+1
set udg_W[i] = gg_unit_e005_0164
set i=i+1
set udg_W[i] = gg_unit_e005_0165
set i=i+1
set udg_W[i] = gg_unit_e005_0166
call GroupEnumUnitsOfPlayer(g, Player(0), Filter(function GFilter))
call ForGroup(g, function GroupHideWP)
// End
//Faster and safer than calling 140 H2I calls inside a loop.
call DestroyGroup(g)
set g=null
endfunction
//===========================================================================
function InitTrig_Init2 takes nothing returns nothing
set gg_trg_Init2 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Init2, 0.01 )
call TriggerAddAction( gg_trg_Init2, function Trig_Init2_Actions )
endfunction
//TESH.scrollpos=386
//TESH.alwaysfold=0
//alot of functions:
//go further down for the main function
constant function Peasant takes nothing returns string
return "units\\human\\Peasant\\Peasant.mdl"
endfunction
function DustTimer takes nothing returns nothing
set udg_Real[1] = udg_Real[1] - 0.00675
call SetUnitScale(C(13), udg_Real[1], udg_Real[1], udg_Real[1])
if udg_Real[1] < 0.10 then
call RemoveUnit(C(13))
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function Dusty takes nothing returns nothing
set udg_Real[1] = 1.00
call AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", GetUnitX(C(13)), GetUnitY(C(13)))
call TimerStart(CreateTimer(), 0.02, true, function DustTimer)
endfunction
function TankMove takes nothing returns nothing
if udg_Int[76] > 106 then
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
set udg_Int[81] = 3
else
call MakeUnitFaceWidget(C(18), W(udg_Int[76]), 0.00)
call SetUnitX(C(18), GetUnitX(W(udg_Int[76]))) // 76 is just a random number.
call SetUnitY(C(18), GetUnitY(W(udg_Int[76])))
call RemoveUnit(W(udg_Int[76]))
set udg_W[udg_Int[76]] = null // such a big array will leak alot if not nulled.
set udg_Int[76] = udg_Int[76] + 1
endif
endfunction
function StartTank takes nothing returns nothing
set udg_Int[76] = 1
call TimerStart(CreateTimer(), 0.035, true, function TankMove)
endfunction
function TallTimer takes nothing returns nothing
set udg_Real[1] = udg_Real[1] + 0.01
call SetUnitScale(C(14), udg_Real[1], 1.00, 1.00)
if udg_Real[1] > 2.19 then
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function UnTallTimer takes nothing returns nothing
set udg_Real[1] = udg_Real[1] - 0.022
call SetUnitScale(C(14), udg_Real[1], 1.00, 1.00)
if udg_Real[1] < 1.01 then
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function Tall takes nothing returns nothing
set udg_Real[1] = 1.00
call TimerStart(CreateTimer(), 0.02, true, function TallTimer)
call PolledWait(2.90)
call Fart()
call Fart()
call Fart()
call TimerStart(CreateTimer(), 0.02, true, function UnTallTimer)
endfunction
function ToastUnit takes unit u returns nothing
call SetUnitVertexColor(u, 0, 0, 0, 255)
call AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl", GetUnitX(u), GetUnitY(u))
call SetUnitTimeScale(u, 0)
endfunction
function FreezeUnit takes unit u returns nothing
local effect e
call SetUnitVertexColor(u, 160, 160, 255, 255)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl", GetUnitX(u), GetUnitY(u)))
set e = AddSpecialEffect("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl", GetUnitX(u), GetUnitY(u))
call SetUnitTimeScale(u, 0)
call PolledWait(2.00)
call DestroyEffect(e)
set e=null
endfunction
function ResetUnit takes unit u returns nothing
call SetUnitVertexColor(u, 255, 255, 255, 255)
call SetUnitTimeScale(u, 1)
endfunction
function MineExplode takes nothing returns nothing
local unit u=bj_ghoul[100]
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\Mortar\\MortarMissile.mdl", GetUnitX(u), GetUnitY(u)))
call MakeParticle(C(11))
call ParticleSetSpeed(C(11), 0, 0, 2550)
call ParticleAddForce(C(11), G())
call UnitApplyTimedLife(C(11), 0, 0.40)
call RemoveUnit(u)
set u=null
endfunction
function ProjectorPush takes nothing returns nothing
local real x=GetUnitX(C(8))
local real y=GetUnitY(C(8))
local real x2=GetUnitX(C(4))-x
local real y2=GetUnitY(C(4))-y
local real fac=GetUnitFacing(C(8))
call SetUnitX(C(8), x-(1250*0.025))
if SquareRoot(x2*x2+y2*y2) < 50 then
call IssueImmediateOrder(C(3), "stop")
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
call MakeParticle(C(4))
call ParticleSetSpeed(C(4), -1250, 0, 950)
call ParticleAddForce(C(4), G())
call UnitRemoveAbility(C(4), 'Asph')
call ParticleLinkConditionTrigger2Func(C(4), ParticleGroundHit(), "GroundHit_CarlHitWall")
call StartSound(Slam())
set bj_ghoul[100]=CreateParticle(Player(0), 'e001', GetUnitX(C(4))-20, GetUnitY(C(4)), 270)
call ParticleSetSpeed(bj_ghoul[100], -30, 0, 1000)
call ParticleAddForce(bj_ghoul[100], G())
call ParticleLinkConditionTrigger2Func(bj_ghoul[100], ParticleGroundHit(), "GroundHit_BounceStopLow")
endif
endfunction
//==============
//
// Main Function
function Trig_Cine1_Actions takes nothing returns nothing
local unit u=CreateProjectile(Player(15), Peasant(), GetUnitX(gg_unit_hpea_0042), GetUnitY(gg_unit_hpea_0042), 180)
local integer i=GetUnitUserData(u)
call RemoveUnit(gg_unit_hpea_0042)
call ShowUnit(C(8), false)
call StartSound(Music1())
call DisplayTimedTextToPlayer(Player(0), 0.6, 0.2, 3.20,"Long time ago, in an old land..")
call TriggerSleepAction(3.70)
call DisplayTimedTextToPlayer(Player(0), 0.6, 0.2, 6.00,"Where greed, sorrow, assassins and poisonous mushrooms were causing terror upon everything..")
call TriggerSleepAction(6.60)
call DisplayTimedTextToPlayer(Player(0), 0.6, 0.2, 6.00,"There was no justice, while mad cows and flaming cockroaches were killing unsuspecting men and women..")
call TriggerSleepAction(6.60)
call DisplayTimedTextToPlayer(Player(0), 0.6, 0.2, 6.20,"The land was controlled by a mad, evil, viscious, cruel, nasty and selfish man, named PurgeandFrost..")
call TriggerSleepAction(7)
call DisplayTimedTextToPlayer(Player(0), 0.6, 0.2, 16.5,"His brother, PurgeandFire, who also was mad, evil, viscious, cruel, nasty and selfish, but still not quite as mad, evil, viscious, cruel, nasty and selfish as PurgeandFrost, was trying to beat PurgeandFrost(The most mad, evil viscious, cruel, nasty and selfish person of the two)")
call TriggerSleepAction(17.2)
call DisplayTimedTextToPlayer(Player(0), 0.6, 0.2, 3,"Now to something completly different..")
call TriggerSleepAction(3.50)
call AddTrans(udg_C[3],"Officer Jones","People, people, please! Be quiet!", 5)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 3.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam_2, true, 0)
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 3.5)
call TriggerSleepAction(4.2)
call AddTrans(C(3), "Officer Jones", "Turn off the damn music for gods sake!", 3.3)
call TriggerSleepAction(2.60)
call StopSound(Music1(), false, false)
call TriggerSleepAction(1.00)
call CameraSetupApplyForceDuration(gg_cam_Judge_Cam, true, 3)
call AddTrans(udg_C[3], "Officer Jones", "Now starting the trial against Joe the farmer!", 4.5)
call TriggerSleepAction(5.00)
call AddTrans(udg_C[3], "Officer Jones","Now, where the hell is that damn prosecutor...", 3.8)
call TriggerSleepAction(4)
call AddTrans(udg_C[3], "Officer Jones", "PROSECUTOR!", 2.20)
call TriggerSleepAction(2.0)
call StartSound(CannonHitSound())
call ShowUnit(C(4), true)
call IssuePointOrder(C(4), "move", -6143, 6146)
call TriggerSleepAction(1.00)
call AddTrans(udg_C[4], "Carl","I'm coming i'm coming!.. calm down..", 4.5)
call TriggerSleepAction(3)
call CameraSetupApplyForceDuration(gg_cam_Villager1_Cam, true, 1.5)
call AddTrans(C(5), "Villager", "Excuse me your highness, but would you mind explaining why there are exotic trees in here?",5.4)
call TriggerSleepAction(4.8)
call CameraSetupApplyForceDuration(gg_cam_Trial_Tree_Cam, true, 0.00)
call TriggerSleepAction(2)
call CameraSetupApplyForceDuration(gg_cam_Judge_Cam, true, 0.00)
call AddTrans(C(1), "Judge", "Because the lumberjack hasn't been here yet.. duh..", 4.00)
call TriggerSleepAction(4.05)
call CameraSetupApplyForceDuration(gg_cam_Villager1_Cam, true, 1.00)
call AddTrans(C(5), "Villager", "Okay..", 1.80)
call TriggerSleepAction(1.55)
call AddTrans(C(5), "Villager", "But i don't get what those barrels over there are for..", 4.5)
call TriggerSleepAction(1.2)
call CameraSetupApplyForceDuration(gg_cam_Barrel_Cam, true, 1.00)
call TriggerSleepAction(3)
call AddTrans(C(1), "Judge", "Ammunition for Officer Jones", 3)
call TriggerSleepAction(3.00)
call AddTrans(C(5), "Villager", "Excuse me? Ammunition? Why the hell should he have ammunition?", 3.8)
call CameraSetupApplyForceDuration(gg_cam_Villager1_Cam, true, 3.00)
call TriggerSleepAction(3.55)
call AddTrans(C(5), "Villager", "We're in a court, so he shouldn't..", 2.20)
call TriggerSleepAction(2.1)
call IssueTargetOrder(C(3), "attack", C(5))
call StartSound(ShotgunSound())
call TriggerSleepAction(1.2)
call AddTrans(C(6), "Wife", "George!", 1.6)
call MakeUnitFaceWidget(C(6), C(5), 0)
call TriggerSleepAction(1.5)
call AddTrans(C(6), "Wife", "You killed my husband!", 2.8)
call MakeUnitFaceWidget(C(6), C(3), 0.70)
call TriggerSleepAction(2.5)
call AddTrans(C(6), "Wife", "You bastard! Do you think that just because you carry a gun that you can shoot everyone?", 4.3)
call TriggerSleepAction(4.25)
call StartSound(Crickets())
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 0.00)
call TriggerSleepAction(3.00)
call AddTrans(C(3), "Officer Jones", "Yes i do", 2.00)
call MakeUnitFaceWidget(C(3), C(6), 0.50)
call TriggerSleepAction(1.60)
call IssueTargetOrder(C(3), "attack", C(6))
call StartSound(ShotgunSound())
call TriggerSleepAction(1.5)
call AddTrans(C(1), "Judge", "Any other questions?", 2.6)
call TriggerSleepAction(3.0)
call AddTrans(C(1), "Judge", "Good, go on prosecutor", 3)
call TriggerSleepAction(2.9)
call CameraSetupApplyForceDuration(gg_cam_Prosecutor_Cam, true, 1.5)
call MakeUnitFaceWidget(C(4), C(2), 0)
call AddTrans(C(4), "Carl", "Joe Barness Jackson Farmer", 2.8)
call TriggerSleepAction(2.55)
call AddTrans(C(4), "Carl", "You are in charge for murdering Sir Pointy Hat", 3.2)
call TriggerSleepAction(2.95)
call AddTrans(C(4), "Carl", "Do you have anything to say about this?", 2.9)
call TriggerSleepAction(2.65)
call CameraSetupApplyForceDuration(gg_cam_Accused_Cam, true, 2.5)
call AddTrans(C(2), "Joe", "The horse kicked me once", 3.00)
call StartSound(HorseKickSound())
call TriggerSleepAction(0.80)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(0.90)
call StopSound(HorseKickSound(), false, false)
call CameraSetupApplyForceDuration(gg_cam_Horse_Cam, true, 0.00)
call SetSkyModel( "Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl" )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 2.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.70)
call AddTrans(C(2), "Joe", "Good horse", 1.4)
call TriggerSleepAction(1.5)
call SetUnitAnimationByIndex(gg_unit_hrdh_0043, 12)
call TriggerSleepAction(0.35)
call StartSound(HorseBashSound())
call StartSound(PeasantDeath())
call ParticleSetSpeed(u, -1250, 0, 2300)
call ParticleAddForce(u, G())
call CameraSetupApplyForceDuration(gg_cam_Hill_Long_Cam, true, 0.20)
set udg_vectorZFacSec[i]=-90
call TriggerSleepAction(0.60)
call SetUnitAnimationByIndex(gg_unit_hrdh_0043, 0)
loop
call TriggerSleepAction(0.10)
exitwhen GetUnitFlyHeight(u) < 1
endloop
call StartSound(StompSound())
call RemoveParticle(u, true)
call TriggerSleepAction(0.40)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.30)
call SetSkyModel(null)
call CameraSetupApplyForceDuration(gg_cam_Accused_Cam, true, 0)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call StartSound(HorseKickSound())
call SetSoundVolume(HorseKickSound(),0)
call TriggerSleepAction(1.85)
call AddTrans(C(2), "Joe", "It hurt", 2.00)
call SetSoundVolume(HorseKickSound(),127)
call TriggerSleepAction(2.30)
call AddTrans(C(4), "Carl", "Okay.. I expected some kind of explaination..", 3.2)
call TriggerSleepAction(2.95)
call SetUnitFacingTimed(C(4), 270, 0.80)
call AddTrans(C(4), "Carl", "I will now show Evidence 1", 2.90)
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 1.10)
call TriggerSleepAction(2.65)
call CameraSetupApplyForceDuration(gg_cam_Villager2_Cam, true, 0.60)
call AddTrans(C(7), "Steve", "Aren't evidences usually named with letters instead of numbers?", 3.4)
call TriggerSleepAction(3.15)
call AddTrans(C(7), "Steve", "Like Evidence A, or Evidence B..", 2.50)
call TriggerSleepAction(2.25)
call IssueTargetOrder(C(3), "attack", C(7))
call StartSound(ShotgunSound())
call TriggerSleepAction(1.2)
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 0.60)
call AddTrans(C(1), "Judge", "In this trial we do it with numbers", 2.8)
call TriggerSleepAction(2.55)
call AddTrans(C(1), "Judge", "Show us Evidence 1 so we can get going", 2.9)
call MakeUnitFaceWidget(C(1), C(4), 0.40)
call TriggerSleepAction(2.65)
call AddTrans(C(4), "Carl", "Right, i'll go get it", 2.6)
call IssuePointOrder(C(4), "move", -5143, 5146)
call TriggerSleepAction(2.35)
call AddTrans(C(1), "Judge", "Jones, get the video projector", 2.6)
call MakeUnitFaceWidget(C(1), C(4), 0.60)
call TriggerSleepAction(2.35)
call AddTrans(C(3), "Officer Jones", "Aye", 1.80)
call CameraSetupApplyForceDuration(gg_cam_Trial_Mid_Cam, true, 1.2)
call UnitAddAbility(C(4), 'Asph')
call IssuePointOrder(C(3), "move", GetUnitX(C(8)), GetUnitY(C(8)))
call TriggerSleepAction(0.40)
call IssuePointOrder(C(4), "move", -6513, 6030)
loop
call TriggerSleepAction(0.10)
exitwhen GetUnitX(C(4)) < -6400
endloop
call AddTrans(C(4), "Carl", "Here's the tape, where's the projector?", 2.9)
call TriggerSleepAction(2.5)
call ShowUnit(C(8), true)
call SetUnitX(C(8), -5620)
call SetUnitY(C(8), 6000)
call TimerStart(CreateTimer(), 0.025, true, function ProjectorPush)
call SetUnitX(C(3), -5550)
call SetUnitY(C(3), 6030)
loop
call TriggerSleepAction(0.10)
exitwhen udg_Int[1] == 27
endloop
call IssuePointOrder(C(3), "move", GetUnitX(C(8))+80, GetUnitY(C(8)))
loop
call TriggerSleepAction(0.10)
exitwhen DistanceBetweenUnits(C(4), bj_ghoul[100]) < 50
endloop
call RemoveUnit(bj_ghoul[100])
call UnitAddAbility(C(4), 'Asph')
call AddTrans(C(4), "Carl", "How the heck was that possible?", 2.6)
call TriggerSleepAction(2.35)
call AddTrans(C(4), "Carl", "It doesn't even have wheels", 2.6)
call TriggerSleepAction(2.55)
call AddTrans(C(3), "Officer Jones", "Just start the video", 2.6)
call TriggerSleepAction(2.45)
call AddTrans(C(4), "Carl", "I'm trying, but i can't find the start button!", 2.9)
call TriggerSleepAction(2.65)
call UnitRemoveAbility(C(4), 'Asph')
call AddTrans(C(4), "Carl", "There it is!", 2.5)
call TriggerSleepAction(2.00)
call StartSound(SecretFoundSound())
call TriggerSleepAction(0.20)
call AddTrans(C(1), "Judge", "Yay, movie time!", 2.6)
call CameraSetupApplyForceDuration(gg_cam_Movie_Cam, true, 0.00)
call CameraSetupApplyForceDuration(gg_cam_MovieLoop_Cam, true, 3.00)
call TriggerSleepAction(0.60)
//===============================
// Baby movie |
// Start |
//===============================
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.60, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.50)
call ResetTerrainFog()
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call CameraSetupApplyForceDuration(gg_cam_Black_Screen, true, 0.00)
call AddTextTag("A movie by Carl", -1560, 350, 0, 13, 100, 100, 80, 0)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
//call SetTextTagVelocity(bj_lastCreatedTextTag, 0, TextTagSpeed2Velocity(60))
//call SetTextTagPermanent(bj_lastCreatedTextTag, false)
//call SetTextTagLifespan(bj_lastCreatedTextTag, 5)
//call SetTextTagFadepoint(bj_lastCreatedTextTag, 5)
call TriggerSleepAction(4.1)
call DestroyTextTag(bj_lastCreatedTextTag)
call AddTextTag("How Babies Are Born", -1560, 300, 0, 14, 100, 70, 75, 0)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
//call SetTextTagPermanent(bj_lastCreatedTextTag, false)
//call SetTextTagLifespan(bj_lastCreatedTextTag, 6)
//call SetTextTagFadepoint(bj_lastCreatedTextTag, 6)
call TriggerSleepAction(4.50)
call DestroyTextTag(bj_lastCreatedTextTag)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call CameraSetupApplyForceDuration(gg_cam_Baby_Cam, true, 0.00)
call SetSkyModel( "Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl" )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.40)
set bj_ghoul[100] = gg_unit_e003_0048 // Mine
call AddTrans(C(10), "Woman", "Oh George! It hurts so much!", 2.8)
call TriggerSleepAction(2.55)
call AddTrans(C(9), "Man", "Don't worry sweetie. Just push! Let it out!", 3.1)
call TriggerSleepAction(2.85)
call SetUnitAnimationByIndex(C(11), 3)
call AddTrans(C(10), "Woman", "Ok.. I'll try!", 2.6)
call TriggerSleepAction(2.35)
call IssuePointOrder(C(11), "move", GetUnitX(bj_ghoul[100]), GetUnitY(bj_ghoul[100]))
call AddTrans(C(10), "Woman", "Something is coming out!", 2.6)
call TriggerSleepAction(2.35)
call AddTrans(C(9), "Man", "Yes! Let it out! Push! Push!", 2.8)
call TriggerSleepAction(2.55)
call AddTrans(C(10), "Woman", "*scream*", 2.6)
call StartSound(ScreamSound())
call TriggerSleepAction(2.35)
call Fart()
set bj_ghoul[101]=CreateParticle(Player(0), 'e002', GetUnitX(C(10)), GetUnitY(C(10)), 270)
call UnitApplyTimedLife(bj_ghoul[101], 0, 3)
call ParticleSetSpeed(bj_ghoul[101], -70, -25, -5)
call ParticleLinkConditionTrigger2Func(bj_ghoul[101], ParticleDeath(), "Death_Remove")
call TriggerSleepAction(1.10)
call AddTrans(C(9), "Man", "Umm..", 1.8)
call TriggerSleepAction(1.05)
call AddTrans(C(9), "Man", "Well.. That was..", 2.5)
call TriggerSleepAction(0.20)
call KillUnit(C(9))
call TriggerSleepAction(0.40)
call PauseUnit(C(9), true)
call SetUnitTimeScale(C(9), 0.00)
call PauseUnit(C(10), true)
call SetUnitTimeScale(C(10), 0.00)
call TriggerSleepAction(0.10)
call AddTrans(C(4), "Carl", "Oups, wrong tape", 2.0)
call TriggerSleepAction(1.75)
call AddTrans(C(4), "Carl", "Ok, here it is.. I think", 2.2)
//End Baby Movie
//===============================
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.45)
call CameraSetupApplyForceDuration(gg_cam_Commercial_Cam, true, 0.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(0.80)
call AddTrans(C(4), "Carl", "Yes it's the right one. I remember the commercial.", 2.8)
call TriggerSleepAction(2.65)
call AddTrans(C(12), "Spell Breaker", "Are you tired of being weak, lonely, short and perhaps even bald?", 3.5)
call TriggerSleepAction(2.95)
call AddTrans(C(12), "Spell Breaker", "Well, here's the solution to all your problems!", 3.10)
call TriggerSleepAction(2.70)
call AddTrans(C(12), "Spell Breaker", "Magic! The easiest and best way to solve your problems!", 3.65)
call SetUnitAnimation(C(12), "spell")
call ToastUnit(C(13))
call TriggerSleepAction(3.5)
call MakeUnitFaceWidget(C(12), C(13), 1.00)
call TriggerSleepAction(0.20)
call SetUnitAnimation(C(12), "stand")
call AddTrans(C(12), "Spell Breaker", "Umm.. Oups..", 2.6)
call TriggerSleepAction(2.35)
call MakeUnitFaceWidget(C(12), C(13), 1.00)
call AddTrans(C(12), "Spell Breaker", "Well, that can easily be fixed with magic!", 3.20)
call TriggerSleepAction(3.05)
call SetUnitAnimation(C(12), "spell")
call AddSpecialEffect("Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl", GetUnitX(C(13)), GetUnitY(C(13)))
call TriggerSleepAction(0.20)
call Dusty()
call TriggerSleepAction(2.00)
call AddTrans(C(12), "Spell Breaker", "Holy cow, not again..", 2.7)
call TriggerSleepAction(2.45)
call SetUnitAnimation(C(12), "stand")
call SetUnitFacingTimed(C(12), 270, 0.70)
call AddTrans(C(12), "Spell Breaker", "Anyway, I will now demonstrate how magic works", 3.35)
call TriggerSleepAction(3.10)
call IssuePointOrder(C(12), "move", GetUnitX(C(12)), -2120)
loop
call TriggerSleepAction(0.10)
exitwhen GetUnitY(C(12)) > -2150
endloop
call IssueImmediateOrder(C(12), "stop")
call SetUnitFacingTimed(C(12), 270, 1.00)
call CameraSetupApplyForceDuration(gg_cam_Peasant_Cam, true, 0.60)
call TriggerSleepAction(0.40)
call AddTrans(C(12), "Spell Breaker", "Maybe you are feeling cold", 2.85)
call ToastUnit(C(14))
call TriggerSleepAction(2.80)
call ResetUnit(C(14))
call AddTrans(C(12), "Spell Breaker", "Or maybe you feel warm", 2.65)
call FreezeUnit(C(14))
call TriggerSleepAction(2.40)
call ResetUnit(C(14))
call AddTrans(C(12), "Spell Breaker", "Maybe you wanna be tall", 2.85)
call Tall()
call TriggerSleepAction(2.10)
call AddTrans(C(12), "Spell Breaker", "Or maybe you just wanna get away from everything", 3.1)
call TriggerSleepAction(2.95)
call CameraSetupApplyForceDuration(gg_cam_Commercial_Cam2, true, 0.00)
call TriggerSleepAction(1.2)
set u=CreateProjectile(Player(15), Peasant(), GetUnitX(C(14)), GetUnitY(C(14)), 0)
call RemoveUnit(C(14))
call AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", GetUnitX(u), GetUnitY(u))
call ParticleSetSpeed(u, 1850*CosBJ(175), 1850*SinBJ(175) , 4000)
call ParticleAddForce(u, G())
call CameraSetupApplyForceDuration(gg_cam_Commercial_Cam3, true, 0.60)
set udg_vectorZFacSec[GetUnitUserData(u)]=-90
call SetUnitAnimationByIndex(u, -25)
loop
call TriggerSleepAction(0.10)
exitwhen udg_vectorZ[udg_clsParticleSpeed[GetUnitUserData(u)]] < 0
endloop
call StartSound(Falling())
call ParticleRemoveForce(u, G())
set udg_vectorZFac[GetUnitUserData(u)]=true
call ParticleSetSpeed(u, 0, 0 , -500)
loop
call TriggerSleepAction(0.10)
exitwhen GetUnitFlyHeight(u) < 1
endloop
call StartSound(StompSound())
call StopSound(Falling(), false, false)
call RemoveParticle(u, false)
call TriggerSleepAction(0.20)
call CameraSetupApplyForceDuration(gg_cam_Black_Screen, true, 0.00)
call AddTextTag("Buy magic online!", -1560, 350, 0, 15, 100, 50, 30, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call AddTextTag("Or get it by phone!", -1560, 270, 0, 13, 0, 50, 80, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call AddTextTag("Call 33621581 now!", -1560, 200, 0, 13, 10, 50, 20, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call AddTextTag("www.BuyMagic.com", -1560, -200, 0, 11, 10, 90, 10, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call TriggerSleepAction(2.20)
call StartSound(CommercialSound())
call TriggerSleepAction(1.60)
call AddTextTag("We do NOT take responsibility for any damage caused by our product.", -2090, -70, 0, 13, 255, 0, 0, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call TriggerSleepAction(6.00)
call AddTextTag("Consult your doctor before use", -1560, -20, 0, 14, 10, 90, 10, 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagVisibility(bj_lastCreatedTextTag, true)
call SetTextTagLifespan(bj_lastCreatedTextTag, 26)
call TriggerSleepAction(4.00)
call AddTrans(C(1), "Judge", "Why have a commercial on an evidence tape?..", 3.1)
call TriggerSleepAction(2.85)
call AddTrans(C(4), "Carl", "If you had any idea about how hard it is to sell magic, then you'd understand. People always whine about getting hurt or losing family members.. crybabies..", 7)
call TriggerSleepAction(6.75)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.00)
call AddTrans(C(4), "Carl", "This is how Sir Pointy Hat died", 2.6)
call CameraSetupApplyForceDuration(gg_cam_Water_Cam1, true, 0.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.60)
call CameraSetupApplyForceDuration(gg_cam_Water_Cam2, true, 3.00)
call TriggerSleepAction(2.90)
call CameraSetupApplyForceDuration(gg_cam_Water_Cam3, true, 0.00)
call AddTrans(C(15), "Sir Pointy Hat", "Nasty water ride...", 2.2)
call TriggerSleepAction(1.95)
call AddTrans(C(15), "Sir Pointy Hat", "Ah well, better try it out before judging it", 3.10)
call TriggerSleepAction(3.00)
call AddTrans(C(17), "Cannon Guy", "Yea right.. Get into the cannon so we can get going", 3.2)
call TriggerSleepAction(2.95)
call IssuePointOrder(C(15), "move", GetUnitX(C(17)), GetUnitY(C(17)))
call PolledWait(0.60)
call SetUnitAnimation(C(17), "attack")
call PolledWait(0.80)
set u=CreateProjectile(Player(15), "units\\human\\TheCaptain\\TheCaptain.mdl", GetUnitX(C(15)), GetUnitY(C(15)), 0)
call ShowUnit(C(15), false)
call ParticleSetSpeed(u, 920, -60, 1800)
call ParticleAddForce(u, Wind())
call SetUnitAnimationByIndex(u, 90)
set udg_vectorZFac[GetUnitUserData(u)] = true
call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_Splash")
call CameraSetupApplyForceDuration(gg_cam_Water_Cam4, true, 3.8)
call TriggerSleepAction(4.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.40)
call SetTerrainFogEx(0, 500, 8000, 1, 3, 1, 1)
call CameraSetupApplyForceDuration(gg_cam_Judge_Cam, true, 0.00)
call SetSkyModel(null)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(0.60)
call AddTrans(C(1), "Judge", "So the guy died in a water ride?..", 2.9)
call TriggerSleepAction(2.65)
call AddTrans(C(1), "Judge", "What does this have to do with the horse guy?", 3.2)
call TriggerSleepAction(3.15)
call CameraSetupApplyForceDuration(gg_cam_Trial_Mid_Cam, true, 1.20)
call AddTrans(C(4), "Carl", "That's a very good question", 2.5)
call TriggerSleepAction(2.25)
call AddTrans(C(4), "Carl", "Sir Pointy Hat died because the water was green, and we all know that green means either poison or grass.", 6.5)
call TriggerSleepAction(6.3)
call AddTrans(C(4), "Carl", "In this case it was most likely poison, and i have a theory about how the water got poisoned..", 6)
call TriggerSleepAction(5.85)
call AddTrans(C(4), "Carl", "Joe happens to work on a toy factory that is driven by a nuclear reactor" , 4.2)
call TriggerSleepAction(3.95)
call AddTrans(C(4), "Carl", "And Joe was assigned to get rid of some nuclear waste", 3.3)
call TriggerSleepAction(3.35)
call AddTrans(C(4), "Carl", "The time was 21.33, and Joe was at the water ride..", 3.4)
call TriggerSleepAction(3.15)
call AddTrans(C(4), "Carl", "He brought the barrels with the nuclear garbage there", 3.4)
call TriggerSleepAction(3.15)
call AddTrans(C(4), "Carl", "And then he threw it in the water ride..", 3.00)
call TriggerSleepAction(3.15)
call AddTrans(C(4), "Carl", "I have asked some scientists to investigate the water for material that usually isn't found in water", 5.90)
call TriggerSleepAction(5.65)
call AddTrans(C(4), "Carl", "If it contains nuclear material, then he's guilty", 3.40)
call TriggerSleepAction(3.45)
call AddTrans(C(2), "Joe", "21.33? I was on toilet from 21.32 to 21.35 that night", 3.8)
call TriggerSleepAction(3.55)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call AddTrans(C(3), "Officer Jones", "Can you hear that?", 2.00)
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call AddTrans(C(1), "Judge", "Incoming!", 1.9)
call CameraSetupApplyForceDuration(gg_cam_Tank_Cam1, true, 0.80)
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
call StartTank()
call KillDestructable(gg_dest_LTe3_0000)
call CameraSetupApplyForceDuration(gg_cam_Tank_Cam2, true, 1.20)
loop
exitwhen udg_Int[81] == 3 // again, random number
call TriggerSleepAction(1)
set bj_lastPlayedSound = CreateSound("Units\\Human\\SteamTank\\SteamTankMovement.wav", false, false, false, 0, 0, "")
call StartSound(bj_lastPlayedSound)
call SetSoundVolume(bj_lastPlayedSound, 100)
call KillSoundWhenDone(bj_lastPlayedSound)
endloop
call DisableTrigger(gg_trg_Tank_Kill)
call CreateUnit(Player(0), 'nhew', GetUnitX(C(18))-10, GetUnitY(C(18))-25, 260)
call StartSound(Load())
call TriggerSleepAction(0.40)
set udg_C[19]=CreateUnit(Player(0), 'nemi', GetUnitX(C(18)), GetUnitY(C(18))-25, 270)
call StartSound(Load())
call MakeUnitFaceWidget(C(3), C(18), 1.00)
call TriggerSleepAction(0.40)
call CreateUnit(Player(0), 'nhew', GetUnitX(C(18))+10, GetUnitY(C(18))-25, 280)
call StartSound(Load())
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 1.00)
call AddTrans(C(19), "Scientist", "We are here to inform you about what the green water contained, as Carl requested", 4.9)
call TriggerSleepAction(4.75)
call AddTrans(C(3), "Officer Jones", "Like we haven't already figured out why you are here..", 3.9)
call TriggerSleepAction(3.80)
call AddTrans(C(19), "Scientist", "...right.. We have investigated the water from all kinds unusual material", 5.1)
call TriggerSleepAction(4.85)
call AddTrans(C(19), "Scientist", "And we have come to the conclusion that it does NOT contain nuclear waste", 5.3)
call TriggerSleepAction(5.05)
call AddTrans(C(19), "Scientist", "It appears to be a lot of different acids combined with gas that somehow managed to get mixed with the water..", 6.9)
call TriggerSleepAction(6.6)
call AddTrans(C(19), "Scientist", "We haven't yet figured out how this could happen, but the water is VERY dangerous", 4.35)
call TriggerSleepAction(4.10)
call CameraSetupApplyForceDuration(gg_cam_Villager3_Cam, true, 1.00)
call AddTrans(C(20), "Child", "Excuse me Sir, but why are we children here? Children usually don't have to be in court", 4.9)
call TriggerSleepAction(5.00)
call StartSound(Crickets())
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 0.00)
call TriggerSleepAction(3.00)
call AddTrans(C(1), "Judge", "Umm... Jones?", 2.2)
call TriggerSleepAction(2.05)
call AddTrans(C(3), "Officer Jones", "Dude, I don't shoot children.. that's mean", 3.2)
call TriggerSleepAction(3.40)
call CameraSetupApplyForceDuration(gg_cam_Villager4_Cam, true, 1.00)
call AddTrans(C(21), "Villager", "What the hell is wrong with you? You shoot adults but not children. That's discriminating!", 4.9)
call TriggerSleepAction(4.8)
call MakeUnitFaceWidget(C(3), C(21), 0.80)
call AddTrans(C(3), "Officer Jones", "You dare criticize the way i do my job?", 3.00)
call TriggerSleepAction(2.75)
call AddTrans(C(3), "Officer Jones", "Why you..", 1.6)
call TriggerSleepAction(1.35)
call StopSound(ShotgunSound(), false, false)
call StartSound(ShotgunSound())
call IssueTargetOrder(C(3), "attack", C(22))
call TriggerSleepAction(0.60)
call AddTrans(C(21), "Villager", "Missed", 1.2)
call TriggerSleepAction(0.80)
call StopSound(ShotgunSound(), false, false)
call StartSound(ShotgunSound())
call IssueTargetOrder(C(3), "attack", C(23))
call TriggerSleepAction(0.60)
call AddTrans(C(21), "Villager", "Missed again", 1.2)
call TriggerSleepAction(0.80)
call StopSound(ShotgunSound(), false, false)
call StartSound(ShotgunSound())
call IssueTargetOrder(C(3), "attack", C(24))
call TriggerSleepAction(0.60)
call AddTrans(C(21), "Villager", "Man, who taught you to shoot? Your grandmother?", 3.30)
call TriggerSleepAction(3.00)
call AddTrans(C(3), "Officer Jones", "Don't ever mock Grandmother Jones!", 2.8)
call TriggerSleepAction(2.55)
call StopSound(ShotgunSound(), false, false)
call StartSound(ShotgunSound())
call IssueTargetOrder(C(3), "attack", C(25))
call TriggerSleepAction(0.60)
call AddTrans(C(21), "Villager", "Missed again", 1.2)
call TriggerSleepAction(0.80)
call StopSound(ShotgunSound(), false, false)
call StartSound(ShotgunSound())
call IssueTargetOrder(C(3), "attack", C(21))
call TriggerSleepAction(0.70)
call AddTrans(C(21), "Villager", "This time you hit..", 1.9)
call TriggerSleepAction(2.05)
call CameraSetupApplyForceDuration(gg_cam_Judge_Close_Cam, true, 1.80)
call AddTrans(C(1), "Judge", "Wait a second! You said the water contained some kind of gas?", 3.8)
call TriggerSleepAction(3.60)
call AddTrans(C(19), "Scientist", "Yes, we can't explain how the water could contain gas, but it did, and it was methane gas", 5.80)
call TriggerSleepAction(5.55)
call AddTrans(C(1), "Judge", "Methane you say?.. That means it can have come from a butt!", 4.00)
call TriggerSleepAction(3.75)
call AddTrans(C(1), "Judge", "Maybe it didn't have anything to do with nuclear waste. Rather extra strong chili!", 4.8)
call TriggerSleepAction(2.8)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.20)
call FogEnable(false)
call SetSkyModel( "Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl" )
call CameraSetupApplyForceDuration(gg_cam_Water_Cam5, true, 0.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.20, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(0.90)
call AddTrans(C(1), "Judge", "The chili they sell at the amusement park is very, very strong", 3.8)
call TriggerSleepAction(3.60)
call AddTrans(C(1), "Judge", "And i've heard that they add a lot of weird chemicals that even the owners don't know what is.", 5.1)
call TriggerSleepAction(4.90)
call AddTrans(C(1), "Judge", "It must have been late into the night", 2.6)
call TriggerSleepAction(2.35)
call AddTrans(C(1), "Judge", "And it was dark..", 2.8)
call TriggerSleepAction(2.9)
call AddTrans(C(1), "Judge", "I said it was dark!", 2.30)
call TriggerSleepAction(2.20)
call SetTerrainFogEx(1, 500, 8000, 1, 0, 0, 0)
call AddTrans(C(1), "Judge", "No, not that dark", 2.4)
call TriggerSleepAction(2.00)
call ResetTerrainFog()
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 18.20)
call TriggerSleepAction(0.20)
call AddTrans(C(1), "Judge", "Perfect!", 1.8)
call TriggerSleepAction(1.8)
call AddTrans(C(1), "Judge", "Joe probaly ate alot of chili from 'Bob's Chili House'", 3.6)
call TriggerSleepAction(3.35)
call AddTrans(C(1), "Judge", "And he was having serious diarrhea problems..", 3.6)
call TriggerSleepAction(3.30)
call AddTrans(C(1), "Judge", "The toilet was too far away, so he had to do it somewhere else..", 4.1)
call TriggerSleepAction(3.1)
call IssuePointOrder(C(26), "move", 5095, -6172)
call TriggerSleepAction(1.80)
call SetUnitFacingTimed(C(26), GetUnitFacing(C(26))+180, 1.00)
call TriggerSleepAction(0.90)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 300*CosBJ(GetUnitFacing(C(26))+200),300*SinBJ(GetUnitFacing(C(26))+200), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 300*CosBJ(GetUnitFacing(C(26))+180),300*SinBJ(GetUnitFacing(C(26))+180), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 250*CosBJ(GetUnitFacing(C(26))+190),300*SinBJ(GetUnitFacing(C(26))+190), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 300*CosBJ(GetUnitFacing(C(26))+165),300*SinBJ(GetUnitFacing(C(26))+165), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 3000*CosBJ(GetUnitFacing(C(26))+180),300*SinBJ(GetUnitFacing(C(26))+180), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 300*CosBJ(GetUnitFacing(C(26))+185),300*SinBJ(GetUnitFacing(C(26))+185), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.60, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 300*CosBJ(GetUnitFacing(C(26))+150),300*SinBJ(GetUnitFacing(C(26))+150), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.20)
call Fart()
set u=CreateParticle(Player(0), 'e002', GetUnitX(C(26)), GetUnitY(C(26))-40, GetUnitFacing(C(26)))
call ParticleSetSpeed(u, 300*CosBJ(GetUnitFacing(C(26))+160),300*SinBJ(GetUnitFacing(C(26))+160), 300)
call ParticleAddForce(u, G())
call UnitApplyTimedLife(u, 0, 3)
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call TriggerSleepAction(0.30)
call SetTerrainFogEx(0, 500, 8000, 1, 3, 1, 1)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.80, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 0.00)
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 6)
call TriggerSleepAction(0.60)
call MakeUnitFaceWidget(C(2), C(1), 1.00)
call AddTrans(C(2), "Joe", "How the hell did you know?", 2.6)
call TriggerSleepAction(2.8)
call SetUnitFacingTimed(C(2), 260, 1.20)
call AddTrans(C(2), "Joe", "Oups, i mean..", 2.4)
call TriggerSleepAction(2.15)
call AddTrans(C(2), "Joe", "Doh..", 2.00)
call StartSound(Doh())
call TriggerSleepAction(2.00)
call CameraSetupApplyForceDuration(gg_cam_Judge_Close_Cam, true, 1.60)
call AddTrans(C(1), "Judge", "Joe Barness Jackson Farmer", 2.8)
call TriggerSleepAction(2.55)
call AddTrans(C(2), "Joe", "Do you really have to use my full name?", 3.00)
call TriggerSleepAction(2.75)
call AddTrans(C(1), "Judge", "Yes.. I'll start over..", 3.00)
call TriggerSleepAction(3.00)
call AddTrans(C(1), "Judge", "Joe Barness Jackson Farmer", 2.8)
call TriggerSleepAction(2.55)
call AddTrans(C(1), "Judge", "I hereby declare you man and horse!", 3.2)
call TriggerSleepAction(3.2)
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam, true, 0.00)
call TriggerSleepAction(0.20)
call AddTrans(C(3), "Officer Jones", "Umm... what?", 2.8)
call TriggerSleepAction(2.8)
call CameraSetupApplyForceDuration(gg_cam_Judge_Cam, true, 0.00)
call AddTrans(C(1), "Judge", "Sorry, i was supposed to say that your punishment is 20 years in jail", 4.8)
call TriggerSleepAction(4.55)
call AddTrans(C(1), "Judge", "The guy who made the chili goes to jail aswell", 3.6)
call TriggerSleepAction(3.65)
call StartSound(ImDead())
call AddTrans(C(2), "Joe", "That's it, i'm dead", 2.00)
call CameraSetupApplyForceDuration(gg_cam_Trial_Cam_3, true, 1.6)
call TriggerSleepAction(1.85)
call MakeParticle(C(2))
call ParticleSetSpeed(C(2), 260, -320, 650)
call ParticleAddForce(C(2), G())
call ParticleLinkConditionTrigger2Func(C(2), ParticleGroundHit(), "RemoveFrom_Joe")
call TriggerSleepAction(3.60)
call IssuePointOrder(C(2), "move", -5916, 6060)
call TriggerSleepAction(0.25)
call IssuePointOrder(CreateUnit(Player(0), 'Hpal', -5916, 5300, 90), "move", -5916, 5800)
call StartSound(Ahh())
call TriggerSleepAction(3.4)
call SetUnitFacingTimed(C(2), 270, 2.00)
call TriggerSleepAction(2.00)
call StartSound(OIG())
call AddTrans(C(2), "Joe", "Off i go then", 2.5)
call TriggerSleepAction(2.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.00)
call CameraSetupApplyForceDuration(gg_cam_Jail_Cam, true, 0.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.00)
//======================================
// Jail Part
//======================================
set udg_C[1] = gg_unit_hpea_0169
set udg_C[2] = gg_unit_hfoo_0170
call AddTrans(C(1), "Joe", "Stupid extra strong chili..", 2.7)
call TriggerSleepAction(2.85)
call IssuePointOrder(C(2), "move", -5434, -3560)
call AddTrans(C(2), "PurgeAndFire", "Don't worry Joe! I'll get you out!", 3.2)
call TriggerSleepAction(3.6)
call IssuePointOrder(C(1), "move", -5500, -3419)
call TriggerSleepAction(0.20)
call AddTrans(C(1), "Joe", "PurgeAndFire? Is it really you?", 3.00)
call TriggerSleepAction(2.75)
call AddTrans(C(1), "Joe", "Are you here to get me out?", 2.9)
call TriggerSleepAction(2.65)
call AddTrans(C(2), "PurgeAndFire", "Didn't I just say that I was gonna get you out?..", 4.1)
call TriggerSleepAction(3.85)
call AddTrans(C(1), "Joe", "Right, sorry", 2.2)
call TriggerSleepAction(2.15)
call AddTrans(C(2), "PurgeAndFire", "So, how much do i have to pay to get you out?", 3.50)
call TriggerSleepAction(3.60)
call AddTrans(C(1), "Joe", "About 2700$..", 2.3)
call TriggerSleepAction(2.5)
call AddTrans(C(2), "PurgeAndFire", "Well, I'm participating in a tournament, and the prize is 3000$", 4.6)
call TriggerSleepAction(4.35)
call AddTrans(C(2), "PurgeAndFire", "If I win, then I'll get you out of jail", 3.4)
call TriggerSleepAction(3.15)
call AddTrans(C(2), "PurgeAndFire", "I have to win one more battle.. Against my brother", 4.1)
call TriggerSleepAction(3.85)
call AddTrans(C(1), "Joe", "Thanks buddy", 2.2)
call TriggerSleepAction(1.50)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
//Going on to next trigger
//========================
call TriggerExecute(gg_trg_Cinematic_Battle)
endfunction
//===========================================================================
function InitTrig_Cinematic_Main takes nothing returns nothing
set gg_trg_Cinematic_Main = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Cinematic_Main, 2.00 )
call TriggerAddAction( gg_trg_Cinematic_Main, function Trig_Cine1_Actions )
endfunction
//TESH.scrollpos=40
//TESH.alwaysfold=0
function Move1 takes nothing returns nothing
call SetUnitAnimationByIndex(C(1), 7)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam5, true, 0.50)
call DestroyTimer(GetExpiredTimer())
endfunction
function Move2 takes nothing returns nothing
call SetUnitAnimation(C(2), "stand")
call StartSound(Bump())
call DestroyTimer(GetExpiredTimer())
endfunction
function Move3 takes nothing returns nothing
call SetUnitAnimationByIndex(C(1), 5)
call DestroyTimer(GetExpiredTimer())
endfunction
function Move4 takes nothing returns nothing
call SetUnitTimeScale(C(1), 0.50)
call SetUnitTimeScale(C(2), 0.50)
call DestroyTimer(GetExpiredTimer())
endfunction
function Move5 takes nothing returns nothing
call SetUnitTimeScale(C(1), 0.00)
call SetUnitTimeScale(C(2), 0.00)
call StartSound(Tralala())
call DestroyTimer(GetExpiredTimer())
endfunction
function Move6 takes nothing returns nothing
call SetUnitAnimation(C(2), "death")
call SetUnitTimeScale(C(1), 1.00)
call SetUnitTimeScale(C(2), 1.00)
call DestroyTimer(GetExpiredTimer())
endfunction
function Shake takes nothing returns nothing
if udg_Real[4] == 2 then
call AddTrans(C(3), "Uther", "STOP! I WAS KIDDING!", 2.8)
call StopSound(Drive(), false, false)
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
return
endif
if udg_Real[2] == 3 then
call SetUnitX(C(1), GetUnitX(C(1))-7)
call SetUnitX(C(2), GetUnitX(C(2))+7)
else
set udg_Real[1]=udg_Real[1] + udg_Real[3]*3
call SetUnitFlyHeight(C(1), udg_Real[1], 0)
call SetUnitFlyHeight(C(2), udg_Real[1], 0)
if udg_Real[1] >= 15 or udg_Real[1] < 1 then
set udg_Real[3] = udg_Real[3]*-1
endif
endif
endfunction
function Trig_Cinematic_Battle_Actions takes nothing returns nothing
set udg_C[1] = gg_unit_hfoo_0232
set udg_C[2] = gg_unit_Obla_0233
set udg_C[3] = gg_unit_Huth_0175
call SetSkyModel( "Environment\\Sky\\LordaeronSummerSky\\LordaeronSummerSky.mdl" )
call MakeUnitFaceWidget(C(2), C(1), 0.00)
call MakeUnitFaceWidget(C(1), C(2), 0.00)
call StartSound(Music2())
call CameraSetupApplyForceDuration(gg_cam_Uther_Cam, true, 0.00)
call TriggerSleepAction(1.20)
call AddTrans(C(3), "Uther", "Today, PurgeAndFire against PurgeAndFrost", 3.5)
call TriggerSleepAction(3.25)
call AddTrans(C(3), "Uther", "The Winner will recieve 3000$", 2.95)
call TriggerSleepAction(3.25)
call AddTrans(C(3), "Uther", "Prepare to fight!", 2.7)
call TriggerSleepAction(2.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.30)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam1, true, 0.00)
call DisplayTimedTextToPlayer(Player(0), 0.5, 0.2, 0.50,"PurgeAndFrost")
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.25)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam2, true, 1.20)
call TriggerSleepAction(1.00)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.10)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam3, true, 0.00)
call DisplayTimedTextToPlayer(Player(0), 0.5, 0.2, 0.50,"PurgeAndFire")
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.25, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.00)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam4, true, 1.20)
call TriggerSleepAction(1.30)
call CameraSetupApplyForceDuration(gg_cam_Uther_Cam, true, 0.00)
call StopSound(Music2(), false, false)
call AddTrans(C(3), "Uther", "Gentlemen, Start you engines!", 3.00)
call TriggerSleepAction(2.60)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam2, true, 0.00)
call MakeUnitFlyable(C(1))
call MakeUnitFlyable(C(2))
call TimerStart(CreateTimer(), 0.01, true, function Shake)
set udg_Real[3] = 1
call StartSound(EngineStart())
call TriggerSleepAction(1.4)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam4, true, 0.00)
call TriggerSleepAction(1.4)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam2, true, 0.00)
set udg_Real[2] = 3
call StartSound(Drive())
call TriggerSleepAction(0.30)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam6, true, 0.00)
call TriggerSleepAction(0.30)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam8, true, 0.00)
call TriggerSleepAction(0.30)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam7, true, 0.00)
call TriggerSleepAction(2.60)
call CameraSetupApplyForceDuration(gg_cam_Arena_Cam8, true, 0.50)
call IssuePointOrder(C(1), "move", -1125, -3200)
call IssuePointOrder(C(2), "move", -1215, -3200)
call PolledWait(1.30)
call SetUnitAnimationByIndex(C(2), 2)
call TimedCall(0.27, function Move1)
call TimedCall(0.38, function Move2)
call TimedCall(0.68, function Move3)
call TimedCall(0.82, function Move4)
call TimedCall(1.65, function Move5)
call TimedCall(4.30, function Move6)
call TriggerSleepAction(4.30+1.65+0.82+0.68+0.38+0.27+1.2)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(1.25)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call ResetTerrainFog()
call Credits()
endfunction
function InitTrig_Cinematic_Battle takes nothing returns nothing
set gg_trg_Cinematic_Battle = CreateTrigger( )
call TriggerAddAction( gg_trg_Cinematic_Battle, function Trig_Cinematic_Battle_Actions )
endfunction