Advertisement
Mjjstral

C&C4 scripts.lua

Nov 7th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.77 KB | None | 0 0
  1. --- define lua functions
  2. function NoOp(self, source)
  3. end
  4.  
  5.  
  6. function kill(self) -- Kill unit self.
  7.     ExecuteAction("NAMED_KILL", self);
  8. end
  9.  
  10. function RadiateUncontrollableFear( self )
  11.     ObjectBroadcastEventToEnemies( self, "BeUncontrollablyAfraid", 350 )
  12. end
  13.  
  14. function RadiateGateDamageFear(self)
  15.     ObjectBroadcastEventToAllies(self, "BeAfraidOfGateDamaged", 200)
  16. end
  17.  
  18. function OnNeutralGarrisonableBuildingCreated(self)
  19.     ObjectHideSubObjectPermanently( self, "ARMOR", true )
  20. end
  21.  
  22. function OnGDITechCenterCreated(self)
  23.     ObjectHideSubObjectPermanently( self, "UG_Boost", true )
  24.     ObjectHideSubObjectPermanently( self, "UG_Mortar", true )
  25.     ObjectHideSubObjectPermanently( self, "B_MortarRound_1", true )
  26.     ObjectHideSubObjectPermanently( self, "UG_Rail", true )
  27.     ObjectHideSubObjectPermanently( self, "UG_Scan", true )
  28. end
  29.  
  30. function OnGDIMedicalBayCreated(self)
  31.     ObjectHideSubObjectPermanently( self, "UG_Armor", true )
  32.     ObjectHideSubObjectPermanently( self, "UG_StealthDetector", true )
  33.     ObjectHideSubObjectPermanently( self, "UG_StealthDetector01", true )
  34.     ObjectHideSubObjectPermanently( self, "UG_Injector", true )
  35. end
  36.  
  37. function OnGDIPowerPlantCreated(self)
  38.     ObjectHideSubObjectPermanently( self, "Turbines", true )
  39.     ObjectHideSubObjectPermanently( self, "TurbineGlows", true )
  40. end
  41.  
  42. function OnGDIInfantryCCreated(self)
  43.     ObjectHideSubObjectPermanently( self, "UGSCANNER", true )
  44.     ObjectHideSubObjectPermanently( self, "UGJUMP", true )
  45.     ObjectHideSubObjectPermanently( self, "UGINJECTOR", true )
  46. end
  47.  
  48. function OnGDIVehicleAGCreated(self)
  49.     ObjectHideSubObjectPermanently( self, "GUL_VehicleAG_UPG", true )
  50.     ObjectHideSubObjectPermanently( self, "UPG_SHIELD_FX", true )
  51. end
  52.  
  53. function OnGDIVehicleAGHuskCreated(self)
  54.     OnGDIVehicleAGCreated( self )
  55.     ObjectClearObjectStatus( self, "CANNOT_PROVIDE_BUILDABILITY" )
  56.     OnBaseHuskCreatorCreated(self)
  57. end
  58.  
  59. function OnGDIVehicleDCreated(self)
  60.     ObjectHideSubObjectPermanently( self, "GUL_VehicleD_UPG", true )
  61.     ObjectHideSubObjectPermanently( self, "UGRAIL_01", true )
  62.     ObjectHideSubObjectPermanently( self, "UGRAIL_02", true )
  63.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_01", true )
  64.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_02", true )
  65.     OnBaseHuskCreatorCreated(self)
  66. end
  67.  
  68. function OnGDIVehicleDHuskCreated(self)
  69.     OnGDIVehicleDCreated( self )
  70.     ObjectClearObjectStatus( self, "CANNOT_PROVIDE_BUILDABILITY" )
  71. end
  72.  
  73.  
  74. function OnGDIVehicleGCreated(self)
  75.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_01", true )
  76.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_02", true )
  77.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_03", true )
  78.     ObjectHideSubObjectPermanently( self, "Upgrade", true )
  79. end
  80.  
  81. function OnGDIVehicleHCreated(self)
  82.     ObjectHideSubObjectPermanently( self, "GUVehicleH_UPG", true )
  83. end
  84.  
  85. function OnGDIWatchTowerCreated(self)
  86.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_01", true )
  87.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_02", true )
  88. end
  89.  
  90. function OnGDIAircraftBCreated(self)
  91.     -- bomb load by default.
  92.     ObjectGrantUpgrade( self, "Upgrade_SelectLoad_02" )
  93.     ObjectGrantUpgrade( self, "Upgrade_SelectLoad_02_Desired" )
  94.     ObjectHideSubObjectPermanently( self, "Plane04", true )
  95. end
  96.  
  97. function OnGDIVehicleJCreated(self)
  98.     ObjectHideSubObjectPermanently( self, "MortorTube", true )
  99. end
  100.  
  101. function OnGDIAircraftACreated(self)
  102.     ObjectHideSubObjectPermanently( self, "UG_PROBE", true )
  103. end
  104.  
  105. function OnGDIInfantryFSquadCreated(self)
  106.     ObjectSetObjectStatus( self, "CAN_SPOT_FOR_BOMBARD" )
  107. end
  108.  
  109. function OnGDIOrcaClipEmpty(self)
  110.     ObjectHideSubObjectPermanently( self, "MISSILE01", true )
  111. end
  112.  
  113. function OnGDIOrcaClipFull(self)
  114.     ObjectHideSubObjectPermanently( self, "MISSILE01", false )
  115. end
  116.  
  117. function OnNODShredderCreated(self)
  118.  
  119. end
  120.  
  121. function OnNODVehicleDCreated(self)
  122.     ObjectHideSubObjectPermanently( self, "Gun_Upgrade", true )
  123.     ObjectHideSubObjectPermanently( self, "Turret2_Gun", true )
  124.     ObjectHideSubObjectPermanently( self, "Turret2", true )
  125.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_01", true )
  126.     ObjectHideSubObjectPermanently( self, "DOZERBLADE", true )
  127. end
  128.  
  129. function OnNODVehicleGCreated(self)
  130.     ObjectHideSubObjectPermanently( self, "NUBEAM", true )
  131.     ObjectHideSubObjectPermanently( self, "FLAMETANK", true )
  132.     ObjectHideSubObjectPermanently( self, "S_DETECTOR", true )
  133.     ObjectHideSubObjectPermanently( self, "S_GENERATOR", true )
  134.     OnBaseHuskCreatorCreated(self)
  135. end
  136.  
  137. function OnNODVehicleGGenericEvent(self, data)
  138.  
  139.     local str = tostring( data )
  140.  
  141.     if str == "upgrades_copied" then
  142.         ObjectRemoveUpgrade( self, "Upgrade_Veterancy_VETERAN" );
  143.         ObjectRemoveUpgrade( self, "Upgrade_Veterancy_ELITE" );
  144.         ObjectRemoveUpgrade( self, "Upgrade_Veterancy_HEROIC" );
  145.     end
  146. end
  147.  
  148. function OnNODVehicleACreated(self)
  149.     ObjectHideSubObjectPermanently( self, "NUS_VehicleA_UPG", true )
  150. end
  151.  
  152. function OnNODVehicleADCreated(self)
  153.     ObjectHideSubObjectPermanently( self, "NUL_VehicleAD_upgrade", true )
  154.  
  155.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider01", true )
  156.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider02", true )
  157.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider03", true )
  158.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider04", true )
  159.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider05", true )
  160.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider06", true )
  161. end
  162.  
  163. function OnNODVehicleADHuskCreated(self)
  164.     OnNODVehicleADCreated( self )
  165.     ObjectClearObjectStatus( self, "CANNOT_PROVIDE_BUILDABILITY" )
  166. end
  167.  
  168. function NODVehicleAFHuskFunctions(self)
  169.     ObjectClearObjectStatus( self, "CANNOT_PROVIDE_BUILDABILITY" )
  170. end
  171.  
  172. function OnNODVehicleADContainCountChanged(self, countData)
  173.  
  174.     local count = tonumber( countData )
  175.    
  176.     local hidetag1 = count < 1
  177.     local hidetag2 = count < 2
  178.     local hidetag3 = count < 3
  179.     local hidetag4 = count < 4
  180.     local hidetag5 = count < 5
  181.     local hidetag6 = count < 6
  182.  
  183.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider01", hidetag1 )
  184.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider02", hidetag2 )
  185.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider03", hidetag3 )
  186.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider04", hidetag4 )
  187.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider05", hidetag5 )
  188.     ObjectHideSubObjectPermanently( self, "ModuleTag_Spider06", hidetag6 )
  189.  
  190. end
  191.  
  192. function OnNODAircraftACreated(self)
  193.     ObjectHideSubObjectPermanently( self, "SigGen", true )
  194. end
  195.  
  196. function OnNODAircraftNCreated(self)
  197.     ObjectHideSubObjectPermanently( self, "UPgrade", true )
  198. end
  199.  
  200. function OnNODVehicleLCreated(self)
  201.     ObjectHideSubObjectPermanently( self, "NUM_VehicleL_UPG", true )
  202.     ObjectHideSubObjectPermanently( self, "NUM_VehicleL_UPG1", true )
  203.     --ObjectHideSubObjectPermanently( self, "TREDS", true )
  204. end
  205.  
  206. function OnNODTechAssembleyPlantCreated(self)
  207.     ObjectHideSubObjectPermanently( self, "UG_EMP", true )
  208.     ObjectHideSubObjectPermanently( self, "UG_Lasers", true )
  209.     ObjectHideSubObjectPermanently( self, "UG_SigGen", true )
  210.     ObjectHideSubObjectPermanently( self, "UG_DozerBlades", true )
  211. end
  212.  
  213. function OnNODSecretShrineCreated(self)
  214.     ObjectHideSubObjectPermanently( self, "GLOWS", true )  
  215.     ObjectHideSubObjectPermanently( self, "ConfUpgrd", true )
  216. end
  217.  
  218. function OnNODSecretShrinePowerOutage(self)
  219.     if ObjectHasUpgrade( self, "Upgrade_NODConfessorUpgrade" ) == 1 then
  220.         ObjectHideSubObjectPermanently( self, "GLOWS", true )  
  221.     end
  222. end
  223.  
  224. function OnNODSecretShrinePowerRestored(self)        
  225.     if ObjectHasUpgrade( self, "Upgrade_NODConfessorUpgrade" ) == 1 then
  226.         ObjectHideSubObjectPermanently( self, "GLOWS", false ) 
  227.     end
  228. end
  229.  
  230. function onCreatedControlPointFunctions(self)
  231.     ObjectHideSubObjectPermanently( self, "TB_CP_ALN", true )
  232.     ObjectHideSubObjectPermanently( self, "TB_CP_GDI", true )
  233.     ObjectHideSubObjectPermanently( self, "TB_CP_NOD", true )
  234.     ObjectHideSubObjectPermanently( self, "LIGHTSF01", true )
  235.     ObjectHideSubObjectPermanently( self, "100", false)
  236.     ObjectHideSubObjectPermanently( self, "75", false)
  237.     ObjectHideSubObjectPermanently( self, "50", false)
  238.     ObjectHideSubObjectPermanently( self, "25", false )
  239. end
  240.  
  241. function onBuildingPowerOutage(self)
  242.     ObjectHideSubObjectPermanently( self, "LIGHTS", true )
  243.     ObjectHideSubObjectPermanently( self, "FXLIGHTS05", true )
  244.     ObjectHideSubObjectPermanently( self, "FXLIGHTS", true )
  245.     ObjectHideSubObjectPermanently( self, "FXGLOWS", true )
  246.     ObjectHideSubObjectPermanently( self, "FLASHINGLIGHTS", true )
  247.     ObjectHideSubObjectPermanently( self, "MESH01", true )
  248.     ObjectHideSubObjectPermanently( self, "POWERPLANTGLOWS", true )
  249.     ObjectHideSubObjectPermanently( self, "LIGHTL", true )
  250.     ObjectHideSubObjectPermanently( self, "LIGHTR", true )
  251.     ObjectHideSubObjectPermanently( self, "LIGHTS1", true )
  252.     ObjectHideSubObjectPermanently( self, "NBCHEMICALPTE1", true )
  253.     ObjectHideSubObjectPermanently( self, "LINKS", true )
  254.     ObjectHideSubObjectPermanently( self, "MESH28", true )
  255.     ObjectHideSubObjectPermanently( self, "TURBINEGLOWS", true )
  256.     ObjectHideSubObjectPermanently( self, "GLOWS", true )
  257. end
  258.  
  259. function onBuildingPowerRestored(self)
  260.     ObjectHideSubObjectPermanently( self, "LIGHTS", false )
  261.     ObjectHideSubObjectPermanently( self, "FXLIGHTS05", false )
  262.     ObjectHideSubObjectPermanently( self, "FXLIGHTS", false )
  263.     ObjectHideSubObjectPermanently( self, "FXGLOWS", false )
  264.     ObjectHideSubObjectPermanently( self, "FLASHINGLIGHTS", false )
  265.     ObjectHideSubObjectPermanently( self, "MESH01", false )
  266.     ObjectHideSubObjectPermanently( self, "POWERPLANTGLOWS", false )
  267.     ObjectHideSubObjectPermanently( self, "LIGHTL", false )
  268.     ObjectHideSubObjectPermanently( self, "LIGHTR", false )
  269.     ObjectHideSubObjectPermanently( self, "LIGHTS1", false )
  270.     ObjectHideSubObjectPermanently( self, "NBCHEMICALPTE1", false )
  271.     ObjectHideSubObjectPermanently( self, "LINKS", false )
  272.     ObjectHideSubObjectPermanently( self, "MESH28", false )
  273.     ObjectHideSubObjectPermanently( self, "TURBINEGLOWS", false )
  274.     ObjectHideSubObjectPermanently( self, "GLOWS", false )
  275. end
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283. function OnNeutralGarrisonableBuildingGenericEvent(self,data)
  284. end
  285.  
  286. function onCreatedGDIOrcaAirstrike(self)
  287.     ObjectForbidPlayerCommands( self, true )
  288. end
  289.  
  290. function onCreatedAlienMCVUnpacking(self)
  291.     ObjectForbidPlayerCommands( self, true )
  292. end
  293.  
  294. function MakeMeAlert(self)
  295.     ObjectEnterAlertState(self)
  296. end
  297.  
  298. function BecomeUncontrollablyAfraid(self, other)
  299.     if not ObjectTestCanSufferFear(self) then
  300.         return
  301.     end
  302.  
  303.     ObjectEnterUncontrollableCowerState(self, other)
  304. end
  305.  
  306. function RadiateTerror(self, other)
  307.     ObjectBroadcastEventToEnemies(self, "BeTerrified", 180)
  308. end
  309.    
  310. function RadiateTerrorEx(self, other, terrorRange)
  311.     ObjectBroadcastEventToEnemies(self, "BeTerrified", terrorRange)
  312. end
  313.    
  314.  
  315. function BecomeTerrified(self, other)
  316.     ObjectEnterRunAwayPanicState(self, other)
  317. end
  318.  
  319. function BecomeAfraidOfGateDamaged(self, other)
  320.     if not ObjectTestCanSufferFear(self) then
  321.         return
  322.     end
  323.  
  324.     ObjectEnterCowerState(self,other)
  325. end
  326.  
  327.  
  328. function ChantForUnit(self) -- Used by units to broadcast the chant event to their own side.
  329.     ObjectBroadcastEventToAllies(self, "BeginChanting", 9999)
  330. end
  331.  
  332. function StopChantForUnit(self) -- Used by units to stop the chant event to their own side.
  333.     ObjectBroadcastEventToAllies(self, "StopChanting", 9999)
  334. end
  335.  
  336. function SpyMoving(self, other)
  337.     print(ObjectDescription(self).." spying movement of "..ObjectDescription(other));
  338. end
  339.  
  340. function OnGarrisonableCreated(self)
  341.     ObjectHideSubObjectPermanently( self, "GARRISON01", true )
  342.     ObjectHideSubObjectPermanently( self, "GARRISON02", true )
  343. end
  344.  
  345. function OnRubbleDropshipCreated(self)
  346.     ObjectHideSubObjectPermanently( self, "Loadref", true )
  347. end
  348.  
  349. function OnAlienMotherShipCreated(self)
  350.     ObjectSetObjectStatus( self, "AIRBORNE_TARGET" )
  351. end
  352.  
  353. function OnNODInfantryICreated(self)
  354.     ObjectHideSubObjectPermanently( self, "WEAPON_PARTICLEBM", true )
  355. end
  356.  
  357. function OnNodVehicleMCreated(self)
  358.     ObjectHideSubObjectPermanently( self, "NUM_VehicleM_UPG", true )
  359. end
  360.  
  361. function OnNodVehicleOCreated(self)
  362.     ObjectHideSubObjectPermanently( self, "B_FTR", true )
  363.     ObjectHideSubObjectPermanently( self, "FTR", true )
  364.     ObjectHideSubObjectPermanently( self, "FX_FTpilotflameR", true )
  365.     ObjectHideSubObjectPermanently( self, "B_FTL", true )
  366.     ObjectHideSubObjectPermanently( self, "FTL", true )
  367.     ObjectHideSubObjectPermanently( self, "FX_FTpilotflameL", true )   
  368.     ObjectHideSubObjectPermanently( self, "HvyMGL", true )
  369.     ObjectHideSubObjectPermanently( self, "HvyMGBarrelL", true )
  370.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_01", true ) 
  371.     ObjectHideSubObjectPermanently( self, "HvyMGR", true )
  372.     ObjectHideSubObjectPermanently( self, "HvyMGBarrelR", true )
  373.     ObjectHideSubObjectPermanently( self, "MuzzleFlash_02", true ) 
  374.     ObjectHideSubObjectPermanently( self, "RocketPodL", true )
  375.     ObjectHideSubObjectPermanently( self, "RocketPodR", true ) 
  376.     ObjectHideSubObjectPermanently( self, "ModuleR", true )
  377.     ObjectHideSubObjectPermanently( self, "ModuleBeacontR", true )
  378.     ObjectHideSubObjectPermanently( self, "ModuleLightR", true )   
  379.     ObjectHideSubObjectPermanently( self, "ModuleL", true )
  380.     ObjectHideSubObjectPermanently( self, "ModuleBeaconL", true )
  381.     ObjectHideSubObjectPermanently( self, "ModuleLightL", true )   
  382.     OnBaseHuskCreatorCreated(self)
  383. end
  384.  
  385. function OnNODVehicleRCreated(self)
  386.     ObjectHideSubObjectPermanently( self, "NUBEAM", true )
  387.     ObjectHideSubObjectPermanently( self, "S_DETECTOR", true )
  388.     ObjectHideSubObjectPermanently( self, "S_GENERATOR", true )
  389. end
  390.  
  391. function TechStructureEOnCreated(self)
  392.     ObjectHideSubObjectPermanently( self, "FXTopLightRED", true )
  393.     ObjectHideSubObjectPermanently( self, "FXTopLightRED_Bulb", true )
  394.     --- ObjectHideSubObjectPermanently( self, "FXTopLightGREEN", true )
  395.     --- ObjectHideSubObjectPermanently( self, "FXTopLightGREEN_Bulb", true )
  396. end
  397.  
  398. function NODStructureAOnCreated(self)
  399.     ObjectHideSubObjectPermanently( self, "NSL_StructureA_UPG", true )
  400. end
  401.  
  402.  
  403.  
  404. function NODStructureBOnCreated(self)
  405.     ObjectHideSubObjectPermanently( self, "NSL_StructureB_UPG", true )
  406. end
  407.  
  408. function NODStructureJOnCreated(self)
  409.     ObjectHideSubObjectPermanently( self, "Rocket_UPG_1", true )
  410.     ObjectHideSubObjectPermanently( self, "Rocket_UPG_2", true )
  411.     ObjectHideSubObjectPermanently( self, "Rocket_UPG_3", true )
  412.     ObjectHideSubObjectPermanently( self, "StructureJ_UPG1", true )
  413.     ObjectHideSubObjectPermanently( self, "StructureJ_UPG2", true )
  414. end
  415.  
  416. function GDIStructureEOnCreated(self)
  417.     ObjectHideSubObjectPermanently( self, "GSL_StructureE_UPG", true )
  418. end
  419.  
  420. function GDIStructureIOnCreated(self)
  421.     ObjectHideSubObjectPermanently( self, "GSL_StructureI_UPG", true )
  422. end
  423.  
  424. function SharedBaseHoleOnCreated(self)
  425.     --- set USER_20 model state so I can detect the hole in WB
  426.     ObjectSetModelCondition(self, "USER_20")
  427. end
  428.  
  429. function OnGDIVehicleVCreated(self)
  430.     ObjectHideSubObjectPermanently( self, "GUVehicle_UPG", true )
  431.     ObjectHideSubObjectPermanently( self, "Weapon_UPG", true )
  432. end
  433.  
  434. function OnGDIVehicleSCreated(self)
  435.     ObjectSetObjectStatus( self, "REPAIR_ALLIES_WHEN_IDLE" )
  436. end
  437.  
  438. function OnGDIVehicleMCreated(self)
  439.     ObjectHideSubObjectPermanently( self, "GUL_VehicleM_UPG", true )
  440.     ObjectHideSubObjectPermanently( self, "UPG_SHIELD_FX", true )
  441. end
  442.  
  443. function CrawlerCreated(self)
  444.     ObjectHideSubObjectPermanently( self, "TECH2", true )
  445.     ObjectHideSubObjectPermanently( self, "TECH3", true )
  446. end
  447.  
  448. function GideonCrawlerCreated(self)
  449. end
  450.  
  451. function OnNodVehicleCCreated(self)
  452.     ObjectSetObjectStatus( self, "SHIELDBODY_ENABLED" )
  453.     ObjectHideSubObjectPermanently( self, "NODVehicleC_UPG", true )
  454. end
  455.  
  456. -- remove upgrade from object or else it will pop back to life right away the next
  457. -- time it dies
  458. function OnBaseHuskCreatorCreated(self)
  459.     ObjectRemoveUpgrade( self, "Upgrade_HuskReviveTrigger" )
  460. end
  461.  
  462. function OnGDIVehicleACreated(self)
  463.     ObjectHideSubObjectPermanently( self, "GUVehicleA_Gun_UPG", true )
  464.     ObjectHideSubObjectPermanently( self, "GUVehicleA_Ammo_UPG", true )
  465. end
  466.  
  467. function OnGDIVehicleABCreated(self)
  468.     ObjectHideSubObjectPermanently( self, "GUS_VehicleAB_UPG", true )
  469. end
  470.  
  471. function OnGDIVehicleACCreated(self)
  472.     ObjectHideSubObjectPermanently( self, "GUS_VehicleAC_UPG", true )
  473. end
  474.  
  475. function OnNODVehicleABCreated(self)
  476.     ObjectHideSubObjectPermanently( self, "NUM_VehicleAB_UPG", true )
  477.     ObjectHideSubObjectPermanently( self, "Treads_UPG", true )
  478.     ObjectHideSubObjectPermanently( self, "NUM_VehicleAB_UPG01", true )
  479.     ObjectHideSubObjectPermanently( self, "Missile_Holder_UPG", true ) 
  480. end
  481.  
  482. function OnGDIVehicleAECreated(self)
  483.     ObjectHideSubObjectPermanently( self, "GUVehicleAE_UPG", true )
  484. end
  485.  
  486. function OnNODVehicleBCreated(self)
  487.     ObjectHideSubObjectPermanently( self, "NUS_VehicleB_UPG", true )
  488. end
  489.  
  490. function OnNODStructureFCreated(self)
  491.     ObjectHideSubObjectPermanently( self, "NSL_StructureF_UPG", true )
  492. end
  493.  
  494. function OnGDIVehiclePCreated(self)
  495.     ObjectHideSubObjectPermanently( self, "GUM_VehicleP_UPG", true )
  496. end
  497.  
  498. function OnConquerVehicleCreated(self)
  499.     ObjectSetObjectStatus( self, "AI_SKIP_UPGRADE_CRATE_SEARCH" )
  500. end
  501.  
  502. function OnGDIVehicleADCreated(self)
  503.     ObjectHideSubObjectPermanently( self, "GUS_VehicleAD_UPG", true )
  504. end
  505.  
  506. function OnGDIVehicleABCreated(self)
  507.     ObjectHideSubObjectPermanently( self, "GUM_VehicleAB_UPG", true )
  508. end
  509.  
  510. function OnGDIVehicleAFCreated(self)
  511.     ObjectHideSubObjectPermanently( self, "GUL_VehicleAF_UPG", true )
  512.     ObjectHideSubObjectPermanently( self, "Refraction_Armor", true )
  513. end
  514.  
  515. function OnGDIVehicleLCreated(self)
  516.     ObjectHideSubObjectPermanently( self, "Gun_Upgrade", true )
  517. end
  518.  
  519. function OnGDIVehicleLHuskCreated(self)
  520.     OnGDIVehicleLCreated( self )
  521.     ObjectClearObjectStatus( self, "CANNOT_PROVIDE_BUILDABILITY" )
  522. end
  523.  
  524. function OnNodVehicleTCreated(self)
  525.     ObjectHideSubObjectPermanently( self, "NUVehicleT_UPG", true )
  526. end
  527.  
  528. function OnNodVehicleFCreated(self)
  529.     ObjectHideSubObjectPermanently( self, "Upgrade2", true )
  530. end
  531.  
  532. function OnNODVehicleWCreated(self)
  533.     ObjectHideSubObjectPermanently( self, "MINE_UPG", true )
  534.     ObjectHideSubObjectPermanently( self, "UPGRADE", true )
  535. end
  536.  
  537. function OnNodVehicleECreated(self)
  538.     ObjectHideSubObjectPermanently( self, "NUM_VehicleE_UPG", true )
  539. end
  540.  
  541. function OnNODVehicleICreated(self)
  542.     ObjectHideSubObjectPermanently( self, "", true )
  543. end
  544.  
  545. function OnNODAircraftJCreated(self)
  546.     ObjectHideSubObjectPermanently( self, "NUM_AircraftJ_UPG", true )
  547. end
  548.  
  549. function OnNODInfantryTCreated(self)
  550.     ObjectHideSubObjectPermanently( self, "NODInfantryT_UPG", true )
  551. end
  552.  
  553. function OnNODStructureDCreated(self)
  554.     ObjectHideSubObjectPermanently( self, "NSL_StructureD_UPG", true )
  555.     ObjectHideSubObjectPermanently( self, "IRIS", true )
  556. end
  557.  
  558. function OnGDIAircraftOCreated(self)
  559.     ObjectHideSubObjectPermanently( self, "GUS_AircraftO_UPG", true )
  560. end
  561.  
  562. function OnGDIInfantryVCreated(self)
  563.     ObjectHideSubObjectPermanently( self, "Upgrade", true )
  564. end
  565.  
  566. function OnGDIInfantryRCreated(self)
  567.     ObjectHideSubObjectPermanently( self, "Upgrades", true )
  568. end
  569.  
  570. function OnGDIInfantryTGenericEvent(self, data)
  571.     local str = tostring( data )
  572.     if str == "hide_backpack" then
  573.         ObjectHideSubObjectPermanently( self, "GUINFANTRYT_BACKPACK", true )
  574.     elseif str == "hide_platform" then     
  575.         ObjectHideSubObjectPermanently( self, "GUINFANTRYT_BASE", true )
  576.     elseif str == "show_backpack" then
  577.         ObjectHideSubObjectPermanently( self, "GUINFANTRYT_BACKPACK", false )
  578.     elseif str == "show_platform" then
  579.         ObjectHideSubObjectPermanently( self, "GUINFANTRYT_BASE", false )
  580.     end
  581. end
  582.  
  583. function OnGDIInfantryTCreated(self)
  584.     ObjectHideSubObjectPermanently( self, "GUINFANTRYT_BASE", true )
  585. end
  586.  
  587. function OnGDIStructureCCreated(self)
  588.     ObjectHideSubObjectPermanently( self, "GSL_StructureC_UPG", true )
  589. end
  590.  
  591. function OnGDIStructureACreated(self)
  592.     ObjectHideSubObjectPermanently( self, "GSX_StructureA_UPG", true )
  593. end
  594.  
  595. function OnGDIStructureBCreated(self)
  596.     ObjectHideSubObjectPermanently( self, "GSL_StructureB_UPG", true )
  597. end
  598.  
  599. function OnGDIStructureDCreated(self)
  600.     ObjectHideSubObjectPermanently( self, "GSL_StructureD_UPG", true )
  601. end
  602.  
  603. function OnGDIStructureFCreated(self)
  604.     ObjectHideSubObjectPermanently( self, "GSL_StructureF_UPG", true )
  605. end
  606.  
  607. function OnIonStormCreated(self)
  608.     ObjectSetModelCondition(self, "EMOTION_DISSIDENT")
  609. end
  610.  
  611. function OnGDIStructureGCreated(self)
  612.     ObjectHideSubObjectPermanently( self, "GSM_StructureG_UPG01", true )
  613. end
  614.  
  615. function OnGDIInfantryUCreated(self)
  616.     ObjectHideSubObjectPermanently( self, "GUS_InfantryU_UPG", true )
  617. end
  618.  
  619. function OnNODVehicleACCreated(self)
  620.     ObjectHideSubObjectPermanently( self, "NUL_VehicleAC_upgrade", true )
  621. end
  622.  
  623. function OnNODVehicleACHuskCreated(self)
  624.     OnNODVehicleACCreated( self )
  625.     ObjectClearObjectStatus( self, "CANNOT_PROVIDE_BUILDABILITY" )
  626. end
  627.  
  628.  
  629. function OnNODInfantryUCreated(self)
  630.     ObjectHideSubObjectPermanently( self, "Upgrade", true )
  631. end
  632.  
  633. function OnNODInfantrySCreated(self)
  634.     ObjectHideSubObjectPermanently( self, "NUS_InfantryS_upgrade", true )
  635.     ObjectHideSubObjectPermanently( self, "NUS_InfantryS_suicide", true )
  636. end
  637.  
  638. function OnNODInfantryRCreated(self)
  639.     ObjectHideSubObjectPermanently( self, "NU_InfantryR_upgrade", true )
  640. end
  641.  
  642. function OnNODAircraftOCreated(self)
  643.     ObjectHideSubObjectPermanently( self, "Upgrade", true )
  644. end
  645.  
  646. function OnNODStructureCCreated(self)
  647.     ObjectHideSubObjectPermanently( self, "NSL_StructureC_UPG", true )
  648.     ObjectHideSubObjectPermanently( self, "IRIS", true )
  649. end
  650.  
  651. function OnNODStructureGCreated(self)
  652.     ObjectHideSubObjectPermanently( self, "NSM_StructureG_UPG", true )
  653. end
  654.  
  655. function OnNODStructureECreated(self)
  656.     ObjectHideSubObjectPermanently( self, "NSL_StructureE_UPG", true )
  657. end
  658.  
  659. function OnGDIVehicleAKCreated(self)
  660.     ObjectHideSubObjectPermanently( self, "GUL_VehicleAK_UPG", true )
  661. end
  662.  
  663. function OnNODInfantryBCreated(self)
  664.     ObjectHideSubObjectPermanently( self, "Upgrd", true )
  665. end
  666.  
  667. function OnGDIInfantryOCreated(self)
  668.     ObjectHideSubObjectPermanently( self, "Upgrades", true )
  669. end
  670.  
  671. function OnCrystalLifterCreated(self)
  672.     ObjectHideSubObjectPermanently( self, "Tiberium_Blue", true )
  673. end
  674.  
  675. function OnSuperCrystalLifterCreated(self)
  676.     ObjectHideSubObjectPermanently( self, "Tiberium", true )
  677. end
  678.  
  679. function OnNODCommandoACreated(self)
  680.     ObjectHideSubObjectPermanently( self, "Upgrade", true )
  681. end
  682.  
  683. function OnGDICommandoACreated(self)
  684.     ObjectHideSubObjectPermanently( self, "CommandoA_UPG", true )
  685. end
  686.  
  687. function OnGDICommander_3_2_Functions(self, data)
  688.     local str = tostring( data )
  689.  
  690.     if str == "WeaponRocket" then
  691.         ObjectHideSubObjectPermanently( self, "Rocket", false )
  692.         ObjectHideSubObjectPermanently( self, "Rifle", true )
  693.     elseif str == "WeaponRifle" then
  694.         ObjectHideSubObjectPermanently( self, "Rocket", true )
  695.         ObjectHideSubObjectPermanently( self, "Rifle", false )
  696.     end
  697. end
  698.  
  699. function NODStructureJRocketOnCreated(self)
  700.     ObjectHideSubObjectPermanently( self, "Rocket_UPG_1", true )
  701.     ObjectHideSubObjectPermanently( self, "Rocket_UPG_2", true )
  702.     ObjectHideSubObjectPermanently( self, "Rocket_UPG_3", true )
  703. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement