Advertisement
jrubimf

Sample

Mar 11th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 102.99 KB | None | 0 0
  1. local e = {} local p = Tpp.IsTypeFunc
  2. local n = Tpp.IsTypeTable
  3. local l = Tpp.IsTypeString
  4. local t = Fox.StrCode32
  5. local o = GkEventTimerManager.Start
  6. local m = GkEventTimerManager.Stop
  7. local a = GameObject.GetTypeIndex
  8. local s = GameObject.GetGameObjectId
  9. local T = GameObject.GetTypeIndexWithTypeName
  10. local a = TppGameObject.GAME_OBJECT_TYPE_SOLDIER2
  11. local a = TppGameObject.GAME_OBJECT_TYPE_HOSTAGE2
  12. local r = GameObject.NULL_ID
  13. local i = GameObject.SendCommand
  14. e.MISSION_CLEAR_CAMERA_FADE_DELAY_TIME = 3
  15. e.MISSION_CLEAR_CAMERA_DELAY_TIME = 0
  16. e.PLAYER_FALL_DEAD_DELAY_TIME = .2
  17. e.DisableAbilityList = { Stand = "DIS_ACT_STAND", Squat = "DIS_ACT_SQUAT", Crawl = "DIS_ACT_CRAWL", Dash = "DIS_ACT_DASH" } e.ControlModeList = { LockPadMode = "All", LockMBTerminalOpenCloseMode = "MB_Disable", MBTerminalOnlyMode = "MB_OnlyMode" } e.CageRandomTableG1 = { { 1, 20 }, { 0, 80 } } e.CageRandomTableG2 = { { 2, 15 }, { 1, 20 }, { 0, 65 } } e.CageRandomTableG3 = { { 4, 5 }, { 3, 10 }, { 2, 15 }, { 1, 20 }, { 0, 50 } } e.RareLevelList = { "N", "NR", "R", "SR", "SSR" } function e.RegisterCallbacks(e) if p(e.OnFultonIconDying) then
  18.     mvars.ply_OnFultonIconDying = e.OnFultonIconDying
  19. end
  20. end
  21.  
  22. function e.SetStartStatus(e) if (e > TppDefine.INITIAL_PLAYER_STATE.MIN) and (e < TppDefine.INITIAL_PLAYER_STATE.MAX) then
  23.     gvars.ply_initialPlayerState = e
  24. end
  25. end
  26.  
  27. function e.ResetDisableAction() vars.playerDisableActionFlag = PlayerDisableAction.NONE
  28. end
  29.  
  30. function e.GetPosition() return { vars.playerPosX, vars.playerPosY, vars.playerPosZ } end
  31.  
  32. function e.GetRotation() return vars.playerRotY
  33. end
  34.  
  35. function e.Warp(e) if not n(e) then
  36.     return
  37. end
  38.     local a = e.pos
  39.     if not n(a) or (#a ~= 3) then
  40.         return
  41.     end
  42.     local n = foxmath.NormalizeRadian(foxmath.DegreeToRadian(e.rotY or 0)) local t
  43.     if e.fobRespawn == true then
  44.         t = { type = "TppPlayer2", index = PlayerInfo.GetLocalPlayerIndex() } else
  45.         t = { type = "TppPlayer2", index = 0 }
  46.     end
  47.     local e = e.unrealize
  48.     local e = { id = "WarpAndWaitBlock", pos = a, rotY = n, unrealize = e } GameObject.SendCommand(t, e)
  49. end
  50.  
  51. function e.ResetAroundCameraRotation(e) Player.RequestToSetCameraRotation { rotX = 10, rotY = e or vars.playerRotY, interpTime = 0 } end
  52.  
  53. function e.ResetPlayerForReturnBaseCamp() if not TppGameStatus.IsSet("", "S_IN_BASE_CHECKPOINT") then
  54. end
  55.     local a, t
  56.     if TppLocation.IsAfghan() then
  57.         a, t = Tpp.GetLocator("DataIdentifier_afgh_common_fasttravel", "fast_afgh_basecamp") elseif TppLocation.IsMiddleAfrica() then
  58.         a, t = Tpp.GetLocator("DataIdentifier_mafr_common_fasttravel", "fast_mafr_basecamp")
  59.     end
  60.     if a then
  61.         a[2] = a[2] + .8
  62.         e.Warp { pos = a, rotY = t }
  63.     end
  64.     e.ResetAroundCameraRotation(t)
  65. end
  66.  
  67. function e.OnEndWarp() if mvars.ply_requestedRevivePlayer then
  68.     mvars.ply_requestedRevivePlayer = false
  69.     if not TppMission.IsMultiPlayMission(vars.missionCode) then
  70.         TppUI.FadeIn(TppUI.FADE_SPEED.FADE_NORMALSPEED, "EndRevivePlayer", TppUI.FADE_PRIORITY.SYSTEM)
  71.     end
  72. elseif mvars.ply_deliveryWarpState then
  73.     e.OnEndWarpByFastTravel()
  74. end
  75. end
  76.  
  77. function e.Revive() mvars.ply_requestedRevivePlayer = true
  78.     GameObject.SendCommand({ type = "TppPlayer2", index = PlayerInfo.GetLocalPlayerIndex() }, { id = "Revive", revivalType = "Item" })
  79. end
  80.  
  81. function e.SetForceFultonPercent(a, e) if not Tpp.IsTypeNumber(a) then
  82.     return
  83. end
  84.     if not Tpp.IsTypeNumber(e) then
  85.         return
  86.     end
  87.     if (a < 0) or (a >= r) then
  88.         return
  89.     end
  90.     if (e < 0) or (e > 100) then
  91.         return
  92.     end
  93.     mvars.ply_forceFultonPercent = mvars.ply_forceFultonPercent or {} mvars.ply_forceFultonPercent[a] = e
  94. end
  95.  
  96. function e.ForceChangePlayerToSnake(e) vars.playerType = PlayerType.SNAKE
  97.     if e then
  98.         vars.playerPartsType = PlayerPartsType.NORMAL
  99.         vars.playerCamoType = PlayerCamoType.OLIVEDRAB
  100.         vars.playerFaceEquipId = 0
  101.     else
  102.         vars.playerPartsType = vars.sortiePrepPlayerSnakePartsType
  103.         vars.playerCamoType = vars.sortiePrepPlayerSnakeCamoType
  104.         vars.playerFaceEquipId = vars.sortiePrepPlayerSnakeFaceEquipId
  105.     end
  106.     Player.SetItemLevel(TppEquip.EQP_SUIT, vars.sortiePrepPlayerSnakeSuitLevel)
  107. end
  108.  
  109. function e.CheckRotationSetting(a) if not n(a) then
  110.     return
  111. end
  112.     local e = mvars
  113.     e.ply_checkDirectionList = {} e.ply_checkRotationResult = {} local function n(a, t, e) if e >= -180 and e < 180 then
  114.         a[t] = e
  115.     end
  116.     end
  117.  
  118.     for a, t in pairs(a) do
  119.         if p(t.func) then
  120.             e.ply_checkDirectionList[a] = {} e.ply_checkDirectionList[a].func = t.func
  121.             local r = t.directionX or 0
  122.             local o = t.directionY or 0
  123.             local l = t.directionRangeX or 0
  124.             local t = t.directionRangeY or 0
  125.             n(e.ply_checkDirectionList[a], "directionX", r) n(e.ply_checkDirectionList[a], "directionY", o) n(e.ply_checkDirectionList[a], "directionRangeX", l) n(e.ply_checkDirectionList[a], "directionRangeY", t) else
  126.             return
  127.         end
  128.     end
  129. end
  130.  
  131. function e.CheckRotation() local a = mvars
  132.     if a.ply_checkDirectionList == nil then
  133.         return
  134.     end
  135.     for t, n in pairs(a.ply_checkDirectionList) do
  136.         local e = e._CheckRotation(n.directionX, n.directionRangeX, n.directionY, n.directionRangeY, t) if e ~= a.ply_checkRotationResult[t] then
  137.         a.ply_checkRotationResult[t] = e
  138.         a.ply_checkDirectionList[t].func(e)
  139.     end
  140.     end
  141. end
  142.  
  143. function e.IsFastTraveling() if mvars.ply_deliveryWarpState then
  144.     return true
  145. else
  146.     return false
  147. end
  148. end
  149.  
  150. function e.IsFastTravelingAndWarpEnd() if mvars.ply_deliveryWarpState and mvars.ply_deliveryWarpState < e.DELIVERY_WARP_STATE.START_FADE_IN then
  151.     return true
  152. else
  153.     return false
  154. end
  155. end
  156.  
  157. function e.GetStationUniqueId(e) if not l(e) then
  158.     return
  159. end
  160.     local e = "col_stat_" .. e
  161.     return TppCollection.GetUniqueIdByLocatorName(e)
  162. end
  163.  
  164. function e.SetMissionStartPositionToCurrentPosition() gvars.ply_useMissionStartPos = true
  165.     gvars.ply_missionStartPos[0] = vars.playerPosX
  166.     gvars.ply_missionStartPos[1] = vars.playerPosY + .5
  167.     gvars.ply_missionStartPos[2] = vars.playerPosZ
  168.     gvars.ply_missionStartRot = vars.playerRotY
  169.     gvars.mis_orderBoxName = 0
  170.     e.SetInitialPositionFromMissionStartPosition()
  171. end
  172.  
  173. function e.SetNoOrderBoxMissionStartPosition(e, a) gvars.ply_useMissionStartPosForNoOrderBox = true
  174.     gvars.ply_missionStartPosForNoOrderBox[0] = e[1] gvars.ply_missionStartPosForNoOrderBox[1] = e[2] gvars.ply_missionStartPosForNoOrderBox[2] = e[3] gvars.ply_missionStartRotForNoOrderBox = a
  175. end
  176.  
  177. function e.SetNoOrderBoxMissionStartPositionToCurrentPosition() gvars.ply_useMissionStartPosForNoOrderBox = true
  178.     gvars.ply_missionStartPosForNoOrderBox[0] = vars.playerPosX
  179.     gvars.ply_missionStartPosForNoOrderBox[1] = vars.playerPosY + .5
  180.     gvars.ply_missionStartPosForNoOrderBox[2] = vars.playerPosZ
  181.     gvars.ply_missionStartRotForNoOrderBox = vars.playerRotY
  182. end
  183.  
  184. function e.SetMissionStartPositionToBaseFastTravelPoint() if TppLocation.IsAfghan() then
  185.     e.SetMissionStartPosition({ -453.189, 288.312, 2231.18 }, 62.5757) e.SetInitialPositionFromMissionStartPosition() elseif TppLocation.IsMiddleAfrica() then
  186.     e.SetMissionStartPosition({ 2865.74, 102.611, -911.52 }, 89.5129) e.SetInitialPositionFromMissionStartPosition() else
  187.     e.ResetMissionStartPosition()
  188. end
  189. end
  190.  
  191. function e.SetMissionStartPosition(e, a) gvars.ply_useMissionStartPos = true
  192.     gvars.ply_missionStartPos[0] = e[1] gvars.ply_missionStartPos[1] = e[2] gvars.ply_missionStartPos[2] = e[3] gvars.ply_missionStartRot = a
  193. end
  194.  
  195. function e.ResetMissionStartPosition() gvars.ply_useMissionStartPos = false
  196.     gvars.ply_missionStartPos[0] = 0
  197.     gvars.ply_missionStartPos[1] = 0
  198.     gvars.ply_missionStartPos[2] = 0
  199.     gvars.ply_missionStartRot = 0
  200. end
  201.  
  202. function e.ResetNoOrderBoxMissionStartPosition() gvars.ply_useMissionStartPosForNoOrderBox = false
  203.     gvars.ply_missionStartPosForNoOrderBox[0] = 0
  204.     gvars.ply_missionStartPosForNoOrderBox[1] = 0
  205.     gvars.ply_missionStartPosForNoOrderBox[2] = 0
  206.     gvars.ply_missionStartRotForNoOrderBox = 0
  207. end
  208.  
  209. function e.SetMissionStartPositionFromNoOrderBoxPosition() if gvars.ply_useMissionStartPosForNoOrderBox then
  210.     gvars.ply_useMissionStartPos = true
  211.     gvars.ply_missionStartPos[0] = gvars.ply_missionStartPosForNoOrderBox[0] gvars.ply_missionStartPos[1] = gvars.ply_missionStartPosForNoOrderBox[1] gvars.ply_missionStartPos[2] = gvars.ply_missionStartPosForNoOrderBox[2] gvars.ply_missionStartRot = gvars.ply_missionStartRotForNoOrderBox
  212.     e.ResetNoOrderBoxMissionStartPosition()
  213. end
  214. end
  215.  
  216. function e.DEBUG_CheckNearMissionStartPositionToRealizePosition() if gvars.ply_useMissionStartPos then
  217.     local e
  218.     if TppLocation.IsMotherBase() then
  219.         e = 1e3 * 1e3
  220.     else
  221.         e = 64 * 64
  222.     end
  223.     local t = gvars.ply_missionStartPos[0] - vars.playerPosX
  224.     local a = gvars.ply_missionStartPos[2] - vars.playerPosZ
  225.     local a = (t * t) + (a * a) if (a > e) then
  226.     return true
  227. else
  228.     return false
  229. end
  230. else
  231.     return false
  232. end
  233. end
  234.  
  235. function e.SetInitialPositionToCurrentPosition() vars.initialPlayerFlag = PlayerFlag.USE_VARS_FOR_INITIAL_POS
  236.     vars.initialPlayerPosX = vars.playerPosX
  237.     vars.initialPlayerPosY = vars.playerPosY + .5
  238.     vars.initialPlayerPosZ = vars.playerPosZ
  239.     vars.initialPlayerRotY = vars.playerRotY
  240. end
  241.  
  242. function e.SetInitialPosition(e, a) vars.initialPlayerFlag = PlayerFlag.USE_VARS_FOR_INITIAL_POS
  243.     vars.initialPlayerPosX = e[1] vars.initialPlayerPosY = e[2] vars.initialPlayerPosZ = e[3] vars.initialPlayerRotY = a
  244. end
  245.  
  246. function e.SetInitialPositionFromMissionStartPosition() if gvars.ply_useMissionStartPos then
  247.     vars.initialPlayerFlag = PlayerFlag.USE_VARS_FOR_INITIAL_POS
  248.     vars.initialPlayerPosX = gvars.ply_missionStartPos[0] vars.initialPlayerPosY = gvars.ply_missionStartPos[1] vars.initialPlayerPosZ = gvars.ply_missionStartPos[2] vars.initialPlayerRotY = gvars.ply_missionStartRot
  249.     vars.playerCameraRotation[0] = 0
  250.     vars.playerCameraRotation[1] = gvars.ply_missionStartRot
  251. end
  252. end
  253.  
  254. function e.ResetInitialPosition() vars.initialPlayerFlag = 0
  255.     vars.initialPlayerPosX = 0
  256.     vars.initialPlayerPosY = 0
  257.     vars.initialPlayerPosZ = 0
  258.     vars.initialPlayerRotY = 0
  259. end
  260.  
  261. function e.StoreTempInitialPosition() gvars.sav_continueForOutOfBaseArea = true
  262.     gvars.ply_startPosTempForBaseDefense[0] = vars.playerPosX
  263.     gvars.ply_startPosTempForBaseDefense[1] = vars.playerPosY
  264.     gvars.ply_startPosTempForBaseDefense[2] = vars.playerPosZ
  265.     gvars.ply_startPosTempForBaseDefense[3] = vars.playerRotY
  266. end
  267.  
  268. function e.RestoreTempInitialPosition() vars.playerPosX = gvars.ply_startPosTempForBaseDefense[0] vars.playerPosY = gvars.ply_startPosTempForBaseDefense[1] vars.playerPosZ = gvars.ply_startPosTempForBaseDefense[2] vars.playerRotY = gvars.ply_startPosTempForBaseDefense[3] gvars.sav_continueForOutOfBaseArea = false
  269.     gvars.ply_startPosTempForBaseDefense[0] = 0
  270.     gvars.ply_startPosTempForBaseDefense[1] = 0
  271.     gvars.ply_startPosTempForBaseDefense[2] = 0
  272.     gvars.ply_startPosTempForBaseDefense[3] = 0
  273.     e.SetInitialPositionToCurrentPosition()
  274. end
  275.  
  276. function e.FailSafeInitialPositionForFreePlay() if not ((vars.missionCode == 30010) or (vars.missionCode == 30020)) then
  277.     return
  278. end
  279.     if vars.initialPlayerFlag ~= PlayerFlag.USE_VARS_FOR_INITIAL_POS then
  280.         return
  281.     end
  282.     if (((vars.initialPlayerPosX > 3500) or (vars.initialPlayerPosX < -3500)) or (vars.initialPlayerPosZ > 3500)) or (vars.initialPlayerPosZ < -3500) then
  283.         local e = { [30010] = { 1448.61, 337.787, 1466.4 }, [30020] = { -510.73, 5.09, 1183.02 } } local e = e[vars.missionCode] vars.initialPlayerPosX, vars.initialPlayerPosY, vars.initialPlayerPosZ = e[1], e[2], e[3]
  284.     end
  285. end
  286.  
  287. function e.RegisterTemporaryPlayerType(e) if not n(e) then
  288.     return
  289. end
  290.     mvars.ply_isExistTempPlayerType = true
  291.     local r = e.camoType
  292.     local n = e.partsType
  293.     local a = e.playerType
  294.     local t = e.handEquip
  295.     local e = e.faceEquipId
  296.     if n then
  297.         mvars.ply_tempPartsType = n
  298.     end
  299.     if r then
  300.         mvars.ply_tempCamoType = r
  301.     end
  302.     if a then
  303.         mvars.ply_tempPlayerType = a
  304.     end
  305.     if t then
  306.         mvars.ply_tempPlayerHandEquip = t
  307.     end
  308.     if e then
  309.         mvars.ply_tempPlayerFaceEquipId = e
  310.     end
  311. end
  312.  
  313. function e.SaveCurrentPlayerType() if not gvars.ply_isUsingTempPlayerType then
  314.     if DebugMenu then
  315.         if vars.playerCamoType == PlayerCamoType.HOSPITAL then
  316.             TppGameSequence.GetPauseMenu():DebugPause()
  317.         end
  318.     end
  319.     gvars.ply_lastPlayerPartsTypeUsingTemp = vars.playerPartsType
  320.     gvars.ply_lastPlayerCamoTypeUsingTemp = vars.playerCamoType
  321.     gvars.ply_lastPlayerHandTypeUsingTemp = vars.handEquip
  322.     gvars.ply_lastPlayerTypeUsingTemp = vars.playerType
  323.     gvars.ply_lastPlayerFaceIdUsingTemp = vars.playerFaceId
  324.     gvars.ply_lastPlayerFaceEquipIdUsingTemp = vars.playerFaceEquipId
  325. end
  326.     gvars.ply_isUsingTempPlayerType = true
  327. end
  328.  
  329. function e.ApplyTemporaryPlayerType() if mvars.ply_tempPartsType then
  330.     vars.playerPartsType = mvars.ply_tempPartsType
  331. end
  332.     if mvars.ply_tempCamoType then
  333.         vars.playerCamoType = mvars.ply_tempCamoType
  334.     end
  335.     if mvars.ply_tempPlayerType then
  336.         vars.playerType = mvars.ply_tempPlayerType
  337.     end
  338.     if mvars.ply_tempPlayerHandEquip then
  339.         vars.handEquip = mvars.ply_tempPlayerHandEquip
  340.     end
  341.     if mvars.ply_tempPlayerFaceEquipId then
  342.         vars.playerFaceEquipId = mvars.ply_tempPlayerFaceEquipId
  343.     end
  344. end
  345.  
  346. function e.RestoreTemporaryPlayerType() if gvars.ply_isUsingTempPlayerType then
  347.     if DebugMenu then
  348.         if gvars.ply_lastPlayerCamoTypeUsingTemp == PlayerCamoType.HOSPITAL then
  349.             TppGameSequence.GetPauseMenu():DebugPause()
  350.         end
  351.     end
  352.     vars.playerPartsType = gvars.ply_lastPlayerPartsTypeUsingTemp
  353.     vars.playerCamoType = gvars.ply_lastPlayerCamoTypeUsingTemp
  354.     vars.playerType = gvars.ply_lastPlayerTypeUsingTemp
  355.     vars.playerFaceId = gvars.ply_lastPlayerFaceIdUsingTemp
  356.     vars.playerFaceEquipId = gvars.ply_lastPlayerFaceEquipIdUsingTemp
  357.     vars.handEquip = gvars.ply_lastPlayerHandTypeUsingTemp
  358.     gvars.ply_lastPlayerPartsTypeUsingTemp = PlayerPartsType.NORMAL_SCARF
  359.     gvars.ply_lastPlayerCamoTypeUsingTemp = PlayerCamoType.OLIVEDRAB
  360.     gvars.ply_lastPlayerTypeUsingTemp = PlayerType.SNAKE
  361.     gvars.ply_lastPlayerFaceIdUsingTemp = 0
  362.     gvars.ply_lastPlayerFaceEquipIdUsingTemp = 0
  363.     gvars.ply_isUsingTempPlayerType = false
  364.     gvars.ply_lastPlayerHandTypeUsingTemp = TppEquip.EQP_HAND_NORMAL
  365. end
  366. end
  367.  
  368. function e.SupplyAllAmmoFullOnMissionFinalize() end
  369.  
  370. function e.SupplyWeaponAmmoFull(e) end
  371.  
  372. function e.SupplySupportWeaponAmmoFull(e) end
  373.  
  374. function e.SupplyAmmoByBulletId(e, e) end
  375.  
  376. function e.SavePlayerCurrentAmmoCount() end
  377.  
  378. function e.SetMissionStartAmmoCount() end
  379.  
  380. function e.SetEquipMissionBlockGroupSize() local e = mvars.ply_equipMissionBlockGroupSize
  381.     if e > 0 then
  382.         TppEquip.CreateEquipMissionBlockGroup { size = e }
  383.     end
  384. end
  385.  
  386. function e.SetMaxPickableLocatorCount() if mvars.ply_maxPickableLocatorCount > 0 then
  387.     TppPickable.OnAllocate { locators = mvars.ply_maxPickableLocatorCount, svarsName = "ply_pickableLocatorDisabled" }
  388. end
  389. end
  390.  
  391. function e.SetMaxPlacedLocatorCount() if mvars.ply_maxPlacedLocatorCount > 0 then
  392.     TppPlaced.OnAllocate { locators = mvars.ply_maxPlacedLocatorCount, svarsName = "ply_placedLocatorDisabled" }
  393. end
  394. end
  395.  
  396. function e.IsDecoy(e) local a = TppEquip.GetSupportWeaponTypeId(e) local e = { [TppEquip.SWP_TYPE_Decoy] = true, [TppEquip.SWP_TYPE_ActiveDecoy] = true, [TppEquip.SWP_TYPE_ShockDecoy] = true } if e[a] then
  397.     return true
  398. else
  399.     return false
  400. end
  401. end
  402.  
  403. function e.IsMine(e) local a = TppEquip.GetSupportWeaponTypeId(e) local e = { [TppEquip.SWP_TYPE_DMine] = true, [TppEquip.SWP_TYPE_SleepingGusMine] = true, [TppEquip.SWP_TYPE_AntitankMine] = true, [TppEquip.SWP_TYPE_ElectromagneticNetMine] = true } if e[a] then
  404.     return true
  405. else
  406.     return false
  407. end
  408. end
  409.  
  410. function e.AddTrapSettingForIntel(a) local n = a.trapName
  411.     local s = a.direction or 0
  412.     local p = a.directionRange or 60
  413.     local e = a.intelName
  414.     local d = a.autoIcon
  415.     local i = a.gotFlagName
  416.     local o = a.markerTrapName
  417.     local r = a.markerObjectiveName
  418.     local c = a.identifierName
  419.     local a = a.locatorName
  420.     if not l(n) then
  421.         return
  422.     end
  423.     mvars.ply_intelTrapInfo = mvars.ply_intelTrapInfo or {} if e then
  424.         mvars.ply_intelTrapInfo[e] = { trapName = n } else
  425.         return
  426.     end
  427.     mvars.ply_intelNameReverse = mvars.ply_intelNameReverse or {} mvars.ply_intelNameReverse[t(e)] = e
  428.     mvars.ply_intelFlagInfo = mvars.ply_intelFlagInfo or {} if i then
  429.         mvars.ply_intelFlagInfo[e] = i
  430.         mvars.ply_intelFlagInfo[t(e)] = i
  431.         mvars.ply_intelTrapInfo[e].gotFlagName = i
  432.     end
  433.     mvars.ply_intelMarkerObjectiveName = mvars.ply_intelMarkerObjectiveName or {} if r then
  434.         mvars.ply_intelMarkerObjectiveName[e] = r
  435.         mvars.ply_intelMarkerObjectiveName[t(e)] = r
  436.         mvars.ply_intelTrapInfo[e].markerObjectiveName = r
  437.     end
  438.     mvars.ply_intelMarkerTrapList = mvars.ply_intelMarkerTrapList or {} mvars.ply_intelMarkerTrapInfo = mvars.ply_intelMarkerTrapInfo or {} if o then
  439.         table.insert(mvars.ply_intelMarkerTrapList, o) mvars.ply_intelMarkerTrapInfo[t(o)] = e
  440.         mvars.ply_intelTrapInfo[e].markerTrapName = o
  441.     end
  442.     mvars.ply_intelTrapList = mvars.ply_intelTrapList or {} if d then
  443.         table.insert(mvars.ply_intelTrapList, n) mvars.ply_intelTrapInfo[t(n)] = e
  444.         mvars.ply_intelTrapInfo[e].autoIcon = true
  445.     end
  446.     if c and a then
  447.         local a, e = Tpp.GetLocator(c, a) if a and e then
  448.         s = e
  449.     end
  450.     end
  451.     mvars.ply_intelTrapInfo[e].direction = s
  452.     mvars.ply_intelTrapInfo[e].directionRange = p
  453.     Player.AddTrapDetailCondition { trapName = n, condition = PlayerTrap.FINE, action = (PlayerTrap.NORMAL + PlayerTrap.BEHIND), stance = (PlayerTrap.STAND + PlayerTrap.SQUAT), direction = s, directionRange = p }
  454. end
  455.  
  456. function e.ShowIconForIntel(e, t) if not l(e) then
  457.     return
  458. end
  459.     local n
  460.     if mvars.ply_intelTrapInfo and mvars.ply_intelTrapInfo[e] then
  461.         n = mvars.ply_intelTrapInfo[e].trapName
  462.     end
  463.     local a = mvars.ply_intelFlagInfo[e] if a then
  464.         if svars[a] ~= nil then
  465.             t = svars[a]
  466.         end
  467.     end
  468.     if not t then
  469.         if Tpp.IsNotAlert() then
  470.             Player.RequestToShowIcon { type = ActionIcon.ACTION, icon = ActionIcon.INTEL, message = Fox.StrCode32 "GetIntel", messageInDisplay = Fox.StrCode32 "IntelIconInDisplay", messageArg = e } elseif n then
  471.             Player.RequestToShowIcon { type = ActionIcon.ACTION, icon = ActionIcon.INTEL_NG, message = Fox.StrCode32 "NGIntel", messageInDisplay = Fox.StrCode32 "IntelIconInDisplay", messageArg = e } if not TppRadio.IsPlayed(TppRadio.COMMON_RADIO_LIST[TppDefine.COMMON_RADIO.CANNOT_GET_INTEL_ON_ALERT]) then
  472.             TppRadio.PlayCommonRadio(TppDefine.COMMON_RADIO.CANNOT_GET_INTEL_ON_ALERT)
  473.         end
  474.         end
  475.     end
  476. end
  477.  
  478. function e.GotIntel(a) local e = mvars.ply_intelFlagInfo[a] if not e then
  479.     return
  480. end
  481.     if svars[e] ~= nil then
  482.         svars[e] = true
  483.     end
  484.     local e = mvars.ply_intelMarkerObjectiveName[a] if e then
  485.         local a = TppMission.GetParentObjectiveName(e) local e = {} for a, t in pairs(a) do
  486.         table.insert(e, a)
  487.     end
  488.         TppMission.UpdateObjective { objectives = e }
  489.     end
  490. end
  491.  
  492. function e.HideIconForIntel() Player.RequestToHideIcon { type = ActionIcon.ACTION, icon = ActionIcon.INTEL } Player.RequestToHideIcon { type = ActionIcon.ACTION, icon = ActionIcon.INTEL_NG } end
  493.  
  494. function e.DisableSwitchIcon() GameObject.SendCommand({ type = "TppPlayer2", index = PlayerInfo.GetLocalPlayerIndex() }, { id = "SetDisableSearchSwitch", disable = true }) end
  495.  
  496. function e.EnableSwitchIcon() GameObject.SendCommand({ type = "TppPlayer2", index = PlayerInfo.GetLocalPlayerIndex() }, { id = "SetDisableSearchSwitch", disable = false }) end
  497.  
  498. function e.AddTrapSettingForQuest(e) local a = e.trapName
  499.     local r = e.direction or 0
  500.     local n = e.directionRange or 180
  501.     local e = e.questName
  502.     if not l(a) then
  503.         return
  504.     end
  505.     mvars.ply_questStartTrapInfo = mvars.ply_questStartTrapInfo or {} if e then
  506.         mvars.ply_questStartTrapInfo[e] = { trapName = a } else
  507.         return
  508.     end
  509.     mvars.ply_questNameReverse = mvars.ply_questNameReverse or {} mvars.ply_questNameReverse[t(e)] = e
  510.     mvars.ply_questStartFlagInfo = mvars.ply_questStartFlagInfo or {} mvars.ply_questStartFlagInfo[e] = false
  511.     mvars.ply_questTrapList = mvars.ply_questTrapList or {} table.insert(mvars.ply_questTrapList, a) mvars.ply_questStartTrapInfo[t(a)] = e
  512.     Player.AddTrapDetailCondition { trapName = a, condition = PlayerTrap.FINE, action = PlayerTrap.NORMAL, stance = (PlayerTrap.STAND + PlayerTrap.SQUAT), direction = r, directionRange = n }
  513. end
  514.  
  515. function e.ShowIconForQuest(e, a) if not l(e) then
  516.     return
  517. end
  518.     local t
  519.     if mvars.ply_questStartTrapInfo and mvars.ply_questStartTrapInfo[e] then
  520.         t = mvars.ply_questStartTrapInfo[e].trapName
  521.     end
  522.     if mvars.ply_questStartFlagInfo[e] ~= nil then
  523.         a = mvars.ply_questStartFlagInfo[e]
  524.     end
  525.     if not a then
  526.         Player.RequestToShowIcon { type = ActionIcon.ACTION, icon = ActionIcon.TRAINING, message = Fox.StrCode32 "QuestStarted", messageInDisplay = Fox.StrCode32 "QuestIconInDisplay", messageArg = e }
  527.     end
  528. end
  529.  
  530. function e.QuestStarted(a) local a = mvars.ply_questNameReverse[a] if mvars.ply_questStartFlagInfo[a] ~= nil then
  531.     mvars.ply_questStartFlagInfo[a] = true
  532. end
  533.     e.HideIconForQuest()
  534. end
  535.  
  536. function e.HideIconForQuest() Player.RequestToHideIcon { type = ActionIcon.ACTION, icon = ActionIcon.TRAINING } end
  537.  
  538. function e.ResetIconForQuest(e) mvars.ply_questStartFlagInfo.ShootingPractice = false
  539. end
  540.  
  541. function e.AppearHorseOnMissionStart(e, a) local e, a = Tpp.GetLocator(e, a) if e then
  542.     vars.buddyType = BuddyType.HORSE
  543.     vars.initialBuddyPos[0] = e[1] vars.initialBuddyPos[1] = e[2] vars.initialBuddyPos[2] = e[3]
  544. end
  545. end
  546.  
  547. function e.StartGameOverCamera(e, a, t, n) if mvars.ply_gameOverCameraGameObjectId ~= nil then
  548.     return
  549. end
  550.     mvars.ply_gameOverCameraGameObjectId = e
  551.     mvars.ply_gameOverCameraStartTimerName = a
  552.     mvars.ply_gameOverCameraAnnounceLog = t
  553.     mvars.ply_gameOverCameraFadeInName = n
  554.     TppUiStatusManager.SetStatus("AnnounceLog", "INVALID_LOG") TppSound.PostJingleOnGameOver() TppSoundDaemon.PostEvent "sfx_s_force_camera_out" vars.playerDisableActionFlag = PlayerDisableAction.SUBJECTIVE_CAMERA
  555.     o("Timer_StartGameOverCamera", .25)
  556. end
  557.  
  558. function e._StartGameOverCamera(e, e) TppUiStatusManager.ClearStatus "AnnounceLog" FadeFunction.SetFadeColor(64, 0, 0, 255) TppUI.FadeOut(TppUI.FADE_SPEED.FADE_HIGHSPEED, mvars.ply_gameOverCameraStartTimerName, TppUI.FADE_PRIORITY.DEMO, { exceptGameStatus = { AnnounceLog = false } }) Player.RequestToSetCameraFocalLengthAndDistance { focalLength = 16, interpTime = TppUI.FADE_SPEED.FADE_HIGHSPEED } end
  559.  
  560. function e.PrepareStartGameOverCamera() FadeFunction.ResetFadeColor() local e = {} for a, t in pairs(TppDefine.GAME_STATUS_TYPE_ALL) do
  561.     e[a] = false
  562. end
  563.     for a, t in pairs(TppDefine.UI_STATUS_TYPE_ALL) do
  564.         e[a] = false
  565.     end
  566.     e.S_DISABLE_NPC = nil
  567.     e.AnnounceLog = nil
  568.     TppUI.FadeIn(TppUI.FADE_SPEED.FADE_HIGHESTSPEED, mvars.ply_gameOverCameraFadeInName, TppUI.FADE_PRIORITY.DEMO, { exceptGameStatus = e }) Player.RequestToStopCameraAnimation {} if mvars.ply_gameOverCameraAnnounceLog then
  569.         TppUiStatusManager.ClearStatus "AnnounceLog" TppUI.ShowAnnounceLog(mvars.ply_gameOverCameraAnnounceLog)
  570.     end
  571. end
  572.  
  573. function e.SetTargetDeadCamera(t) local o
  574.     local a
  575.     local l
  576.     if n(t) then
  577.         o = t.gameObjectName or "" a = t.gameObjectId
  578.         l = t.announceLog or "target_extract_failed"
  579.     end
  580.     a = a or s(o) if a == r then
  581.         return
  582.     end
  583.     e.StartGameOverCamera(a, "EndFadeOut_StartTargetDeadCamera", l, "EndFadeIn_StartTargetDeadCamera")
  584. end
  585.  
  586. function e._SetTargetDeadCamera() e.PrepareStartGameOverCamera() Player.RequestToPlayCameraNonAnimation { characterId = mvars.ply_gameOverCameraGameObjectId, isFollowPos = false, isFollowRot = true, followTime = 7, followDelayTime = .1, candidateRots = { { 10, 0 }, { 10, 45 }, { 10, 90 }, { 10, 135 }, { 10, 180 }, { 10, 225 }, { 10, 270 } }, skeletonNames = { "SKL_004_HEAD", "SKL_011_LUARM", "SKL_021_RUARM", "SKL_032_LFOOT", "SKL_042_RFOOT" }, skeletonCenterOffsets = { Vector3(0, 0, 0), Vector3(0, 0, 0), Vector3(0, 0, 0), Vector3(0, 0, 0), Vector3(0, 0, 0) }, skeletonBoundings = { Vector3(0, .45, 0), Vector3(0, 0, 0), Vector3(0, 0, 0), Vector3(0, -.3, 0), Vector3(0, -.3, 0) }, offsetPos = Vector3(.3, .2, -4.6), focalLength = 21, aperture = 1.875, timeToSleep = 10, fitOnCamera = true, timeToStartToFitCamera = .001, fitCameraInterpTime = .24, diffFocalLengthToReFitCamera = 16 } end
  587.  
  588. function e.ReserveTargetDeadCameraGameObjectId(e) mvars.ply_reserveDeadTargetGameObjectId = e
  589. end
  590.  
  591. function e.SetTargetDeadCameraIfReserved() if mvars.ply_reserveDeadTargetGameObjectId then
  592.     e.SetTargetDeadCamera { gameObjectId = mvars.ply_reserveDeadTargetGameObjectId } return true
  593. end
  594. end
  595.  
  596. function e.SetDefenseTargetBrokenCamera(a) local t
  597.     if not n(a) then
  598.         return
  599.     end
  600.     if not a.gimmickPosition then
  601.         return
  602.     end
  603.     if not a.cameraRotation then
  604.         return
  605.     end
  606.     if not a.cameraDistance then
  607.         return
  608.     end
  609.     if a.announceLog then
  610.         t = a.announceLog
  611.     end
  612.     mvars.ply_gameOverCameraGimmickInfo = a
  613.     e.StartGameOverCamera(r, "EndFadeOut_StartDefenseTargetBrokenCamera", t)
  614. end
  615.  
  616. function e._SetDefenseTargetBrokenCamera() if not mvars.ply_gameOverCameraGimmickInfo then
  617.     return
  618. end
  619.     local a = mvars.ply_gameOverCameraGimmickInfo.gimmickPosition
  620.     local t = mvars.ply_gameOverCameraGimmickInfo.cameraRotation
  621.     local n = mvars.ply_gameOverCameraGimmickInfo.cameraDistance
  622.     e.PrepareStartGameOverCamera() local e = a + Vector3(0, 1.7, 0) local a = e + t:Rotate(Vector3(.064699664, .107832773, -.992061513) * n) Player.RequestToPlayCameraNonAnimation { isFollowPos = false, isFollowRot = true, followTime = 7, followDelayTime = .1, positionAndTargetMode = true, position = a, target = e, isCollisionCheck = false, focalLength = 18, aperture = 1.875, timeToSleep = 10, fitOnCamera = true, timeToStartToFitCamera = .001, fitCameraInterpTime = .24, diffFocalLengthToReFitCamera = 16 }
  623. end
  624.  
  625. local a = { [Fox.StrCode32 "com_ai001_gim_n0000|srt_aip0_main0_def"] = 4.2, [Fox.StrCode32 "com_ai002_gim_n0000|srt_pup0_main0_ssd_v00"] = 4.2, [Fox.StrCode32 "com_ai003_gim_n0000|srt_ssde_swtc001"] = 3.6, [Fox.StrCode32 "whm0_gim_n0000|srt_whm0_main0_def_v00"] = 8.5, [Fox.StrCode32 "com_portal001_gim_n0000|srt_ftp0_main0_def_v00"] = 8 } local c = { [Fox.StrCode32 "whm0_gim_n0000|srt_whm0_main0_def_v00"] = { foxmath.DegreeToRadian(300) }, [Fox.StrCode32 "com_portal001_gim_n0000|srt_ftp0_main0_def_v00"] = { foxmath.DegreeToRadian(210), [Gimmick.GetDataSetCode "/Assets/ssd/level/location/afgh/block_extraLarge/south/afgh_south_gimmick.fox2"] = foxmath.DegreeToRadian(45) }, [Fox.StrCode32 "com_ai003_gim_n0000|srt_ssde_swtc001"] = { foxmath.DegreeToRadian(215) } } local l = { [Fox.StrCode32 "whm0_gim_n0000|srt_whm0_main0_def_v00"] = Vector3(0, 2, 0), [Fox.StrCode32 "com_portal001_gim_n0000|srt_ftp0_main0_def_v00"] = Vector3(0, 10, 0) } function e.GetDefenseTargetBrokenCameraInfo(r, o, e, t) local n = 4.2
  626.     if e and a[e] then
  627.         n = a[e]
  628.     end
  629.     local a = foxmath.DegreeToRadian(150) if c[e] then
  630.         local e = c[e] if e[t] then
  631.         a = e[t] else
  632.         a = e[1]
  633.     end
  634.         if not a then
  635.             return
  636.         end
  637.     end
  638.     local t = o * Quat.RotationY(a) local a = Vector3(0, 1, 0) if l[e] then
  639.         a = l[e]
  640.     end
  641.     local e = r - a
  642.     local e = { gimmickPosition = e, cameraRotation = t, cameraDistance = n } return e
  643. end
  644.  
  645. function e.ReserveDefenseTargetBrokenCamera(e) local a
  646.     if not n(e) then
  647.         return
  648.     end
  649.     if not e.gimmickPosition then
  650.         return
  651.     end
  652.     if not e.cameraRotation then
  653.         return
  654.     end
  655.     if not e.cameraDistance then
  656.         return
  657.     end
  658.     if e.announceLog then
  659.         a = e.announceLog
  660.     end
  661.     mvars.ply_reserveGameOverCameraGimmickInfo = e
  662. end
  663.  
  664. function e.SetDefenseTargetBrokenCameraIfReserved() if mvars.ply_reserveGameOverCameraGimmickInfo then
  665.     e.SetDefenseTargetBrokenCamera(mvars.ply_reserveGameOverCameraGimmickInfo) return true
  666. end
  667. end
  668.  
  669. function e.SetPressStartCamera() local e = s "Player" if e == r then
  670.     return
  671. end
  672.     Player.RequestToStopCameraAnimation {} Player.RequestToPlayCameraNonAnimation { characterId = e, isFollowPos = true, isFollowRot = true, followTime = 0, followDelayTime = 0, candidateRots = { { 0, 185 } }, skeletonNames = { "SKL_004_HEAD" }, skeletonCenterOffsets = { Vector3(-.5, -.15, 0) }, skeletonBoundings = { Vector3(.5, .45, .1) }, offsetPos = Vector3(-.8, 0, -1.4), focalLength = 21, aperture = 1.875, timeToSleep = 0, fitOnCamera = false, timeToStartToFitCamera = 0, fitCameraInterpTime = 0, diffFocalLengthToReFitCamera = 0 }
  673. end
  674.  
  675. function e.SetTitleCamera() local e = s "Player" if e == r then
  676.     return
  677. end
  678.     Player.RequestToStopCameraAnimation {} Player.RequestToPlayCameraNonAnimation { characterId = e, isFollowPos = true, isFollowRot = true, followTime = 0, followDelayTime = 0, candidateRots = { { 0, 185 } }, skeletonNames = { "SKL_004_HEAD" }, skeletonCenterOffsets = { Vector3(-.5, -.15, .1) }, skeletonBoundings = { Vector3(.5, .45, .9) }, offsetPos = Vector3(-.8, 0, -1.8), focalLength = 21, aperture = 1.875, timeToSleep = 0, fitOnCamera = false, timeToStartToFitCamera = 0, fitCameraInterpTime = 0, diffFocalLengthToReFitCamera = 0 }
  679. end
  680.  
  681. function e.SetSearchTarget(i, l, s, n, e, t, o, a) if (i == nil or l == nil) then
  682.     return
  683. end
  684.     local l = T(l) if l == r then
  685.         return
  686.     end
  687.     if o == nil then
  688.         o = true
  689.     end
  690.     if e == nil then
  691.         e = Vector3(0, .25, 0)
  692.     end
  693.     if a == nil then
  694.         a = .03
  695.     end
  696.     local e = { name = s, targetGameObjectTypeIndex = l, targetGameObjectName = i, offset = e, centerRange = .3, lookingTime = 1, distance = 200, doWideCheck = true, wideCheckRadius = .15, wideCheckRange = a, doDirectionCheck = false, directionCheckRange = 100, doCollisionCheck = true } if (n ~= nil) then
  697.         e.skeletonName = n
  698.     end
  699.     if (t ~= nil) then
  700.         e.targetFox2Name = t
  701.     end
  702.     Player.AddSearchTarget(e)
  703. end
  704.  
  705. function e.IsSneakPlayerInFOB(e) if e == 0 then
  706.     return true
  707. else
  708.     return false
  709. end
  710. end
  711.  
  712. function e.PlayMissionClearCamera() local e = e.SetPlayerStatusForMissionEndCamera() if not e then
  713.     return
  714. end
  715.     o("Timer_StartPlayMissionClearCameraStep1", .25)
  716. end
  717.  
  718. function e.SetPlayerStatusForMissionEndCamera() Player.SetPadMask { settingName = "MissionClearCamera", except = true } vars.playerDisableActionFlag = PlayerDisableAction.SUBJECTIVE_CAMERA
  719.     return true
  720. end
  721.  
  722. function e.ResetMissionEndCamera() Player.ResetPadMask { settingName = "MissionClearCamera" } Player.RequestToStopCameraAnimation {} end
  723.  
  724. function e.PlayCommonMissionEndCamera(r, s, i, l, t, n) local a
  725.     local e = vars.playerVehicleGameObjectId
  726.     if Tpp.IsHorse(e) then
  727.         GameObject.SendCommand(e, { id = "HorseForceStop" }) a = r(e, t, n) elseif Tpp.IsVehicle(e) then
  728.         local r = GameObject.SendCommand(e, { id = "GetVehicleType" }) GameObject.SendCommand(e, { id = "ForceStop", enabled = true }) local r = s[r] if r then
  729.         a = r(e, t, n)
  730.     end
  731.     elseif (Tpp.IsPlayerWalkerGear(e) or Tpp.IsEnemyWalkerGear(e)) then
  732.         GameObject.SendCommand(e, { id = "ForceStop", enabled = true }) a = i(e, t, n) elseif Tpp.IsHelicopter(e) then
  733.     else
  734.         a = l(t, n)
  735.     end
  736.     if a then
  737.         local e = "Timer_StartPlayMissionClearCameraStep" .. tostring(t + 1) o(e, a)
  738.     end
  739. end
  740.  
  741. function e._PlayMissionClearCamera(a, t) if a == 1 then
  742.     TppMusicManager.PostJingleEvent("SingleShot", "Play_bgm_common_jingle_clear")
  743. end
  744.     e.PlayCommonMissionEndCamera(e.PlayMissionClearCameraOnRideHorse, e.VEHICLE_MISSION_CLEAR_CAMERA, e.PlayMissionClearCameraOnWalkerGear, e.PlayMissionClearCameraOnFoot, a, t)
  745. end
  746.  
  747. function e.RequestMissionClearMotion() Player.RequestToPlayDirectMotion { "missionClearMotion", { "/Assets/ssd/motion/SI_game/fani/bodies/snap/snapnon/snapnon_f_idl7.gani", false, "", "", "", false } } end
  748.  
  749. function e.PlayMissionClearCameraOnFoot(p, c) if PlayerInfo.AndCheckStatus { PlayerStatus.NORMAL_ACTION } then
  750.     if PlayerInfo.OrCheckStatus { PlayerStatus.STAND, PlayerStatus.SQUAT } then
  751.         if PlayerInfo.AndCheckStatus { PlayerStatus.CARRY } then
  752.             mvars.ply_requestedMissionClearCameraCarryOff = true
  753.             GameObject.SendCommand({ type = "TppPlayer2", index = PlayerInfo.GetLocalPlayerIndex() }, { id = "RequestCarryOff" }) else
  754.             e.RequestMissionClearMotion()
  755.         end
  756.     end
  757. end
  758.     local n = { "SKL_004_HEAD", "SKL_002_CHEST" } local r = { Vector3(0, 0, .05), Vector3(.15, 0, 0) } local t = { Vector3(.1, .125, .1), Vector3(.15, .1, .05) } local e = Vector3(0, 0, -4.5) local a = .3
  759.     local l
  760.     local o = false
  761.     local i = 20
  762.     local s = false
  763.     if p == 1 then
  764.         n = { "SKL_004_HEAD", "SKL_002_CHEST" } r = { Vector3(0, 0, .05), Vector3(.15, 0, 0) } t = { Vector3(.1, .125, .1), Vector3(.15, .1, .05) } e = Vector3(0, 0, -1.5) a = .3
  765.         l = 1
  766.         o = true
  767.     elseif c then
  768.         n = { "SKL_004_HEAD" } r = { Vector3(0, 0, .05) } t = { Vector3(.1, .125, .1) } e = Vector3(0, -.5, -3.5) a = 3
  769.         i = 4
  770.     else
  771.         n = { "SKL_004_HEAD", "SKL_031_LLEG", "SKL_041_RLEG" } r = { Vector3(0, 0, .05), Vector3(.15, 0, 0), Vector3(-.15, 0, 0) } t = { Vector3(.1, .125, .1), Vector3(.15, .1, .05), Vector3(.15, .1, .05) } e = Vector3(0, 0, -3.2) a = 3
  772.         s = true
  773.     end
  774.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 4, followDelayTime = .1, candidateRots = { { 1, 168 }, { 1, -164 } }, skeletonNames = n, skeletonCenterOffsets = r, skeletonBoundings = t, offsetPos = e, focalLength = 28, aperture = 1.875, timeToSleep = i, interpTimeAtStart = a, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = o, useLastSelectedIndex = s } return l
  775. end
  776.  
  777. function e.PlayMissionClearCameraOnRideHorse(e, c, p) local r = { "SKL_004_HEAD", "SKL_002_CHEST" } local n = { Vector3(0, 0, .05), Vector3(.15, 0, 0) } local a = { Vector3(.1, .125, .1), Vector3(.15, .1, .05) } local t = Vector3(0, 0, -3.2) local e = .2
  778.     local i
  779.     local s = false
  780.     local l = 20
  781.     local o = false
  782.     if p then
  783.         l = 4
  784.     end
  785.     if c == 1 then
  786.         r = { "SKL_004_HEAD", "SKL_002_CHEST" } n = { Vector3(0, -.125, .05), Vector3(.15, -.125, 0) } a = { Vector3(.1, .125, .1), Vector3(.15, .1, .05) } t = Vector3(0, 0, -3.2) e = .2
  787.         i = 1
  788.         s = true
  789.     else
  790.         r = { "SKL_004_HEAD", "SKL_031_LLEG", "SKL_041_RLEG" } n = { Vector3(0, -.125, .05), Vector3(.15, -.125, 0), Vector3(-.15, -.125, 0) } a = { Vector3(.1, .125, .1), Vector3(.15, .1, .05), Vector3(.15, .1, .05) } t = Vector3(0, 0, -4.5) e = 3
  791.         o = true
  792.     end
  793.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 4, followDelayTime = .1, candidateRots = { { 0, 160 }, { 0, -160 } }, skeletonNames = r, skeletonCenterOffsets = { Vector3(0, -.125, .05), Vector3(.15, -.125, 0), Vector3(-.15, -.125, 0) }, skeletonBoundings = { Vector3(.1, .125, .1), Vector3(.15, .1, .05), Vector3(.15, .1, .05) }, skeletonCenterOffsets = n, skeletonBoundings = a, offsetPos = t, focalLength = 28, aperture = 1.875, timeToSleep = l, interpTimeAtStart = e, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = s, useLastSelectedIndex = o } return i
  794. end
  795.  
  796. function e.PlayMissionClearCameraOnRideLightVehicle(e, i, s) local e = Vector3(-.35, .6, .7) local a = Vector3(0, 0, -2.25) local t = .2
  797.     local r
  798.     local n = false
  799.     local o = 20
  800.     local l = false
  801.     if s then
  802.         o = 4
  803.     end
  804.     if i == 1 then
  805.         e = Vector3(-.35, .6, .7) a = Vector3(0, 0, -2.25) t = .2
  806.         r = .5
  807.         n = true
  808.     else
  809.         e = Vector3(-.35, .4, .7) a = Vector3(0, 0, -4) t = .75
  810.         l = true
  811.     end
  812.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 5, followDelayTime = 0, candidateRots = { { 3, 160 }, { 3, -160 } }, offsetTarget = e, offsetPos = a, focalLength = 28, aperture = 1.875, timeToSleep = o, interpTimeAtStart = t, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = n, useLastSelectedIndex = l } return r
  813. end
  814.  
  815. function e.PlayMissionClearCameraOnRideTruck(e, i, s) local t = Vector3(-.35, 1.3, 1) local a = Vector3(0, 0, -2) local e = .2
  816.     local n
  817.     local o = false
  818.     local l = 20
  819.     local r = false
  820.     if s then
  821.         l = 4
  822.     end
  823.     if i == 1 then
  824.         t = Vector3(-.35, 1.3, 1) a = Vector3(0, 0, -3) e = .2
  825.         n = .5
  826.         o = true
  827.     else
  828.         t = Vector3(-.35, 1, 1) a = Vector3(0, 0, -6) e = .75
  829.         r = true
  830.     end
  831.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 5, followDelayTime = 0, candidateRots = { { 3, 160 }, { 3, -160 } }, offsetTarget = t, offsetPos = a, focalLength = 28, aperture = 1.875, timeToSleep = l, interpTimeAtStart = e, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = o, useLastSelectedIndex = r } return n
  832. end
  833.  
  834. function e.PlayMissionClearCameraOnRideCommonArmoredVehicle(a, s, e, i) local a = Vector3(.05, -.5, -2.2) if e == 1 then
  835.     a = Vector3(.05, -.5, -2.2) else
  836.     a = Vector3(-.05, -1, 0)
  837. end
  838.     local t = Vector3(0, 0, -7.5) local e = .2
  839.     local n
  840.     local r = false
  841.     local o = 20
  842.     local l = false
  843.     if i then
  844.         o = 4
  845.     end
  846.     if s == 1 then
  847.         t = Vector3(0, 0, -7.5) e = .2
  848.         n = .5
  849.         r = true
  850.     else
  851.         t = Vector3(0, 0, -13.25) e = .75
  852.         l = true
  853.     end
  854.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 5, followDelayTime = 0, candidateRots = { { 8, 165 }, { 8, -165 } }, offsetTarget = a, offsetPos = t, focalLength = 28, aperture = 1.875, timeToSleep = o, interpTimeAtStart = e, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = r, useLastSelectedIndex = l } return n
  855. end
  856.  
  857. function e.PlayMissionClearCameraOnRideEasternArmoredVehicle(r, n, t) local a
  858.     a = e.PlayMissionClearCameraOnRideCommonArmoredVehicle(r, n, 1, t) return a
  859. end
  860.  
  861. function e.PlayMissionClearCameraOnRideWesternArmoredVehicle(t, n) local a
  862.     a = e.PlayMissionClearCameraOnRideCommonArmoredVehicle(t, n, 2, isQuest) return a
  863. end
  864.  
  865. function e.PlayMissionClearCameraOnRideTank(e, l, i) local a = Vector3(0, 0, -6.5) local e = .2
  866.     local o
  867.     local r = false
  868.     local n = 20
  869.     local t = false
  870.     if i then
  871.         n = 4
  872.     end
  873.     if l == 1 then
  874.         a = Vector3(0, 0, -6.5) e = .2
  875.         o = .5
  876.         r = true
  877.     else
  878.         a = Vector3(0, 0, -9) e = .75
  879.         t = true
  880.     end
  881.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 5, followDelayTime = 0, candidateRots = { { 9, 165 }, { 9, -165 } }, offsetTarget = Vector3(0, -.85, 3.25), offsetPos = a, focalLength = 28, aperture = 1.875, timeToSleep = n, interpTimeAtStart = e, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = r, useLastSelectedIndex = t } return o
  882. end
  883.  
  884. function e.PlayMissionClearCameraOnWalkerGear(a, s, p) local t = Vector3(0, .55, .35) local n = Vector3(0, 0, -3.65) local a = .2
  885.     local r
  886.     local l = false
  887.     local o = 20
  888.     local i = false
  889.     if p then
  890.         o = 4
  891.     end
  892.     if s == 1 then
  893.         t = Vector3(0, .55, .35) n = Vector3(0, 0, -3.65) a = .2
  894.         r = 1
  895.         l = true
  896.     else
  897.         t = Vector3(0, .4, .35) n = Vector3(0, 0, -4.95) a = 3
  898.         i = true
  899.     end
  900.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 3, followDelayTime = .1, candidateRots = { { 7, 165 }, { 7, -165 } }, offsetTarget = t, offsetPos = n, focalLength = 28, aperture = 1.875, timeToSleep = o, interpTimeAtStart = a, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16, callSeOfCameraInterp = l, useLastSelectedIndex = i } return r
  901. end
  902.  
  903. e.VEHICLE_MISSION_CLEAR_CAMERA = { [Vehicle.type.EASTERN_LIGHT_VEHICLE] = e.PlayMissionClearCameraOnRideLightVehicle, [Vehicle.type.EASTERN_TRACKED_TANK] = e.PlayMissionClearCameraOnRideTank, [Vehicle.type.EASTERN_TRUCK] = e.PlayMissionClearCameraOnRideTruck, [Vehicle.type.EASTERN_WHEELED_ARMORED_VEHICLE] = e.PlayMissionClearCameraOnRideEasternArmoredVehicle, [Vehicle.type.WESTERN_LIGHT_VEHICLE] = e.PlayMissionClearCameraOnRideLightVehicle, [Vehicle.type.WESTERN_TRACKED_TANK] = e.PlayMissionClearCameraOnRideTank, [Vehicle.type.WESTERN_TRUCK] = e.PlayMissionClearCameraOnRideTruck, [Vehicle.type.WESTERN_WHEELED_ARMORED_VEHICLE] = e.PlayMissionClearCameraOnRideWesternArmoredVehicle } function e.PlayMissionAbortCamera() local e = e.SetPlayerStatusForMissionEndCamera() if not e then
  904.     return
  905. end
  906.     o("Timer_StartPlayMissionAbortCamera", .25)
  907. end
  908.  
  909. function e._PlayMissionAbortCamera() TppMusicManager.PostJingleEvent("SingleShot", "Play_bgm_common_jingle_failed") e.PlayCommonMissionEndCamera(e.PlayMissionAbortCameraOnRideHorse, e.VEHICLE_MISSION_ABORT_CAMERA, e.PlayMissionAbortCameraOnWalkerGear, e.PlayMissionAbortCameraOnFoot) end
  910.  
  911. function e.PlayMissionAbortCameraOnFoot() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 4, followDelayTime = .1, candidateRots = { { 6, 10 }, { 6, -10 } }, skeletonNames = { "SKL_004_HEAD", "SKL_031_LLEG", "SKL_041_RLEG" }, skeletonCenterOffsets = { Vector3(0, .2, 0), Vector3(-.15, 0, 0), Vector3(-.15, 0, 0) }, skeletonBoundings = { Vector3(.1, .125, .1), Vector3(.15, .1, .05), Vector3(.15, .1, .05) }, offsetPos = Vector3(0, 0, -3), focalLength = 28, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 } end
  912.  
  913. function e.PlayMissionAbortCameraOnRideHorse(e) Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 4, followDelayTime = .1, candidateRots = { { 6, 20 }, { 6, -20 } }, skeletonNames = { "SKL_004_HEAD", "SKL_031_LLEG", "SKL_041_RLEG" }, skeletonCenterOffsets = { Vector3(0, .2, 0), Vector3(-.15, 0, 0), Vector3(-.15, 0, 0) }, skeletonBoundings = { Vector3(.1, .125, .1), Vector3(.15, .1, .05), Vector3(.15, .1, .05) }, offsetPos = Vector3(0, 0, -3), focalLength = 28, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 } end
  914.  
  915. function e.PlayMissionAbortCameraOnRideLightVehicle(e) Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 3, followDelayTime = .1, candidateRots = { { 10, 30 }, { 10, -30 } }, offsetTarget = Vector3(-.35, .3, 0), offsetPos = Vector3(0, 0, -4), focalLength = 28, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 } end
  916.  
  917. function e.PlayMissionAbortCameraOnRideTruck(e) Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 3, followDelayTime = .1, candidateRots = { { 8, 75 }, { 8, -55 } }, offsetTarget = Vector3(-.35, 1, 1), offsetPos = Vector3(0, 0, -5), focalLength = 35, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 } end
  918.  
  919. function e.PlayMissionAbortCameraOnRideCommonArmoredVehicle(e, a) local e = Vector3(.05, -.5, -2.2) if a == 1 then
  920.     e = Vector3(.05, -.5, -2.2) else
  921.     e = Vector3(-.65, -1, 0)
  922. end
  923.     Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 3, followDelayTime = .1, candidateRots = { { 8, 30 }, { 8, -30 } }, offsetTarget = e, offsetPos = Vector3(0, 0, -9), focalLength = 35, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 }
  924. end
  925.  
  926. function e.PlayMissionAbortCameraOnRideEasternArmoredVehicle(a) e.PlayMissionAbortCameraOnRideCommonArmoredVehicle(a, 1) end
  927.  
  928. function e.PlayMissionAbortCameraOnRideWesternArmoredVehicle(a) e.PlayMissionAbortCameraOnRideCommonArmoredVehicle(a, 2) end
  929.  
  930. function e.PlayMissionAbortCameraOnRideTank(e) local e = Vector3(0, -.5, 0) Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 3, followDelayTime = .1, candidateRots = { { 8, 25 }, { 8, -25 } }, offsetTarget = e, offsetPos = Vector3(0, 0, -10), focalLength = 35, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 } end
  931.  
  932. function e.PlayMissionAbortCameraOnWalkerGear(a) Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", 0), isFollowPos = true, isFollowRot = true, followTime = 3, followDelayTime = .1, candidateRots = { { 7, 15 }, { 7, -15 } }, offsetTarget = Vector3(0, .8, 0), offsetPos = Vector3(0, .5, -3.5), focalLength = 35, aperture = 1.875, timeToSleep = 20, interpTimeAtStart = .5, fitOnCamera = false, timeToStartToFitCamera = 1, fitCameraInterpTime = .3, diffFocalLengthToReFitCamera = 16 } end
  933.  
  934. e.VEHICLE_MISSION_ABORT_CAMERA = { [Vehicle.type.EASTERN_LIGHT_VEHICLE] = e.PlayMissionAbortCameraOnRideLightVehicle, [Vehicle.type.EASTERN_TRACKED_TANK] = e.PlayMissionAbortCameraOnRideTank, [Vehicle.type.EASTERN_TRUCK] = e.PlayMissionAbortCameraOnRideTruck, [Vehicle.type.EASTERN_WHEELED_ARMORED_VEHICLE] = e.PlayMissionAbortCameraOnRideEasternArmoredVehicle, [Vehicle.type.WESTERN_LIGHT_VEHICLE] = e.PlayMissionAbortCameraOnRideLightVehicle, [Vehicle.type.WESTERN_TRACKED_TANK] = e.PlayMissionAbortCameraOnRideTank, [Vehicle.type.WESTERN_TRUCK] = e.PlayMissionAbortCameraOnRideTruck, [Vehicle.type.WESTERN_WHEELED_ARMORED_VEHICLE] = e.PlayMissionAbortCameraOnRideWesternArmoredVehicle } function e.PlayFallDeadCamera(a) mvars.ply_fallDeadCameraTimeToSleep = 20
  935.     if a and Tpp.IsTypeNumber(a.timeToSleep) then
  936.         mvars.ply_fallDeadCameraTimeToSleep = a.timeToSleep
  937.     end
  938.     mvars.ply_fallDeadCameraTargetPlayerIndex = PlayerInfo.GetLocalPlayerIndex() HighSpeedCamera.RequestEvent { continueTime = .03, worldTimeRate = .1, localPlayerTimeRate = .1 } e.PlayCommonMissionEndCamera(e.PlayFallDeadCameraOnRideHorse, e.VEHICLE_FALL_DEAD_CAMERA, e.PlayFallDeadCameraOnWalkerGear, e.PlayFallDeadCameraOnFoot)
  939. end
  940.  
  941. function e.SetLimitFallDeadCameraOffsetPosY(e) mvars.ply_fallDeadCameraPosYLimit = e
  942. end
  943.  
  944. function e.ResetLimitFallDeadCameraOffsetPosY() mvars.ply_fallDeadCameraPosYLimit = nil
  945. end
  946.  
  947. function e.GetFallDeadCameraOffsetPosY() local a = vars.playerPosY
  948.     local e = .5
  949.     if mvars.ply_fallDeadCameraPosYLimit then
  950.         local t = a + e
  951.         if t < mvars.ply_fallDeadCameraPosYLimit then
  952.             e = mvars.ply_fallDeadCameraPosYLimit - a
  953.         end
  954.     end
  955.     return e
  956. end
  957.  
  958. function e.PlayFallDeadCameraOnFoot() local e = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-2.5, (e + 1), -2.5), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  959.  
  960. function e.PlayFallDeadCameraOnRideHorse(a) local e = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-2.5, (e + 1), -2.5), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  961.  
  962. function e.PlayFallDeadCameraOnRideLightVehicle(a) local e = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-4, (e + 1), -8), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  963.  
  964. function e.PlayFallDeadCameraOnRideTruck(a) local e = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-4, (e + 1), -8), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  965.  
  966. function e.PlayFallDeadCameraOnRideArmoredVehicle(a) local e = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-4, (e + 1), -8), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  967.  
  968. function e.PlayFallDeadCameraOnRideTank(a) local e = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-4, (e + 1), -8), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  969.  
  970. function e.PlayFallDeadCameraOnWalkerGear(a) local a = e.GetFallDeadCameraOffsetPosY() Player.RequestToPlayCameraNonAnimation { characterId = GameObject.GetGameObjectIdByIndex("TppPlayer2", mvars.ply_fallDeadCameraTargetPlayerIndex), isFollowPos = false, isFollowRot = true, followTime = .8, followDelayTime = 0, candidateRots = { { -60, -25 }, { -60, 25 }, { -60, -115 }, { -60, 115 }, { 5, -25 }, { 5, 25 }, { 5, -115 }, { 5, 115 } }, offsetTarget = Vector3(0, 0, 0), offsetPos = Vector3(-4, (a + 1), -8), focalLength = 21, aperture = 1.875, timeToSleep = mvars.ply_fallDeadCameraTimeToSleep, interpTimeAtStart = 0, fitOnCamera = false } end
  971.  
  972. e.VEHICLE_FALL_DEAD_CAMERA = { [Vehicle.type.EASTERN_LIGHT_VEHICLE] = e.PlayFallDeadCameraOnRideLightVehicle, [Vehicle.type.EASTERN_TRACKED_TANK] = e.PlayFallDeadCameraOnRideTank, [Vehicle.type.EASTERN_TRUCK] = e.PlayFallDeadCameraOnRideTruck, [Vehicle.type.EASTERN_WHEELED_ARMORED_VEHICLE] = e.PlayFallDeadCameraOnRideArmoredVehicle, [Vehicle.type.WESTERN_LIGHT_VEHICLE] = e.PlayFallDeadCameraOnRideLightVehicle, [Vehicle.type.WESTERN_TRACKED_TANK] = e.PlayFallDeadCameraOnRideTank, [Vehicle.type.WESTERN_TRUCK] = e.PlayFallDeadCameraOnRideTruck, [Vehicle.type.WESTERN_WHEELED_ARMORED_VEHICLE] = e.PlayFallDeadCameraOnRideArmoredVehicle } if DebugMenu then
  973.     local o = { OneHandSwing = true, TwoHandSwing = true } local r = { OneHandSwing = 1, TwoHandSwing = 1, TwoHandHeavy = 1, Thrust = 1, Bow = 1, Arrow = 100, Gun = 1, Item = 4 } local a = { id = "PRD_*", tryEquip = true } function e.DEBUG_ProductAndEquipWithTable(e) local t = false
  974.     for e, n in pairs(e) do
  975.         a.id = n
  976.         a.count = r[e] or 1
  977.         if e == "Item" then
  978.             a.toInventory = true
  979.         else
  980.             a.toInventory = nil
  981.         end
  982.         if o[e] then
  983.             if t then
  984.                 a.tryEquip = nil
  985.                 a.tryEquip2 = true
  986.             else
  987.                 a.tryEquip = true
  988.                 a.tryEquip2 = nil
  989.             end
  990.             t = not t
  991.         else
  992.             a.tryEquip = true
  993.             a.tryEquip2 = nil
  994.         end
  995.         SsdSbm.AddProduction(a)
  996.     end
  997. end
  998.  
  999.     function e.DEBUG_GetSkills(e) for a, e in pairs(e) do
  1000.         if Tpp.IsTypeTable(e) then
  1001.             SsdSbm.SetSkillLevel(e)
  1002.         end
  1003.     end
  1004.     end
  1005.  
  1006.     local a = { id = "RES_*", count = 1 } function e.DEBUG_GetResource(e) for t, e in pairs(e) do
  1007.     a.id = t
  1008.     a.count = e
  1009.     SsdSbm.AddResource(a)
  1010. end
  1011. end
  1012. end
  1013. function e.Messages() local a = Tpp.StrCode32Table {
  1014.     GameObject = {
  1015.         {
  1016.             msg = "RevivePlayer",
  1017.             func = function() if TppMission.IsMultiPlayMission(vars.missionCode) then
  1018.                 e.Revive() else
  1019.                 local e = { S_DISABLE_THROWING = false, S_DISABLE_PLACEMENT = false } TppUI.FadeOut(TppUI.FADE_SPEED.FADE_NORMALSPEED, "StartRevivePlayer", TppUI.FADE_PRIORITY.SYSTEM, { exceptGameStatus = e })
  1020.             end
  1021.             end
  1022.         }
  1023.     },
  1024.     Player = {
  1025.         { msg = "CalcFultonPercent", func = function(a, n, t, r, o) e.MakeFultonRecoverSucceedRatio(a, n, t, r, o, false) end }, { msg = "CalcDogFultonPercent", func = function(o, r, t, n, a) e.MakeFultonRecoverSucceedRatio(o, r, t, n, a, true) end }, { msg = "PlayerFulton", func = e.OnPlayerFulton }, { msg = "OnPickUpCollection", func = e.OnPickUpCollection }, { msg = "OnPickUpPlaced", func = e.OnPickUpPlaced }, { msg = "WarpEnd", func = e.OnEndWarp, option = { isExecFastTravel = true } }, {
  1026.             msg = "EndCarryAction",
  1027.             func = function() if mvars.ply_requestedMissionClearCameraCarryOff then
  1028.                 if PlayerInfo.AndCheckStatus { PlayerStatus.STAND } then
  1029.                     e.RequestMissionClearMotion()
  1030.                 end
  1031.             end
  1032.             end,
  1033.             option = { isExecMissionClear = true }
  1034.         }, { msg = "IntelIconInDisplay", func = e.OnIntelIconDisplayContinue }, { msg = "QuestIconInDisplay", func = e.OnQuestIconDisplayContinue }, { msg = "PlayerShowerEnd", func = function() TppUI.ShowAnnounceLog "refresh" end }
  1035.     },
  1036.     UI = { { msg = "BedMenuSleepSelected", func = e.OnSelectSleepInBed }, { msg = "FastTravelMenuPointSelected", func = e.OnSelectFastTravelByMenu }, { msg = "EndFadeOut", sender = "OnSelectFastTravel", func = e.WarpByFastTravel, option = { isExecFastTravel = true } }, { msg = "EndFadeIn", sender = "OnEndWarpByFastTravel", func = e.OnEndFadeInWarpByFastTravel, option = { isExecFastTravel = true } }, { msg = "EndFadeOut", sender = "OnSelectSleepInBed", func = e.PassTimeBySleeping }, { msg = "EndFadeIn", sender = "OnEndSleepInBed", func = e.OnEndFadeInSleepInBed }, { msg = "EndFadeOut", sender = "EndFadeOut_StartTargetDeadCamera", func = e._SetTargetDeadCamera, option = { isExecGameOver = true } }, { msg = "EndFadeOut", sender = "EndFadeOut_StartDefenseTargetBrokenCamera", func = e._SetDefenseTargetBrokenCamera, option = { isExecGameOver = true } }, { msg = "EndFadeOut", sender = "StartRevivePlayer", func = function() e.Revive() end } },
  1037.     Timer = { { msg = "Finish", sender = "Timer_StartPlayMissionClearCameraStep1", func = function() e._PlayMissionClearCamera(1) end, option = { isExecMissionClear = true } }, { msg = "Finish", sender = "Timer_StartPlayMissionAbortCamera", func = e._PlayMissionAbortCamera, option = { isExecGameOver = true } }, { msg = "Finish", sender = "Timer_DeliveryWarpSoundCannotCancel", func = e.OnDeliveryWarpSoundCannotCancel, option = { isExecFastTravel = true } }, { msg = "Finish", sender = "Timer_StartGameOverCamera", func = e._StartGameOverCamera, option = { isExecGameOver = true } }, { msg = "Finish", sender = "Timer_SleepInBed", func = function() TppUI.FadeIn(TppUI.FADE_SPEED.FADE_NORMAL, "OnEndSleepInBed", TppUI.FADE_PRIORITY.MISSION) end } },
  1038.     Trap = { { msg = "Enter", sender = "fallDeath_camera", func = function() e.SetLimitFallDeadCameraOffsetPosY(-18) end, option = { isExecMissionPrepare = true } }, { msg = "Exit", sender = "fallDeath_camera", func = e.ResetLimitFallDeadCameraOffsetPosY, option = { isExecMissionPrepare = true } } }
  1039. } if n(mvars.ply_intelMarkerTrapList) and next(mvars.ply_intelMarkerTrapList) then
  1040.     a[t "Trap"] = a[t "Trap"] or {} table.insert(a[t "Trap"], Tpp.StrCode32Table { msg = "Enter", sender = mvars.ply_intelMarkerTrapList, func = e.OnEnterIntelMarkerTrap, option = { isExecMissionPrepare = true } })
  1041. end
  1042.     if n(mvars.ply_intelTrapList) and next(mvars.ply_intelTrapList) then
  1043.         a[t "Trap"] = a[t "Trap"] or {} table.insert(a[t "Trap"], Tpp.StrCode32Table { msg = "Enter", sender = mvars.ply_intelTrapList, func = e.OnEnterIntelTrap }) table.insert(a[t "Trap"], Tpp.StrCode32Table { msg = "Exit", sender = mvars.ply_intelTrapList, func = e.OnExitIntelTrap })
  1044.     end
  1045.     return a
  1046. end
  1047.  
  1048. function e.DeclareSVars() return { { name = "ply_pickableLocatorDisabled", arraySize = mvars.ply_maxPickableLocatorCount, type = TppScriptVars.TYPE_BOOL, value = false, save = false, sync = false, wait = false, category = TppScriptVars.CATEGORY_MISSION }, { name = "ply_placedLocatorDisabled", arraySize = mvars.ply_maxPlacedLocatorCount, type = TppScriptVars.TYPE_BOOL, value = false, save = false, sync = false, wait = false, category = TppScriptVars.CATEGORY_MISSION }, { name = "ply_isUsedPlayerInitialAction", type = TppScriptVars.TYPE_BOOL, value = false, save = false, sync = false, wait = false, category = TppScriptVars.CATEGORY_MISSION }, nil } end
  1049.  
  1050. function e.OnAllocate(e) if (e and e.sequence) and e.sequence.EQUIP_MISSION_BLOCK_GROUP_SIZE then
  1051.     mvars.ply_equipMissionBlockGroupSize = e.sequence.EQUIP_MISSION_BLOCK_GROUP_SIZE
  1052. else
  1053.     mvars.ply_equipMissionBlockGroupSize = TppDefine.DEFAULT_EQUIP_MISSION_BLOCK_GROUP_SIZE
  1054. end
  1055.     if (e and e.sequence) and e.sequence.MAX_PICKABLE_LOCATOR_COUNT then
  1056.         mvars.ply_maxPickableLocatorCount = e.sequence.MAX_PICKABLE_LOCATOR_COUNT
  1057.     else
  1058.         mvars.ply_maxPickableLocatorCount = TppDefine.PICKABLE_MAX
  1059.     end
  1060.     if (e and e.sequence) and e.sequence.MAX_PLACED_LOCATOR_COUNT then
  1061.         mvars.ply_maxPlacedLocatorCount = e.sequence.MAX_PLACED_LOCATOR_COUNT
  1062.     else
  1063.         mvars.ply_maxPlacedLocatorCount = TppDefine.PLACED_MAX
  1064.     end
  1065.     Mission.SetRevivalDisabled(false)
  1066. end
  1067.  
  1068. function e.SetInitialPlayerState(a) local t
  1069.     if (a.sequence and a.sequence.missionStartPosition) and a.sequence.missionStartPosition.helicopterRouteList then
  1070.         if not Tpp.IsTypeFunc(a.sequence.missionStartPosition.IsUseRoute) or a.sequence.missionStartPosition.IsUseRoute() then
  1071.             t = a.sequence.missionStartPosition.helicopterRouteList
  1072.         end
  1073.     end
  1074.     if t == nil then
  1075.         if gvars.ply_initialPlayerState == TppDefine.INITIAL_PLAYER_STATE.RIDEON_HELICOPTER then
  1076.         end
  1077.         e.SetStartStatus(TppDefine.INITIAL_PLAYER_STATE.ON_FOOT)
  1078.     end
  1079. end
  1080.  
  1081. function e.MissionStartPlayerTypeSetting() if not mvars.ply_isExistTempPlayerType then
  1082.     e.RestoreTemporaryPlayerType()
  1083. end
  1084.     if mvars.ply_isExistTempPlayerType then
  1085.         e.SaveCurrentPlayerType() e.ApplyTemporaryPlayerType()
  1086.     end
  1087. end
  1088.  
  1089. function e.Init(a) e.messageExecTable = Tpp.MakeMessageExecTable(e.Messages()) if gvars.ini_isTitleMode then
  1090.     vars.isInitialWeapon[TppDefine.WEAPONSLOT.PRIMARY_HIP] = 1
  1091.     vars.isInitialWeapon[TppDefine.WEAPONSLOT.PRIMARY_BACK] = 1
  1092.     vars.isInitialWeapon[TppDefine.WEAPONSLOT.SECONDARY] = 1
  1093. end
  1094.     if a.sequence and a.sequence.ALLWAYS_100_PERCENT_FULTON then
  1095.         mvars.ply_allways_100percent_fulton = true
  1096.     end
  1097.     if TppMission.IsMissionStart() then
  1098.         local e
  1099.         if a.sequence and a.sequence.INITIAL_HAND_EQUIP then
  1100.             e = a.sequence.INITIAL_HAND_EQUIP
  1101.         end
  1102.         if e then
  1103.         end
  1104.         local e
  1105.         if a.sequence and a.sequence.INITIAL_CAMERA_ROTATION then
  1106.             e = a.sequence.INITIAL_CAMERA_ROTATION
  1107.         end
  1108.         if e then
  1109.             vars.playerCameraRotation[0] = e[1] vars.playerCameraRotation[1] = e[2] mvars.ply_setInitialCameraRotation = true
  1110.         end
  1111.     end
  1112.     if a.sequence and a.sequence.INITIAL_INFINIT_OXYGEN then
  1113.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "infiniteOxygen", value = a.sequence.INITIAL_INFINIT_OXYGEN } else
  1114.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "infiniteOxygen", value = false }
  1115.     end
  1116.     if a.sequence and a.sequence.INITIAL_IGNORE_HUNGER then
  1117.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "ignoreHunger", value = a.sequence.INITIAL_IGNORE_HUNGER } else
  1118.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "ignoreHunger", value = false }
  1119.     end
  1120.     if a.sequence and a.sequence.INITIAL_IGNORE_THIRST then
  1121.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "ignoreThirst", value = a.sequence.INITIAL_IGNORE_THIRST } else
  1122.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "ignoreThirst", value = false }
  1123.     end
  1124.     if a.sequence and a.sequence.INITIAL_IGNORE_FATIGUE then
  1125.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "ignoreFatigue", value = a.sequence.INITIAL_IGNORE_THIRST } else
  1126.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "ignoreFatigue", value = false }
  1127.     end
  1128.     if a.sequence and a.sequence.INITIAL_INFINITE_STAMINA then
  1129.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "infiniteStamina", value = a.sequence.INITIAL_INFINITE_STAMINA } else
  1130.         ScriptParam.SetValue { category = ScriptParamCategory.PLAYER, paramName = "infiniteStamina", value = false }
  1131.     end
  1132.     Player.SetUseBlackDiamondEmblem(false) local e = 0
  1133.     if TppMission.IsMissionStart() then
  1134.         vars.currentItemIndex = e
  1135.     end
  1136.     if (gvars.ply_initialPlayerState == TppDefine.INITIAL_PLAYER_STATE.RIDEON_HELICOPTER) and (svars.ply_isUsedPlayerInitialAction == false) then
  1137.         local e = s("TppHeli2", "SupportHeli") if e ~= r then
  1138.         vars.initialPlayerAction = PlayerInitialAction.FROM_HELI_SPACE
  1139.         vars.initialPlayerPairGameObjectId = e
  1140.     end
  1141.     else
  1142.         if TppMission.IsMissionStart() then
  1143.             local e
  1144.             if a.sequence and a.sequence.MISSION_START_INITIAL_ACTION then
  1145.                 e = a.sequence.MISSION_START_INITIAL_ACTION
  1146.             end
  1147.             if e then
  1148.                 vars.initialPlayerAction = e
  1149.             end
  1150.         end
  1151.     end
  1152.     mvars.ply_locationStationTable = {} mvars.ply_stationLocatorList = {}
  1153. end
  1154.  
  1155. function e.OnReload() e.messageExecTable = Tpp.MakeMessageExecTable(e.Messages()) end
  1156.  
  1157. function e.OnMissionCanStart() if not Player.IsInstanceValid() then
  1158.     return
  1159. end
  1160.     if mvars.ply_setInitialCameraRotation then
  1161.         return
  1162.     end
  1163.     Player.RequestToSetCameraRotation { rotX = 10, rotY = vars.playerRotY, interpTime = 0 }
  1164. end
  1165.  
  1166. function e.OnMessage(r, n, o, i, l, t, a) Tpp.DoMessage(e.messageExecTable, TppMission.CheckMessageOption, r, n, o, i, l, t, a) end
  1167.  
  1168.  
  1169. local gameTicks = 0
  1170. local printTicks = 0
  1171. local pressTicks = 0
  1172. local selected = 1
  1173. local active = false
  1174.  
  1175. local PRESS_TICK_DELAY = 30 -- = 0.5 seconds
  1176. local PRINT_TICK_DELAY = 180 -- = 3.0 seconds
  1177. local mainMenu, debugMenu, itemMenu, tweakMenu, caseMenu
  1178. mainMenu = {
  1179.     { text = "==MAIN MENU==", action = function() this.Exit() end },
  1180.     { text = "1. Items", action = function() this.OpenMenu(itemMenu) end },
  1181.     { text = "2. Cases", action = function() this.OpenMenu(caseMenu) end },
  1182.     { text = "3. Tweak", action = function() this.OpenMenu(tweakMenu) end },
  1183.     { text = "4. Warp", action = function() this.OpenMenu(tweakMenu) end },
  1184.     { text = "99. Debug", action = function() this.OpenMenu(debugMenu) end },
  1185.     { text = "00. Exit Menu", action = function() this.Exit() end }
  1186. }
  1187.  
  1188. debugMenu = {
  1189.     { text = "1. My Position", action = function() TppUiCommand.AnnounceLogView("Location = " .. toString(TppPlayer.GetPosition())) end },
  1190.     { text = "2. Box Test", action = function() this.droptheBox() end },
  1191.     { text = "3. Playersnake", action = function() this.ForceChangePlayerToSnake(true) end },
  1192.     { text = "3. Playersnake 2", action = function() e.ForceChangePlayerToSnake(true) end },
  1193.     { text = "6. Back", action = function() this.OpenMenu(mainMenu) end }
  1194. }
  1195.  
  1196. itemMenu = {
  1197.     { text = "1. Veav Helper/DLC Items", action = function() this.veavHelper() end },
  1198.     { text = "2. Wormhole Portal", action = function() this.equipItem("PRD_EQP_SWP_WormholePortal") end },
  1199.     { text = "2.1 Wormhole Portal", action = function() this.addItem("PRD_EQP_SWP_WormholePortal") end },
  1200.     { text = "2.2 Wormhole Portal", action = function() this.addItemR("PRD_EQP_SWP_WormholePortal") end },
  1201.     { text = "3. Revival Pill", action = function() this.addItem("PRD_EXP_RevivalPill") end },
  1202.     { text = "4. Ration", action = function() this.addItem("PRD_FOD_Ration") end },
  1203.     { text = "5. Canteen", action = function() this.addItem("PRD_FOD_Canteen_Water_Pure") end },
  1204.     { text = "6. Back", action = function() this.OpenMenu(mainMenu) end }
  1205. }
  1206.  
  1207. caseMenu = {
  1208.     { text = "boss", action = function() this.droptheBox("boss") end },
  1209.     { text = "colJunk", action = function() this.droptheBox("colJunk") end },
  1210.     { text = "colStuff", action = function() this.droptheBox("colStuff") end },
  1211.     { text = "pkgStuff", action = function() this.droptheBox("pkgStuff") end },
  1212.     { text = "bpJunk", action = function() this.droptheBox("bpJunk") end },
  1213.     { text = "bpMaterial", action = function() this.droptheBox("bpMaterial") end },
  1214.     { text = "bpLegendary", action = function() this.droptheBox("bpLegendary") end },
  1215.     { text = "bpArmor", action = function() this.droptheBox("bpArmor") end },
  1216.     { text = "bpWeap", action = function() this.droptheBox("bpWeap") end },
  1217.     { text = "bpEvent", action = function() this.droptheBox("bpEvent") end },
  1218.     { text = "bpEnhance", action = function() this.droptheBox("bpEnhance") end },
  1219.     { text = "99. END", action = function() this.OpenMenu(mainMenu) end }
  1220. }
  1221. --Sub-Menu
  1222. tweakMenu = {
  1223.     { text = "1. Minimap", action = function() this.minimapToggle() end },
  1224.     { text = "2. Disable Robot", action = function() this.OpenMenu(mainMenu) end },
  1225.     { text = "3. InfiniteAmmo", action = function() this.cheatsAmmo() end },
  1226.     { text = "4. Disable Fog", action = function() this.toggleFog() end },
  1227.     { text = "5. Rainy Day", action = function() this.OpenMenu(mainMenu) end },
  1228.     { text = "6. Sunny Day", action = function() this.OpenMenu(mainMenu) end },
  1229.     { text = "7. Back", action = function() this.OpenMenu(mainMenu) end }
  1230. }
  1231.  
  1232. local call = false
  1233. local action = false
  1234. local subject = false
  1235. local reload = false
  1236. local stance = false
  1237. local decide = false
  1238. local zoom = false
  1239. local pweapon = false
  1240. local sweapon = false
  1241.  
  1242. local minimapState = false
  1243. local fogOff = false
  1244. local infAmmo = false
  1245.  
  1246. local boss = {
  1247.     { id = "BP_Boss02Reward_Material", count = 1, },
  1248.     { id = "BP_Boss02Reward_WeaponEnhance", count = 1, },
  1249.     { id = "BP_Boss02Reward_AccessoryEnhance", count = 1, },
  1250.     { id = "BP_Boss01Reward_Accessory", count = 1, },
  1251.     { id = "BP_Boss01Reward_Weapon", count = 1, },
  1252.     { id = "BP_Boss01Reward_Material", count = 1, },
  1253. }
  1254.  
  1255. local colJunk = {
  1256.     { id = "COL_JUNK_Common_Weapon", count = 1, },
  1257.     { id = "COL_JUNK_UnCommon_Weapon", count = 1, },
  1258.     { id = "COL_JUNK_Rare_Weapon", count = 1, },
  1259.     { id = "COL_JUNK_Legendary_Weapon", count = 1, },
  1260.     { id = "COL_JUNK_Exotic_Weapon", count = 1, },
  1261.     { id = "COL_JUNK_Common_Accessory", count = 1, },
  1262.     { id = "COL_JUNK_UnCommon_Accessory", count = 1, },
  1263.     { id = "COL_JUNK_Rare_Accessory", count = 1, },
  1264.     { id = "COL_JUNK_Legendary_Accessory", count = 1, },
  1265.     { id = "COL_JUNK_Exotic_Accessory", count = 1, },
  1266. }
  1267.  
  1268. local colStuff = {
  1269.     { id = "COL_Common_Weapon", count = 1, },
  1270.     { id = "COL_Common_Accessory", count = 1, },
  1271.     { id = "COL_Common_Material", count = 1, },
  1272.     { id = "COL_UnCommon_Weapon", count = 1, },
  1273.     { id = "COL_UnCommon_Accessory", count = 1, },
  1274.     { id = "COL_UnCommon_Material", count = 1, },
  1275.     { id = "COL_Rare_Weapon", count = 1, },
  1276.     { id = "COL_Rare_Accessory", count = 1, },
  1277.     { id = "COL_Rare_Material", count = 1, },
  1278.     { id = "COL_Legendary_Weapon", count = 1, },
  1279.     { id = "COL_Legendary_Accessory", count = 1, },
  1280.     { id = "COL_Legendary_Material", count = 1, },
  1281.     { id = "COL_Exotic_Weapon", count = 1, },
  1282.     { id = "COL_Exotic_Accessory", count = 1, },
  1283.     { id = "COL_Exotic_Material", count = 1, },
  1284. }
  1285. local pkgStuff = {
  1286.     {
  1287.         { id = "COL_PKG_Common_Weapon", count = 1, },
  1288.         { id = "COL_PKG_UnCommon_Weapon", count = 1, },
  1289.         { id = "COL_PKG_Rare_Weapon", count = 1, },
  1290.         { id = "COL_PKG_Legendary_Weapon", count = 1, },
  1291.         { id = "COL_PKG_Exotic_Weapon", count = 1, },
  1292.         { id = "COL_PKG_Common_Accessory", count = 1, },
  1293.         { id = "COL_PKG_UnCommon_Accessory", count = 1, },
  1294.         { id = "COL_PKG_Rare_Accessory", count = 1, },
  1295.         { id = "COL_PKG_Legendary_Accessory", count = 1, },
  1296.         { id = "COL_PKG_Exotic_Accessory", count = 1, },
  1297.         { id = "COL_PKG_Common_Material", count = 1, },
  1298.         { id = "COL_PKG_UnCommon_Material", count = 1, },
  1299.         { id = "COL_PKG_Rare_Material", count = 1, },
  1300.         { id = "COL_PKG_Legendary_Material", count = 1, },
  1301.         { id = "COL_PKG_Exotic_Material", count = 1, },
  1302.     }
  1303. }
  1304.  
  1305. local bpJunk = {
  1306.     { id = "BP_Junk_Weapon_Common", count = 1, },
  1307.     { id = "BP_Junk_Weapon_Uncommon", count = 1, },
  1308.     { id = "BP_Junk_Weapon_Rare", count = 1, },
  1309.     { id = "BP_Junk_Weapon_Legendary", count = 1, },
  1310.     { id = "BP_Junk_Weapon_Exotic", count = 1, },
  1311.     { id = "BP_Junk_Accessory_Common", count = 1, },
  1312.     { id = "BP_Junk_Accessory_Uncommon", count = 1, },
  1313.     { id = "BP_Junk_Accessory_Rare", count = 1, },
  1314.     { id = "BP_Junk_Accessory_Legendary", count = 1, },
  1315.     { id = "BP_Junk_Accessory_Exotic", count = 1, },
  1316. }
  1317.  
  1318. local bpMaterial = {
  1319.     { id = "BP_Material_Common", count = 1, },
  1320.     { id = "BP_Material_Uncommon", count = 1, },
  1321.     { id = "BP_Material_Rare", count = 1, },
  1322.     { id = "BP_Material_Legendary", count = 1, },
  1323.     { id = "BP_Material_Exotic", count = 1, },
  1324. }
  1325.  
  1326. local bpLegendary = {
  1327.     { id = "BP_Junk_Weapon_Legendary_singleQuest", count = 1, },
  1328. }
  1329.  
  1330. local bpEvent = {
  1331.     { id = "BP_Event_20171012_R3", count = 1, },
  1332.     { id = "BP_Event_20171012_R4", count = 1, },
  1333.     { id = "BP_Event_20171012_R5", count = 1, },
  1334.     { id = "BP_Event_20171018_R3", count = 1, },
  1335.     { id = "BP_Event_20171018_R4", count = 1, },
  1336.     { id = "BP_Event_20171018_R5", count = 1, },
  1337.     { id = "BP_Enhance_Legendary", count = 1, },
  1338. }
  1339.  
  1340. local bpEnhance = {
  1341.     { id = "BP_Enhance_Legendary", count = 1, },
  1342.     { id = "BP_Enhance_Epic", count = 1, },
  1343. }
  1344.  
  1345. local bpWeap = {
  1346.     { id = "BP_Junk_Weapon_Legendary_CloseRange", count = 1, },
  1347.     { id = "BP_Junk_Weapon_Legendary_LongRange", count = 1, },
  1348.     { id = "BP_Junk_Weapon_Exotic_CloseRange", count = 1, },
  1349.     { id = "BP_Junk_Weapon_Exotic_LongRange", count = 1, },
  1350. }
  1351.  
  1352. local bpArmor = {
  1353.     { id = "BP_Junk_Accessory_Legendary_Head", count = 1, },
  1354.     { id = "BP_Junk_Accessory_Legendary_Body", count = 1, },
  1355.     { id = "BP_Junk_Accessory_Legendary_Arm", count = 1, },
  1356.     { id = "BP_Junk_Accessory_Legendary_Leg", count = 1, },
  1357.     { id = "BP_Junk_Accessory_Exotic_Head", count = 1, },
  1358.     { id = "BP_Junk_Accessory_Exotic_Body", count = 1, },
  1359.     { id = "BP_Junk_Accessory_Exotic_Arm", count = 1, },
  1360.     { id = "BP_Junk_Accessory_Exotic_Leg", count = 1, },
  1361. }
  1362.  
  1363. local selectedMenu = mainMenu
  1364. function e.Update()
  1365.  
  1366.     --Q
  1367.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.CALL) == PlayerPad.CALL) and call then
  1368.     --space
  1369.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.ACTION) == PlayerPad.ACTION) and action then
  1370.     --E
  1371.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.SUBJECT) == PlayerPad.SUBJECT) and subject then
  1372.     --R
  1373.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.RELOAD) == PlayerPad.RELOAD) and reload then
  1374.     --c
  1375.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.STANCE) == PlayerPad.STANCE) and stance then
  1376.     --ENTER or MOUSE1 sometimes
  1377.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.DECIDE) == PlayerPad.DECIDE) and decide then
  1378.     --V
  1379.     --    if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.ZOOM_CHANGE) == PlayerPad.ZOOM_CHANGE) and zoom then
  1380.     ------------- RUBIM HOOKS
  1381.     if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.SUBJECT) == PlayerPad.SUBJECT and bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.CALL) == PlayerPad.CALL and pressTicks < gameTicks) then
  1382.         if (active) then
  1383.             active = false
  1384.  
  1385.             pressTicks = gameTicks + PRESS_TICK_DELAY
  1386.  
  1387.             TppUiCommand.AnnounceLogView("Menu: OFF")
  1388.         else
  1389.             active = true
  1390.  
  1391.             pressTicks = gameTicks + PRESS_TICK_DELAY
  1392.  
  1393.             TppUiCommand.AnnounceLogView("Menu: ON")
  1394.         end
  1395.     end
  1396.  
  1397.     if (active) then
  1398.         --If it's been 3 seconds (180 ticks) since the menu printed, print out the select items text.
  1399.         if (printTicks < gameTicks) then
  1400.             TppUiCommand.AnnounceLogView(selectedMenu[selected].text)
  1401.             printTicks = gameTicks + PRINT_TICK_DELAY
  1402.         end
  1403.  
  1404.         --If it's been half a second since a button was pressed, the action should be accounted for.
  1405.         if (pressTicks < gameTicks) then
  1406.             --If the UP key is pressed, go to the next option.
  1407.             if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.CALL) == PlayerPad.CALL) then
  1408.                 selected = selected - 1
  1409.  
  1410.                 if (selected < 1) then
  1411.                     selected = #selectedMenu
  1412.                 end
  1413.  
  1414.                 TppUiCommand.AnnounceLogView(selectedMenu[selected].text)
  1415.  
  1416.                 pressTicks = gameTicks + PRESS_TICK_DELAY
  1417.                 printTicks = gameTicks + PRINT_TICK_DELAY
  1418.             end
  1419.  
  1420.             --If the DOWN key is pressed, go to the previous option.
  1421.             if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.SUBJECT) == PlayerPad.SUBJECT) then
  1422.                 selected = selected + 1
  1423.  
  1424.                 if (selected > #selectedMenu) then
  1425.                     selected = 1
  1426.                 end
  1427.  
  1428.                 TppUiCommand.AnnounceLogView(selectedMenu[selected].text)
  1429.  
  1430.                 pressTicks = gameTicks + PRESS_TICK_DELAY
  1431.                 printTicks = gameTicks + PRINT_TICK_DELAY
  1432.             end
  1433.  
  1434.             --If the RIGHT key is pressed, perform the selected action.
  1435.             if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.ACTION) == PlayerPad.ACTION) then
  1436.                 selectedMenu[selected].action()
  1437.  
  1438.                 pressTicks = gameTicks + PRESS_TICK_DELAY
  1439.                 printTicks = gameTicks + PRINT_TICK_DELAY
  1440.             end
  1441.  
  1442.             --If the LEFT key is pressed, perform the alternate action.
  1443.             if (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.LEFT) == PlayerPad.LEFT) then
  1444.                 selectedMenu[selected].altAction()
  1445.  
  1446.                 pressTicks = gameTicks + PRESS_TICK_DELAY
  1447.                 printTicks = gameTicks + PRINT_TICK_DELAY
  1448.             end
  1449.         end
  1450.     end
  1451.  
  1452.     gameTicks = gameTicks + 1 --ticks happen every frame
  1453.     --Universal Functions----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1454.     --Function OpenMenu opens a selected menu
  1455.  
  1456.     ------------- END OF CUSTOM SHIT
  1457.     function this.OpenMenu(menu)
  1458.         selectedMenu = menu
  1459.         selected = 1
  1460.     end
  1461.  
  1462.     --Main Menu Functions----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1463.     --Function HelloWorld prints "Hello World!" in the AnnounceLog.
  1464.     function this.rPrint(text)
  1465.         TppUiCommand.AnnounceLogView(text)
  1466.     end
  1467.  
  1468.     function this.HelloWorld()
  1469.         TppUiCommand.AnnounceLogView("Hello World!")
  1470.     end
  1471.  
  1472.     function this.veavHelper()
  1473.         TppUiCommand.AnnounceLogView("Adding DLC items :)")
  1474.         SsdSbm.AddProduction { id = "PRD_ACC_ExHead_Bandana", toInventory = true, count = 1 }
  1475.         SsdSbm.AddProduction { id = "PRD_ACC_ExHead_Eyepatch", toInventory = true, count = 1 }
  1476.         SsdSbm.AddProduction { id = "PRD_ACC_ExHead_RexHead", toInventory = true, count = 1 }
  1477.         SsdSbm.AddProduction { id = "PRD_ACC_ExHead_RayHead", toInventory = true, count = 1 }
  1478.         SsdSbm.AddProduction { id = "PRD_ACC_ExHead_CyborgNinja", tryEquip = false, count = 1 }
  1479.     end
  1480.  
  1481.     function this.equipItem(item)
  1482.         TppUiCommand.AnnounceLogView("Equipping " .. item)
  1483.         SsdSbm.AddProduction { id = item, tryEquip = true }
  1484.     end
  1485.  
  1486.     function this.addItem(item)
  1487.         TppUiCommand.AnnounceLogView("Adding: " .. item)
  1488.         SsdSbm.AddProduction { id = item, toInventory = true, count = 1, tryEquip = false }
  1489.     end
  1490.  
  1491.     function this.addItemR(item)
  1492.         TppUiCommand.AnnounceLogView("Adding: " .. item)
  1493.         SsdSbm.AddResource { item, count = 1 }
  1494.     end
  1495.  
  1496.     function this.addItemRe(item)
  1497.         TppUiCommand.AnnounceLogView("Adding: " .. item)
  1498.         SsdSbm.AddRecipe { item }
  1499.     end
  1500.  
  1501.     function this.droptheBox(type)
  1502.         TppUiCommand.AnnounceLogView("Dropping stuff at my head")
  1503.         if type == "boss" then
  1504.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = boss, }
  1505.         end
  1506.  
  1507.         if type == "colJunk" then
  1508.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = colJunk, }
  1509.         end
  1510.  
  1511.         if type == "colStuff" then
  1512.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = colStuff, }
  1513.         end
  1514.  
  1515.         if type == "pkgStuff" then
  1516.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = pkgStuff, }
  1517.         end
  1518.  
  1519.         if type == "bpEvent" then
  1520.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = bpEvent, }
  1521.         end
  1522.  
  1523.         if type == "bpArmor" then
  1524.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = bpArmor, }
  1525.         end
  1526.  
  1527.         if type == "bpEnhance" then
  1528.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = bpEnhance, }
  1529.         end
  1530.  
  1531.         if type == "bpMaterial" then
  1532.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = bpMaterial, }
  1533.         end
  1534.  
  1535.         if type == "bpWeap" then
  1536.             SsdRewardCbox.Drop { pos = Vector3(TppPlayer.GetPosition()), contents = bpWeap, }
  1537.         end
  1538.         SsdRewardCbox.ObtainAll()
  1539.     end
  1540.  
  1541.     function this.minimapToggle()
  1542.         if minimapState == true then
  1543.             TppUiCommand.AnnounceLogView("Minimap: OFF")
  1544.             minimapState = false
  1545.             SsdMinimap.Close()
  1546.         elseif minimapState == false then
  1547.             TppUiCommand.AnnounceLogView("Minimap: ON")
  1548.             minimapState = true
  1549.             SsdMinimap.Open()
  1550.         end
  1551.     end
  1552.  
  1553.     function this.toggleFog()
  1554.         if fogOff == true then
  1555.             TppUiCommand.AnnounceLogView("FOG: ON")
  1556.             FogWallController.SetEnabled(true)
  1557.             fogOff = false
  1558.         elseif fogOff == false then
  1559.             TppUiCommand.AnnounceLogView("FOG: OFF")
  1560.             FogWallController.SetEnabled(false)
  1561.             fogOff = true
  1562.         end
  1563.     end
  1564.  
  1565.     function this.cheatsAmmo()
  1566.         if infAmmo == true then
  1567.             TppUiCommand.AnnounceLogView("Ammo: OFF")
  1568.             Player.SetInfiniteAmmoFromScript(false)
  1569.             infAmmo = false
  1570.         elseif infAmmo == false then
  1571.             TppUiCommand.AnnounceLogView("Ammo: ON")
  1572.             Player.SetInfiniteAmmoFromScript(true)
  1573.             infAmmo = true
  1574.         end
  1575.     end
  1576.  
  1577.     --Function Exit closes the menu
  1578.     function this.Exit()
  1579.         active = false
  1580.         TppUiCommand.AnnounceLogView("Menu: OFF")
  1581.     end
  1582.  
  1583.     --Sub-Menu Functions-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1584.     --Function SubHello prints "Sub-Hello!" in the AnnounceLog.
  1585.     function this.SubHello()
  1586.         TppUiCommand.AnnounceLogView("Sub-Hello!")
  1587.     end
  1588.  
  1589.     --Sub-Menu2 Functions----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1590.     --Function SubHello2 prints "Sub-Hello2!" in the AnnounceLog.
  1591.     function this.SubHello2()
  1592.         TppUiCommand.AnnounceLogView("Sub-Hello2!")
  1593.     end
  1594.  
  1595.     --Function AltHello prints "Alt Hello!" in the AnnounceLog.
  1596.     function this.AltHello()
  1597.         TppUiCommand.AnnounceLogView("Alt Hello!")
  1598.     end
  1599.  
  1600.     e.UpdateFastTravelWarp()
  1601. end
  1602.  
  1603. local c = { [TppDefine.WEATHER.SUNNY] = 0, [TppDefine.WEATHER.CLOUDY] = -10, [TppDefine.WEATHER.RAINY] = -30, [TppDefine.WEATHER.FOGGY] = -50, [TppDefine.WEATHER.SANDSTORM] = -70 } function e.MakeFultonRecoverSucceedRatio(t, a, i, l, o, r) local p = { [TppMotherBaseManagementConst.SECTION_FUNC_RANK_S] = 60, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_A] = 50, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_B] = 40, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_C] = 30, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_D] = 20, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_E] = 10, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_F] = 0, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_NONE] = 0 } local t = a
  1604.     local a = 0
  1605.     local s = 100
  1606.     local n = 0
  1607.     n = TppTerminal.DoFuncByFultonTypeSwitch(t, i, l, o, nil, nil, nil, e.GetSoldierFultonSucceedRatio, e.GetVolginFultonSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio, e.GetDefaultSucceedRatio) if n == nil then
  1608.         n = 100
  1609.     end
  1610.     local e = TppMotherBaseManagement.GetSectionFuncRank { sectionFuncId = TppMotherBaseManagementConst.SECTION_FUNC_ID_SUPPORT_FULTON } local o = p[e] or 0
  1611.     local e = c[vars.weather] or 0
  1612.     e = e + o
  1613.     if e > 0 then
  1614.         e = 0
  1615.     end
  1616.     a = (s + n) + e
  1617.     if mvars.ply_allways_100percent_fulton then
  1618.         a = 100
  1619.     end
  1620.     if TppEnemy.IsRescueTarget(t) then
  1621.         a = 100
  1622.     end
  1623.     local e
  1624.     if mvars.ply_forceFultonPercent then
  1625.         e = mvars.ply_forceFultonPercent[t]
  1626.     end
  1627.     if e then
  1628.         a = e
  1629.     end
  1630.     if r then
  1631.         Player.SetDogFultonIconPercentage { percentage = a, targetId = t } else
  1632.         Player.SetFultonIconPercentage { percentage = a, targetId = t }
  1633.     end
  1634. end
  1635.  
  1636. function e.GetSoldierFultonSucceedRatio(t) local e = 0
  1637.     local n = 0
  1638.     local a = i(t, { id = "GetLifeStatus" }) local r = GameObject.SendCommand(t, { id = "GetStateFlag" }) if (bit.band(r, StateFlag.DYING_LIFE) ~= 0) then
  1639.         e = -70
  1640.     elseif (a == TppGameObject.NPC_LIFE_STATE_SLEEP) or (a == TppGameObject.NPC_LIFE_STATE_FAINT) then
  1641.         e = 0
  1642.         if mvars.ply_OnFultonIconDying then
  1643.             mvars.ply_OnFultonIconDying()
  1644.         end
  1645.     elseif (a == TppGameObject.NPC_LIFE_STATE_DEAD) then
  1646.         return
  1647.     end
  1648.     local r = { [TppMotherBaseManagementConst.SECTION_FUNC_RANK_S] = 60, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_A] = 50, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_B] = 40, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_C] = 30, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_D] = 20, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_E] = 10, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_F] = 0, [TppMotherBaseManagementConst.SECTION_FUNC_RANK_NONE] = 0 } local a = TppMotherBaseManagement.GetSectionFuncRank { sectionFuncId = TppMotherBaseManagementConst.SECTION_FUNC_ID_MEDICAL_STAFF_EMERGENCY } local a = r[a] or 0
  1649.     e = e + a
  1650.     if e > 0 then
  1651.         e = 0
  1652.     end
  1653.     local a = i(t, { id = "GetStatus" }) if a == TppGameObject.NPC_STATE_STAND_HOLDUP then
  1654.         n = -10
  1655.     end
  1656.     return (e + n)
  1657. end
  1658.  
  1659. function e.GetDefaultSucceedRatio(e) return 0
  1660. end
  1661.  
  1662. function e.GetVolginFultonSucceedRatio(e) return 100
  1663. end
  1664.  
  1665. function e.OnPlayerFulton(e, e) end
  1666.  
  1667. function e.SetRetryFlag() vars.playerRetryFlag = PlayerRetryFlag.RETRY
  1668. end
  1669.  
  1670. function e.SetRetryFlagWithChickCap() vars.playerRetryFlag = PlayerRetryFlag.RETRY_WITH_CHICK_CAP
  1671. end
  1672.  
  1673. function e.UnsetRetryFlag() vars.playerRetryFlag = 0
  1674. end
  1675.  
  1676. function e.ResetStealthAssistCount() vars.stealthAssistLeftCount = 0
  1677. end
  1678.  
  1679. function e.OnPickUpCollection(t, a, e, n) local t = 255
  1680.     TppCollection.RepopCountOperation("SetAt", a, t) TppTerminal.AddPickedUpResourceToTempBuffer(e, n) local t = { [TppCollection.TYPE_POSTER_SOL_AFGN] = "key_poster_3500", [TppCollection.TYPE_POSTER_SOL_MAFR] = "key_poster_3501", [TppCollection.TYPE_POSTER_GRAVURE_V] = "key_poster_3502", [TppCollection.TYPE_POSTER_GRAVURE_H] = "key_poster_3503", [TppCollection.TYPE_POSTER_MOE_V] = "key_poster_3504", [TppCollection.TYPE_POSTER_MOE_H] = "key_poster_3505" } local t = t[e] if t ~= nil then
  1681.         TppUI.ShowAnnounceLog("getPoster", t, TppTerminal.GMP_POSTER)
  1682.     end
  1683.     local t
  1684.     if TppTerminal.RESOURCE_INFORMATION_TABLE[e] and TppTerminal.RESOURCE_INFORMATION_TABLE[e].count then
  1685.         t = TppTerminal.RESOURCE_INFORMATION_TABLE[e].count
  1686.     end
  1687.     if TppCollection.IsHerbByType(e) then
  1688.         local e = GameObject.GetGameObjectIdByIndex("TppBuddyDog2", 0) if e ~= r then
  1689.         i(e, { id = "GetPlant", uniqueId = a })
  1690.     end
  1691.     end
  1692.     if TppCollection.IsMaterialByType(e) then
  1693.         TppUI.ShowAnnounceLog("find_processed_res", n, t)
  1694.     end
  1695.     if e == TppCollection.TYPE_DIAMOND_SMALL then
  1696.         TppUI.ShowAnnounceLog("find_diamond", TppDefine.SMALL_DIAMOND_GMP)
  1697.     end
  1698.     if e == TppCollection.TYPE_DIAMOND_LARGE then
  1699.         TppUI.ShowAnnounceLog("find_diamond", TppDefine.LARGE_DIAMOND_GMP)
  1700.     end
  1701.     TppTerminal.PickUpBluePrint(a)
  1702. end
  1703.  
  1704. function e.OnPickUpPlaced(e, e, a) local e = GameObject.GetGameObjectIdByIndex("TppBuddyDog2", 0) if e ~= r then
  1705.     i(e, { id = "GetPlacedItem", index = a })
  1706. end
  1707. end
  1708.  
  1709. function e.StorePlayerDecoyInfos() if e.IsExistDecoySystem() then
  1710.     local e = { type = "TppDecoySystem" } i(e, { id = "StorePlayerDecoyInfos" })
  1711. end
  1712. end
  1713.  
  1714. function e.IsExistDecoySystem() if GameObject.GetGameObjectIdByIndex("TppDecoySystem", 0) ~= r then
  1715.     return true
  1716. else
  1717.     return false
  1718. end
  1719. end
  1720.  
  1721. local r = 7.5
  1722. local a = 3.5
  1723. e.DELIVERY_WARP_STATE = Tpp.Enum { "START_FADE_OUT", "START_WARP", "END_WARP", "START_FADE_IN" } function e.OnSelectFastTravelByMenu(a, t) if mvars.ply_unexecFastTravelByMenu then
  1724.     return
  1725. end
  1726.     e.OnSelectFastTravel(a, t)
  1727. end
  1728.  
  1729. function e.OnSelectFastTravel(t, a) if mvars.ply_requestedRevivePlayer then
  1730.     return
  1731. end
  1732.     mvars.ply_deliveryWarpState = e.DELIVERY_WARP_STATE.START_FADE_OUT
  1733.     local e, a = SsdFastTravel.GetFastTravelPointName(a) if not e then
  1734.         return
  1735.     end
  1736.     if not a then
  1737.         return
  1738.     end
  1739.     Player.SetPadMask { settingName = "FastTravel", except = true } local n = mvars.ply_fastTravelOption
  1740.     local t = false
  1741.     if n then
  1742.         t = n.noSound
  1743.     end
  1744.     local e, n = Tpp.GetLocatorByTransform(e, a) if e then
  1745.         e = e + Vector3(0, .8, 0)
  1746.     end
  1747.     mvars.ply_selectedFastTravelPointName = a
  1748.     mvars.ply_selectedFastTravelPosition = e
  1749.     mvars.ply_selectedFastTravelRotY = Tpp.GetRotationY(n) if not t then
  1750.         mvars.ply_playingDeliveryWarpSoundHandle = TppSoundDaemon.PostEventAndGetHandle("Play_truck_transfer", "Loading") else
  1751.         mvars.ply_playingDeliveryWarpSoundHandle = nil
  1752.     end
  1753.     TppUI.FadeOut(TppUI.FADE_SPEED.FADE_HIGHESTSPEED, "OnSelectFastTravel", TppUI.FADE_PRIORITY.MISSION, { setMute = true }) TppGameStatus.Set("TppPlayer.lua", "S_IS_FAST_TRAVEL") TppGameStatus.Set("TppPlayer.lua", "S_DISABLE_TARGET")
  1754. end
  1755.  
  1756. function e.WarpByFastTravel() if mvars.ply_deliveryWarpState == e.DELIVERY_WARP_STATE.START_WARP then
  1757.     return
  1758. end
  1759.     TppGameStatus.Set("TppPlayer.WarpByFastTravel", "S_IS_BLACK_LOADING") local a = mvars.ply_fastTravelOption
  1760.     local t = false
  1761.     if a then
  1762.         if a.surviveBox then
  1763.             SsdSbm.CreateSurviveCbox()
  1764.         end
  1765.         if a.resetState then
  1766.             t = a.resetState
  1767.         end
  1768.     end
  1769.     TppRadio.Stop() mvars.ply_deliveryWarpState = e.DELIVERY_WARP_STATE.START_WARP
  1770.     o("Timer_DeliveryWarpSoundCannotCancel", r) local e = { type = "TppPlayer2", index = 0 } local a = { id = "WarpAndWaitBlock", pos = mvars.ply_selectedFastTravelPosition, rotY = TppMath.DegreeToRadian(mvars.ply_selectedFastTravelRotY), resetState = t } GameObject.SendCommand(e, a)
  1771. end
  1772.  
  1773. function e.OnEndWarpByFastTravel() TppGameStatus.Reset("TppPlayer.lua", "S_DISABLE_TARGET") TppGameStatus.Reset("TppPlayer.lua", "S_IS_FAST_TRAVEL") TppGameStatus.Reset("TppPlayer.WarpByFastTravel", "S_IS_BLACK_LOADING") if mvars.ply_deliveryWarpState == e.DELIVERY_WARP_STATE.START_WARP then
  1774.     mvars.ply_deliveryWarpState = e.DELIVERY_WARP_STATE.END_WARP
  1775. end
  1776. end
  1777.  
  1778. function e.UpdateFastTravelWarp() if not mvars.ply_deliveryWarpState then
  1779.     return
  1780. end
  1781.     if (mvars.ply_deliveryWarpState == e.DELIVERY_WARP_STATE.START_WARP) then
  1782.         TppUI.ShowAccessIconContinue()
  1783.     end
  1784.     if (mvars.ply_deliveryWarpState ~= e.DELIVERY_WARP_STATE.END_WARP) then
  1785.         return
  1786.     end
  1787.     if not TppMission.CheckMissionState(false, false, false, false, true) then
  1788.         TppSoundDaemon.PostEventAndGetHandle("Stop_truck_transfer", "Loading") e.OnEndFadeInWarpByFastTravel() return
  1789.     end
  1790.     if mvars.ply_playingDeliveryWarpSoundHandle then
  1791.         local e = TppSoundDaemon.IsEventPlaying("Play_truck_transfer", mvars.ply_playingDeliveryWarpSoundHandle) if (e == false) then
  1792.         mvars.ply_playingDeliveryWarpSoundHandle = nil
  1793.         return
  1794.     else
  1795.         TppUI.ShowAccessIconContinue()
  1796.     end
  1797.     end
  1798.     if (mvars.ply_playingDeliveryWarpSoundHandle and (not mvars.ply_deliveryWarpSoundCannotCancel)) and (bit.band(PlayerVars.scannedButtonsDirect, PlayerPad.STANCE) == PlayerPad.STANCE) then
  1799.         mvars.ply_deliveryWarpSoundCannotCancel = true
  1800.         TppSoundDaemon.ResetMute "Loading" TppSoundDaemon.PostEventAndGetHandle("Stop_truck_transfer", "Loading")
  1801.     end
  1802.     if TppSave.IsSaving() then
  1803.         return
  1804.     end
  1805.     if not mvars.ply_playingDeliveryWarpSoundHandle then
  1806.         mvars.ply_deliveryWarpState = e.DELIVERY_WARP_STATE.START_FADE_IN
  1807.         TppSoundDaemon.ResetMute "Loading" TppMission.ExecuteSystemCallback("OnEndDeliveryWarp", mvars.ply_selectedFastTravelPointName) Player.RequestToSetCameraRotation { rotX = 10, rotY = mvars.ply_selectedFastTravelRotY } local a = mvars.ply_fastTravelOption
  1808.         if a and a.noFadeIn then
  1809.             e.OnEndFadeInWarpByFastTravel() else
  1810.             TppUI.FadeIn(TppUI.FADE_SPEED.FADE_NORMAL, "OnEndWarpByFastTravel", TppUI.FADE_PRIORITY.DEMO)
  1811.         end
  1812.     end
  1813. end
  1814.  
  1815. function e.OnEndFadeInWarpByFastTravel() mvars.ply_selectedFastTravelPointName = nil
  1816.     mvars.ply_selectedFastTravelPosition = nil
  1817.     mvars.ply_selectedFastTravelRotY = nil
  1818.     mvars.ply_deliveryWarpState = nil
  1819.     mvars.ply_deliveryWarpSoundCannotCancel = nil
  1820.     mvars.ply_fastTravelOption = nil
  1821.     if mvars.ply_endFastTravelCallback then
  1822.         mvars.ply_endFastTravelCallback()
  1823.     end
  1824.     mvars.ply_endFastTravelCallback = nil
  1825.     m "Timer_DeliveryWarpSoundCannotCancel" Player.ResetPadMask { settingName = "FastTravel" }
  1826. end
  1827.  
  1828. function e.OnDeliveryWarpSoundCannotCancel() mvars.ply_deliveryWarpSoundCannotCancel = true
  1829. end
  1830.  
  1831. function e.StartFastTravel(o, r, t, a) mvars.ply_endFastTravelCallback = nil
  1832.     mvars.ply_fastTravelOption = nil
  1833.     if p(t) then
  1834.         mvars.ply_endFastTravelCallback = t
  1835.     end
  1836.     if n(a) then
  1837.         mvars.ply_fastTravelOption = a
  1838.     end
  1839.     e.OnSelectFastTravel(o, r)
  1840. end
  1841.  
  1842. function e.StartFastTravelByReturnBase() local a = "fast_afgh_basecamp" if TppLocation.IsMiddleAfrica() then
  1843.     a = "fast_mafr_basecamp"
  1844. end
  1845.     e.StartFastTravel(nil, t(a), nil, { surviveBox = true, resetState = true, noSound = true })
  1846. end
  1847.  
  1848. function e.AddFastTravelOption(a) if not n(a) then
  1849.     return
  1850. end
  1851.     if not e.IsFastTraveling() then
  1852.         return
  1853.     end
  1854.     mvars.ply_fastTravelOption = mvars.ply_fastTravelOption or {} for e, a in pairs(a) do
  1855.         mvars.ply_fastTravelOption[e] = a
  1856.     end
  1857. end
  1858.  
  1859. function e.OnEnterIntelMarkerTrap(e, a) local a = mvars.ply_intelMarkerTrapInfo[e] local e = mvars.ply_intelFlagInfo[a] if e then
  1860.     if svars[e] then
  1861.         return
  1862.     end
  1863. else
  1864.     return
  1865. end
  1866.     local e = mvars.ply_intelMarkerObjectiveName[a] if e then
  1867.         TppMission.UpdateObjective { objectives = { e } }
  1868.     end
  1869. end
  1870.  
  1871. function e.OnEnterIntelTrap(a, t) local a = mvars.ply_intelTrapInfo[a] e.ShowIconForIntel(a) end
  1872.  
  1873. function e.OnExitIntelTrap(a, a) e.HideIconForIntel() end
  1874.  
  1875. function e.OnIntelIconDisplayContinue(a, t, t) local a = mvars.ply_intelNameReverse[a] e.ShowIconForIntel(a) end
  1876.  
  1877. function e.OnEnterQuestTrap(a, t) local a = mvars.ply_questStartTrapInfo[a] e.ShowIconForQuest(a) local e = mvars.ply_questStartFlagInfo[a] if e ~= nil and e == false then
  1878.     TppSoundDaemon.PostEvent "sfx_s_ifb_mbox_arrival"
  1879. end
  1880. end
  1881.  
  1882. function e.OnExitQuestTrap(a, a) e.HideIconForQuest() end
  1883.  
  1884. function e.OnQuestIconDisplayContinue(a, t, t) local a = mvars.ply_questNameReverse[a] e.ShowIconForQuest(a) end
  1885.  
  1886. function e.SaveCaptureAnimal() if mvars.loc_locationAnimalSettingTable == nil then
  1887.     return
  1888. end
  1889.     local a = TppPlaced.GetCaptureCageInfo() for t, a in pairs(a) do
  1890.         local a, e, t, t = e.EvaluateCaptureCage(a.x, a.z, a.grade, a.material) if e ~= 0 then
  1891.         CaptureCage.RegisterCaptureAnimal(e, a)
  1892.     end
  1893.     end
  1894.     TppPlaced.DeleteAllCaptureCage()
  1895. end
  1896.  
  1897. function e.AggregateCaptureAnimal() local e = 0
  1898.     local a = 0
  1899.     local t = CaptureCage.GetCaptureAnimalList() for t, n in pairs(t) do
  1900.         local t = n.animalId
  1901.         local n = n.areaName
  1902.         TppMotherBaseManagement.DirectAddDataBaseAnimal { dataBaseId = t, areaNameHash = n, isNew = true } local n, r = TppMotherBaseManagement.GetAnimalHeroicPointAndGmp { dataBaseId = t } e = e + n
  1903.         a = a + r
  1904.         TppUiCommand.ShowBonusPopupAnimal(t, "regist")
  1905.     end
  1906.     if e > 0 or a > 0 then
  1907.         TppMotherBaseManagement.AddHeroicPointAndGmpByCageAnimal { heroicPoint = e, gmp = a, isAnnounce = true }
  1908.     end
  1909. end
  1910.  
  1911. function e.CheckCaptureCage(t, r) if mvars.loc_locationAnimalSettingTable == nil then
  1912.     return
  1913. end
  1914.     if t < 2 or t > 4 then
  1915.         return
  1916.     end
  1917.     local n = {} local a = 5
  1918.     local o = r / a
  1919.     for r = 1, o do
  1920.         if t == 2 then
  1921.             Player.DEBUG_PlaceAround { radius = 5, count = a, equipId = TppEquip.EQP_SWP_CaptureCage } elseif t == 3 then
  1922.             Player.DEBUG_PlaceAround { radius = 5, count = a, equipId = TppEquip.EQP_SWP_CaptureCage_G01 } elseif t == 4 then
  1923.             Player.DEBUG_PlaceAround { radius = 5, count = a, equipId = TppEquip.EQP_SWP_CaptureCage_G02 }
  1924.         end
  1925.         for e = 1, a do
  1926.             coroutine.yield()
  1927.         end
  1928.         local a = TppPlaced.GetCaptureCageInfo() for t, a in pairs(a) do
  1929.         local t, a, r, e = e.EvaluateCaptureCage(a.x, a.z, a.grade, a.material) if a ~= 0 then
  1930.         TppMotherBaseManagement.DirectAddDataBaseAnimal { dataBaseId = a, areaName = t, isNew = true } if n[e] == nil then
  1931.         n[e] = 1
  1932.     else
  1933.         n[e] = n[e] + 1
  1934.     end
  1935.     end
  1936.     end
  1937.         TppPlaced.DeleteAllCaptureCage()
  1938.     end
  1939.     for a, e in pairs(n) do
  1940.         local e = (e / r) * 100
  1941.     end
  1942. end
  1943.  
  1944. function e.GetCaptureAnimalSE(t) local e = "sfx_s_captured_nom" local a = mvars.loc_locationAnimalSettingTable
  1945.     if a == nil then
  1946.         return e
  1947.     end
  1948.     local a = a.animalRareLevel
  1949.     if a[t] == nil then
  1950.         return e
  1951.     end
  1952.     local a = a[t] if a == TppMotherBaseManagementConst.ANIMAL_RARE_SR then
  1953.         e = "sfx_s_captured_super" elseif a == TppMotherBaseManagementConst.ANIMAL_RARE_R then
  1954.         e = "sfx_s_captured_rare" else
  1955.         e = "sfx_s_captured_nom"
  1956.     end
  1957.     return e
  1958. end
  1959.  
  1960. function e.OnSelectSleepInBed(e) Player.SetPadMask { settingName = "SleepInBed", except = true } mvars.ply_sleepTimeHour = e
  1961.     TppUI.FadeOut(TppUI.FADE_SPEED.FADE_HIGHESTSPEED, "OnSelectSleepInBed", TppUI.FADE_PRIORITY.MISSION)
  1962. end
  1963.  
  1964. function e.PassTimeBySleeping() WeatherManager.AddTimeToCurrentClock { hour = mvars.ply_sleepTimeHour } Player.OnSleepInBedLocal(mvars.ply_sleepTimeHour) o("Timer_SleepInBed", 2) end
  1965.  
  1966. function e.OnEndFadeInSleepInBed() Player.ResetPadMask { settingName = "SleepInBed" } mvars.ply_sleepTimeHour = nil
  1967.     TppQuest.UpdateActiveQuest() TppMission.UpdateCheckPointAtCurrentPosition()
  1968. end
  1969.  
  1970. function e._IsStartStatusValid(a) if (e.StartStatusList[a] == nil) then
  1971.     return false
  1972. end
  1973.     return true
  1974. end
  1975.  
  1976. function e._IsAbilityNameValid(a) if (e.DisableAbilityList[a] == nil) then
  1977.     return false
  1978. end
  1979.     return true
  1980. end
  1981.  
  1982. function e._IsControlModeValid(a) if (e.ControlModeList[a] == nil) then
  1983.     return false
  1984. end
  1985.     return true
  1986. end
  1987.  
  1988. function e._CheckRotation(e, t, n, r, a) local a = mvars
  1989.     local a = vars.playerCameraRotation[0] local o = vars.playerCameraRotation[1] local e = foxmath.DegreeToRadian(a - e) e = foxmath.NormalizeRadian(e) local a = foxmath.RadianToDegree(e) local e = foxmath.DegreeToRadian(o - n) e = foxmath.NormalizeRadian(e) local e = foxmath.RadianToDegree(e) if (foxmath.Absf(a) < t) and (foxmath.Absf(e) < r) then
  1990.         return true
  1991.     else
  1992.         return false
  1993.     end
  1994. end
  1995.  
  1996. local function n(a) local n = math.random(0, 99) local e = 0
  1997.     local t = -1
  1998.     for r, a in pairs(a) do
  1999.         e = e + a[2] if n < e then
  2000.         t = a[1] break
  2001.     end
  2002.     end
  2003.     return t
  2004. end
  2005.  
  2006. local function p(e, a) for t, e in pairs(e) do
  2007.     if e == a then
  2008.         return true
  2009.     end
  2010. end
  2011.     return false
  2012. end
  2013.  
  2014. function e.EvaluateCaptureCage(l, a, o, c) local t = mvars
  2015.     local r = t.loc_locationAnimalSettingTable
  2016.     local i = r.captureCageAnimalAreaSetting
  2017.     local t = "wholeArea" for n, e in pairs(i) do
  2018.         if ((l >= e.activeArea[1] and l <= e.activeArea[3]) and a >= e.activeArea[2]) and a <= e.activeArea[4] then
  2019.             t = e.areaName
  2020.             break
  2021.         end
  2022.     end
  2023.     local a = 0
  2024.     if o == 2 then
  2025.         a = n(e.CageRandomTableG3) elseif o == 1 then
  2026.         a = n(e.CageRandomTableG2) else
  2027.         a = n(e.CageRandomTableG1)
  2028.     end
  2029.     local e = r.captureAnimalList
  2030.     local i = r.animalRareLevel
  2031.     local s = r.animalInfoList
  2032.     local n = {} if e[t] == nil then
  2033.         t = "wholeArea"
  2034.     end
  2035.     local l = false
  2036.     for t, e in pairs(e[t]) do
  2037.         local t = i[e] if t >= TppMotherBaseManagementConst.ANIMAL_RARE_SR and o == 2 then
  2038.         if not TppMotherBaseManagement.IsGotDataBase { dataBaseId = e } then
  2039.             table.insert(n, e) a = t
  2040.             l = true
  2041.             break
  2042.         end
  2043.     end
  2044.     end
  2045.     if not l then
  2046.         local r = a
  2047.         while a >= 0 do
  2048.             for t, e in pairs(e[t]) do
  2049.                 if i[e] == a then
  2050.                     table.insert(n, e)
  2051.                 end
  2052.             end
  2053.             if table.maxn(n) > 0 then
  2054.                 break
  2055.             end
  2056.             a = a - 1
  2057.         end
  2058.         if a < 0 then
  2059.             a = r
  2060.             t = "wholeArea" while a >= 0 do
  2061.             for t, e in pairs(e[t]) do
  2062.                 if i[e] == a then
  2063.                     table.insert(n, e)
  2064.                 end
  2065.             end
  2066.             if table.maxn(n) > 0 then
  2067.                 break
  2068.             end
  2069.             a = a - 1
  2070.         end
  2071.         end
  2072.     end
  2073.     local l = r.animalMaterial
  2074.     local r = {} local o = a
  2075.     if l ~= nil then
  2076.         while o >= 0 do
  2077.             for a, e in pairs(e.wholeArea) do
  2078.                 if l[e] == nil and i[e] == o then
  2079.                     table.insert(r, e)
  2080.                 end
  2081.             end
  2082.             if table.maxn(r) > 0 then
  2083.                 break
  2084.             end
  2085.             o = o - 1
  2086.         end
  2087.     end
  2088.     local e = 0
  2089.     local i = table.maxn(n) if i == 1 then
  2090.         e = n[1] elseif i > 1 then
  2091.         local a = math.random(1, i) e = n[a]
  2092.     end
  2093.     if #r == 0 then
  2094.         local n = "" return t, e, a, n
  2095.     end
  2096.     if l ~= nil then
  2097.         local t = l[e] if t ~= nil then
  2098.         if p(t, c) == false then
  2099.             local t = math.random(1, #r) e = r[t] a = o
  2100.         end
  2101.     end
  2102.     end
  2103.     local n = "" if s ~= nil then
  2104.         if e ~= 0 then
  2105.             n = s[e].name
  2106.         end
  2107.     end
  2108.     return t, e, a, n
  2109. end
  2110.  
  2111. function e.Refresh(e) if e then
  2112.     Player.ResetDirtyEffect()
  2113. end
  2114.     vars.passageSecondsSinceOutMB = 0
  2115. end
  2116.  
  2117. return e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement