Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 7th, 2011  |  syntax: Lua  |  size: 1.81 KB  |  views: 77  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. OnScriptBitSet = function(self, bit)
  2.         URL0001OLD.OnScriptBitSet(self, bit)
  3.         if bit == 0 then # shield toggle
  4.             self:EnableShield()
  5.         elseif bit == 8 then # cloak toggle
  6.             self:StopUnitAmbientSound( 'ActiveLoop' )
  7.             self:SetMaintenanceConsumptionInactive()
  8.             self:DisableUnitIntel('Cloak')
  9.             self:DisableUnitIntel('RadarStealth')
  10.             self:DisableUnitIntel('RadarStealthField')
  11.             self:DisableUnitIntel('SonarStealth')
  12.             self:DisableUnitIntel('SonarStealthField')          
  13.         end
  14.     end,
  15.  
  16.     OnScriptBitClear = function(self, bit)
  17.         URL0001OLD.OnScriptBitClear(self, bit)
  18.         if bit == 0 then # shield toggle
  19.             self:DisableShield()
  20.         elseif bit == 8 then # cloak toggle
  21.             self:PlayUnitAmbientSound( 'ActiveLoop' )
  22.             self:SetMaintenanceConsumptionActive()
  23.             self:EnableUnitIntel('Cloak')
  24.             self:EnableUnitIntel('RadarStealth')
  25.             self:EnableUnitIntel('RadarStealthField')
  26.             self:EnableUnitIntel('SonarStealth')
  27.             self:EnableUnitIntel('SonarStealthField')
  28.         end
  29.     end,
  30.  
  31.         CreateEnhancement = function(self, enh)
  32.         URL0001OLD.CreateEnhancement(self, enh)
  33.         local bp = self:GetBlueprint().Enhancements[enh]
  34.         if enh == 'Shield' then
  35.             self:AddToggleCap('RULEUTC_ShieldToggle')
  36.             self:SetEnergyMaintenanceConsumptionOverride(bp.MaintenanceConsumptionPerSecondEnergy or 0)
  37.             self:SetMaintenanceConsumptionActive()
  38.             self:CreatePersonalShield(bp)
  39.         elseif enh == 'ShieldRemove' then
  40.             self:DestroyShield()
  41.             self:SetMaintenanceConsumptionInactive()
  42.             self:RemoveToggleCap('RULEUTC_ShieldToggle')
  43.                 end
  44.         end,
clone this paste RAW Paste Data