Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- JIMMY'S REVENGE 1.3
- -- PASTEBIN EXCLUSIVE BULLY MISSION (probably will post later on bully-board and/or bullymods)
- --[[ VERSION HISTORY
- 1.0: Initial release.
- 1.1: Changed the way the race time is shown, now it looks like M:SS instead of Mm SSs.
- 1.2: Changed method of setting unique model statuses, changed "Wow!" to "Holy shit!" in race comments.
- 1.3: Added skip feature to cutscene (press jump while loading).
- ]]
- function main()
- -- Make mission peds unique:
- local modelStatus = {}
- for i,model in {21,22,23,24,25,26,27,28,29,41,42,43,44,45} do
- modelStatus[model] = PedGetUniqueModelStatus(model)
- PedSetUniqueModelStatus(model,-1)
- end
- -- Let game initialize:
- Wait(500)
- -- Set attitude and respect:
- for i,f in {1,2,3,4,5,6,11} do
- PedSetTypeToTypeAttitude(f,13,4)
- SetFactionRespect(f,100)
- end
- -- Go outside:
- local skip = false
- TextPrintString("It's such a nice day, go outside.",3,1)
- while AreaGetVisible() ~= 0 or AreaIsLoading() do
- if IsButtonBeingPressed(8,0) and AreaIsLoading() then
- skip = true
- end
- Wait(0)
- end
- -- Play cutscene:
- if skip then
- PlayerSetControl(0)
- else
- PlayerSetWeapon(-1)
- PlayerSetControl(0)
- PlayerSetPosXYZ(234.1,-56.1,6.2)
- PedMoveToXYZ(gPlayer,0,234.4,-67.7,6.2)
- CameraSetActive(4)
- CameraSetWidescreen(true)
- CameraAllowChange(false)
- repeat
- local x,y,z = PlayerGetPosXYZ()
- CameraSetXYZ(241,-69.6,10.2,x,y,z)
- TextPrintString("It was just a normal day in Bullworth for young Hopkins...",0,1)
- Wait(0)
- until PedIsInAreaXYZ(gPlayer,234.4,-67.7,6.2,0.5)
- TextPrintString("when suddenly...",1.5,1)
- Wait(1500)
- local johnny = PedCreateXYZ(23,220.4,-68.6,8.5)
- PedSetPedToTypeAttitude(johnny,13,2)
- PedSetInfiniteSprint(johnny,true)
- TextPrintString("a wild Johnny appeared",3,1)
- CameraSetXYZ(239.6,-75.1,11.3,220.4,-68.6,8.5)
- Wait(3000)
- PedMoveToXYZ(johnny,2,234.4,-67.7,6.2)
- local attacked = false
- repeat
- local x,y,z = PedGetPosXYZ(johnny)
- CameraSetXYZ(239.6,-75.1,11.3,x,y,z)
- TextPrintString("and attacked!",0,1)
- if not attacked and PedIsInAreaXYZ(johnny,234.4,-67.7,6.2,2) then
- PedLockTarget(johnny,gPlayer)
- PedSetActionNode(johnny,"/Global/Actions/Offense/RunningAttacks/RunningAttacksDirect","Act/Globals.act")
- attacked = true
- end
- Wait(0)
- until (attacked and not PedIsPlaying(johnny,"/Global/Actions/Offense/RunningAttacks/RunningAttacksDirect",true))
- PedLockTarget(johnny,-1)
- PedMoveToXYZ(johnny,2,271.5,-73,6)
- CameraSetXYZ(227.7,-52.3,11.6,229.8,-54.4,11)
- repeat
- TextPrintString("...and got away.",0,1)
- Wait(0)
- until PedIsInAreaXYZ(johnny,271.5,-73,6,0.5)
- PedDelete(johnny)
- johnny = -1
- end
- PlayerFaceHeading(0.01403962076)
- PlayerSetPosSimple(233.7,-63.4,6.2)
- CameraSetXYZ(233.3,-62.7,7.8,234.8,-65.3,7.5)
- TextPrintString("Jimmy must get revenge.",3,1)
- Wait(3000)
- CameraAllowChange(true)
- CameraSetWidescreen(false)
- CameraReset()
- CameraReturnToPlayer()
- PlayerSetControl(1)
- -- Go to the tenements:
- TextPrintString("Search for Johnny in the Tenements",3,1)
- blip = BlipAddXYZ(583.4,-472.4,4.5,0,1,1)
- local raceStart = GetTimer()
- local timeShown = false
- while AreaGetVisible() ~= 36 do
- if PedIsInAreaXYZ(gPlayer,583.4,-472.4,4.5,0.6) then
- TextPrintString("Press \b to enter",0,2)
- Wait(0)
- if IsButtonBeingPressed(9,0) then
- PlayerFaceHeading(0.007246047258)
- PlayerSetPosXYZArea(-544.5,-49.5,31,36)
- while AreaIsLoading() do
- Wait(0)
- end
- end
- elseif not timeShown and PedIsInAreaXYZ(gPlayer,583.4,-472.4,4.5,5) then
- local seconds = (GetTimer() - raceStart)/1000
- local comment,comments = "Fucking terrible.",{
- {1,"You cheater."},
- {5,"Unbelievable."},
- {10,"10 seconds? Did you cheat mister?"},
- {25,"How the fuck did you pull that off?"},
- {30,"You are amazing."},
- {35,"Insane time!"},
- {40,"Fucking incredible!"},
- {45,"Remarkable!"},
- {50,"Holy shit!"},
- {55,"Amazing!"},
- {59,"Under a minute!"},
- {60,"Great!"},
- {65,"Pretty good."},
- {70,"Decent."},
- {75,"Not bad."},
- {80,"Could be better."},
- {85,"Needs some work."},
- {90,"A bit slow."},
- {100,"Pretty slow..."},
- {120,"A bit embarassing."},
- {150,"Awful."},
- {180,"3 minutes? Really?"},
- {200,"You should be ashamed."},
- {300,"What the fuck were you doing?"},
- {400,"...I don't even know what to say."},
- {500,"Did you fucking ride a turtle here?"},
- {600,"Great, you beat 10 minutes!\nFucking awful..."},
- }
- for i,v in ipairs(comments) do
- if seconds <= v[1] then
- comment = v[2]
- break
- end
- end
- local minutes = 0
- while seconds > 60 do
- seconds = seconds - 60
- minutes = minutes + 1
- end
- seconds = string.format("%.0f",seconds)
- if tonumber(seconds) < 10 then
- seconds = "0"..seconds
- end
- TextPrintString("Time: "..minutes..":"..seconds.."\n\n"..comment,6,1)
- timeShown = true
- else
- Wait(0)
- end
- end
- BlipRemove(blip)
- -- Set greaser attitude and respect:
- PedSetTypeToTypeAttitude(3,3,4)
- PedSetTypeToTypeAttitude(3,4,4)
- PedSetTypeToTypeAttitude(3,13,0)
- PedSetTypeToTypeAttitude(4,4,4)
- PedSetTypeToTypeAttitude(4,3,4)
- PedSetTypeToTypeAttitude(4,13,0)
- SetFactionRespect(3,0)
- SetFactionRespect(4,0)
- -- Setup enemy room tables:
- local rooms = {
- --{{blip position},{enemy model,x,y,z},{enemy model,x,y,z},...}
- {{-547.1,-42.3,31.0},{21,-550.0,-43.9,31.0},{24,-545.1,-38.6,31.0}},
- {{-547.8,-20.6,31.0},{22,-542.7,-17.2,31.0},{26,-540.5,-27.3,31.3},{27,-546.5,-24.4,31.0}},
- {{-534.2,-21.0,31.0},{28,-535.3,-26.4,31.0}},
- {{-534.7,-42.9,31.0},{29,-537.3,-48.1,30.9},{41,-530.0,-43.2,30.8}},
- {{-517.1,-44.0,31.0},{42,-508.4,-39.2,31.0},{43,-525.7,-48.1,31.0}},
- {{-519.0,-21.2,31.0},{44,-525.9,-18.4,31.0},{45,-510.4,-22.5,31.0}}
- }
- -- Setup enemy rooms:
- for key,t in ipairs(rooms) do
- t[1][4] = BlipAddXYZ(t[1][1],t[1][2],t[1][3],0,1)
- local i = 2
- while t[i] do
- t[i][5] = PedCreateXYZ(t[i][1],t[i][2],t[i][3],t[i][4])
- i = i + 1
- end
- end
- -- Clear rooms:
- TextPrintString("This place is crawling with greasers! Clear all the rooms before confronting Johnny.",5,1)
- local cleared
- repeat
- -- Set to be cleared (will be set to false if any peds are alive):
- cleared = true
- -- Process each room:
- for key,t in ipairs(rooms) do
- -- Process room blip:
- if t[1][4] then
- local aggressed = false
- local i = 2
- while t[i] do
- if not PedIsValid(t[i][5]) or PedIsDead(t[i][5]) or PedIsInCombat(t[i][5]) or PedHasAggressed(t[i][5]) then
- aggressed = true
- break
- end
- i = i + 1
- end
- if aggressed then
- BlipRemove(t[1][4])
- t[1][4] = nil
- local i = 2
- while t[i] do
- if PedIsValid(t[i][5]) and not PedIsDead(t[i][5]) then
- PedAttackPlayer(t[i][5],3)
- AddBlipForChar(t[i][5],0,26,1)
- end
- i = i + 1
- end
- end
- end
- -- Check if room is clear:
- local i = 2
- while cleared and t[i] do
- if PedIsValid(t[i][5]) and not PedIsDead(t[i][5]) then
- cleared = false
- break
- end
- i = i + 1
- end
- end
- -- Wait:
- Wait(0)
- until cleared
- rooms = nil
- -- Confront Johnny:
- TextPrintString("Find Johnny",3,1)
- johnny = PedCreateXYZ(23,-524.2,-32.4,35.7)
- repeat
- Wait(0)
- until PedIsOnScreen(johnny)
- PedAttackPlayer(johnny,3)
- AddBlipForChar(johnny,0,26,4)
- repeat
- Wait(0)
- until not PedIsValid(johnny) or PedIsDead(johnny)
- -- Mission succeed:
- MissionSucceed()
- -- Restore original model status:
- for model,status in modelStatus do
- PedSetUniqueModelStatus(model,status)
- end
- -- Keep the script running:
- while true do
- Wait(0)
- end
- end
- -- STimeCycle functions:
- F_AttendedClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- SetSkippedClass(false)
- PlayerSetPunishmentPoints(0)
- end
- F_MissedClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- SetSkippedClass(true)
- StatAddToInt(166)
- end
- F_AttendedCurfew = function()
- if not PedInConversation(gPlayer) and not MissionActive() then
- TextPrintString("You got home in time for curfew", 4)
- end
- end
- F_MissedCurfew = function()
- if not PedInConversation(gPlayer) and not MissionActive() then
- TextPrint("TM_TIRED5", 4, 2)
- end
- end
- F_StartClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- F_RingSchoolBell()
- local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
- end
- F_EndClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- F_RingSchoolBell()
- end
- F_StartMorning = function()
- F_UpdateTimeCycle()
- end
- F_EndMorning = function()
- F_UpdateTimeCycle()
- end
- F_StartLunch = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- F_UpdateTimeCycle()
- return
- end
- F_UpdateTimeCycle()
- end
- F_EndLunch = function()
- F_UpdateTimeCycle()
- end
- F_StartAfternoon = function()
- F_UpdateTimeCycle()
- end
- F_EndAfternoon = function()
- F_UpdateTimeCycle()
- end
- F_StartEvening = function()
- F_UpdateTimeCycle()
- end
- F_EndEvening = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_SlightlyTired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_Tired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_MoreTired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_TooTired = function()
- F_UpdateTimeCycle()
- end
- F_EndCurfew_TooTired = function()
- F_UpdateTimeCycle()
- end
- F_EndTired = function()
- F_UpdateTimeCycle()
- end
- F_Nothing = function()
- end
- F_ClassWarning = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- local l_23_0 = math.random(1, 2)
- end
- F_UpdateTimeCycle = function()
- if not IsMissionCompleated("1_B") then
- local l_24_0 = GetCurrentDay(false)
- if l_24_0 < 0 or l_24_0 > 2 then
- SetCurrentDay(0)
- end
- end
- F_UpdateCurfew()
- end
- F_UpdateCurfew = function()
- local l_25_0 = shared.gCurfewRules
- if not l_25_0 then
- l_25_0 = F_CurfewDefaultRules
- end
- l_25_0()
- end
- F_CurfewDefaultRules = function()
- local l_26_0 = ClockGet()
- if l_26_0 >= 23 or l_26_0 < 7 then
- shared.gCurfew = true
- else
- shared.gCurfew = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment