Advertisement
Mjjstral

BFMEII scripts.lua

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