DaBOSS54320

Bully LUA: Cutscene Viewer

Aug 31st, 2016
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.88 KB | None | 0 0
  1. function main()
  2.     -- Setup cutscenes:
  3.     SETUP_Cutscenes()
  4.    
  5.     -- Load the game:
  6.     while not SystemIsReady() or AreaIsLoading() do
  7.         Wait(0)
  8.     end
  9.    
  10.     -- Wait for player:
  11.     local s = 1
  12.     while true do
  13.         TextPrintString("Start at >"..gCutscenes[s][1].."<\nPress ~ddown~ to start.",0,1)
  14.         Wait(0)
  15.         if PedMePlaying(gPlayer,"Default_KEY") then
  16.             if IsButtonBeingPressed(0,0) then
  17.                 s = s - 1
  18.                 if s < 1 then
  19.                     s = table.getn(gCutscenes)
  20.                 end
  21.             elseif IsButtonBeingPressed(1,0) then
  22.                 s = s + 1
  23.                 if s > table.getn(gCutscenes) then
  24.                     s = 1
  25.                 end
  26.             elseif IsButtonBeingPressed(3,0) then
  27.                 break
  28.             end
  29.         end
  30.     end
  31.    
  32.     -- Play all cutscenes:
  33.     for i = s,table.getn(gCutscenes) do
  34.         PlayCutsceneWithLoad(unpack(gCutscenes[i]))
  35.     end
  36.     Wait(500)
  37.    
  38.     -- Return to normal:
  39.     CameraFade(500,1)
  40.     while true do
  41.         Wait(0)
  42.     end
  43. end
  44.  
  45. function SETUP_Cutscenes()
  46.     gCutscenes = {
  47.         {"1-02B",true,false,true},
  48.         {"1-02D",true,false},
  49.         {"1-02E",true,true},
  50.         {"1-03",true,true,true},
  51.         {"1-04",true},
  52.         {"1-05",true},
  53.         {"1-06",true},
  54.         {"1-06B",true},
  55.         {"1-07",true},
  56.         {"1-08",true},
  57.         {"1-09",true},
  58.         {"1-1-1",true,true,true},
  59.         {"1-1-2",true,true},
  60.         {"1-10",true},
  61.         {"1-11",true,false},
  62.         {"1-B",true},
  63.         {"1-BB",true},
  64.         {"1-BC",true},
  65.         {"1-G1",true,true},
  66.         {"1-S01",true},
  67.         {"2-0",true,true},
  68.         {"2-01",true,true,true},
  69.         {"2-02",true,false,false,false},
  70.         {"2-03",true},
  71.         {"2-03b",true},
  72.         {"2-04",true},
  73.         {"2-05",true,true},
  74.         {"2-06",true},
  75.         {"2-07",true,true,true},
  76.         {"2-08",true,true},
  77.         {"2-09",true},
  78.         {"2-09B",true},
  79.         {"2-B",true},
  80.         {"2-BB",true},
  81.         {"2-G2",true},
  82.         {"2-S02",true,true},
  83.         {"2-S04",true},
  84.         {"2-S05",true,true},
  85.         {"2-S05B",true,true},
  86.         {"2-S05C",false,false,true,true},
  87.         {"2-S06",true},
  88.         {"2-S07",true,true,false},
  89.         {"3-0",true,true},
  90.         {"3-01",true},
  91.         {"3-01AA",true},
  92.         {"3-01AB",true},
  93.         {"3-01BA",true},
  94.         {"3-01CA",true},
  95.         {"3-01CB",true},
  96.         {"3-01DA",true},
  97.         {"3-01DB",true},
  98.         {"3-01DC",true},
  99.         {"3-02",true},
  100.         {"3-03",true},
  101.         {"3-04",true},
  102.         {"3-04B",true},
  103.         {"3-05",true},
  104.         {"3-06",true,true},
  105.         {"3-B",true,true},
  106.         {"3-BB",true,true},
  107.         {"3-BD",true},
  108.         {"3-G3",true},
  109.         {"3-R05A",true},
  110.         {"3-R05B",true},
  111.         {"3-R07",true},
  112.         {"3-S03",true},
  113.         {"3-S08",true},
  114.         {"3-S10",true},
  115.         {"3-S11",true},
  116.         {"3-S11C",true,true},
  117.         {"4-0",true,true},
  118.         {"4-01",true},
  119.         {"4-02",true,true,true},
  120.         {"4-03",true,true,true},
  121.         {"4-04",true},
  122.         {"4-05",true},
  123.         {"4-06",true},
  124.         {"4-B1",true,true},
  125.         {"4-B1D",true,false},
  126.         {"4-B2",true},
  127.         {"4-B2B",true},
  128.         {"4-G4",true,true},
  129.         {"4-S12",true,true},
  130.         {"4-S12B",true,true},
  131.         {"5-0",true,true},
  132.         {"5-01",true},
  133.         {"5-02",true},
  134.         {"5-02B",true,true},
  135.         {"5-03",true,true,true},
  136.         {"5-04",true},
  137.         {"5-05",true,true},
  138.         {"5-05B",true,true,true,true},
  139.         {"5-06",true},
  140.         {"5-09",true,false,false},
  141.         {"5-09B",true,false},
  142.         {"5-BC",true},
  143.         {"5-G5",true},
  144.         {"6-0",true,true},
  145.         {"6-02",true,true},
  146.         {"6-02B",true,true},
  147.         {"6-B",true},
  148.         {"6-BB",true},
  149.         {"6-BB",true,false,true,true},
  150.         {"6-BC",true},
  151.     }
  152. end
  153.  
  154. -- STimeCycle functions:
  155. F_AttendedClass = function()
  156.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  157.     return
  158.   end
  159.   SetSkippedClass(false)
  160.   PlayerSetPunishmentPoints(0)
  161. end
  162.  
  163. F_MissedClass = function()
  164.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  165.     return
  166.   end
  167.   SetSkippedClass(true)
  168.   StatAddToInt(166)
  169. end
  170.  
  171. F_AttendedCurfew = function()
  172.   if not PedInConversation(gPlayer) and not MissionActive() then
  173.     TextPrintString("You got home in time for curfew", 4)
  174.   end
  175. end
  176.  
  177. F_MissedCurfew = function()
  178.   if not PedInConversation(gPlayer) and not MissionActive() then
  179.     TextPrint("TM_TIRED5", 4, 2)
  180.   end
  181. end
  182.  
  183. F_StartClass = function()
  184.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  185.     return
  186.   end
  187.   F_RingSchoolBell()
  188.   local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
  189. end
  190.  
  191. F_EndClass = function()
  192.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  193.     return
  194.   end
  195.   F_RingSchoolBell()
  196. end
  197.  
  198. F_StartMorning = function()
  199.   F_UpdateTimeCycle()
  200. end
  201.  
  202. F_EndMorning = function()
  203.   F_UpdateTimeCycle()
  204. end
  205.  
  206. F_StartLunch = function()
  207.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  208.     F_UpdateTimeCycle()
  209.     return
  210.   end
  211.   F_UpdateTimeCycle()
  212. end
  213.  
  214. F_EndLunch = function()
  215.   F_UpdateTimeCycle()
  216. end
  217.  
  218. F_StartAfternoon = function()
  219.   F_UpdateTimeCycle()
  220. end
  221.  
  222. F_EndAfternoon = function()
  223.   F_UpdateTimeCycle()
  224. end
  225.  
  226. F_StartEvening = function()
  227.   F_UpdateTimeCycle()
  228. end
  229.  
  230. F_EndEvening = function()
  231.   F_UpdateTimeCycle()
  232. end
  233.  
  234. F_StartCurfew_SlightlyTired = function()
  235.   F_UpdateTimeCycle()
  236. end
  237.  
  238. F_StartCurfew_Tired = function()
  239.   F_UpdateTimeCycle()
  240. end
  241.  
  242. F_StartCurfew_MoreTired = function()
  243.   F_UpdateTimeCycle()
  244. end
  245.  
  246. F_StartCurfew_TooTired = function()
  247.   F_UpdateTimeCycle()
  248. end
  249.  
  250. F_EndCurfew_TooTired = function()
  251.   F_UpdateTimeCycle()
  252. end
  253.  
  254. F_EndTired = function()
  255.   F_UpdateTimeCycle()
  256. end
  257.  
  258. F_Nothing = function()
  259. end
  260.  
  261. F_ClassWarning = function()
  262.   if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  263.     return
  264.   end
  265.   local l_23_0 = math.random(1, 2)
  266. end
  267.  
  268. F_UpdateTimeCycle = function()
  269.   if not IsMissionCompleated("1_B") then
  270.     local l_24_0 = GetCurrentDay(false)
  271.     if l_24_0 < 0 or l_24_0 > 2 then
  272.       SetCurrentDay(0)
  273.     end
  274.   end
  275.   F_UpdateCurfew()
  276. end
  277.  
  278. F_UpdateCurfew = function()
  279.   local l_25_0 = shared.gCurfewRules
  280.   if not l_25_0 then
  281.     l_25_0 = F_CurfewDefaultRules
  282.   end
  283.   l_25_0()
  284. end
  285.  
  286. F_CurfewDefaultRules = function()
  287.   local l_26_0 = ClockGet()
  288.   if l_26_0 >= 23 or l_26_0 < 7 then
  289.     shared.gCurfew = true
  290.   else
  291.     shared.gCurfew = false
  292.   end
  293. end
Advertisement
Add Comment
Please, Sign In to add comment