Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.96 KB | None | 0 0
  1. --
  2. -- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
  3. --
  4.  
  5. -- load the gametype script --
  6. ScriptCB_DoFile("setup_teams")
  7. ScriptCB_DoFile("ObjectiveConquest")
  8.  
  9. function fLowHealthSound()
  10.         print("ME5_MiscFunctions: fLowHealthSound()")
  11.     ScriptCB_SndPlaySound("organic_lowhealth_property")
  12.     ScriptCB_SndBusFade("lowhealth", 0.0, 0.0)
  13.    
  14.     local isSoundPlaying = false
  15.     local busEndGain    = 0.05
  16.     local busFadeTime   = 1.0
  17.     local playerMaxHealth = 0
  18.    
  19.     local testcheckhumanspawn = OnCharacterSpawn(
  20.         function(player)
  21.             if IsCharacterHuman(player) then
  22.                 Iamhuman = GetEntityPtr(GetCharacterUnit(player))
  23.                 playerMaxHealth = GetObjectHealth(player)
  24.                     print("fLowHealthSound: Player's max health is "..playerMaxHealth)
  25.             end
  26.         end
  27.     )
  28.    
  29.     local lowhealthsound = OnObjectDamage(
  30.         function(object, damager)
  31.             local playerCurHealth = GetObjectHealth(object)
  32.             local playerHealthPercent = playerCurHealth / playerMaxHealth
  33.             if Iamhuman == GetEntityPtr(object) then
  34.                     print("fLowHealthSound: Player damaged")
  35.                 if playerHealthPercent < 0.9 then
  36.                         print("fLowHealthSound: Player's health is "..playerCurHealth)
  37.                     if isSoundPlaying == false then
  38.                         print("fLowHealthSound: isSoundPlaying is false, setting to true")
  39.                         isSoundPlaying = true
  40.                         ScriptCB_SndBusFade("main",             busFadeTime, busEndGain)
  41.                         ScriptCB_SndBusFade("soundfx",          busFadeTime, busEndGain)
  42.                         ScriptCB_SndBusFade("battlechatter",    busFadeTime, busEndGain)
  43.                         ScriptCB_SndBusFade("music",            busFadeTime, busEndGain)
  44.                         ScriptCB_SndBusFade("ingamemusic",      busFadeTime, busEndGain)
  45.                         ScriptCB_SndBusFade("ambience",         busFadeTime, busEndGain)
  46.                         ScriptCB_SndBusFade("voiceover",        busFadeTime, busEndGain)
  47.                         ScriptCB_SndBusFade("lowhealth",        1.0, 1.0)
  48.                     end
  49.                 else
  50.                     isSoundPlaying = false
  51.                     ScriptCB_SndBusFade("main",             busFadeTime, 1.0)
  52.                     ScriptCB_SndBusFade("soundfx",          busFadeTime, 0.7)
  53.                     ScriptCB_SndBusFade("battlechatter",    busFadeTime, 1.0)
  54.                     ScriptCB_SndBusFade("music",            busFadeTime, 1.0)
  55.                     ScriptCB_SndBusFade("ingamemusic",      busFadeTime, 0.7)
  56.                     ScriptCB_SndBusFade("ambience",         busFadeTime, 0.7)
  57.                     ScriptCB_SndBusFade("voiceover",        busFadeTime, 0.8)
  58.                     ScriptCB_SndBusFade("lowhealth",        0.0, 1.0)
  59.                 end
  60.             end
  61.         end
  62.     )
  63.    
  64.     local lowhealthplayerdeath = OnCharacterDeath(
  65.         function(player,killer)
  66.             if IsCharacterHuman(player) then
  67.                     print("fLowHealthSound: Player died, resetting buses and variables")
  68.                 if isSoundPlaying == true then
  69.                     isSoundPlaying = false
  70.                     ScriptCB_SndBusFade("main",             busFadeTime, 1.0)
  71.                     ScriptCB_SndBusFade("soundfx",          busFadeTime, 0.7)
  72.                     ScriptCB_SndBusFade("battlechatter",    busFadeTime, 1.0)
  73.                     ScriptCB_SndBusFade("music",            busFadeTime, 1.0)
  74.                     ScriptCB_SndBusFade("ingamemusic",      busFadeTime, 0.7)
  75.                     ScriptCB_SndBusFade("ambience",         busFadeTime, 0.7)
  76.                     ScriptCB_SndBusFade("voiceover",        busFadeTime, 0.8)
  77.                     ScriptCB_SndBusFade("lowhealth",        0.0, 1.0)
  78.                 end
  79.             else end
  80.         end
  81.     )
  82. end
  83.  
  84.  
  85.  function ScriptPostLoad()
  86.  
  87.     fLowHealthSound()
  88.  
  89.     DisableBarriers("dropship")
  90.     DisableBarriers("shield_03")
  91.     DisableBarriers("shield_02")
  92.     DisableBarriers("shield_01")
  93.     DisableBarriers("ctf")
  94.     DisableBarriers("ctf1")
  95.     DisableBarriers("ctf2")
  96.     DisableBarriers("ctf3")
  97.     DisableBarriers("coresh1")
  98.  
  99.     EnableSPHeroRules()
  100.    
  101.     cp1 = CommandPost:New{name = "CP1_CON"}
  102.     cp2 = CommandPost:New{name = "CP2_CON"}
  103.     cp4 = CommandPost:New{name = "CP4_CON"}
  104.     cp5 = CommandPost:New{name = "CP5_CON"}
  105.     cp7 = CommandPost:New{name = "CP7_CON"}
  106.    
  107.  
  108.    
  109.     conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, textATT = "game.modes.con", textDEF = "game.modes.con2", multiplayerRules = true}
  110.    
  111.     conquest:AddCommandPost(cp1)
  112.     conquest:AddCommandPost(cp2)
  113.     conquest:AddCommandPost(cp4)
  114.     conquest:AddCommandPost(cp5)
  115.     conquest:AddCommandPost(cp7)
  116.    
  117.     conquest:Start()
  118.     AddAIGoal(1, "conquest", 100)
  119.     AddAIGoal(2, "conquest", 100)
  120.     AddAIGoal(B1FODDER, "deathmatch", 100)
  121.     AddAIGoal(B1SPECIAL, "conquest", 100)
  122.  
  123.  
  124.    
  125.     SetProperty("CP1_CON", "AllyPath", "CP1JERKPATH")
  126.     SetProperty("CP2_CON", "AllyPath", "CP2JERKPATH")
  127.     SetProperty("CP4_CON", "AllyPath", "CP4JERKPATH")
  128.     SetProperty("CP5_CON", "AllyPath", "CP5JERKPATH")
  129.     SetProperty("CP7_CON", "AllyPath", "CP7JERKPATH")  
  130.    
  131. end
  132.  
  133. function ScriptInit()
  134.     -- Designers, these two lines *MUST* be first!
  135.     StealArtistHeap(2048 * 1024)
  136.     SetPS2ModelMemory(4000000)
  137.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\ingame.lvl")  
  138.     ReadDataFile("ingame.lvl")
  139.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\ingame.lvl")  
  140.    
  141.     REP = 1
  142.     CIS = 2
  143.     B1FODDER = 3
  144.     B1SPECIAL = 4
  145.  
  146.     ATT = 1
  147.     DEF = 2
  148.  
  149.    ReadDataFile("sound\\myg.lvl;myg1cw")
  150.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SOUND\\tcw.lvl;tcwcw")
  151.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\militia.lvl",
  152.                             "rep_inf_tcw_rifleman_militia",
  153.                             "rep_inf_tcw_heavy_militia",
  154.                             "rep_inf_tcw_engineer_militia",
  155.                             "rep_inf_tcw_sniper_militia",
  156.                             "rep_inf_tcw_elite_militia",
  157.                             "rep_inf_tcw_medic_militia")
  158.                              
  159.                              
  160.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\cis.lvl",
  161.                             "cis_inf_B1",
  162.                             "cis_inf_B2",
  163.                             "cis_inf_B2HA",
  164.                             "cis_inf_B2RP",
  165.                             "cis_inf_IG100",
  166.                             "cis_inf_BX_rifleman",
  167.                             "cis_inf_BX_sniper",
  168.                             "cis_inf_droideka",
  169.                             "cis_inf_B1_airdroid",
  170.                             "cis_inf_B1_sergeant")
  171.                            
  172.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\ar169.lvl",
  173.                             "BX_sniper_scope")
  174.     ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\SIDE\\icons.lvl")
  175.                              
  176.     ReadDataFile("SIDE\\tur.lvl",
  177.                             "tur_bldg_recoilless_lg")
  178.  
  179.  
  180.     SetupTeams{
  181.         rep = {
  182.             team = REP,
  183.             units = 24,
  184.             reinforcements = 300,
  185.             class1 = { "rep_inf_tcw_engineer_militia",3, 5},
  186.             class2 = { "rep_inf_tcw_heavy_militia",3, 4},
  187.             class3 = { "rep_inf_tcw_sniper_militia",3, 5},
  188.             class4 = { "rep_inf_tcw_rifleman_militia",3, 5},           
  189.             class5 = { "rep_inf_tcw_medic_militia",3, 4},
  190.             class6 = { "rep_inf_tcw_elite_militia",3, 4},
  191.            
  192.         },
  193.         cis = {
  194.             team = CIS,
  195.             units = 18,
  196.             reinforcements = 300,
  197.             class1 = { "cis_inf_BX_rifleman",2, 3},  
  198.             class2 = { "cis_inf_BX_sniper",1, 2},
  199.             class3 = { "cis_inf_B2HA",2, 3},
  200.             class4 = { "cis_inf_B2",4, 5},
  201.             class5 = { "cis_inf_B2RP",2, 3},
  202. --          class6 = { "cis_inf_B1",1, 3},
  203.             class7 = { "cis_inf_droideka",1, 2},
  204.             class8 = { "cis_inf_IG100", 0, 2},
  205. --          class9 = { "cis_inf_recondroid",0, 2},
  206.         }
  207.     }
  208.    
  209. --    SetHeroClass(CIS, "cis_hero_darthmaul")
  210. --    SetHeroClass(REP, "rep_hero_obiwan")
  211.  
  212.     SetTeamName(B1FODDER, CIS)
  213.     SetTeamIcon(B1FODDER, "cis_icon")
  214.     SetUnitCount(B1FODDER, 12)
  215.     AddUnitClass(B1FODDER, "cis_inf_B1", 12)
  216.  
  217.  
  218.     SetTeamName(B1SPECIAL, CIS)
  219.     SetTeamIcon(B1SPECIAL, "cis_icon")
  220.     SetUnitCount(B1SPECIAL, 3)
  221.     AddUnitClass(B1SPECIAL, "cis_inf_B1_sergeant", 1)
  222.     AddUnitClass(B1SPECIAL, "cis_inf_B1_airdroid", 2)
  223.  
  224.     SetTeamAsEnemy(REP,B1FODDER)
  225.     SetTeamAsEnemy(B1FODDER,REP)
  226.     SetTeamAsFriend(CIS,B1FODDER)
  227.     SetTeamAsFriend(B1FODDER,CIS)
  228.     SetTeamAsFriend(B1FODDER,B1SPECIAL)
  229.     SetTeamAsFriend(B1SPECIAL,B1FODDER)
  230.     SetTeamAsEnemy(REP,B1SPECIAL)
  231.     SetTeamAsEnemy(B1SPECIAL,REP)
  232.     SetTeamAsFriend(CIS,B1SPECIAL)
  233.     SetTeamAsFriend(B1SPECIAL,CIS)
  234.    
  235.     --  Level Stats
  236.     ClearWalkers()
  237.     AddWalkerType(0, 4)
  238.     AddWalkerType(2, 0)
  239.     local weaponCnt = 230
  240.     SetMemoryPoolSize("Aimer", 60)
  241.     SetMemoryPoolSize("AmmoCounter", weaponCnt)
  242.     SetMemoryPoolSize("BaseHint", 250)
  243.     SetMemoryPoolSize("EnergyBar", weaponCnt)
  244.     SetMemoryPoolSize("EntityCloth", 19)
  245.     SetMemoryPoolSize("EntityHover", 7)
  246.     SetMemoryPoolSize("EntityFlyer", 6)
  247.     SetMemoryPoolSize("SoldierAnimation", 400)
  248.     SetMemoryPoolSize("EntitySoundStream", 1)
  249.     SetMemoryPoolSize("EntitySoundStatic", 76)
  250.     SetMemoryPoolSize("MountedTurret", 16)
  251.     SetMemoryPoolSize("Navigator", 50)
  252.     SetMemoryPoolSize("Obstacle", 500)
  253.     SetMemoryPoolSize("PathNode", 256)
  254.     SetMemoryPoolSize("TreeGridStack", 275)
  255.     SetMemoryPoolSize("UnitAgent", 50)
  256.     SetMemoryPoolSize("UnitController", 50)
  257.     SetMemoryPoolSize("Weapon", weaponCnt)
  258.    
  259.     SetSpawnDelay(10.0, 0.25)
  260.     ReadDataFile("myg\\myg1.lvl", "myg1_conquest")
  261.     SetDenseEnvironment("false")
  262.     AddDeathRegion("deathregion")
  263.     SetMaxFlyHeight(20)
  264.     SetMaxPlayerFlyHeight(20)
  265.  
  266.     --  Sound Stats
  267.    
  268.     voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
  269.     AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
  270.     AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
  271.    
  272.     voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
  273.     AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)    
  274.    
  275.     OpenAudioStream("sound\\global.lvl",  "cw_music")
  276.     OpenAudioStream("sound\\myg.lvl",  "myg1")
  277.     OpenAudioStream("sound\\myg.lvl",  "myg1")
  278.     -- OpenAudioStream("sound\\global.lvl",  "global_vo_quick")
  279.     -- OpenAudioStream("sound\\global.lvl",  "global_vo_slow")
  280.     -- OpenAudioStream("sound\\myg.lvl",  "myg1_emt")
  281.  
  282.     SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
  283.     SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing",   1)
  284.     SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing",   1)
  285.     SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)
  286.    
  287.     SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
  288.     SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
  289.     SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
  290.     SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)    
  291.  
  292.     SetOutOfBoundsVoiceOver(1, "Repleaving")
  293.     SetOutOfBoundsVoiceOver(2, "Cisleaving")
  294.  
  295.     SetAmbientMusic(REP, 1.0, "rep_myg_amb_start",  0,1)
  296.     SetAmbientMusic(REP, 0.8, "rep_myg_amb_middle", 1,1)
  297.     SetAmbientMusic(REP, 0.2,"rep_myg_amb_end",    2,1)
  298.     SetAmbientMusic(CIS, 1.0, "cis_myg_amb_start",  0,1)
  299.     SetAmbientMusic(CIS, 0.8, "cis_myg_amb_middle", 1,1)
  300.     SetAmbientMusic(CIS, 0.2,"cis_myg_amb_end",    2,1)
  301.  
  302.     SetVictoryMusic(REP, "rep_myg_amb_victory")
  303.     SetDefeatMusic (REP, "rep_myg_amb_defeat")
  304.     SetVictoryMusic(CIS, "cis_myg_amb_victory")
  305.     SetDefeatMusic (CIS, "cis_myg_amb_defeat")
  306.  
  307.     SetSoundEffect("ScopeDisplayZoomIn",  "binocularzoomin")
  308.     SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
  309.     --SetSoundEffect("WeaponUnableSelect",  "com_weap_inf_weaponchange_null")
  310.     --SetSoundEffect("WeaponModeUnableSelect",  "com_weap_inf_modechange_null")
  311.     SetSoundEffect("SpawnDisplayUnitChange",       "shell_select_unit")
  312.     SetSoundEffect("SpawnDisplayUnitAccept",       "shell_menu_enter")
  313.     SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
  314.     SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
  315.     SetSoundEffect("SpawnDisplayBack",             "shell_menu_exit")
  316.  
  317.  
  318.         --Camera Shizzle--
  319.        
  320.         -- Collector Shot
  321.     AddCameraShot(0.008315, 0.000001, -0.999965, 0.000074, -64.894348, 5.541570, 201.711090);
  322.     AddCameraShot(0.633584, -0.048454, -0.769907, -0.058879, -171.257629, 7.728924, 28.249359);
  323.     AddCameraShot(-0.001735, -0.000089, -0.998692, 0.051092, -146.093109, 4.418306, -167.739212);
  324.     AddCameraShot(0.984182, -0.048488, 0.170190, 0.008385, 1.725611, 8.877428, 88.413887);
  325.     AddCameraShot(0.141407, -0.012274, -0.986168, -0.085598, -77.743042, 8.067328, 42.336128);
  326.     AddCameraShot(0.797017, 0.029661, 0.602810, -0.022434, -45.726467, 7.754435, -47.544712);
  327.     AddCameraShot(0.998764, 0.044818, -0.021459, 0.000963, -71.276566, 4.417432, 221.054550);
  328. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement