Advertisement
Mjjstral

BFMEII ROTWK scripts.lua

Nov 7th, 2017
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 28.55 KB | None
  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 RadiatePhialFear( self )
  11.     ObjectBroadcastEventToEnemies( self, "BeAfraidOfPhial", 75 )
  12. end
  13.  
  14. function RadiateUncontrollableFear( self )
  15.     ObjectBroadcastEventToEnemies( self, "BeUncontrollablyAfraid", 350 )
  16. end
  17.  
  18. function RadiateGateDamageFear(self)
  19.     ObjectBroadcastEventToAllies(self, "BeAfraidOfGateDamaged", 200)
  20. end
  21.  
  22. function RadiateBalrogFear(self)
  23.     ObjectBroadcastEventToEnemies(self, "BeAfraidOfBalrog", 180)
  24. end
  25.  
  26. function OnMumakilCreated(self)
  27.     ObjectHideSubObjectPermanently( self, "Houda", true )
  28.     ObjectHideSubObjectPermanently( self, "Houda01", true )
  29. end
  30.  
  31. function OnTrollCreated(self)
  32.     ObjectHideSubObjectPermanently( self, "Trunk01", true )
  33.     ObjectGrantUpgrade( self, "Upgrade_SwitchToRockThrowing" )
  34. end
  35.  
  36. function OnCreepTrollCreated(self)
  37.     ObjectHideSubObjectPermanently( self, "Trunk01", true )
  38.     ObjectHideSubObjectPermanently( self, "ROCK", true )
  39. end
  40.  
  41. function OnCaptureFlagGenericEvent(self,data)
  42.     local str = ObjectCapturingObjectPlayerSide(self)
  43.     if str == nil then
  44.         str = ObjectPlayerSide(self)
  45.     end
  46.  
  47.  
  48.     ObjectHideSubObjectPermanently( self, "FLAG_ISENGARD", true)
  49.     ObjectHideSubObjectPermanently( self, "FLAG_MORDOR", true)
  50.     ObjectHideSubObjectPermanently( self, "FLAG_WILD", true)
  51.     ObjectHideSubObjectPermanently( self, "FLAG_MEN", true)
  52.     ObjectHideSubObjectPermanently( self, "FLAG_ELVES", true)
  53.     ObjectHideSubObjectPermanently( self, "FLAG_DWARVES", true)
  54.     ObjectHideSubObjectPermanently( self, "FLAG_ANGMAR", true)
  55.  
  56.     if str == "Isengard" then
  57.         ObjectHideSubObjectPermanently( self, "FLAG_ISENGARD", false)
  58.     elseif str == "Mordor" then
  59.         ObjectHideSubObjectPermanently( self, "FLAG_MORDOR", false)
  60.     elseif str == "Men" then
  61.         ObjectHideSubObjectPermanently( self, "FLAG_MEN", false)
  62.     elseif str == "Dwarves" then
  63.         ObjectHideSubObjectPermanently( self, "FLAG_DWARVES", false)
  64.     elseif str == "Elves" then
  65.         ObjectHideSubObjectPermanently( self, "FLAG_ELVES", false)
  66.     elseif str == "Wild" then
  67.         ObjectHideSubObjectPermanently( self, "FLAG_WILD", false)
  68.     elseif str == "Angmar" then
  69.         ObjectHideSubObjectPermanently( self, "FLAG_ANGMAR", false)
  70.     else
  71.         ObjectHideSubObjectPermanently( self, "FLAG_NEUTRAL", false)
  72.     end
  73. end
  74.  
  75. function OnTrollGenericEvent(self,data)
  76.  
  77.     local str = tostring( data )
  78.  
  79.     if str == "show_rock" then
  80.         ObjectHideSubObjectPermanently( self, "ROCK", false )
  81.     elseif str == "hide_rock" then
  82.         ObjectHideSubObjectPermanently( self, "ROCK", true )
  83.     end
  84. end
  85.  
  86. function OnEntCreated(self)
  87.     --ObjectShowSubObjectPermanently( self, "ROCK", true )
  88.     ObjectGrantUpgrade( self, "Upgrade_SwitchToRockThrowing" )
  89. end
  90.  
  91. function OnMountainGiantCreated(self)
  92.     --ObjectHideSubObjectPermanently( self, "ROCK", true )
  93.     ObjectGrantUpgrade( self, "Upgrade_SwitchToRockThrowing" )
  94. end
  95.  
  96. function OnMountainGiantGenericEvent(self)
  97.    
  98.     local str = tostring( data )
  99.  
  100.     if str == "show_rock" then
  101.         ObjectHideSubObjectPermanently( self, "ROCK", false )
  102.     elseif str == "hide_rock" then
  103.         ObjectHideSubObjectPermanently( self, "ROCK", true )
  104.     end
  105. end
  106.  
  107. function GoIntoRampage(self)
  108.     ObjectEnterRampageState(self)
  109.        
  110.     --Broadcast fear to surrounding unit(if we actually rampaged)
  111.     if ObjectTestModelCondition(self, "WEAPONSET_RAMPAGE") then
  112.         ObjectBroadcastEventToUnits(self, "BeAfraidOfRampage", 250)
  113.     end
  114. end
  115.  
  116. function MakeMeAlert(self)
  117.     ObjectEnterAlertState(self)
  118. end
  119.  
  120. function BeEnraged(self)
  121.     --Broadcast enraged to surrounding units.
  122.     ObjectBroadcastEventToAllies(self, "BeingEnraged", 500)
  123. end
  124.  
  125. function BecomeEnraged(self)
  126.     ObjectSetEnragedState(self, true)
  127. end
  128.  
  129. function StopEnraged(self)
  130.     ObjectSetEnragedState(self, false)
  131. end
  132.  
  133. function BecomeUncontrollablyAfraid(self, other)
  134.     if not ObjectTestCanSufferFear(self) then
  135.         return
  136.     end
  137.  
  138.     ObjectEnterUncontrollableCowerState(self, other)
  139. end
  140.  
  141. function BecomeAfraidOfRampage(self, other)
  142.     if not ObjectTestCanSufferFear(self) then
  143.         return
  144.     end
  145.  
  146.     ObjectEnterCowerState(self, other)
  147. end
  148.  
  149. function BecomeAfraidOfBalrog(self, other)
  150.     if not ObjectTestCanSufferFear(self) then
  151.         return
  152.     end
  153.  
  154.     ObjectEnterCowerState(self, other)
  155. end
  156.  
  157. function RadiateTerror(self, other)
  158.     ObjectBroadcastEventToEnemies(self, "BeTerrified", 180)
  159. end
  160.    
  161. function RadiateTerrorEx(self, other, terrorRange)
  162.     ObjectBroadcastEventToEnemies(self, "BeTerrified", terrorRange)
  163. end
  164.    
  165.  
  166. function BecomeTerrified(self, other)
  167.     ObjectEnterRunAwayPanicState(self, other)
  168. end
  169.  
  170. function BecomeAfraidOfGateDamaged(self, other)
  171.     if not ObjectTestCanSufferFear(self) then
  172.         return
  173.     end
  174.  
  175.     ObjectEnterCowerState(self,other)
  176. end
  177.  
  178.  
  179. function ChantForUnit(self) -- Used by units to broadcast the chant event to their own side.
  180.     ObjectBroadcastEventToAllies(self, "BeginChanting", 9999)
  181. end
  182.  
  183. function StopChantForUnit(self) -- Used by units to stop the chant event to their own side.
  184.     ObjectBroadcastEventToAllies(self, "StopChanting", 9999)
  185. end
  186.  
  187. function BeginCheeringForGrond(self)
  188.     ObjectSetChanting(self, true)
  189. end
  190.  
  191. function StopCheeringForGrond(self)
  192.     ObjectSetChanting(self, false)
  193. end
  194.  
  195. function OnMordorArcherCreated(self)
  196.     ObjectHideSubObjectPermanently( self, "ARROWFIRE", true )
  197. end
  198.  
  199. function OnMordorFighterCreated(self)
  200.     ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
  201.     ObjectHideSubObjectPermanently( self, "FORGED_BLADES", true )
  202. end
  203.  
  204. function MordorFighterBecomeUncontrollablyAfraid(self,other)
  205.     local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
  206.  
  207.     BecomeUncontrollablyAfraid(self,other)                 -- Call base function appropriate to many unit types
  208.    
  209.     -- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
  210.     -- BecomeAfraidOfTroll may fail, don't play sound if we didn't enter fear state
  211.         if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
  212.         ObjectPlaySound(self, "MordorFighterEntFear")
  213.     end
  214. end
  215.  
  216. function MordorFighterBecomeAfraidOfPhial(self,other)
  217.     local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
  218.  
  219.     BecomeUncontrollablyAfraid(self,other)
  220.     -- BecomeAfraidOfTroll(self,other)                 -- Call base function appropriate to many unit types
  221.    
  222.     -- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
  223.     -- BecomeAfraidOfTroll may fail, don't play sound if we didn't enter fear state
  224. --      if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
  225. --          ObjectPlaySound(self, "MordorFighterEntFear")
  226. --      end
  227. end
  228.  
  229. function OnMordorCorsairCreated(self)
  230.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  231.     ObjectHideSubObjectPermanently( self, "Forged_Blade01", true )
  232. end
  233.  
  234. function WildInfantryBecomeAfraidOfPhial(self,other)
  235.     local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
  236.     BecomeUncontrollablyAfraid(self,other)
  237. end
  238.  
  239.  
  240. function ShelobBecomeAfraidOfPhial(self,other)
  241.     local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
  242.  
  243.     BecomeUncontrollablyAfraid(self,other)
  244.     -- BecomeAfraidOfTroll(self,other)                 -- Call base function appropriate to many unit types
  245.    
  246.     -- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
  247.     -- BecomeAfraidOfTroll may fail, don't play sound if we didn't enter fear state
  248. --      if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
  249. --          ObjectPlaySound(self, "MordorFighterEntFear")
  250. --      end
  251. end
  252.  
  253. function OnInfantryBannerCreated(self)
  254.     ObjectHideSubObjectPermanently( self, "Glow", true )
  255. end
  256.  
  257. function OnCavalryCreated(self)
  258.     ObjectHideSubObjectPermanently( self, "Glow", true )
  259. end
  260.  
  261. function OnGondorFighterCreated(self)
  262.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  263.     ObjectHideSubObjectPermanently( self, "Hammer1", true )
  264.     ObjectHideSubObjectPermanently( self, "Glow", true )
  265.     ObjectHideSubObjectPermanently( self, "Glow1", true )
  266. end
  267.  
  268. function OnAragornCreated(self)
  269.     ObjectHideSubObjectPermanently( self, "PLANE02", true )
  270. end
  271.  
  272. function OnGondorArcherCreated(self)
  273.     -- ObjectHideSubObjectPermanently( self, "arrow", true )        -- This gets hidden pending the art being fixed.  it is the pre-new-archer-firing-pattern arrow
  274.     ObjectHideSubObjectPermanently( self, "FireArowTip", true ) -- This gets hidden because the Fire Arrow upgrade turns it on.
  275. end
  276.  
  277. function DragonStrikeDragonCreated(self)
  278.     ObjectForbidPlayerCommands( self, true )
  279. end
  280.  
  281. function OnLegolasCreated(self)
  282.     -- ObjectHideSubObjectPermanently( self, "arrow02", true )      -- This gets hidden pending the art being fixed.  it is the pre-new-archer-firing-pattern arrow
  283.     -- ObjectHideSubObjectPermanently( self, "arrow", true )        -- This gets hidden pending the art being fixed.  it is the pre-new-archer-firing-pattern arrow
  284. end
  285.  
  286. function OnRohanArcherCreated(self)
  287.     ObjectHideSubObjectPermanently( self, "FireArowTip", true ) -- yes, it's a typo in the art.
  288.     -- ObjectHideSubObjectPermanently( self, "ArrowNock", true )
  289.     -- ObjectHideSubObjectPermanently( self, "arrow", true )
  290. end
  291.  
  292. function GondorFighterBecomeAfraid(self, other)
  293.     local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
  294.  
  295.     -- An object has a 100% chance to become afraid.
  296.     -- An object has a 66% chance to be feared, 33% chance to run away.
  297.     if GetRandomNumber() <= 0.67 then
  298.         ObjectEnterFearState(self, other, false) -- become afraid of other.
  299.     else --if GetRandomNumber() > 0.67 then
  300.         ObjectEnterRunAwayPanicState(self, other) -- run away.
  301.  
  302.     end
  303.    
  304.     if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
  305.         ObjectPlaySound(self, "GondorSoldierScream")   
  306.     end
  307.    
  308. end
  309.  
  310.  
  311. function GondorFighterBecomeAfraidOfGateDamaged(self, other)
  312.     local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
  313.  
  314.     BecomeAfraidOfGateDamaged(self,other)                 -- Call base function appropriate to many unit types
  315.    
  316.     -- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
  317.     -- BecomeAfraidOfGateDamaged may fail, don't play sound if we didn't enter fear state
  318.    
  319.     if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
  320.         ObjectPlaySound(self, "GondorSoldierScream")   
  321.     end
  322. end
  323.  
  324. function GondorFighterRecoverFromTerror(self)
  325.     -- Add recovery sound
  326.     ObjectPlaySound(self, "GondorSoldierRecoverFromTerror")
  327. end
  328.  
  329. function SpyMoving(self, other)
  330.     print(ObjectDescription(self).." spying movement of "..ObjectDescription(other));
  331. end
  332.  
  333. --function GandalfConsiderUsingDefensePower(self, other, delay, amount)
  334. --  -- Put up the shield if a big attack is coming and we have time to block it
  335. --  if tonumber(delay) > 1 then
  336. --      if tonumber(amount) >= 100 then
  337. --          ObjectDoSpecialPower(self, "SpecialPowerShieldBubble")
  338. --          return
  339. --      end
  340. --  end
  341. -- 
  342. --  -- Or, if we are being hit and there are alot of guys arround, do our cool pushback power
  343. --  if tonumber(ObjectCountNearbyEnemies(self, 50)) >= 4 then
  344. --      ObjectDoSpecialPower(self, "SpecialPowerTelekeneticPush")
  345. --      return
  346. --  end
  347. --end
  348.  
  349. function GandalfTriggerWizardBlast(self)
  350.     ObjectCreateAndFireTempWeapon(self, "GandalfWizardBlast")
  351. end
  352.  
  353. --function SarumanConsiderUsingDefensePower(self, other, delay, amount)
  354. --  -- Put up the shield if a big attack is coming and we have time to block it
  355. --E4    if tonumber(delay) > 1 then
  356. --E4        if tonumber(amount) >= 25 then
  357. --E4            ObjectDoSpecialPower(self, "SpecialPowerShieldBubble")
  358. --E4            return
  359. --E4        end
  360. --E4    end
  361. -- 
  362. --  -- Or, if we are being hit and there are alot of guys arround, do our cool pushback power
  363. --  if tonumber(ObjectCountNearbyEnemies(self, 50)) >= 4 then
  364. --      ObjectDoSpecialPower(self, "SpecialPowerTelekeneticPush")
  365. --      return
  366. --  end
  367. --end
  368.  
  369. function BalrogTriggerBreatheFire(self)
  370.     ObjectCreateAndFireTempWeapon(self, "MordorBalrogBreath")
  371. end
  372.  
  373. function OnRohirrimCreated(self)
  374.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  375.     ObjectHideSubObjectPermanently( self, "SHIELD", true )
  376.     ObjectHideSubObjectPermanently( self, "FireArowTip", true )
  377. end
  378.  
  379. function OnSummonedRohirrimCreated(self)
  380.     ObjectGrantUpgrade( self, "Upgrade_RohanHeavyArmorForRohirrim" )
  381.     ObjectGrantUpgrade( self, "Upgrade_RohanHorseShield" )
  382.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  383. end
  384.  
  385. function OnGondorCavalryCreated(self)
  386.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  387.     ObjectHideSubObjectPermanently( self, "sshield", true )
  388. end
  389.  
  390. function OnDwarvenBattleWagonCreated(self)
  391.     ObjectHideSubObjectPermanently( self, "dwarfHearth", true )
  392.     ObjectHideSubObjectPermanently( self, "dwarfHearthFire", true )
  393.     ObjectHideSubObjectPermanently( self, "Banner_L", true )
  394.     ObjectHideSubObjectPermanently( self, "Glow", true )
  395. end
  396.  
  397. function OnEvilMenBlackRiderCreated(self)
  398.     -- @todo place appropriate functionality here
  399. end
  400.  
  401. function OnBallistaCreated(self)
  402.     ObjectHideSubObjectPermanently( self, "MinedArrow", true )
  403. end
  404.  
  405. function OnCatapultCreated(self)
  406.     ObjectHideSubObjectPermanently( self, "PROJECTILEROCK", true )
  407.     ObjectHideSubObjectPermanently( self, "FIREPLANE", true )
  408. end
  409.  
  410. function OnTrebuchetCreated(self)
  411.     ObjectHideSubObjectPermanently( self, "FIREPLANE", true )
  412. end
  413.  
  414. function OnTrollSlingCreated(self)
  415.     ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
  416. end
  417.  
  418. function OnPorterCreated(self)
  419.     ObjectHideSubObjectPermanently( self, "ARROWS", true )
  420.     ObjectHideSubObjectPermanently( self, "BRAZIER", true )
  421.     ObjectHideSubObjectPermanently( self, "BOWS", true )
  422.     ObjectHideSubObjectPermanently( self, "TREBUCHET_FIRE", true )
  423.     ObjectHideSubObjectPermanently( self, "SWORDS", true )
  424.     ObjectHideSubObjectPermanently( self, "SHIELDS", true )
  425.     ObjectHideSubObjectPermanently( self, "ARMOR", true )
  426.     ObjectHideSubObjectPermanently( self, "BANNERS", true )
  427. end
  428.  
  429. function OnEvilPorterCreated(self)
  430.     ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
  431.     ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
  432.     ObjectHideSubObjectPermanently( self, "ARROW_UPGRADE", true )
  433.     ObjectHideSubObjectPermanently( self, "ARMOR_UPGRADE", true )
  434.     ObjectHideSubObjectPermanently( self, "GOLD", true )
  435.     ObjectHideSubObjectPermanently( self, "SWORD_UPGRADES", true )
  436. end
  437.  
  438. function OnPeasantCreated(self)
  439.     ObjectHideSubObjectPermanently( self, "HELMET", true )
  440.     ObjectHideSubObjectPermanently( self, "SWORD", true )
  441.     ObjectHideSubObjectPermanently( self, "HAMMER", false )
  442.     ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
  443.     ObjectHideSubObjectPermanently( self, "SHIELD", true )
  444.     ObjectHideSubObjectPermanently( self, "Broom", true )
  445. end
  446.  
  447. function OnMordorSauronCreated(self)
  448.     ObjectHideSubObjectPermanently( self, "SHARD01", true )
  449.     ObjectHideSubObjectPermanently( self, "SHARD02", true )
  450.     ObjectHideSubObjectPermanently( self, "SHARD03", true )
  451.     ObjectHideSubObjectPermanently( self, "SHARD04", true )
  452.     ObjectHideSubObjectPermanently( self, "SHARD05", true )
  453.     ObjectHideSubObjectPermanently( self, "SHARD06", true )
  454.     ObjectHideSubObjectPermanently( self, "SHARD07", true )
  455.     ObjectHideSubObjectPermanently( self, "SHARD08", true )
  456.     ObjectHideSubObjectPermanently( self, "SHARD09", true )
  457.     ObjectHideSubObjectPermanently( self, "SHARD10", true )
  458.     ObjectHideSubObjectPermanently( self, "SHARD11", true )
  459.     ObjectHideSubObjectPermanently( self, "SHARD12", true )
  460.     ObjectHideSubObjectPermanently( self, "SHARD13", true )
  461.     ObjectHideSubObjectPermanently( self, "SHARD14", true )
  462.     ObjectHideSubObjectPermanently( self, "SHARD15", true )
  463.     ObjectHideSubObjectPermanently( self, "SHARD16", true )
  464.     ObjectHideSubObjectPermanently( self, "SHARD17", true )
  465.     ObjectHideSubObjectPermanently( self, "SHARD18", true )
  466.     ObjectHideSubObjectPermanently( self, "SHARD19", true )
  467.     ObjectHideSubObjectPermanently( self, "SHARD20", true )
  468. end
  469.  
  470. function OnElvenWarriorCreated(self)
  471.     ObjectHideSubObject( self, "ARROW", true )
  472.     ObjectHideSubObject( self, "ARROWNOCK", true )
  473.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  474.     ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
  475. end
  476.  
  477. function OnIsengardFighterCreated(self)
  478.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  479.     ObjectHideSubObjectPermanently( self, "Glow", true )
  480. end
  481.  
  482. function OnIsengardWildmanCreated(self)
  483.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  484.     ObjectHideSubObjectPermanently( self, "Torch", true )
  485.     ObjectHideSubObjectPermanently( self, "FireArowTip", true )
  486. end
  487.  
  488. function OnWildSpiderRiderCreated(self)
  489.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  490.     ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
  491.     ObjectHideSubObject( self, "ARROWNOCK", true )
  492. end
  493.  
  494. function OnHaradrimArcherCreated(self)
  495.     ObjectHideSubObjectPermanently( self, "FireArowTip", true )
  496.     ObjectHideSubObject( self, "ArrowNock", true )
  497. end
  498.  
  499. function OnIsengardArcherCreated(self)
  500.     ObjectHideSubObject( self, "ARROWNOCK", true )
  501.     ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
  502. end
  503.  
  504. function OnWildGoblinArcherCreated(self)
  505.     ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
  506. end
  507.  
  508. function OnGarrisonableCreated(self)
  509.     ObjectHideSubObjectPermanently( self, "GARRISON01", true )
  510.     ObjectHideSubObjectPermanently( self, "GARRISON02", true )
  511. end
  512. function OnDwarvenGuardianCreated(self)
  513.     ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
  514.     ObjectHideSubObjectPermanently( self, "Hammer1", true )
  515. end
  516.  
  517. function CreateAHeroHideEverything(self)
  518.     ObjectHideSubObjectPermanently( self, "SWORD", true )
  519.     ObjectHideSubObjectPermanently( self, "BOW", true )
  520.     ObjectHideSubObjectPermanently( self, "BOW_03", true )
  521.     ObjectHideSubObjectPermanently( self, "BOW_04", true )
  522.     ObjectHideSubObjectPermanently( self, "BOW_05", true )
  523.     ObjectHideSubObjectPermanently( self, "TRUNK01", true )
  524.     ObjectHideSubObjectPermanently( self, "STAFF_LIGHT", true )
  525.     ObjectHideSubObjectPermanently( self, "OBJECT01", true )
  526.    
  527.     ObjectHideSubObjectPermanently( self, "SHIELD01", true )
  528.     ObjectHideSubObjectPermanently( self, "SHIELD_01", true )
  529.     ObjectHideSubObjectPermanently( self, "SPEAR", true )
  530.     ObjectHideSubObjectPermanently( self, "SHIELD_B", true )
  531.     ObjectHideSubObjectPermanently( self, "SHIELD_C", true )
  532.     ObjectHideSubObjectPermanently( self, "SHIELD_D", true )
  533.     ObjectHideSubObjectPermanently( self, "B_SHIELD", true )
  534.     ObjectHideSubObjectPermanently( self, "WEAPON_A", true )
  535.     ObjectHideSubObjectPermanently( self, "WEAPON_B", true )
  536.     ObjectHideSubObjectPermanently( self, "WEAPON_C", true )
  537.     ObjectHideSubObjectPermanently( self, "WEAPON_D", true )
  538.    
  539.     ObjectHideSubObjectPermanently( self, "AXE02", true )
  540.  
  541.     ObjectHideSubObjectPermanently( self, "AxeWeapon", true )
  542.     ObjectHideSubObjectPermanently( self, "Belthronding", true )
  543.     -- ObjectHideSubObjectPermanently( self, "Mithlondrecurve", true )
  544.     ObjectHideSubObjectPermanently( self, "Dwarf_Axe01", true )
  545.     ObjectHideSubObjectPermanently( self, "FireBrand", true )
  546.     ObjectHideSubObjectPermanently( self, "FireBrand_SM", true )
  547.     ObjectHideSubObjectPermanently( self, "FireBrand_FX01", true )
  548.     ObjectHideSubObjectPermanently( self, "FireBrand_FX02", true )
  549.     ObjectHideSubObjectPermanently( self, "Gurthang", true )
  550.     ObjectHideSubObjectPermanently( self, "Gurthang_SM", true )
  551.     ObjectHideSubObjectPermanently( self, "HeroOfTheWestShield", true )
  552.     ObjectHideSubObjectPermanently( self, "HeroOfTheWestShield_SM", true )
  553.     ObjectHideSubObjectPermanently( self, "MithlondBow", true )
  554.     ObjectHideSubObjectPermanently( self, "TrollBane", true )
  555.     ObjectHideSubObjectPermanently( self, "TrollBane_SM", true )
  556.     ObjectHideSubObjectPermanently( self, "TrollBane_FX01", true )
  557.     ObjectHideSubObjectPermanently( self, "TrollBane_FX02", true )
  558.     ObjectHideSubObjectPermanently( self, "TrollMace", true )
  559.     ObjectHideSubObjectPermanently( self, "TrollSword", true )
  560.     ObjectHideSubObjectPermanently( self, "WestronSword", true )
  561.     ObjectHideSubObjectPermanently( self, "WestronSword", true )
  562.     ObjectHideSubObjectPermanently( self, "WestronSword_SM", true )
  563.     ObjectHideSubObjectPermanently( self, "WizardStaff01", true )
  564.     ObjectHideSubObjectPermanently( self, "WizStaff01_FX01", true )
  565.     ObjectHideSubObjectPermanently( self, "WizStaff01_FX2", true )
  566.     ObjectHideSubObjectPermanently( self, "WizStaff01_FX3", true )
  567.     ObjectHideSubObjectPermanently( self, "WizStaff01_FX4", true )
  568.     ObjectHideSubObjectPermanently( self, "WizardStaff02", true )
  569.     ObjectHideSubObjectPermanently( self, "WizStaff02_FX1", true )
  570.     ObjectHideSubObjectPermanently( self, "WizardStaff03", true )
  571.     ObjectHideSubObjectPermanently( self, "WizStaff03_FX01", true )
  572.     ObjectHideSubObjectPermanently( self, "WizStaff03_FX02", true )
  573.     ObjectHideSubObjectPermanently( self, "WizardStaff04", true )
  574.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX01", true )
  575.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX02", true )
  576.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX03", true )
  577.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX04", true )
  578.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX05", true )
  579.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX06", true )
  580.     ObjectHideSubObjectPermanently( self, "WizStaff04_FX07", true )
  581.     ObjectHideSubObjectPermanently( self, "WizardSword", true )
  582.     ObjectHideSubObjectPermanently( self, "CMSword01", true )
  583.     ObjectHideSubObjectPermanently( self, "CMSword02", true )
  584.     ObjectHideSubObjectPermanently( self, "CHEST_00", true )   
  585.     ObjectHideSubObjectPermanently( self, "CHEST_01", true )   
  586.     ObjectHideSubObjectPermanently( self, "CHEST_02", true )   
  587.     ObjectHideSubObjectPermanently( self, "BOOT_00", true )
  588.     ObjectHideSubObjectPermanently( self, "BOOT_01", true )
  589.     ObjectHideSubObjectPermanently( self, "BOOT_02", true )
  590.     ObjectHideSubObjectPermanently( self, "BOOT_03", true )
  591.     ObjectHideSubObjectPermanently( self, "BOOT_04", true )
  592.     ObjectHideSubObjectPermanently( self, "BOOT_05", true )
  593.     ObjectHideSubObjectPermanently( self, "BOOT_06", true )
  594.     ObjectHideSubObjectPermanently( self, "SHLD_00", true )
  595.     ObjectHideSubObjectPermanently( self, "SHLD_01", true )
  596.     ObjectHideSubObjectPermanently( self, "SHLD_02", true )
  597.     ObjectHideSubObjectPermanently( self, "SHLD_03", true )
  598.     ObjectHideSubObjectPermanently( self, "SHLD_04", true )
  599.     ObjectHideSubObjectPermanently( self, "SLDR_00", true )
  600.     ObjectHideSubObjectPermanently( self, "SLDR_01", true )
  601.     ObjectHideSubObjectPermanently( self, "SLDR_02", true )
  602.     ObjectHideSubObjectPermanently( self, "SLDR_03", true )
  603.     ObjectHideSubObjectPermanently( self, "SLDR_04", true )
  604.     ObjectHideSubObjectPermanently( self, "SLDR_05", true )
  605.     ObjectHideSubObjectPermanently( self, "SLDR_06", true )
  606.     ObjectHideSubObjectPermanently( self, "Shield_1OG", true )
  607.     ObjectHideSubObjectPermanently( self, "Shield_2OG", true )
  608.     ObjectHideSubObjectPermanently( self, "HAIR_00", true )
  609.     ObjectHideSubObjectPermanently( self, "HAIR_01", true )
  610.     ObjectHideSubObjectPermanently( self, "HLMT_00", true )
  611.     ObjectHideSubObjectPermanently( self, "HLMT_01", true )
  612.     ObjectHideSubObjectPermanently( self, "HLMT_02", true )
  613.     ObjectHideSubObjectPermanently( self, "HLMT_03", true )
  614.     ObjectHideSubObjectPermanently( self, "HLMT_04", true )
  615.     ObjectHideSubObjectPermanently( self, "HLMT_05", true )
  616.     ObjectHideSubObjectPermanently( self, "HLMT_06", true )
  617.     ObjectHideSubObjectPermanently( self, "HLMT_07", true )
  618.     ObjectHideSubObjectPermanently( self, "HLMT_07_LOD1", true )
  619.     ObjectHideSubObjectPermanently( self, "HLMT_08", true )
  620.     ObjectHideSubObjectPermanently( self, "HLMT_09", true )
  621.     ObjectHideSubObjectPermanently( self, "GNLT_00", true )
  622.     ObjectHideSubObjectPermanently( self, "GNLT_01", true )
  623.     ObjectHideSubObjectPermanently( self, "GNLT_02", true )
  624.     ObjectHideSubObjectPermanently( self, "GNLT_03", true )
  625.     ObjectHideSubObjectPermanently( self, "GNLT_04", true )
  626.     ObjectHideSubObjectPermanently( self, "GNLT_05", true )
  627.     ObjectHideSubObjectPermanently( self, "GNLT_06", true )
  628.     ObjectHideSubObjectPermanently( self, "GNLT_07", true )
  629.     ObjectHideSubObjectPermanently( self, "GNLT_08", true )
  630.     ObjectHideSubObjectPermanently( self, "GHLT_08", true )
  631.     ObjectHideSubObjectPermanently( self, "GNLT_09", true )
  632.     ObjectHideSubObjectPermanently( self, "GNLT_09_LOD1", true )
  633.     ObjectHideSubObjectPermanently( self, "GNLT_10", true )
  634.     ObjectHideSubObjectPermanently( self, "SPR_01", true )
  635.     ObjectHideSubObjectPermanently( self, "PAXE_01", true )
  636.     ObjectHideSubObjectPermanently( self, "PAXE_01_LOD1", true )
  637.     ObjectHideSubObjectPermanently( self, "SWRD_01", true )
  638.     ObjectHideSubObjectPermanently( self, "SWRD_02", true )
  639.     ObjectHideSubObjectPermanently( self, "SWRD_03", true )
  640.     ObjectHideSubObjectPermanently( self, "SWRD_04", true )
  641.     ObjectHideSubObjectPermanently( self, "SWRD_05", true )
  642.     ObjectHideSubObjectPermanently( self, "SWD_01", true )
  643.     ObjectHideSubObjectPermanently( self, "SWD_02", true )
  644.     ObjectHideSubObjectPermanently( self, "SWD_03", true )
  645.     ObjectHideSubObjectPermanently( self, "SWD_04", true )
  646.     ObjectHideSubObjectPermanently( self, "STFF_05", true )
  647.     ObjectHideSubObjectPermanently( self, "STFF_06", true )
  648.     ObjectHideSubObjectPermanently( self, "objSLDR_01", true )
  649.     ObjectHideSubObjectPermanently( self, "objSLDR_02", true )
  650.     ObjectHideSubObjectPermanently( self, "objSLDR_03", true )
  651.     ObjectHideSubObjectPermanently( self, "objHLMT_01", true )
  652.     ObjectHideSubObjectPermanently( self, "objHLMT_02", true )
  653.     ObjectHideSubObjectPermanently( self, "objHLMT_03", true )
  654.     ObjectHideSubObjectPermanently( self, "objHLMT_04", true ) 
  655.     ObjectHideSubObjectPermanently( self, "Uruk_Sword_01", true )
  656.     ObjectHideSubObjectPermanently( self, "Uruk_Sword_02", true )
  657.     ObjectHideSubObjectPermanently( self, "Uruk_Sword_03", true )
  658.     ObjectHideSubObjectPermanently( self, "TrollTree", true )
  659.     ObjectHideSubObjectPermanently( self, "TrollHammer", true )
  660.     ObjectHideSubObjectPermanently( self, "CLUB_01", true )
  661.     ObjectHideSubObjectPermanently( self, "CLUB_02", true )
  662.     ObjectHideSubObjectPermanently( self, "CLUB_03", true )
  663.     ObjectHideSubObjectPermanently( self, "HMR_01", true )
  664.     ObjectHideSubObjectPermanently( self, "HMR_02", true )
  665.     ObjectHideSubObjectPermanently( self, "HMR_03", true )
  666.     ObjectHideSubObjectPermanently( self, "HMR_04", true )
  667.     ObjectHideSubObjectPermanently( self, "AXE_01", true )
  668.     ObjectHideSubObjectPermanently( self, "AXE_02", true )
  669.     ObjectHideSubObjectPermanently( self, "AXE_03", true )
  670.     ObjectHideSubObjectPermanently( self, "BARREL", true )
  671.     ObjectHideSubObjectPermanently( self, "OBJECT02", true )    -- Barrel on the Orc Raider
  672.     ObjectHideSubObjectPermanently( self, "ARROW", true )
  673.     ObjectHideSubObjectPermanently( self, "PLANE02", true )
  674. end
  675.  
  676. function OnCreateAHeroFunctions(self)
  677.     CreateAHeroHideEverything(self)
  678. end
  679.  
  680. function OnEvilShipCreated(self)
  681.     ObjectHideSubObjectPermanently( self, "CAULDRON", true )
  682.     ObjectHideSubObjectPermanently( self, "CAULDRON_FIRE", true )
  683.     ObjectHideSubObjectPermanently( self, "CAULDRON_TOP", true )
  684.     ObjectHideSubObjectPermanently( self, "CROWSNEST", true )
  685.     ObjectHideSubObjectPermanently( self, "FLAG", true )
  686.     ObjectHideSubObjectPermanently( self, "BANNER", true )
  687. end
  688.  
  689. function OnGoodShipCreated(self)
  690.     ObjectHideSubObjectPermanently( self, "UG_FLAMING_01", true )
  691.     ObjectHideSubObjectPermanently( self, "UG_FLAMING_02", true )
  692.     ObjectHideSubObjectPermanently( self, "UG_FLAMING_FIRE", true )
  693.     ObjectHideSubObjectPermanently( self, "UG_ARMOR", true )
  694.     ObjectHideSubObjectPermanently( self, "BANNER", true )
  695. end
  696.  
  697. function OnShipWrightCreated(self)
  698.     ObjectHideSubObjectPermanently( self, "GoodPart_A", true )
  699.     ObjectHideSubObjectPermanently( self, "GoodPart_B", true )
  700.     ObjectHideSubObjectPermanently( self, "EvilPart_A", true )
  701.     ObjectHideSubObjectPermanently( self, "EvilPart_B", true )
  702. end
  703.  
  704. function OnDormitoryBuildVariation(self,variation)
  705.  
  706.     local var = tonumber(variation)
  707.  
  708.     if var == 1 then
  709.         ObjectSetGeometryActive( self, "VersionOne", true )
  710.         ObjectSetGeometryActive( self, "VersionTwo", false )
  711.     elseif var == 2 then
  712.         ObjectSetGeometryActive( self, "VersionOne", false )
  713.         ObjectSetGeometryActive( self, "VersionTwo", true )
  714.     end
  715.  
  716. end
  717.  
  718. function OnFortressCreated(self)
  719.     ObjectHideSubObjectPermanently( self, "DBFBANNER", true )  
  720.     ObjectSetGeometryActive( self, "HighTowerGeom", false )
  721. end
  722.  
  723. function OnGateWatcherBuilt(self)
  724.     ObjectDoSpecialPower(self, "SpecialAbilityGateWatchersFear")
  725. end
  726.  
  727. function NeutralGollum_RingStealerDamaged(self,other)
  728.  
  729.     if ObjectHasUpgrade( other, "Upgrade_RingHero" ) == 0 then
  730.         ObjectChangeAllegianceFromNonPlayablePlayer( self, other )
  731.     end
  732.    
  733. end
  734.  
  735. function NeutralGollum_RingStealerSlaughtered(self,other)
  736.     ObjectRemoveUpgrade( other, "Upgrade_RingHero" )
  737. end
  738.  
  739. function OnNecromancerStatueCreated(self)
  740.     ObjectDoSpecialPower(self, "SpecialAbilityGateWatchersFear")
  741. end
Advertisement
RAW Paste Data Copied
Advertisement