home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 April / Gamestar_83_2006-04_dvd.iso / Dema / lotrbfme2_demo.exe / INI.big / data_ini_object_civilian_gondorbuildings.ini < prev    next >
Text File  |  2006-01-31  |  78KB  |  2,534 lines

  1. ;----------------------------------------------------------------------------------------------
  2. ;
  3. ; FILE: GondorBuildings.ini
  4. ;
  5. ;----------------------------------------------------------------------------------------------
  6.  
  7. ;----------------------------------------------------------------------------------------------
  8. ;
  9. ;    Base gate template, note an instance of this type shouldn't be created, use a left or
  10. ;    right version instead.
  11. ;
  12. ;----------------------------------------------------------------------------------------------
  13. ;----------------------------------------------------------------------------------------------
  14. Object GondorCastleGateL
  15.         
  16.         SelectPortrait = BPCastleWall
  17.     ; *** ART Parameters ***
  18.     Draw = W3DScriptedModelDraw Draw_Wall
  19.         OkToChangeModelColor = Yes
  20.  
  21.         WallBoundsMesh = P1
  22.  
  23.         DefaultModelConditionState
  24.             Model = GBCASTGATEL
  25.         End
  26.         
  27.         ModelConditionState = WORLD_BUILDER
  28.               Model = GBCASTGATELW
  29.           End
  30.                     
  31.         ModelConditionState = BASE_BUILD
  32.               Model = GBCASTGATEL_A
  33.           End
  34.         AnimationState = BASE_BUILD
  35.             StateName = STATE_None
  36.             Animation
  37.                 AnimationName = GBCASTGATEL_A.GBCASTGATEL_A
  38.                 AnimationMode = ONCE
  39.                 AnimationSpeedFactorRange = 2.0 2.5 ; keep range wide to avoid lockstep anims
  40.             End
  41.         End
  42.         
  43.         ModelConditionState = JUST_BUILT
  44.               Model = GBCASTGATEL_A
  45.           End
  46.         AnimationState = JUST_BUILT
  47.             StateName = STATE_None
  48.             Animation
  49.                 AnimationName = GBCASTGATEL_A.GBCASTGATEL_A
  50.                 AnimationMode = MANUAL
  51.             End
  52.             Flags = START_FRAME_FIRST
  53.         End
  54.                     
  55.         ModelConditionState  = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  56.             Model = GBCASTGATEL_UA  
  57.         End
  58.         AnimationState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  59.             Animation
  60.                 AnimationName = GBCASTGATEL_UA.GBCASTGATEL_UA
  61.                 AnimationMode = MANUAL
  62.             End
  63.             Flags = START_FRAME_FIRST
  64.             StateName = STATE_None
  65.         End    
  66.  
  67.         ModelConditionState  = ACTIVELY_BEING_CONSTRUCTED
  68.             Model = GBCASTGATEL_A  
  69.         End
  70.         AnimationState = ACTIVELY_BEING_CONSTRUCTED
  71.             Animation
  72.                 AnimationName = GBCASTGATEL_A.GBCASTGATEL_A
  73.                 AnimationMode = MANUAL
  74.             End
  75.             Flags = START_FRAME_FIRST
  76.             StateName = STATE_None
  77.         End    
  78.  
  79. ;        IdleAnimationState
  80. ;            BeginScript
  81. ;                CurDrawableAllowToContinue()
  82. ;            EndScript
  83. ;        
  84. ;            ; Don't want the entire anim to play.
  85. ;            Flags = START_FRAME_LAST
  86. ;            Animation
  87. ;            StateName        = STATE_None
  88. ;                AnimationName = GBCASTGATEL.GBCASTGATEL
  89. ;                AnimationMode = ONCE
  90. ;            End
  91. ;        End
  92.         
  93.         ModelConditionState  = DAMAGED UPGRADE_NUMENOR_STONEWORK
  94.             Model         = GBCASTGATL_UD1
  95.         End
  96.         
  97.         ModelConditionState  = DAMAGED
  98.             Model         = GBCASTGATEL_D1  
  99.         End
  100.         
  101.         AnimationState = DAMAGED
  102.             StateName        = STATE_None
  103.     ;      EnteringStateFX = FX_MinWallATransitionDamaged
  104.         End
  105.  
  106.         ; REALLYDAMAGED ----------------------------------------------------------------------------------------------------------------
  107.         TransitionState = TRANS_U_IntoReallyDamaged
  108.             EnteringStateFX        = FX_BuildingReallyDamaged
  109.             Animation = D2
  110.                 AnimationName        = GBCASTGATL_UD2.GBCASTGATL_UD2
  111.                 AnimationMode        = ONCE
  112.                 AnimationBlendTime    = 0
  113.             End
  114.         End
  115.         ModelConditionState  = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  116.             Model         = GBCASTGATL_UD2
  117.         End
  118.         AnimationState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  119.             StateName            = STATE_ReallyDamaged
  120.              Flags                = START_FRAME_LAST
  121.                Animation            = ReallyDamagedanimation
  122.                 AnimationName    = GBCASTGATL_UD2.GBCASTGATL_UD2
  123.                 AnimationMode    = ONCE
  124.                End
  125.             BeginScript
  126.                 Prev = CurDrawablePrevAnimationState()
  127.                 if Prev == "STATE_None" or Prev == "STATE_Rubble"
  128.                 then
  129.                     ; Only play the really damaged anim if we havn't come from another really damaged.
  130.                     CurDrawableSetTransitionAnimState("TRANS_U_IntoReallyDamaged")
  131.                 end
  132.             EndScript
  133.         End
  134.         
  135.         ModelConditionState  = REALLYDAMAGED
  136.             Model         = GBCASTGATEL_D2
  137.         End
  138.         AnimationState = REALLYDAMAGED
  139.             StateName            = STATE_ReallyDamaged
  140.                Animation            = ReallyDamagedanimation
  141.                 AnimationName    = GBCASTGATEL_D2.GBCASTGATEL_D2
  142.                 AnimationMode    = ONCE
  143.                End
  144.         End
  145.  
  146.         ; RUBBLE ----------------------------------------------------------------------------------------------------------------
  147.         TransitionState = TRANS_U_IntoRubble
  148.             Animation = D3
  149.                 AnimationName        = GBCASTGATL_UD3.GBCASTGATL_UD3
  150.                 AnimationMode        = ONCE
  151.                 AnimationBlendTime    = 0
  152.             End
  153.         End
  154.         ModelConditionState  = RUBBLE UPGRADE_NUMENOR_STONEWORK
  155.             Model         = GBCASTGATL_UD3
  156.         End
  157.         AnimationState = RUBBLE UPGRADE_NUMENOR_STONEWORK
  158.             StateName                = STATE_Rubble
  159.             Flags                    = START_FRAME_LAST
  160.             ;EnteringStateFX    = FX_WallDie    ;this plays after the stone sink into the ground
  161.             Animation                = Death
  162.                 AnimationName        = GBCASTGATL_UD3.GBCASTGATL_UD3
  163.                 AnimationMode        = MANUAL
  164.                 AnimationBlendTime    = 0
  165.             End
  166.             BeginScript
  167.                 Prev = CurDrawablePrevAnimationState()
  168.                 if Prev == "STATE_ReallyDamaged" or Prev == "STATE_None" or Prev == "TRANS_U_IntoReallyDamaged"
  169.                 then
  170.                     ; Only play the rubble anim if we havn't come from another rubble.
  171.                     CurDrawableSetTransitionAnimState("TRANS_U_IntoRubble")
  172.                 end
  173.             EndScript
  174.         End      
  175.         
  176.         ModelConditionState  = RUBBLE
  177.             Model         = GBCASTGATEL_D3
  178.         End
  179.         AnimationState = RUBBLE
  180.             StateName                = STATE_Rubble
  181.             Animation                = Death
  182.                 AnimationName        = GBCASTGATEL_D3.GBCASTGATEL_D3
  183.                 AnimationMode        = ONCE
  184.             End
  185.             EnteringStateFX    = FX_WallDie
  186.         End      
  187.  
  188.           ModelConditionState = UPGRADE_NUMENOR_STONEWORK
  189.               Model = GBCASTGATEL_U
  190.           End
  191.  
  192.           AnimationState = UPGRADE_NUMENOR_STONEWORK
  193.             StateName        = STATE_None
  194.             EnteringStateFX = GenericBuildingUpgrade
  195.         End
  196.  
  197. ;        ModelConditionState  = POST_RUBBLE
  198. ;            Model         = None
  199. ;        End
  200.  
  201. ;        ModelConditionState  = POST_COLLAPSE
  202. ;            Model         = None
  203. ;        End
  204.  
  205.     End
  206.     
  207.   
  208.     ; *** AUDIO Parameters ***
  209.  
  210.     VoiceSelect                = Gui_PlotSelect
  211.  
  212.     SoundOnDamaged            = BuildingLightDamageStone
  213.     SoundOnReallyDamaged        = BuildingHeavyDamageStone
  214.  
  215.     VoiceSelectUnderConstruction    = BuildingGoodVoiceSelectUnderConstruction
  216.  
  217.     UnitSpecificSounds
  218.         UnderConstruction        = BuildingConstructionLoop  ; Built first time
  219.         ; UnderRepairFromDamage    = NoSound                    ; Repaired No animation on the building, so don't bother playing sound
  220.         UnderRepairFromRubble    = BuildingConstructionLoop    ; Repaired from completely destroyed (not used???)
  221.     End
  222.  
  223.     ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
  224.         MaxUpdateRangeCap = 800
  225.         AnimationSound = Sound:WallDie    Animation:GBCASTGATL_UD3.GBCASTGATL_UD3    Frames:0
  226.     End
  227.  
  228.  
  229.     ; ***DESIGN parameters ***
  230.     DisplayName        = OBJECT:GondorCastleGate
  231.     EditorSorting    = STRUCTURE
  232.     Side            = Men
  233.     BuildTime        = CASTLE_WALL_REBUILD_TIME
  234.     BuildCost        = CASTLE_WALL_REBUILD_COST
  235.  
  236.     ArmorSet
  237.         Conditions    = None
  238.         Armor        = GondorCastleWall
  239.         DamageFX    = MinasWallADamageFX
  240.     End
  241.     
  242.  
  243.     ; *** ENGINEERING Parameters ***  
  244.     KindOf                    = STRUCTURE IMMOBILE WALK_ON_TOP_OF_WALL CHUNK_VENDOR SELECTABLE NOT_AUTOACQUIRABLE ;;;should this get autoacquired, or not? NO! or attack move will fail to enter the gate!
  245.     RadarPriority            = STRUCTURE
  246.     KeepSelectableWhenDead    = Yes
  247.     CommandSet                = GenericSelfRepairCommandSet
  248.     
  249.     Body                = ActiveBody ModuleTag_02
  250.         MaxHealth        = GONDOR_CASTLE_WALL_HEALTH
  251.         
  252.         GrabObject = EntThrownBuildingRock
  253.         GrabFX = FX_WallGrab
  254.         GrabDamage = 490
  255.         GrabOffset = X:16 Y:0
  256.     End
  257.  
  258.         Behavior                  = BuildingBehavior BuildingModuleTag
  259.            NightWindowName         = WINDOW_N01
  260.         ;  FireWindowName          = WINDOW_F01
  261.         ;  GlowWindowName            = WINDOW_G01
  262.         ;  FireName                = FIRE01
  263.         End
  264.     
  265. ;    Behavior = SiegeDockingBehavior ModuleTag_SiegeDocking
  266. ;    End
  267.  
  268.     ; Note that structures with "RUBBLE" states should not use DestroyDie; such buildings are 
  269.     ; never truly destroyed, even when reduced to zero health. Also note that garrisonable
  270.     ; buildings automatically stick around because GarrisonContain has it's own DieModule
  271. ;    Behavior = SlowDeathBehavior ModuleTag_SlowDeathWithoutRubble
  272. ;        DestructionDelay  = 3000
  273. ;    End
  274.     Behavior = KeepObjectDie ModuleTag_IWantRubble
  275.     End
  276.  
  277.       Behavior = AttributeModifierAuraUpdate ModuleTag_WallBonus
  278.         StartsActive    = Yes ;If no, requires upgrade to turn on.
  279.         BonusName        = WallBonus
  280.         RefreshDelay    = 2000
  281.         ObjectFilter    = ALL -MACHINE
  282.         ;Range            = 120        ; Range is overridden to affect people on us since we are a wall
  283.         ;TargetEnemy        = Yes    ; Alliances are ignored to affect people on us since we are a wall
  284.     End    
  285.  
  286.      Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
  287.         SelfBuildingLoop = BuildingConstructionLoop ; Only played if we DON'T spawn a worker
  288.         SelfRepairFromDamageLoop  = NoSound         ; This doesn't cause an animation, so don't bother playing a sound
  289.         SelfRepairFromRubbleLoop  = BuildingConstructionLoop
  290.         SpawnTimer = -1.0 ; Negative means no 'autoheal'
  291.         RebuildTimeSeconds = CASTLE_WALL_REBUILD_TIME
  292.     End
  293.  
  294.     Behavior = CastleMemberBehavior ModuleTag_CMB
  295.         CountsForEvaCastleBreached = Yes
  296.     End 
  297.  
  298.     Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
  299.         TriggeredBy                = Upgrade_NumenorStonework
  300.         AttributeModifier        = NumenorStonework_Bonus
  301.         CustomAnimAndDuration    = AnimState:UPGRADE_NUMENOR_STONEWORK AnimTime:0
  302.     End
  303.  
  304.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag2
  305.         DeathTypes                    = ALL
  306.         StartsActive                = Yes
  307.         ActiveDuringConstruction    = Yes
  308.         DeathWeapon                    = StandardWallDeath
  309.     End    
  310.  
  311.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag1
  312.         DeathTypes                    = ALL
  313.         StartsActive                = Yes
  314.         ActiveDuringConstruction    = Yes
  315.         DeathWeapon                    = CastleWallDeath
  316.     End    
  317.  
  318.     Geometry                        = BOX
  319.     GeometryMajorRadius                = 24.0
  320.     GeometryMinorRadius                = 55.0
  321.     GeometryHeight                    = 52.0
  322.     GeometryOffset                    = X:-3 Y:55 Z:0
  323.     
  324.     AdditionalGeometry                = CYLINDER
  325.     GeometryMajorRadius                = 33.0
  326.     GeometryMinorRadius                = 0
  327.     GeometryHeight                    = 52.0
  328.     GeometryOffset                    = X:-12 Y:105 Z:0
  329.     GeometryRotationAnchorOffset    = X:375.0 Y:0
  330.     GeometryIsSmall                    = No
  331.     
  332.     GeometryContactPoint            = X:35        Y: 25        Z:0 Grab
  333.     GeometryContactPoint            = X:21        Y: 25        Z:0 
  334.     GeometryContactPoint            = X:21        Y: 60        Z:52 
  335.     GeometryContactPoint            = X:21        Y: 95        Z:0  
  336.     GeometryContactPoint            = X:31        Y: 95        Z:0 Grab 
  337.     GeometryContactPoint            = X:-50        Y: 95        Z:0 Grab
  338.     GeometryContactPoint            = X:-30        Y: 95        Z:0 
  339.     GeometryContactPoint            = X:-21        Y: 60        Z:52  
  340.     GeometryContactPoint            = X:-21        Y: 25        Z:0 
  341.     GeometryContactPoint            = X:-40        Y: 25        Z:0 Grab
  342.  
  343.     Shadow                            = SHADOW_VOLUME
  344. End
  345.  
  346. ;----------------------------------------------------------------------------------------------
  347. Object GondorCastleGateR
  348.         
  349.         SelectPortrait = BPCastleWall
  350.     ; *** ART Parameters ***
  351.     Draw = W3DScriptedModelDraw Draw_Wall
  352.         OkToChangeModelColor = Yes
  353.  
  354.         WallBoundsMesh = P1
  355.  
  356.         DefaultModelConditionState
  357.             Model = GBCASTGATER
  358.         End
  359.  
  360.         ModelConditionState = WORLD_BUILDER
  361.               Model = GBCASTGATERW
  362.           End
  363.  
  364.         ModelConditionState = BASE_BUILD
  365.               Model = GBCASTGATER_A
  366.           End
  367.         AnimationState = BASE_BUILD
  368.             StateName = STATE_None
  369.             Animation
  370.                 AnimationName = GBCASTGATER_A.GBCASTGATER_A
  371.                 AnimationMode = ONCE
  372.                 AnimationSpeedFactorRange = 2.0 2.5 ; keep range wide to avoid lockstep anims
  373.             End
  374.         End
  375.         
  376.         ModelConditionState = JUST_BUILT
  377.               Model = GBCASTGATER_A
  378.           End
  379.         AnimationState = JUST_BUILT
  380.             StateName = STATE_None
  381.             Animation
  382.                 AnimationName = GBCASTGATER_A.GBCASTGATER_A
  383.                 AnimationMode = MANUAL
  384.             End
  385.             Flags = START_FRAME_FIRST
  386.         End        
  387.         
  388.         ModelConditionState  = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  389.             Model = GBCASTGATER_UA  
  390.         End
  391.         AnimationState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  392.             Animation
  393.                 AnimationName = GBCASTGATER_UA.GBCASTGATER_UA
  394.                 AnimationMode = MANUAL
  395.             End
  396.             StateName = STATE_None
  397.             Flags = START_FRAME_FIRST
  398.         End    
  399.  
  400.         ModelConditionState  = ACTIVELY_BEING_CONSTRUCTED
  401.             Model = GBCASTGATER_A  
  402.         End
  403.         AnimationState = ACTIVELY_BEING_CONSTRUCTED
  404.             Animation
  405.                 AnimationName = GBCASTGATER_A.GBCASTGATER_A
  406.                 AnimationMode = MANUAL
  407.             End
  408.             StateName = STATE_None
  409.             Flags = START_FRAME_FIRST
  410.         End    
  411.  
  412. ;        IdleAnimationState
  413. ;            BeginScript
  414. ;                CurDrawableAllowToContinue()
  415. ;            EndScript
  416. ;        
  417. ;            ; Don't want the entire anim to play.
  418. ;            Flags = START_FRAME_LAST
  419. ;            StateName        = STATE_None
  420. ;            Animation
  421. ;                AnimationName = GBCASTGATER.GBCASTGATER
  422. ;                AnimationMode = ONCE
  423. ;            End
  424. ;        End
  425.         
  426.         ModelConditionState  = DAMAGED UPGRADE_NUMENOR_STONEWORK
  427.             Model         = GBCASTGATR_UD1  
  428.         End
  429.         
  430.         ModelConditionState  = DAMAGED
  431.             Model         = GBCASTGATER_D1  
  432.         End
  433.         
  434.         AnimationState = DAMAGED
  435.             StateName        = STATE_None
  436. ;            EnteringStateFX = FX_MinWallATransitionDamaged
  437.         End
  438.  
  439.         ; REALLYDAMAGED ----------------------------------------------------------------------------------------------------------------
  440.         TransitionState = TRANS_U_IntoReallyDamaged
  441.             EnteringStateFX        = FX_BuildingReallyDamaged
  442.             Animation = D2
  443.                 AnimationName        = GBCASTGATR_UD2.GBCASTGATR_UD2
  444.                 AnimationMode        = ONCE
  445.                 AnimationBlendTime    = 0
  446.             End
  447.         End
  448.         ModelConditionState  = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  449.             Model         = GBCASTGATR_UD2
  450.         End
  451.         AnimationState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  452.             StateName            = STATE_ReallyDamaged
  453.              Flags                = START_FRAME_LAST
  454.                Animation            = ReallyDamagedanimation
  455.                 AnimationName    = GBCASTGATR_UD2.GBCASTGATR_UD2
  456.                 AnimationMode    = ONCE
  457.                End
  458.             BeginScript
  459.                 Prev = CurDrawablePrevAnimationState()
  460.                 if Prev == "STATE_None" or Prev == "STATE_Rubble"
  461.                 then
  462.                     ; Only play the really damaged anim if we havn't come from another really damaged.
  463.                     CurDrawableSetTransitionAnimState("TRANS_U_IntoReallyDamaged")
  464.                 end
  465.             EndScript
  466.         End
  467.  
  468.         ModelConditionState  = REALLYDAMAGED
  469.             Model         = GBCASTGATER_D2
  470.         End
  471.         AnimationState = REALLYDAMAGED
  472.             StateName            = STATE_ReallyDamaged
  473.                Animation            = ReallyDamagedanimation
  474.                 AnimationName    = GBCASTGATER_D2.GBCASTGATER_D2
  475.                 AnimationMode    = ONCE
  476.                End
  477.         End
  478.  
  479.         ; RUBBLE ----------------------------------------------------------------------------------------------------------------
  480.         TransitionState = TRANS_U_IntoRubble
  481.             Animation = D3
  482.                 AnimationName        = GBCASTGATR_UD3.GBCASTGATR_UD3
  483.                 AnimationMode        = ONCE
  484.                 AnimationBlendTime = 0
  485.             End
  486.         End
  487.         ModelConditionState  = RUBBLE UPGRADE_NUMENOR_STONEWORK
  488.             Model         = GBCASTGATR_UD3
  489.         End
  490.         AnimationState = RUBBLE UPGRADE_NUMENOR_STONEWORK
  491.             StateName                = STATE_Rubble
  492.             Flags                    = START_FRAME_LAST
  493.             ;EnteringStateFX    = FX_WallDie    ;this plays after the stone sink into the ground
  494.             Animation                =    Death
  495.                 AnimationName        =    GBCASTGATR_UD3.GBCASTGATR_UD3
  496.                 AnimationMode        = MANUAL
  497.                 AnimationBlendTime    = 0
  498.             End
  499.             BeginScript
  500.                 Prev = CurDrawablePrevAnimationState()
  501.                 if Prev == "STATE_ReallyDamaged" or Prev == "STATE_None" or Prev == "TRANS_U_IntoReallyDamaged"
  502.                 then
  503.                     ; Only play the rubble anim if we havn't come from another rubble.
  504.                     CurDrawableSetTransitionAnimState("TRANS_U_IntoRubble")
  505.                 end
  506.             EndScript
  507.         End      
  508.  
  509.         ModelConditionState  = RUBBLE
  510.             Model         = GBCASTGATER_D3
  511.         End        
  512.         AnimationState = RUBBLE
  513.             StateName                = STATE_Rubble
  514.             Animation                =    Death
  515.                 AnimationName        =    GBCASTGATER_D3.GBCASTGATER_D3
  516.                 AnimationMode        =    ONCE
  517.             End
  518.             EnteringStateFX    = FX_WallDie
  519.         End      
  520.           
  521.           ModelConditionState = UPGRADE_NUMENOR_STONEWORK
  522.               Model = GBCASTGATER_U
  523.           End
  524.  
  525.           AnimationState = UPGRADE_NUMENOR_STONEWORK
  526.             StateName        = STATE_None
  527.             EnteringStateFX = GenericBuildingUpgrade
  528.         End
  529.  
  530. ;        ModelConditionState  = POST_RUBBLE
  531. ;            Model         = None
  532. ;        End
  533.  
  534. ;        ModelConditionState  = POST_COLLAPSE
  535. ;            Model         = None
  536. ;        End
  537.     End
  538.     
  539.   
  540.     ; *** AUDIO Parameters ***
  541.  
  542.     VoiceSelect                = Gui_PlotSelect
  543.  
  544.     SoundOnDamaged            = BuildingLightDamageStone
  545.     SoundOnReallyDamaged        = BuildingHeavyDamageStone
  546.  
  547.     VoiceSelectUnderConstruction    = BuildingGoodVoiceSelectUnderConstruction
  548.  
  549.     UnitSpecificSounds
  550.         UnderConstruction        = BuildingConstructionLoop  ; Built first time
  551.         ; UnderRepairFromDamage    = NoSound                    ; Repaired No animation on the building, so don't bother playing sound
  552.         UnderRepairFromRubble    = BuildingConstructionLoop    ; Repaired from completely destroyed (not used???)
  553.     End
  554.  
  555.     ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
  556.         MaxUpdateRangeCap = 800
  557.         AnimationSound = Sound:WallDie    Animation:GBCASTGATR_UD3.GBCASTGATR_UD3    Frames:0
  558.     End
  559.  
  560.  
  561.     ; ***DESIGN parameters ***
  562.     DisplayName        = OBJECT:GondorCastleGate
  563.     EditorSorting    = STRUCTURE
  564.     Side            = Men
  565.     BuildTime        = CASTLE_WALL_REBUILD_TIME
  566.     BuildCost        = CASTLE_WALL_REBUILD_COST
  567.  
  568.     ArmorSet
  569.         Conditions    = None
  570.         Armor        = GondorCastleWall
  571.         DamageFX    = MinasWallADamageFX
  572.     End
  573.     
  574.  
  575.     ; *** ENGINEERING Parameters ***  
  576.     KindOf                    = STRUCTURE IMMOBILE WALK_ON_TOP_OF_WALL CHUNK_VENDOR SELECTABLE NOT_AUTOACQUIRABLE ;;;should this get autoacquired, or not? NO! or attack move will fail to enter the gate!
  577.     RadarPriority            = STRUCTURE
  578.     KeepSelectableWhenDead    = Yes
  579.     CommandSet                = GenericSelfRepairCommandSet
  580.     
  581.         Behavior                  = BuildingBehavior BuildingModuleTag
  582.            NightWindowName         = WINDOW_N01
  583.         ;  FireWindowName          = WINDOW_F01
  584.         ;  GlowWindowName            = WINDOW_G01
  585.         ;  FireName                = FIRE01
  586.         End
  587.  
  588.     Body                = ActiveBody ModuleTag_02
  589.         MaxHealth        = GONDOR_CASTLE_WALL_HEALTH
  590.         
  591.         GrabObject = EntThrownBuildingRock
  592.         GrabFX = FX_WallGrab
  593.         GrabDamage = 490
  594.         GrabOffset = X:16 Y:0
  595.     End
  596.  
  597. ;    Behavior = SiegeDockingBehavior ModuleTag_SiegeDocking
  598. ;    End
  599.  
  600.     ; Note that structures with "RUBBLE" states should not use DestroyDie; such buildings are 
  601.     ; never truly destroyed, even when reduced to zero health. Also note that garrisonable
  602.     ; buildings automatically stick around because GarrisonContain has it's own DieModule
  603. ;    Behavior = SlowDeathBehavior ModuleTag_SlowDeathWithoutRubble
  604. ;        DestructionDelay  = 3000
  605. ;    End
  606.     Behavior = KeepObjectDie ModuleTag_IWantRubble
  607.     End
  608.  
  609.      Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
  610.         SelfBuildingLoop = BuildingConstructionLoop ; Only played if we DON'T spawn a worker
  611.         SelfRepairFromDamageLoop  = NoSound         ; This doesn't cause an animation, so don't bother playing a sound
  612.         SelfRepairFromRubbleLoop  = BuildingConstructionLoop
  613.         SpawnTimer = -1.0 ; Negative means no 'autoheal'
  614.         RebuildTimeSeconds = CASTLE_WALL_REBUILD_TIME
  615.     End
  616.  
  617.     Behavior = ProductionUpdate ProductionUpdateModuleTag
  618.         ; nothing, but is required if we have any Object-level Upgrades!
  619.     End
  620.  
  621.       Behavior = AttributeModifierAuraUpdate ModuleTag_WallBonus
  622.         StartsActive    = Yes ;If no, requires upgrade to turn on.
  623.         BonusName        = WallBonus
  624.         RefreshDelay    = 2000
  625.         ObjectFilter    = ALL -MACHINE
  626.         ;Range            = 120        ; Range is overridden to affect people on us since we are a wall
  627.         ;TargetEnemy        = Yes    ; Alliances are ignored to affect people on us since we are a wall
  628.     End    
  629.  
  630.     Behavior = CastleMemberBehavior ModuleTag_CMB
  631.         CountsForEvaCastleBreached = Yes
  632.     End 
  633.  
  634.     Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
  635.         TriggeredBy                = Upgrade_NumenorStonework
  636.         AttributeModifier        = NumenorStonework_Bonus
  637.         CustomAnimAndDuration    = AnimState:UPGRADE_NUMENOR_STONEWORK AnimTime:0
  638.     End
  639.  
  640.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag2
  641.         DeathTypes                    = ALL
  642.         StartsActive                = Yes
  643.         ActiveDuringConstruction    = Yes
  644.         DeathWeapon                    = StandardWallDeath
  645.     End    
  646.  
  647.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag1
  648.         DeathTypes                    = ALL
  649.         StartsActive                = Yes
  650.         ActiveDuringConstruction    = Yes
  651.         DeathWeapon                    = CastleWallDeath
  652.     End    
  653.  
  654.     Geometry                        = BOX
  655.     GeometryMajorRadius                = 24.0
  656.     GeometryMinorRadius                = 55.0
  657.     GeometryHeight                    = 52.0
  658.     GeometryOffset                    = X:-3 Y:-55 Z:0
  659.     
  660.     AdditionalGeometry                = CYLINDER
  661.     GeometryMajorRadius                = 33.0
  662.     GeometryMinorRadius                = 0
  663.     GeometryHeight                    = 52.0
  664.     GeometryOffset                    = X:-12 Y:-105 Z:0
  665.     
  666.     GeometryRotationAnchorOffset    = X:375.0 Y:0
  667.     GeometryIsSmall                    = No
  668.     
  669.     GeometryContactPoint            = X:35        Y: -25        Z:0 Grab
  670.     GeometryContactPoint            = X:21        Y: -25        Z:0 
  671.     GeometryContactPoint            = X:21        Y: -60        Z:52 
  672.     GeometryContactPoint            = X:21        Y: -95        Z:0  
  673.     GeometryContactPoint            = X:31        Y: -95        Z:0 Grab 
  674.     GeometryContactPoint            = X:-50        Y: -95        Z:0 Grab
  675.     GeometryContactPoint            = X:-30        Y: -95        Z:0 
  676.     GeometryContactPoint            = X:-21        Y: -60        Z:52  
  677.     GeometryContactPoint            = X:-21        Y: -25        Z:0 
  678.     GeometryContactPoint            = X:-40        Y: -25        Z:0 Grab
  679.  
  680.     
  681.     Shadow                            = SHADOW_VOLUME
  682. End
  683.  
  684.  
  685. ;----------------------------------------------------------------------------------------------
  686. Object GondorCastleBridge
  687.  
  688.     ; *** ART Parameters ***
  689.     Draw = W3DScriptedModelDraw ModuleTag_01
  690.  
  691.  
  692.         RampMesh1 = P2
  693.         RampMesh2 = P3
  694.         RaisedWallMesh = P1
  695.         
  696.                                     
  697.         DefaultModelConditionState
  698.             Model = GBCastBrdg
  699. ;            ParticleSysBone   = glowbone01 TorchSmokeBlack
  700. ;            ParticleSysBone   = glowbone02 TorchGlow
  701. ;            ParticleSysBone   = glowbone03 TorchSmokeBlack
  702. ;            ParticleSysBone   = glowbone04 TorchGlow
  703.         End
  704.           
  705.     IdleAnimationState
  706.         Animation
  707.             AnimationName     = GBCastBrdg.GBCastBrdg
  708.             AnimationMode     = MANUAL
  709.             AnimationBlendTime = 0
  710.         End
  711.         Flags = START_FRAME_LAST
  712.     End    
  713.  
  714.     ;------------Build Up States
  715.     ModelConditionState   = BASE_BUILD
  716.       Model               = GBCastBrdg
  717. ;      ParticleSysBone      = NONE BuildingDoughnutCloud
  718.       ParticleSysBone     = NONE BuildingContructDust
  719.     End  
  720.     AnimationState          = BASE_BUILD
  721.         Animation
  722.             AnimationName = GBCastBrdg.GBCastBrdg
  723.             AnimationMode = ONCE
  724.             AnimationSpeedFactorRange = 2.0 2.5 ; keep range wide to avoid lockstep anims
  725.         End
  726.     End
  727.  
  728.     AnimationState          = JUST_BUILT
  729.         Animation
  730.             AnimationName = GBCastBrdg.GBCastBrdg
  731.             AnimationMode = MANUAL
  732.             AnimationBlendTime = 0
  733.         End
  734.         Flags = START_FRAME_FIRST
  735.     End    
  736.     
  737.     ModelConditionState  = DAMAGED UPGRADE_NUMENOR_STONEWORK
  738.       Model         = GBCastBrdg_U_D1
  739.     End
  740.     ModelConditionState  = DAMAGED
  741.       Model         = GBCastBrdg_D1
  742.     End
  743.     AnimationState = DAMAGED
  744.     End
  745.  
  746.     ModelConditionState  = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  747.       Model         = GBCastBrdg_UD2
  748.     End
  749.     AnimationState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  750.         Animation                =    ReallyDamagedanimation
  751.             AnimationName        =     GBCastBrdg_UD2.GBCastBrdg_UD2
  752.             AnimationMode        =    ONCE
  753. ;           AnimationSpeedFactorRange = 0.5 0.5
  754.            End
  755.     End    
  756.  
  757.     ModelConditionState  = REALLYDAMAGED
  758.       Model         = GBCastBrdg_D2
  759.     End
  760.     AnimationState = REALLYDAMAGED
  761.         Animation                =    ReallyDamagedanimation
  762.             AnimationName        =     GBCastBrdg_D2.GBCastBrdg_D2
  763.             AnimationMode        =    ONCE
  764. ;           AnimationSpeedFactorRange = 0.5 0.5
  765.            End
  766.     End    
  767.     
  768.     ModelConditionState  = RUBBLE UPGRADE_NUMENOR_STONEWORK
  769.       Model         = GBCastBrdg_UD3  
  770. ;      ParticleSysBone emberBone01 TrebuchetImpactDebris
  771. ;      ParticleSysBone emberBone02 SmokeBuildingLarge
  772. ;      ParticleSysBone emberBone03 PCTMediumDust
  773.     End
  774.     AnimationState = RUBBLE UPGRADE_NUMENOR_STONEWORK
  775.         Animation                =    Death
  776.             AnimationName        =    GBCastBrdg_UD3.GBCastBrdg_UD3
  777.             AnimationMode        =    ONCE
  778. ;           AnimationSpeedFactorRange = 0.5 0.5
  779.         End
  780.         EnteringStateFX    = FX_WallDie
  781.     End
  782.  
  783.  
  784.     ModelConditionState  = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  785.       Model         = GBCastBrdg_U_D1
  786.     End
  787.     ModelConditionState  = ACTIVELY_BEING_CONSTRUCTED
  788.       Model         = GBCastBrdg_D1
  789.     End
  790.  
  791.  
  792.     AnimationState  = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  793.         Animation                =    Death
  794.             AnimationName        =    GBCastBrdg_UD3.GBCastBrdg_UD3
  795.             AnimationMode        =    ONCE
  796.         End
  797.     End
  798.     AnimationState  = ACTIVELY_BEING_CONSTRUCTED
  799.         Animation                =    Death
  800.             AnimationName        =    GBCastBrdg_D3.GBCastBrdg_D3
  801.             AnimationMode        =    ONCE
  802.         End
  803.     End
  804.  
  805.  
  806.  
  807.  
  808.     ModelConditionState  = RUBBLE
  809.       Model         = GBCastBrdg_D3  
  810. ;      ParticleSysBone emberBone01 TrebuchetImpactDebris
  811. ;      ParticleSysBone emberBone02 SmokeBuildingLarge
  812. ;      ParticleSysBone emberBone03 PCTMediumDust
  813.     End
  814.     AnimationState = RUBBLE
  815.         Animation                =    Death
  816.             AnimationName        =    GBCastBrdg_D3.GBCastBrdg_D3
  817.             AnimationMode        =    ONCE
  818. ;           AnimationSpeedFactorRange = 0.5 0.5
  819.         End
  820.         EnteringStateFX    = FX_WallDie
  821.     End
  822.         
  823.         ModelConditionState = UPGRADE_NUMENOR_STONEWORK
  824.               Model = GBCastBrdg_U
  825. ;            ParticleSysBone   = glowbone01 TorchSmokeBlack
  826. ;            ParticleSysBone   = glowbone02 TorchGlow
  827. ;            ParticleSysBone   = glowbone03 TorchSmokeBlack
  828. ;            ParticleSysBone   = glowbone04 TorchGlow
  829.           End
  830.  
  831.           AnimationState = UPGRADE_NUMENOR_STONEWORK
  832.             EnteringStateFX = GenericBuildingUpgrade
  833.         End        
  834.  
  835.       ModelConditionState  = POST_RUBBLE
  836.         Model         = None
  837.         ParticleSysBone NONE SmokeBuildingMediumRubble
  838.     End
  839.     ModelConditionState  = POST_COLLAPSE
  840.         Model         = None
  841.         ParticleSysBone NONE SmokeBuildingMediumRubble
  842.     End
  843.  
  844.   End
  845.  
  846.   ; *** AUDIO Parameters ***
  847.  
  848.     SoundOnDamaged            = BuildingLightDamageStone
  849.     SoundOnReallyDamaged        = BuildingHeavyDamageStone
  850.  
  851.     ;VoiceSelectUnderConstruction    = BuildingEvilVoiceSelectUnderConstruction
  852.  
  853.  
  854.   ; ***DESIGN parameters ***
  855.   DisplayName      = OBJECT:GondorCastleGate
  856.   Side = Men
  857.   EditorSorting = STRUCTURE
  858. ; Browser = CINEMATICS UNIT
  859.  
  860.   ArmorSet
  861.     Conditions        = None
  862.     Armor             = GondorCastleWall
  863.     DamageFX          = MinasWallADamageFX
  864.   End
  865.  
  866.   ; *** ENGINEERING Parameters ***  
  867. ;  KindOf                = STRUCTURE SELECTABLE IMMOBILE
  868. ;  RadarPriority = STRUCTURE
  869. ;  Body                  = ActiveBody ModuleTag_03
  870. ;    MaxHealth       = 2000.0
  871. ;  End
  872.     KindOf                    = STRUCTURE IMMOBILE CHUNK_VENDOR WALK_ON_TOP_OF_WALL SELECTABLE NOT_AUTOACQUIRABLE
  873.     RadarPriority            = STRUCTURE    
  874.     KeepSelectableWhenDead    = Yes
  875.  
  876.     Body                    = ActiveBody ModuleTag_03
  877.     
  878.             MaxHealth                = 6000.0
  879.             MaxHealthDamaged        = 3000.0
  880.             MaxHealthReallyDamaged  = 1000.0
  881.         GrabObject = EntThrownBuildingRock
  882.         GrabFX = FX_WallGrab
  883.         GrabDamage = 490
  884.         GrabOffset = X:16 Y:0
  885.     End
  886.  
  887.   ; Note that structures with "RUBBLE" states should not use DestroyDie; such buildings are 
  888.   ; never truly destroyed, even when reduced to zero health. Also note that garrisonable
  889.   ; buildings automatically stick around because GarrisonContain has it's own DieModule
  890. ;  Behavior = SlowDeathBehavior ModuleTag_SlowDeathWithoutRubble
  891. ;      DestructionDelay  = 5000
  892. ;  End
  893.     Behavior = KeepObjectDie ModuleTag_IWantRubble
  894.     End
  895.  
  896.     Behavior = CastleMemberBehavior ModuleTag_CMB
  897.         CountsForEvaCastleBreached = No  ; Having the walkway over the gate destroyed doesn't actually let the enemy into the castle
  898.     End 
  899.  
  900.     Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
  901.         TriggeredBy                = Upgrade_NumenorStonework
  902.         AttributeModifier        = NumenorStonework_Bonus
  903.         CustomAnimAndDuration    = AnimState:UPGRADE_NUMENOR_STONEWORK AnimTime:0
  904.     End
  905.     
  906.     ; These are bunched-up together on purpose
  907.     BuildCost        = 0  ; for free, since this serves no purpose
  908.       CommandSet                = GenericSelfRepairCommandSet   ;
  909.      Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
  910.         SelfBuildingLoop = BuildingConstructionLoop ; Only played if we DON'T spawn a worker
  911.         SelfRepairFromDamageLoop  = NoSound         ; This doesn't cause an animation, so don't bother playing a sound
  912.         SelfRepairFromRubbleLoop  = BuildingConstructionLoop
  913.         SpawnTimer = -1.0 ; Negative means no 'autoheal'
  914.         RebuildTimeSeconds    = 15 ; nice and fast, so we don;t visually block the gateway
  915.     End
  916.   
  917.   Geometry                = BOX
  918.   GeometryMajorRadius   = 25.0
  919.   GeometryMinorRadius   = 82.5 
  920.   GeometryHeight        = 10.0
  921.   GeometryOffset        = X:-5 Y:10 Z:60  
  922.   
  923.   AdditionalGeometry    = BOX
  924.   GeometryMajorRadius   = 17.5
  925.   GeometryMinorRadius   = 12.5 
  926.   GeometryHeight        = 70.0
  927.   GeometryOffset        = X:25 Y:70 Z:0  
  928.       
  929. ;  AdditionalGeometry    = BOX
  930. ;  GeometryMajorRadius   = 37.5
  931. ;  GeometryMinorRadius   = 12.5 
  932. ;  GeometryHeight        = 20.0
  933. ;  GeometryOffset        = X:50 Y:70 Z:0  
  934.   
  935.   AdditionalGeometry    = BOX
  936.   GeometryMajorRadius   = 17.5
  937.   GeometryMinorRadius   = 12.5 
  938.   GeometryHeight        = 70.0
  939.   GeometryOffset        = X:25 Y:-70 Z:0  
  940.       
  941. ;  AdditionalGeometry    = BOX
  942. ;  GeometryMajorRadius   = 37.5
  943. ;  GeometryMinorRadius   = 12.5 
  944. ;  GeometryHeight        = 20.0
  945. ;  GeometryOffset        = X:50 Y:-70 Z:0  
  946.   
  947.   
  948. ;    Geometry                        = BOX
  949. ;    GeometryMajorRadius                = 32
  950. ;    GeometryMinorRadius                = 98.0
  951. ;    GeometryHeight                    = -30
  952. ;    GeometryOffset                    = X:0 Y:0 Z:53.0
  953.  
  954.     GeometryRotationAnchorOffset    = X:375.0 Y:0
  955.     GeometryIsSmall                    = No
  956.     
  957.     GeometryContactPoint            = X:70        Y: 72        Z:0 Grab
  958.     GeometryContactPoint            = X:28        Y: 72        Z:0 
  959.     GeometryContactPoint            = X:0        Y: 60        Z:70 
  960.     GeometryContactPoint            = X:0        Y: -60        Z:70 
  961.     GeometryContactPoint            = X:28        Y: -72        Z:0 
  962.     GeometryContactPoint            = X:70        Y: -72        Z:0 Grab
  963.  
  964.     
  965.     Shadow                            = SHADOW_VOLUME
  966. End
  967.  
  968.  
  969. ;----------------------------------------------------------------------------------------------
  970. Object GondorCastleElevator
  971.  
  972.   SelectPortrait = BPCastleWall
  973.   ; *** ART Parameters ***
  974.   Draw = W3DScriptedModelDraw ModuleTag_01
  975.         OkToChangeModelColor = Yes
  976.  
  977.         ExtraPublicBone = Elev01
  978.         ExtraPublicBone = Elev02
  979.         ExtraPublicBone = Elev03
  980.         ExtraPublicBone = Elev04
  981. ;        ExtraPublicBone = Elev05
  982.  
  983.         WallBoundsMesh = P1
  984.  
  985.     DefaultModelConditionState
  986.       Model = GBCASTELEV
  987.     End
  988.  
  989.         ModelConditionState = WORLD_BUILDER
  990.               Model = GBCASTELEVW
  991.           End
  992.           
  993.     IdleAnimationState
  994.         Animation
  995.             AnimationName     = GBCASTELEV.GBCASTELEV
  996.             AnimationMode     = MANUAL
  997.             AnimationBlendTime = 0
  998.         End
  999.         StateName = STATE_None
  1000.         Flags = START_FRAME_LAST
  1001.     End    
  1002.  
  1003.     ;------------Build Up States
  1004.     ModelConditionState   = BASE_BUILD
  1005.       Model               = GBCASTELEV
  1006. ;      ParticleSysBone      = NONE BuildingDoughnutCloud
  1007.       ParticleSysBone     = NONE BuildingContructDust
  1008.     End  
  1009.     AnimationState          = BASE_BUILD
  1010.         StateName = STATE_None
  1011.         Animation
  1012.             AnimationName = GBCASTELEV.GBCASTELEV
  1013.             AnimationMode = ONCE
  1014.             AnimationSpeedFactorRange = 2.0 2.5 ; keep range wide to avoid lockstep anims
  1015.         End
  1016.     End
  1017.  
  1018.     AnimationState          = JUST_BUILT
  1019.         Animation
  1020.             AnimationName = GBCASTELEV.GBCASTELEV
  1021.             AnimationMode = MANUAL
  1022.             AnimationBlendTime = 0
  1023.         End
  1024.         Flags = START_FRAME_FIRST
  1025.         StateName = STATE_None
  1026.     End    
  1027.  
  1028.     ; Explicit because of numenor upgrade.
  1029.     ModelConditionState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  1030.         Model = GBCASTELEV_UA
  1031.     End
  1032.     AnimationState          = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  1033.         Animation
  1034.             AnimationName = GBCASTELEV_UA.GBCASTELEV_UA
  1035.             AnimationMode = MANUAL
  1036.             AnimationBlendTime = 0
  1037.         End
  1038.         StateName = STATE_None
  1039.         Flags = START_FRAME_FIRST
  1040.         ;BeginScript
  1041.         ;    CurDrawablePlaySound("GondorBarracksBeginConstruction")
  1042.         ;EndScript
  1043.     End    
  1044.  
  1045.     ModelConditionState = ACTIVELY_BEING_CONSTRUCTED
  1046.         Model = GBCASTELEV
  1047.     End
  1048.     AnimationState          = ACTIVELY_BEING_CONSTRUCTED
  1049.         Animation
  1050.             AnimationName = GBCASTELEV.GBCASTELEV
  1051.             AnimationMode = MANUAL
  1052.             AnimationBlendTime = 0
  1053.         End
  1054.         StateName = STATE_None
  1055.         Flags = START_FRAME_FIRST
  1056.         ;BeginScript
  1057.         ;    CurDrawablePlaySound("GondorBarracksBeginConstruction")
  1058.         ;EndScript
  1059.     End    
  1060.         
  1061.     ModelConditionState  = DAMAGED UPGRADE_NUMENOR_STONEWORK
  1062.       Model         = GBCASTELEV_UD1
  1063.     End
  1064.     ModelConditionState  = DAMAGED
  1065.       Model         = GBCASTELEV_D1
  1066.     End
  1067.     
  1068.     AnimationState = DAMAGED
  1069.         StateName = STATE_None
  1070. ;        EnteringStateFX = FX_MinWallATransitionDamaged
  1071.     End
  1072.  
  1073.     ; REALLYDAMAGED ----------------------------------------------------------------------------------------------------------------
  1074.     TransitionState = TRANS_U_IntoReallyDamaged
  1075.         EnteringStateFX        = FX_BuildingReallyDamaged
  1076.         Animation = D2
  1077.             AnimationName        = GBCASTELEV_UD2.GBCASTELEV_UD2
  1078.             AnimationMode        = ONCE
  1079.             AnimationBlendTime    = 0
  1080.         End
  1081.     End
  1082.     ModelConditionState  = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  1083.       Model         = GBCASTELEV_UD2
  1084.     End
  1085.     AnimationState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  1086.          StateName                = STATE_ReallyDamaged
  1087.          Flags                    = START_FRAME_LAST
  1088.           Animation                = ReallyDamagedanimation_U
  1089.             AnimationName        = GBCASTELEV_UD2.GBCASTELEV_UD2
  1090.             AnimationMode        = MANUAL
  1091.             AnimationBlendTime = 0
  1092.            End
  1093.         BeginScript
  1094.             Prev = CurDrawablePrevAnimationState()
  1095.             if Prev == "STATE_None" or Prev == "STATE_Rubble"
  1096.             then
  1097.                 ; Only play the really damaged anim if we havn't come from another really damaged.
  1098.                 CurDrawableSetTransitionAnimState("TRANS_U_IntoReallyDamaged")
  1099.             end
  1100.         EndScript
  1101.     End
  1102.  
  1103.     ModelConditionState  = REALLYDAMAGED
  1104.       Model         = GBCASTELEV_D2
  1105.     End
  1106.     AnimationState = REALLYDAMAGED
  1107.           StateName                = STATE_ReallyDamaged
  1108.           Animation                = ReallyDamagedanimation
  1109.             AnimationName        = GBCASTELEV_D2.GBCASTELEV_D2
  1110.             AnimationMode        = ONCE
  1111.            End
  1112.     End
  1113.  
  1114.     ; RUBBLE ----------------------------------------------------------------------------------------------------------------
  1115.     TransitionState = TRANS_U_IntoRubble
  1116.         Animation = D3
  1117.             AnimationName        = GBCASTELEV_UD3.GBCASTELEV_UD3
  1118.             AnimationMode        = ONCE
  1119.             AnimationBlendTime = 0
  1120.         End
  1121.         ParticleSysBone NONE Explosion3
  1122.         ParticleSysBone NONE ExplosiveMineSmoke02
  1123.     End
  1124.     ModelConditionState  = RUBBLE UPGRADE_NUMENOR_STONEWORK
  1125.       Model         = GBCASTELEV_UD3
  1126.     End
  1127.     AnimationState = RUBBLE UPGRADE_NUMENOR_STONEWORK
  1128.         StateName                = STATE_Rubble
  1129.         Flags                    = START_FRAME_LAST
  1130.         Animation                = Death_U
  1131.             AnimationName        = GBCASTELEV_UD3.GBCASTELEV_UD3
  1132.             AnimationMode        = MANUAL
  1133.             AnimationBlendTime    = 0
  1134.         End
  1135.         BeginScript
  1136.             Prev = CurDrawablePrevAnimationState()
  1137.             if Prev == "STATE_ReallyDamaged" or Prev == "STATE_None" or Prev == "TRANS_U_IntoReallyDamaged"
  1138.             then
  1139.                 ; Only play the rubble anim if we havn't come from another rubble.
  1140.                 CurDrawableSetTransitionAnimState("TRANS_U_IntoRubble")
  1141.             end
  1142.         EndScript
  1143.         ;EnteringStateFX    = FX_WallDie
  1144.     End
  1145.  
  1146.    ModelConditionState  = RUBBLE
  1147.       Model         = GBCASTELEV_D3
  1148.       ParticleSysBone NONE Explosion3
  1149.       ParticleSysBone NONE ExplosiveMineSmoke02
  1150.     End    
  1151.     AnimationState = RUBBLE
  1152.         StateName                = STATE_Rubble
  1153.         Animation                = Death
  1154.             AnimationName        = GBCASTELEV_D3.GBCASTELEV_D3
  1155.             AnimationMode        = ONCE
  1156.         End
  1157.         EnteringStateFX    = FX_WallDie
  1158.     End
  1159.           
  1160.     ModelConditionState = UPGRADE_NUMENOR_STONEWORK
  1161.           Model = GBCASTELEV_U
  1162.       End
  1163.  
  1164.       AnimationState = UPGRADE_NUMENOR_STONEWORK
  1165.         EnteringStateFX = GenericBuildingUpgrade
  1166.     End        
  1167.  
  1168. ;    ModelConditionState  = POST_RUBBLE
  1169. ;        Model         = None
  1170.  ;   End
  1171.  
  1172.   ;  ModelConditionState  = POST_COLLAPSE
  1173. ;         Model         = None
  1174.  ;   End
  1175.  
  1176.  
  1177.   End
  1178.  
  1179.  
  1180.   ; *** AUDIO Parameters ***
  1181.  
  1182.     VoiceSelect            = Gui_PlotSelect
  1183.  
  1184.     SoundOnDamaged            = BuildingLightDamageStone
  1185.     SoundOnReallyDamaged        = BuildingHeavyDamageStone
  1186.  
  1187.     VoiceSelectUnderConstruction    = BuildingGoodVoiceSelectUnderConstruction
  1188.  
  1189.     UnitSpecificSounds
  1190.         UnderConstruction        = BuildingConstructionLoop  ; Built first time
  1191.         ; UnderRepairFromDamage    = NoSound                    ; Repaired No animation on the building, so don't bother playing sound
  1192.         UnderRepairFromRubble    = BuildingConstructionLoop    ; Repaired from completely destroyed (not used???)
  1193.     End
  1194.  
  1195.     ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
  1196.         MaxUpdateRangeCap = 800
  1197.         AnimationSound = Sound:WallDie        Animation:GBCASTELEV_UD3.GBCASTELEV_UD3    Frames:0
  1198.     End
  1199.  
  1200.  
  1201.   ; ***DESIGN parameters ***
  1202.   DisplayName      = OBJECT:GondorCastleElevator
  1203.   Side = Men
  1204.   EditorSorting = STRUCTURE
  1205. ; Browser = CINEMATICS UNIT
  1206.     BuildTime        = CASTLE_WALL_REBUILD_TIME
  1207.     BuildCost        = CASTLE_WALL_REBUILD_COST
  1208.  
  1209.   ArmorSet
  1210.     Conditions        = None
  1211.     Armor             = GondorCastleWall
  1212.     DamageFX          = MinasWallADamageFX
  1213.   End
  1214.     
  1215.     ; *** ENGINEERING Parameters ***  
  1216.     KindOf                    = STRUCTURE IMMOBILE WALK_ON_TOP_OF_WALL CHUNK_VENDOR NOT_AUTOACQUIRABLE SELECTABLE
  1217.     RadarPriority            = STRUCTURE
  1218.     KeepSelectableWhenDead    = Yes
  1219.     CommandSet                = GenericSelfRepairCommandSet
  1220.     
  1221.     Body                = ActiveBody ModuleTag_02
  1222.         MaxHealth          = GONDOR_CASTLE_WALL_HEALTH
  1223.         
  1224.         GrabObject = EntThrownBuildingRock
  1225.         GrabFX = FX_WallGrab
  1226.         GrabDamage = 490
  1227.         GrabOffset = X:16 Y:0
  1228.     End
  1229.  
  1230.     Behavior = KeepObjectDie ModuleTag_IWantRubble
  1231.     End
  1232.  
  1233.     Behavior = SiegeDockingBehavior ModuleTag_SiegeDocking
  1234.     End
  1235.  
  1236.      Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
  1237.         SelfBuildingLoop = BuildingConstructionLoop ; Only played if we DON'T spawn a worker
  1238.         SelfRepairFromDamageLoop  = NoSound         ; This doesn't cause an animation, so don't bother playing a sound
  1239.         SelfRepairFromRubbleLoop  = BuildingConstructionLoop
  1240.         SpawnTimer = -1.0 ; Negative means no 'autoheal'
  1241.         RebuildTimeSeconds = CASTLE_WALL_REBUILD_TIME
  1242.     End
  1243.    
  1244.     Behavior = DynamicPortalBehaviour Portal
  1245.         GenerateNow        = Yes
  1246.         ObjectFilter    = ANY +INFANTRY -MONSTER -MACHINE -CAVALRY -ARMY_OF_DEAD
  1247.         AllowEnemies    = Yes    ; Normally, only allies can use this
  1248.         BonePrefix        = Elev
  1249.         NumberOfBones    = 4
  1250.         
  1251.         WayPoint        = Index:0    Type:PreClimb    ; 0
  1252.         WayPoint        = Index:1    Type:PreClimb    ; 1
  1253.         WayPoint        = Index:2    Type:Climb    ; 2
  1254.         WayPoint        = Index:3    Type:Climb    ; 3
  1255.         WayPoint        = Index:2    Type:Climb    ; 4
  1256.         WayPoint        = Index:1    Type:Climb    ; 5
  1257.  
  1258.         Link            = From:0 Via:4 Via:5 To:3    ; up, to centre
  1259.         Link            = From:3 Via:1 Via:2 To:0    ; down, from centre
  1260.     End
  1261.  
  1262.  
  1263.       Behavior = AttributeModifierAuraUpdate ModuleTag_WallBonus
  1264.         StartsActive    = Yes ;If no, requires upgrade to turn on.
  1265.         BonusName        = WallBonus
  1266.         RefreshDelay    = 2000
  1267.         ObjectFilter    = ALL -MACHINE
  1268.         ;Range            = 120        ; Range is overridden to affect people on us since we are a wall
  1269.         ;TargetEnemy        = Yes    ; Alliances are ignored to affect people on us since we are a wall
  1270.     End    
  1271.     
  1272.     Behavior = CastleMemberBehavior ModuleTag_CMB
  1273.         CountsForEvaCastleBreached = Yes
  1274.     End 
  1275.     
  1276.     Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
  1277.         TriggeredBy                = Upgrade_NumenorStonework
  1278.         AttributeModifier        = NumenorStonework_Bonus
  1279.         CustomAnimAndDuration    = AnimState:UPGRADE_NUMENOR_STONEWORK AnimTime:0
  1280.     End
  1281.  
  1282.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag2
  1283.         DeathTypes                    = ALL
  1284.         StartsActive                = Yes
  1285.         ActiveDuringConstruction    = Yes
  1286.         DeathWeapon                    = StandardWallDeath
  1287.     End    
  1288.  
  1289.     Geometry                        = BOX
  1290.     GeometryMajorRadius                = 24.0
  1291.     GeometryMinorRadius                = 70.0
  1292.     GeometryHeight                    = 53.0
  1293.     GeometryOffset                    = X:-3 Y:0 Z:0
  1294.     
  1295.     AdditionalGeometry                = CYLINDER
  1296.     GeometryMajorRadius                = 26.0
  1297.     GeometryMinorRadius                = 0
  1298.     GeometryHeight                    = 53.0
  1299.     GeometryOffset                    = X:-10 Y:-80 Z:0
  1300.     
  1301.     AdditionalGeometry                = CYLINDER
  1302.     GeometryMajorRadius                = 26.0
  1303.     GeometryMinorRadius                = 0
  1304.     GeometryHeight                    = 53.0
  1305.     GeometryOffset                    = X:-10 Y:80 Z:0
  1306.     
  1307.     AdditionalGeometry                = BOX
  1308.     GeometryMajorRadius                = 15.0
  1309.     GeometryMinorRadius                = 14.0
  1310.     GeometryHeight                    = 102.0
  1311.     GeometryOffset                    = X:-30 Y:0 Z:0
  1312.     
  1313.     AdditionalGeometry                = BOX
  1314.     GeometryMajorRadius                = 18.0
  1315.     GeometryMinorRadius                = 1.0
  1316.     GeometryHeight                    = 53.0
  1317.     GeometryOffset                    = X:-10 Y: 98 Z:0
  1318.     GeometryName                    = Bookend
  1319.     
  1320.     AdditionalGeometry                = BOX
  1321.     GeometryMajorRadius                = 18.0
  1322.     GeometryMinorRadius                = 1.0
  1323.     GeometryHeight                    = 53.0
  1324.     GeometryOffset                    = X:-10 Y:-98 Z:0
  1325.     GeometryName                    = Bookend
  1326.     
  1327.     
  1328.     GeometryIsSmall                    = No
  1329.     GeometryRotationAnchorOffset    = X:375.0 Y:0.0
  1330.     Shadow                            = SHADOW_VOLUME
  1331.     
  1332.     GeometryContactPoint            = X: 0  Y: 0  Z:53 Swoop
  1333.     GeometryContactPoint            = X: 30 Y:-70 Z:0 Grab
  1334.     GeometryContactPoint            = X:-20 Y:-60 Z:0 Grab
  1335.     GeometryContactPoint            = X: 23 Y:-40 Z:0 Grab
  1336.     GeometryContactPoint            = X:-40 Y:-40 Z:0 Grab
  1337.     GeometryContactPoint            = X: 33 Y: 40 Z:0 Grab
  1338.     GeometryContactPoint            = X:-40 Y: 40 Z:0 Grab
  1339.     GeometryContactPoint            = X: 30 Y: 60 Z:0 Grab
  1340.     GeometryContactPoint            = X:-40 Y: 70 Z:0 Grab
  1341.  
  1342. End     
  1343.  
  1344. ;----------------------------------------------------------------------------------------------
  1345. Object GondorCastleUpgrade
  1346.  
  1347.     ; *** ART Parameters ***
  1348.     SelectPortrait         = BPCastleWall
  1349.     Draw = W3DScriptedModelDraw Draw_Trebuchet
  1350.         OkToChangeModelColor = Yes
  1351.  
  1352.         ; Don't want to change the hidden state of this when the postern gate is stealthed.
  1353.         AffectedByStealth = No
  1354.  
  1355.         ExtraPublicBone = Treb01
  1356.         ExtraPublicBone = Treb02
  1357.  
  1358.         DefaultModelConditionState
  1359.             Model                = GBCASTTREB
  1360.         End
  1361.  
  1362.         ModelConditionState = WORLD_BUILDER
  1363.               Model = GBCASTTREBW
  1364.           End
  1365.  
  1366.         IdleAnimationState
  1367.             StateName = Complete
  1368.             BeginScript
  1369.                 CurDrawableHideModule("Draw_Trebuchet")
  1370.             EndScript
  1371.         End
  1372.  
  1373.  
  1374.         ModelConditionState  = SOLD
  1375.             Model = GBCASTTREB  
  1376.         End
  1377.         AnimationState = SOLD
  1378.             Animation
  1379.                 AnimationName = GBCASTTREB.GBCASTTREB
  1380.                 AnimationMode = ONCE_BACKWARDS
  1381.                 AnimationSpeedFactorRange = 3.0 3.0
  1382.             End
  1383.             Flags = START_FRAME_LAST
  1384.             EnteringStateFX = FX_BuildingContructDustCastles
  1385.         End
  1386.  
  1387.  
  1388.  
  1389.         ModelConditionState  = UPGRADE_TREBUCHET DAMAGED
  1390.             Model         = GBCASTTREB_D1  
  1391.         End
  1392.         
  1393.         AnimationState = UPGRADE_TREBUCHET DAMAGED
  1394.     ;      EnteringStateFX = FX_MinWallATransitionDamaged
  1395.         End
  1396.  
  1397.         ModelConditionState  = UPGRADE_TREBUCHET REALLYDAMAGED
  1398.             Model         = GBCASTTREB_D2
  1399.         End
  1400.         
  1401.         AnimationState = UPGRADE_TREBUCHET REALLYDAMAGED
  1402.                Animation                =    ReallyDamagedanimation
  1403.                 AnimationName        =     GBCASTTREB_D2.GBCASTTREB_D2
  1404.                 AnimationMode        =    ONCE
  1405.                End
  1406.     ;        EnteringStateFX = FX_MinWallATransitionReallyDamaged
  1407.         End
  1408.  
  1409.         ModelConditionState  = UPGRADE_TREBUCHET RUBBLE
  1410.         Model         = GBCASTTREB_D3
  1411.         End
  1412.         
  1413.         AnimationState = UPGRADE_TREBUCHET RUBBLE
  1414.             StateName = Complete
  1415.             Animation                =    Death
  1416.                 AnimationName        =    GBCASTTREB_D3.GBCASTTREB_D3
  1417.                 AnimationMode        =    ONCE
  1418.             End
  1419.     ;        EnteringStateFX = FX_MinWallATransitionRubble
  1420.             EnteringStateFX    = FX_WallDie
  1421.         End      
  1422.  
  1423.         ModelConditionState  = UPGRADE_TREBUCHET POST_RUBBLE
  1424.             Model         = None
  1425.         End
  1426.  
  1427.         ModelConditionState  = UPGRADE_TREBUCHET POST_COLLAPSE
  1428.             Model         = None
  1429.         End        
  1430.         
  1431.         TransitionState = TRANS_IdleToBuild
  1432.             Animation
  1433.                 AnimationName                = GBCASTTREB.GBCASTTREB
  1434.                 AnimationMode                = ONCE
  1435.                 AnimationSpeedFactorRange    = GONDOR_WALLTREBUCHET_BUILD_SPEED GONDOR_WALLTREBUCHET_BUILD_SPEED
  1436.             End
  1437.             EnteringStateFX = FX_BuildingContructDustCastles
  1438.         End
  1439.  
  1440.         AnimationState = UPGRADE_TREBUCHET
  1441.             BeginScript
  1442.                 Prev = CurDrawablePrevAnimationState()
  1443.                 if Prev == "Complete" then CurDrawableSetTransitionAnimState("TRANS_IdleToBuild") end
  1444.             EndScript
  1445.             Flags = START_FRAME_LAST
  1446.             Animation
  1447.                 AnimationName = GBCASTTREB.GBCASTTREB
  1448.                 AnimationMode = ONCE
  1449.             End
  1450.         End
  1451.     
  1452.     End
  1453.         
  1454.     ;----------------------------------------------------------------------------------------------
  1455. ;;
  1456. ;;    Newly-created field: the OverrideTooltip field! Notes
  1457. ;;
  1458. ;;        So this field has limitations, first and foremost being that it should
  1459. ;;    only be applied to one drawModule.  When objects are drawn, all drawModules are used; so
  1460. ;;    if you add OverrideTooltips to multiple drawModules, the lowest one (defined in the ini)
  1461. ;;    will always take precedence over any others.
  1462. ;;
  1463. ;;        ReferenceDisplayName is a keyword to the drawable which tells it to ... reference the
  1464. ;;    DisplayName of the object.
  1465. ;;
  1466.     Draw = W3DScriptedModelDraw Draw_Picker
  1467.  
  1468.         ; Don't want to change the hidden state of this when the postern gate is stealthed.
  1469.         AffectedByStealth = No
  1470.     
  1471.         DefaultModelConditionState
  1472.             Model = GBCASTWallOB
  1473.         End
  1474.         
  1475.     End
  1476.     
  1477.     ;----------------------------------------------------------------------------------------------
  1478.     Draw = W3DScriptedModelDraw Draw_Decal
  1479.  
  1480.         ; Don't want to change the hidden state of this when the postern gate is stealthed.
  1481.         AffectedByStealth = No
  1482.     
  1483.         ; USER_1 - elven
  1484.         ; USER_2 - dwarven
  1485.         ; USER_3 - mordor
  1486.         ; USER_4 - isengard
  1487.         ; USER_5 - wild
  1488.  
  1489.         DefaultModelConditionState
  1490.             Model = GBCASTWallBF
  1491.         End
  1492.         
  1493.         ModelConditionState = USER_1
  1494.             Model = GBCASTWallBF
  1495.             Texture = GBFoundation.tga EBFoundation.tga
  1496.         End
  1497.         ModelConditionState = USER_2
  1498.             Model = GBCASTWallBF
  1499.             Texture = GBFoundation.tga DBFoundation.tga
  1500.         End
  1501.         ModelConditionState = USER_3
  1502.             Model = GBCASTWallBF
  1503.             Texture = GBFoundation.tga Mbfs01.tga
  1504.         End
  1505.         ModelConditionState = USER_4
  1506.             Model = GBCASTWallBF
  1507.             Texture = GBFoundation.tga IBFoundation.tga
  1508.         End
  1509.         ModelConditionState = USER_5
  1510.             Model = GBCASTWallBF
  1511.             Texture = GBFoundation.tga WBFoundation.tga
  1512.         End
  1513.  
  1514.         IdleAnimationState
  1515.             BeginScript
  1516.                 CurDrawableShowModule("Draw_Decal")
  1517.                 CurDrawableShowModule("Draw_Picker")
  1518.             EndScript
  1519.         End
  1520.         
  1521.         AnimationState  = JUST_BUILT
  1522.             BeginScript
  1523.                 CurDrawableHideModule("Draw_Decal")
  1524.                 CurDrawableShowModule("Draw_Picker")
  1525.             EndScript
  1526.         End
  1527.  
  1528.         AnimationState  = SOLD
  1529.             BeginScript
  1530.                 CurDrawableHideModule("Draw_Decal"); since the command is not yet available
  1531.             EndScript
  1532.         End
  1533.  
  1534.         AnimationState  = RUBBLE
  1535.             BeginScript
  1536.                 CurDrawableHideModule("Draw_Decal")
  1537.                 CurDrawableHideModule("Draw_Picker")
  1538.             EndScript
  1539.         End
  1540.         
  1541.         AnimationState  = UPGRADE_POSTERN_GATE
  1542.             BeginScript
  1543.                 CurDrawableShowModule("Draw_PosternGate")
  1544.                 CurDrawableShowModule("Draw_Decal")            ; Don't want to hide the decal cause this would give away our stealthed gate.
  1545.                 ;            
  1546.                 CurDrawableHideModule("Draw_Tower")
  1547.                 CurDrawableHideModule("Draw_Trebuchet")
  1548.                 CurDrawableHideModule("Draw_Picker")
  1549.             EndScript
  1550.         End
  1551.         
  1552.         AnimationState  = UPGRADE_TREBUCHET
  1553.             BeginScript
  1554.                 CurDrawableShowModule("Draw_Trebuchet")
  1555.                 ;            
  1556.                 CurDrawableHideModule("Draw_Decal")
  1557.                 CurDrawableHideModule("Draw_PosternGate")
  1558.                 CurDrawableHideModule("Draw_Tower")
  1559.                 CurDrawableHideModule("Draw_Picker")
  1560.             EndScript
  1561.         End
  1562.         
  1563.         AnimationState  = UPGRADE_GARRISON
  1564.             BeginScript
  1565.                 CurDrawableShowModule("Draw_Tower")
  1566.                 ;            
  1567.                 CurDrawableHideModule("Draw_Decal")
  1568.                 CurDrawableHideModule("Draw_PosternGate")
  1569.                 CurDrawableHideModule("Draw_Trebuchet")
  1570.                 CurDrawableHideModule("Draw_Picker")
  1571.             EndScript
  1572.         End
  1573.  
  1574.     End
  1575.  
  1576.     ;----------------------------------------------------------------------------------------------
  1577.     Draw = W3DScriptedModelDraw Draw_PosternGate
  1578.  
  1579.         ExtraPublicBone = Post01
  1580.         ExtraPublicBone = Post02
  1581.         ExtraPublicBone = Post03
  1582.         ExtraPublicBone = Post04
  1583.  
  1584.         DefaultModelConditionState
  1585.             Model                = GBCASTPOST
  1586.         End
  1587.  
  1588.         IdleAnimationState
  1589.             BeginScript
  1590.                 CurDrawableHideModule("Draw_PosternGate")
  1591.             EndScript
  1592.         End
  1593.  
  1594.  
  1595.         ModelConditionState  = SOLD
  1596.             Model = GBCASTPOST  
  1597.         End
  1598.         AnimationState = SOLD
  1599.             Animation
  1600.                 AnimationName = GBCASTPOST.GBCASTPOST
  1601.                 AnimationMode = ONCE_BACKWARDS
  1602.                 AnimationSpeedFactorRange = 3.0 3.0
  1603.             End
  1604.             Flags = START_FRAME_LAST
  1605.             EnteringStateFX = FX_BuildingContructDustCastlesCentre
  1606.         End
  1607.  
  1608.  
  1609.         ModelConditionState  = UPGRADE_POSTERN_GATE DAMAGED
  1610.             Model         = GBCASTPOST_D1  
  1611.         End
  1612.         
  1613.         AnimationState = UPGRADE_POSTERN_GATE DAMAGED
  1614.     ;      EnteringStateFX = FX_MinWallATransitionDamaged
  1615.         End
  1616.  
  1617.         ModelConditionState  = UPGRADE_POSTERN_GATE REALLYDAMAGED
  1618.         Model         = GBCASTPOST_D2
  1619.         End
  1620.         AnimationState = UPGRADE_POSTERN_GATE REALLYDAMAGED
  1621.     ;        EnteringStateFX = FX_MinWallATransitionReallyDamaged
  1622.         End
  1623.  
  1624.         ModelConditionState  = UPGRADE_POSTERN_GATE RUBBLE
  1625.         Model         = GBCASTPOST_D3
  1626.         End
  1627.         
  1628.         AnimationState = UPGRADE_POSTERN_GATE RUBBLE
  1629.             Animation                =    Death
  1630.                 AnimationName        =    GBCASTPOST_D3.GBCASTPOST_D3
  1631.                 AnimationMode        =    ONCE
  1632.             End
  1633.     ;        EnteringStateFX = FX_MinWallATransitionRubble
  1634.             EnteringStateFX    = FX_WallDie
  1635.         End      
  1636.  
  1637.         ModelConditionState  = UPGRADE_POSTERN_GATE POST_RUBBLE
  1638.             Model         = None
  1639.         End
  1640.  
  1641.         ModelConditionState  = UPGRADE_POSTERN_GATE POST_COLLAPSE
  1642.             Model         = None
  1643.         End        
  1644.         
  1645.  
  1646.         AnimationState = UPGRADE_POSTERN_GATE
  1647.             Animation
  1648.                 AnimationName = GBCASTPOST.GBCASTPOST
  1649.                 AnimationMode = ONCE
  1650.             End
  1651.             EnteringStateFX = FX_BuildingContructDustCastlesCentre
  1652.         End
  1653.     
  1654.     End
  1655.         
  1656.     ;----------------------------------------------------------------------------------------------
  1657.     Draw = W3DScriptedModelDraw Draw_Tower
  1658.  
  1659.         ExtraPublicBone = Arrow_01
  1660.         ExtraPublicBone = Arrow_02
  1661.         ExtraPublicBone = Arrow_03
  1662.         ExtraPublicBone = Arrow_04
  1663.         ExtraPublicBone = Arrow_05
  1664.         ExtraPublicBone = Arrow_06
  1665.         ExtraPublicBone = Arrow_07
  1666.         ExtraPublicBone = Arrow_08
  1667.         ExtraPublicBone = Arrow_09
  1668.         ExtraPublicBone = Arrow_10
  1669.         ExtraPublicBone = Arrow_11
  1670.         ExtraPublicBone = Arrow_12
  1671.  
  1672.         ; Don't want to change the hidden state of this when the postern gate is stealthed.
  1673.         AffectedByStealth = No
  1674.  
  1675.         DefaultModelConditionState
  1676.             Model                = GBCASTTOWR
  1677.             WeaponLaunchBone    = PRIMARY ARROW_
  1678.         End
  1679.         
  1680.         ; This idle state is required simply to make sure the tower visual
  1681.         ; mesh is invisible so we can't pick it when it's underground.
  1682.         ; The actual state is not needed.
  1683.         IdleAnimationState
  1684.             StateName = Complete
  1685.             BeginScript
  1686.                 CurDrawableHideModule("Draw_Tower")
  1687.             EndScript
  1688.         End
  1689.         
  1690.         ModelConditionState  = SOLD
  1691.             Model = GBCASTTOWR
  1692.         End
  1693.         AnimationState = SOLD
  1694.             Animation
  1695.                 AnimationName = GBCASTTOWR.GBCASTTOWR
  1696.                 AnimationMode = ONCE_BACKWARDS
  1697.                 AnimationSpeedFactorRange = 3.0 3.0
  1698.             End
  1699.             Flags = START_FRAME_LAST
  1700.             EnteringStateFX = FX_BuildingContructDustCastles
  1701.         End
  1702.         
  1703.         
  1704.         
  1705.         
  1706.         ModelConditionState  = UPGRADE_GARRISON DAMAGED
  1707.             Model         = GBCASTTOWR_D1
  1708.         End
  1709.         
  1710.         AnimationState = UPGRADE_GARRISON DAMAGED
  1711.     ;      EnteringStateFX = FX_MinWallATransitionDamaged
  1712.         End
  1713.  
  1714.         ModelConditionState  = UPGRADE_GARRISON REALLYDAMAGED
  1715.             Model         = GBCASTTOWR_D2
  1716.         End
  1717.         
  1718.         AnimationState = UPGRADE_GARRISON REALLYDAMAGED
  1719.                Animation                =    ReallyDamagedanimation
  1720.                 AnimationName        =     GBCASTTOWR_D2.GBCASTTOWR_D2
  1721.                 AnimationMode        =    ONCE
  1722.               End
  1723.     ;        EnteringStateFX = FX_MinWallATransitionReallyDamaged
  1724.         End
  1725.  
  1726.         ModelConditionState  = UPGRADE_GARRISON RUBBLE
  1727.             Model         = GBCASTTOWR_D3
  1728.         End
  1729.         
  1730.         AnimationState = UPGRADE_GARRISON RUBBLE
  1731.             StateName = Complete
  1732.             Animation                =    Death
  1733.                 AnimationName        =    GBCASTTOWR_D3.GBCASTTOWR_D3
  1734.                 AnimationMode        =    ONCE
  1735.             End
  1736.             EnteringStateFX    = FX_WallDie
  1737.         End      
  1738.  
  1739.         ModelConditionState  = UPGRADE_GARRISON POST_RUBBLE
  1740.             Model         = None
  1741.         End
  1742.  
  1743.         ModelConditionState  = UPGRADE_GARRISON POST_COLLAPSE
  1744.             Model         = None
  1745.         End        
  1746.  
  1747.         TransitionState                =    TRANS_IdleToBuild
  1748.             Animation
  1749.                 AnimationName                = GBCASTTOWR.GBCASTTOWR
  1750.                 AnimationMode                = ONCE
  1751.                 AnimationSpeedFactorRange    = GONDOR_BATTLETOWER_BUILD_SPEED GONDOR_BATTLETOWER_BUILD_SPEED
  1752.             End
  1753.             EnteringStateFX = FX_BuildingContructDustCastles
  1754.         End
  1755.  
  1756.         ; Just play the last frame, so we don't get the build anim again.
  1757.         AnimationState = UPGRADE_GARRISON
  1758.             
  1759.             ; If we're complete then transition via showing and build anim.
  1760.             BeginScript
  1761.                 Prev = CurDrawablePrevAnimationState()
  1762.                 if Prev == "Complete" then CurDrawableSetTransitionAnimState("TRANS_IdleToBuild") end
  1763.             EndScript
  1764.         
  1765.             Flags = START_FRAME_LAST
  1766.             Animation
  1767.                 AnimationName = GBCASTTOWR.GBCASTTOWR
  1768.                 AnimationMode = ONCE
  1769.             End
  1770.         End
  1771.  
  1772.     End
  1773.  
  1774.  
  1775.     ;----------------------- AUDIO -------------------------
  1776.  
  1777.     VoiceSelect                = Gui_PlotSelect
  1778.  
  1779.     SoundOnDamaged            = BuildingLightDamageStone
  1780.     SoundOnReallyDamaged        = BuildingHeavyDamageStone
  1781.  
  1782.     VoiceSelectUnderConstruction    = BuildingGoodVoiceSelectUnderConstruction
  1783.  
  1784.     ;UnitSpecificSounds
  1785.         ; UnderConstruction    = BuildingConstructionLoop ; Useless, this is never actually under construction, just being upgraded
  1786.     ;End
  1787.  
  1788.     ; Change selection sounds based on upgrades
  1789.     ClientBehavior = UpgradeSoundSelectorClientBehavior ModuleTag_UpgradeSoundSelector
  1790.         SoundUpgrade = Upgrade_PosternGate                                ; EVERYTHING on this line must be present
  1791.             ExcludedUpgrades = Upgrade_OpenGarrison Upgrade_TrebuchetTurret        ; NOTHING on this line can be present
  1792.             VoiceSelect = GondorPosternGateSelect
  1793.         End
  1794.         
  1795.         SoundUpgrade = Upgrade_OpenGarrison                                ; EVERYTHING on this line must be present
  1796.             ExcludedUpgrades = Upgrade_PosternGate Upgrade_TrebuchetTurret        ; NOTHING on this line can be present
  1797.             VoiceSelect = GondorBattleTowerSelect
  1798.         End
  1799.  
  1800.         SoundUpgrade = Upgrade_TrebuchetTurret                            ; EVERYTHING on this line must be present
  1801.             ExcludedUpgrades = Upgrade_PosternGate Upgrade_OpenGarrison            ; NOTHING on this line can be present
  1802.             VoiceSelect = GondorArmorySelect
  1803.         End
  1804.     End
  1805.  
  1806.     
  1807.     ; ***DESIGN parameters ***
  1808.     DisplayName        = OBJECT:GondorCastleWallUpgrade
  1809.     EditorSorting    = STRUCTURE
  1810.     Side            = Men
  1811.     IsTrainable        = No
  1812.  
  1813.     ArmorSet
  1814.         Conditions    = None
  1815.         Armor        = GondorCastleWallUpgrade
  1816.         DamageFX    = MinasWallADamageFX
  1817.     End
  1818.     ArmorSet
  1819.         Conditions    = AS_TOWER
  1820.         Armor        = GondorCastleWallUpgradeAsTower
  1821.         DamageFX    = MinasWallADamageFX
  1822.     End
  1823.  
  1824.  
  1825.     WeaponSet
  1826.         Conditions            = None
  1827.     End
  1828.     WeaponSet
  1829.         Conditions            = PLAYER_UPGRADE
  1830.         Weapon                = PRIMARY CastleWallUpgradeBow
  1831.         AutoChooseSources    = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
  1832.     End
  1833.     
  1834.     
  1835.     Behavior = ProductionUpdate ProductionUpdateModuleTag
  1836.         ; nothing, but is required if we have any Object-level Upgrades!
  1837.     End
  1838.     
  1839.     
  1840.     Body                = ActiveBody ModuleTag_02
  1841.         MaxHealth        = GONDOR_CASTLE_WALL_UPGRADE_HEALTH
  1842.     End
  1843.  
  1844. ;    Behavior = GarrisonUpgrade TheGarrisonUpgrade
  1845. ;        TriggeredBy            = Upgrade_OpenGarrison
  1846. ;        ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1847. ;    End
  1848.     Behavior = WeaponSetUpgrade ModuleTag_Add5ArchersToAllKeepsAndBattleTowers
  1849.         TriggeredBy            = Upgrade_OpenGarrison
  1850.         ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1851.     End
  1852.     Behavior = CommandSetUpgrade TheGarrisonCommandSet
  1853.         TriggeredBy            = Upgrade_OpenGarrison
  1854.         ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1855.         CommandSet            = SellableCommandSet
  1856.     End
  1857.     Behavior = AttributeModifierUpgrade DontShootWhilstBuilding
  1858.         TriggeredBy            = Upgrade_OpenGarrison
  1859.         ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1860.         AttributeModifier    = PreventFromShooting
  1861.     End
  1862.     Behavior = AudioLoopUpgrade ModuleTag_GarrisonBuildLoop
  1863.         ; Play a "build loop" while the garrison is building up
  1864.         TriggeredBy            = Upgrade_OpenGarrison
  1865.         ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1866.         SoundToPlay            = BuildingConstructionLoop
  1867.         KillOnDeath         = Yes
  1868.         KillAfterMS            = 6166  ; Should match the length of the build-up animation [Or a little shorter since sounds take a little while to die]
  1869.     End
  1870.     Behavior = ArmorUpgrade ArmorUpgradeModuleTag1
  1871.         TriggeredBy            = Upgrade_OpenGarrison
  1872.         ArmorSetFlag        = AS_TOWER
  1873.     End
  1874.     Behavior = TooltipUpgrade ModuleTag_GarrisonTooltip
  1875.         TriggeredBy                = Upgrade_OpenGarrison
  1876.         ConflictsWith            = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1877.         DisplayName                = OBJECT:GondorBattleTower
  1878.         Description                = OBJECT:GondorBattleTowerDescription
  1879.     End
  1880.     
  1881.     
  1882.     ; This isn't a geom upgrade, we just need something that doesn't do anything
  1883.     ; to hook onto this upgrade.
  1884.     Behavior = GeometryUpgrade ModuleTag_FireArrows
  1885.         TriggeredBy            = Upgrade_BattleTowersToUseFireArrows
  1886.         ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1887.     End
  1888.     
  1889.     Behavior = GeometryUpgrade ModueTag_TowerGeom
  1890.         TriggeredBy            = Upgrade_OpenGarrison
  1891.         ConflictsWith        = Upgrade_PosternGate Upgrade_TrebuchetTurret
  1892.         ShowGeometry        = TowerGeom
  1893.         HideGeometry        = TrebGeom DummyGeom
  1894.         CustomAnimAndDuration    = AnimState:UPGRADE_GARRISON AnimTime:0
  1895.     End
  1896.     
  1897.     Behavior = GeometryUpgrade ModueTag_TrebGeom
  1898.         TriggeredBy            = Upgrade_TrebuchetTurret
  1899.         ConflictsWith        = Upgrade_PosternGate Upgrade_OpenGarrison
  1900.         ShowGeometry        = TrebGeom
  1901.         HideGeometry        = TowerGeom DummyGeom
  1902.         WallBoundsMesh        = P2
  1903.         RampMesh1            = P3
  1904.         
  1905.         CustomAnimAndDuration    = AnimState:UPGRADE_TREBUCHET AnimTime:0
  1906.         
  1907.     End
  1908.     Behavior = AudioLoopUpgrade ModuleTag_TrebBuildLoop
  1909.         ; Play a "build loop" while the treb is building up
  1910.         TriggeredBy            = Upgrade_TrebuchetTurret 
  1911.         ConflictsWith        = Upgrade_PosternGate Upgrade_OpenGarrison
  1912.         SoundToPlay            = BuildingConstructionLoop
  1913.         KillOnDeath         = Yes
  1914.         KillAfterMS            = 6166  ; Should match the length of the build-up animation [Or a little shorter since sounds take a little while to die]
  1915.     End
  1916.     
  1917. ;    Behavior = CommandSetUpgrade ModueTag_TrebCommandSet
  1918. ;        TriggeredBy            = Upgrade_TrebuchetTurret
  1919. ;        ConflictsWith        = Upgrade_HasWallTrebuchet Upgrade_PosternGate Upgrade_OpenGarrison
  1920. ;        CommandSet            = GondorCastleWallUpgradeCommandSetBuyNewTreb
  1921. ;    End
  1922.     Behavior = ArmorUpgrade ArmorUpgradeModuleTag2
  1923.         TriggeredBy            = Upgrade_TrebuchetTurret
  1924.         ArmorSetFlag        = AS_TOWER
  1925.     End
  1926. ;    Behavior = CommandSetUpgrade ModueTag_TrebCommandSet3
  1927. ;        TriggeredBy            = Upgrade_HasWallTrebuchet Upgrade_TrebuchetTurret
  1928. ;        ConflictsWith        = Upgrade_OpenGarrison Upgrade_PosternGate
  1929. ;        CommandSet            = SellableCommandSet
  1930. ;        RequiresAllTriggers    = Yes
  1931. ;    End
  1932.     
  1933.     Behavior = AttributeModifierUpgrade DontShootWhilstBuilding2    ; Required for the buiding canceling - don't ask.
  1934.         TriggeredBy            = Upgrade_TrebuchetTurret
  1935.         AttributeModifier    = PreventFromShooting
  1936.     End
  1937.     Behavior = TooltipUpgrade ModuleTag_TrebuchetTooltip
  1938.         TriggeredBy                = Upgrade_TrebuchetTurret
  1939.         ConflictsWith            = Upgrade_OpenGarrison Upgrade_PosternGate
  1940.         DisplayName                = OBJECT:GondorTrebuchetOutcropping
  1941.         ;Description            = OBJECT:GondorTrebuchetOutcroppingDescription
  1942.     End
  1943.  
  1944. ;    Behavior = HordeGarrisonContain GarrisonContainModuleTag
  1945. ;        ContainMax              = 2
  1946. ;        PassengerFilter            = ANY +INFANTRY +HORDE -CAVALRY -SUMMONED -WildSpiderling -WildSpiderlingHorde
  1947. ;        AllowAlliesInside       = Yes
  1948. ;        AllowEnemiesInside      = Yes
  1949. ;        ObjectStatusOfContained = UNSELECTABLE CAN_ATTACK
  1950. ;        EntryPosition            = X:45.0 Y:0.0 Z:60.0    ; make sure we're aiming at the top of the wall
  1951. ;        EntryOffset                = X:0.0 Y:0.0 Z:60.0    ; make sure we're aiming at the top of the wall
  1952. ;        ExitOffset                = X:0.0 Y:0.0 Z:60.0    ; make sure we're aiming at the top of the wall
  1953. ;        Enabled                    = No
  1954. ;        PassengerBonePrefix        = PassengerBone:ARROW_ KindOf:INFANTRY HORDE
  1955. ;    End
  1956.     
  1957.     Behavior = DynamicPortalBehaviour PosternGatePortal
  1958.         TriggeredBy                = Upgrade_PosternGate
  1959.         ConflictsWith            = Upgrade_OpenGarrison Upgrade_TrebuchetTurret
  1960.         CustomAnimAndDuration    = AnimState:UPGRADE_POSTERN_GATE AnimTime:0
  1961.         ActivationDelaySeconds    = 7.0
  1962.         
  1963.         ObjectFilter    = POSTERNGATE_ALLOWABLE_OBJECTFILTER
  1964.         BonePrefix        = Post
  1965.         NumberOfBones    = 4
  1966.         WayPoint        = Index:0    Type:Walk    ; 0
  1967.         WayPoint        = Index:1    Type:Walk    ; 1
  1968.         WayPoint        = Index:2    Type:Walk    ; 2
  1969.         WayPoint        = Index:3    Type:Walk    ; 3
  1970.         WayPoint        = Index:2    Type:Walk    ; 4
  1971.         WayPoint        = Index:1    Type:Walk    ; 5
  1972.         Link            = From:0 Via:4 Via:5 To:3
  1973.         Link            = From:3 Via:1 Via:2 To:0
  1974.     End
  1975.     Behavior = CommandSetUpgrade ModueTag_PosternGateCommandSet
  1976.         TriggeredBy            = Upgrade_PosternGate
  1977.         ConflictsWith        = Upgrade_OpenGarrison Upgrade_TrebuchetTurret
  1978.         CommandSet            = SellableCommandSet
  1979.     End
  1980.     Behavior = AttributeModifierUpgrade DontShootWhilstBuilding3    ; Required for the buiding canceling - don't ask.
  1981.         TriggeredBy            = Upgrade_PosternGate
  1982.         AttributeModifier    = PreventPosternGateFromShooting
  1983.     End    
  1984.     Behavior = AudioLoopUpgrade ModuleTag_GateBuildLoop
  1985.         ; Play a "build loop" while the gate is building up
  1986.         TriggeredBy            = Upgrade_PosternGate
  1987.         ConflictsWith        = Upgrade_TrebuchetTurret Upgrade_OpenGarrison
  1988.         SoundToPlay            = BuildingConstructionLoop
  1989.         KillOnDeath         = Yes
  1990.         KillAfterMS            = 6166  ; Should match the length of the build-up animation [Or a little shorter since sounds take a little while to die]
  1991.     End
  1992.     Behavior = TooltipUpgrade ModuleTag_PosternGateTooltip
  1993.         TriggeredBy                = Upgrade_PosternGate
  1994.         ConflictsWith            = Upgrade_TrebuchetTurret Upgrade_OpenGarrison
  1995.         DisplayName                = OBJECT:GondorPosternGate
  1996.         ;Description            = OBJECT:GondorPosternGateDescription
  1997.     End
  1998.     
  1999.     
  2000. ;    Behavior = ObjectCreationUpgrade MakeTheFreeTreb
  2001. ;        TriggeredBy        = Upgrade_TrebuchetTurret
  2002. ;        ConflictsWith    = Upgrade_OpenGarrison Upgrade_PosternGate
  2003. ;        Delay            = GONDOR_WALLTREBUCHET_CREATE_DELAY
  2004. ;        GrantUpgrade    = Upgrade_HasWallTrebuchet
  2005. ;        DestroyWhenSold = Yes
  2006. ;        DeathAnimAndDuration = AnimState:DEATH_2 AnimTime:999999
  2007. ;        Offset            = X:50.0 Y:0.0 Z:68
  2008. ;    End
  2009. ;    Behavior = ObjectCreationUpgrade MakeTheFreeTreb2
  2010. ;        TriggeredBy        = Upgrade_HasWallTrebuchet
  2011. ;        ConflictsWith    = Upgrade_OpenGarrison Upgrade_PosternGate
  2012. ;        Delay            = 0.0
  2013. ;        ThingToSpawn    = GondorTrebuchetWall
  2014. ;        Offset            = X:50.0 Y:0.0 Z:68
  2015. ;        FadeInTime        = 1000
  2016. ;    End
  2017. ;    Behavior = SlaveWatcherBehavior WatchTheTreb
  2018. ;        RemoveUpgrade        =    Upgrade_HasWallTrebuchet            ;when our slave dies, remove this upgrade, so we can get the upgrade again.
  2019. ;    End
  2020.  
  2021.     Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
  2022.         TriggeredBy                = Upgrade_NumenorStonework
  2023.         AttributeModifier        = NumenorStoneworkWallUpgrade_Bonus
  2024.     End
  2025.  
  2026.  
  2027.  
  2028. ;    Behavior = GrantUpgradeCreate ModuleTag_ActLikeAnOldUpgrade
  2029. ;        UpgradeToGrant            = Upgrade_TrebuchetTurret
  2030. ;        GiveOnBuildComplete        = Yes                            ; The ExemptStatus UnderConstruction hack doesn't work on foundation buildings.
  2031. ;    End
  2032.     Behavior = CommandSetUpgrade ModueTag_TrebCommandSet
  2033.         TriggeredBy                = Upgrade_TrebuchetTurret
  2034.         ConflictsWith            = Upgrade_HasWallTrebuchet Upgrade_PosternGate Upgrade_OpenGarrison
  2035.         CommandSet                = GenericBuyNewTrebCommandSet
  2036.     End
  2037.     Behavior = CommandSetUpgrade ModueTag_TrebSellCommandSet
  2038.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_TrebuchetTurret
  2039.         CommandSet                = SellableCommandSet
  2040.         RequiresAllTriggers        = Yes
  2041.     End
  2042.     Behavior = ObjectCreationUpgrade MakeTheFreeTreb
  2043.         TriggeredBy                = Upgrade_TrebuchetTurret
  2044.         Delay                    = GONDOR_WALLTREBUCHET_CREATE_DELAY
  2045.         GrantUpgrade            = Upgrade_HasWallTrebuchet
  2046.         DestroyWhenSold            = Yes
  2047.         DeathAnimAndDuration    = AnimState:DEATH_2 AnimTime:999999
  2048.     End
  2049.     Behavior = ObjectCreationUpgrade ModuleTag_MordorTreb
  2050.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_MordorFaction
  2051.         RequiresAllTriggers        = Yes
  2052.         Delay                    = 0.0
  2053.         ThingToSpawn            = MordorWallCatapult
  2054.         Offset                    = X:50.0 Y:0.0 Z:68
  2055.         FadeInTime                = 600
  2056.     End
  2057.     Behavior = ObjectCreationUpgrade ModuleTag_MenTreb
  2058.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_MenFaction
  2059.         RequiresAllTriggers        = Yes
  2060.         Delay                    = 0.0        
  2061.         ThingToSpawn            = GondorTrebuchetWall
  2062.         Offset                    = X:50.0 Y:0.0 Z:68
  2063.         FadeInTime                = 600
  2064.     End
  2065.     Behavior = ObjectCreationUpgrade ModuleTag_ElvenTreb
  2066.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_ElfFaction
  2067.         RequiresAllTriggers        = Yes
  2068.         Delay                    = 0.0        
  2069.         ThingToSpawn            = GondorTrebuchetWall
  2070.         Offset                    = X:50.0 Y:0.0 Z:68
  2071.         FadeInTime                = 600
  2072.     End
  2073.     Behavior = ObjectCreationUpgrade ModuleTag_IsengardTreb
  2074.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_IsengardFaction
  2075.         RequiresAllTriggers        = Yes
  2076.         Delay                    = 0.0        
  2077.         ThingToSpawn            = IsengardWallBallista
  2078.         Offset                    = X:50.0 Y:0.0 Z:68
  2079.         FadeInTime                = 600
  2080.     End
  2081.     Behavior = ObjectCreationUpgrade ModuleTag_WildTreb
  2082.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_WildFaction
  2083.         RequiresAllTriggers        = Yes
  2084.         Delay                    = 0.0        
  2085.         ThingToSpawn            = MordorWallCatapult
  2086.         Offset                    = X:50.0 Y:0.0 Z:68
  2087.         FadeInTime                = 600
  2088.     End
  2089.     Behavior = ObjectCreationUpgrade ModuleTag_DwarfTreb
  2090.         TriggeredBy                = Upgrade_HasWallTrebuchet Upgrade_DwarfFaction
  2091.         RequiresAllTriggers        = Yes
  2092.         Delay                    = 0.0        
  2093.         ThingToSpawn            = DwarvenWallCatapult
  2094.         Offset                    = X:50.0 Y:0.0 Z:68
  2095.         FadeInTime                = 600
  2096.     End
  2097.     Behavior = SlaveWatcherBehavior WatchTheTreb
  2098.         RemoveUpgrade            = Upgrade_HasWallTrebuchet                ; when our slave dies, remove this upgrade, so we can get the upgrade again.
  2099.     End
  2100.  
  2101.  
  2102.     Behavior = CastleMemberBehavior ModuleTag_CMB
  2103.         StoreUpgradePrice = Yes ; We want to overload the refund price with any upgrades purchased.
  2104.         CountsForEvaCastleBreached = No   ; This is just the floating button
  2105.     End 
  2106.     
  2107.     Behavior = FoundationAIUpdate ModuleTag_FoundationAI
  2108.     End
  2109.     
  2110.     Behavior = WallUpgradeUpdate ModuleTag_Update
  2111.     End
  2112.  
  2113.     Behavior = AIUpdateInterface ModuleTag_SoWeCanUseWeapon
  2114.          AutoAcquireEnemiesWhenIdle    = Yes
  2115.          MoodAttackCheckRate            = 250
  2116.         AILuaEventsList                = GarrisonableFunctions
  2117.      End
  2118.  
  2119.     Behavior = RefundDie ModuleTag_refund
  2120.         UpgradeRequired = Upgrade_MarketplaceUpgradeDefiance
  2121.         BuildingRequired = ANY +GondorMarketPlace
  2122.         RefundPercent = 50%
  2123.     End
  2124.  
  2125.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag1
  2126.         DeathTypes                    = ALL
  2127.         StartsActive                = Yes
  2128.         ActiveDuringConstruction    = Yes
  2129.         DeathWeapon                    = CastleUpgradeDeath
  2130.     End
  2131.     
  2132.     Behavior = ModelConditionUpgrade Elven_Faction
  2133.         TriggeredBy                    = Upgrade_ElfFaction
  2134.         AddConditionFlags            = USER_1
  2135.         Permanent                    = Yes
  2136.     End
  2137.     Behavior = ModelConditionUpgrade Dwarven_Faction
  2138.         TriggeredBy                    = Upgrade_DwarfFaction
  2139.         AddConditionFlags            = USER_2
  2140.         Permanent                    = Yes
  2141.     End
  2142.     Behavior = ModelConditionUpgrade Mordor_Faction
  2143.         TriggeredBy                    = Upgrade_MordorFaction
  2144.         AddConditionFlags            = USER_3
  2145.         Permanent                    = Yes
  2146.     End
  2147.     Behavior = ModelConditionUpgrade Isengard_Faction
  2148.         TriggeredBy                    = Upgrade_IsengardFaction
  2149.         AddConditionFlags            = USER_4
  2150.         Permanent                    = Yes
  2151.     End
  2152.     Behavior = ModelConditionUpgrade Goblin_Faction
  2153.         TriggeredBy                    = Upgrade_WildFaction
  2154.         AddConditionFlags            = USER_5
  2155.         Permanent                    = Yes
  2156.     End
  2157.  
  2158.     KindOf                            = STRUCTURE SELECTABLE IMMOBILE CHUNK_VENDOR CAN_ATTACK WALL_UPGRADE WALK_ON_TOP_OF_WALL NOT_AUTOACQUIRABLE IGNORE_FOR_VICTORY ;;;;;;;;  This needs to go in when being obscured by the wall is fixed -> ATTACK_NEEDS_LINE_OF_SIGHT GARRISON
  2159.     RadarPriority                    = STRUCTURE
  2160.     CommandSet                        = GondorCastleWallCommandSet
  2161.     VisionRange                        = GONDOR_ARCHER_VISION_RANGE
  2162.     KeepSelectableWhenDead            = No
  2163.     
  2164.     GeometryRotationAnchorOffset    = X:375.0 Y:0.0
  2165.     GeometryIsSmall                    = No
  2166.  
  2167.     Geometry                        = BOX
  2168.     GeometryMajorRadius                = 1.0
  2169.     GeometryMinorRadius                = 1.0
  2170.     GeometryHeight                    = 1.0
  2171.     GeometryName                    = DummyGeom
  2172.     GeometryActive                    = Yes
  2173.  
  2174.     AdditionalGeometry                = BOX
  2175.     GeometryMajorRadius                = 28.0
  2176.     GeometryMinorRadius                = 28.0
  2177.     GeometryHeight                    = 80.0
  2178.     GeometryOffset                    = X:54.0 Y:0.0 Z:0.0
  2179.     GeometryName                    = TrebGeom
  2180.     GeometryActive                    = No
  2181.  
  2182.     AdditionalGeometry                = BOX
  2183.     GeometryMajorRadius                = 20.0
  2184.     GeometryMinorRadius                = 20.0
  2185.     GeometryHeight                    = 120.0
  2186.     GeometryOffset                    = X:45.0 Y:0.0 Z:0.0
  2187.     GeometryName                    = TowerGeom
  2188.     GeometryActive                    = No
  2189.     
  2190.     
  2191.     GeometryContactPoint    = X: 37.0    Y:-16.0        Z:120    Swoop
  2192.     GeometryContactPoint    = X: 37.0    Y:  0.0        Z:0        Grab
  2193.     GeometryContactPoint    = X: 37.0    Y: 16.0        Z:120    Swoop
  2194.  
  2195.     
  2196.     Shadow                            = SHADOW_VOLUME
  2197.     
  2198. End
  2199.  
  2200.  
  2201. ;----------------------------------------------------------------------------------------------
  2202. Object GondorCastleWall
  2203.         
  2204.         SelectPortrait = BPCastleWall
  2205.     Draw = W3DScriptedModelDraw Draw_Wall
  2206.         OkToChangeModelColor = Yes
  2207.  
  2208.         WallBoundsMesh = P1
  2209.  
  2210.         DefaultModelConditionState
  2211.             Model = GBCASTWALL
  2212.         End
  2213.  
  2214.         ModelConditionState = WORLD_BUILDER
  2215.               Model = GBCASTWALLW
  2216.           End
  2217.  
  2218.         ModelConditionState = BASE_BUILD
  2219.               Model = GBCASTWALL_A
  2220.           End
  2221.         AnimationState = BASE_BUILD
  2222.             StateName = STATE_None
  2223.             Animation
  2224.                 AnimationName = GBCASTWALL_A.GBCASTWALL_A
  2225.                 AnimationMode = ONCE
  2226.                 AnimationSpeedFactorRange = 2.0 2.5 ; keep range wide to avoid lockstep anims
  2227.             End
  2228.         End    
  2229.         
  2230.         ModelConditionState = JUST_BUILT
  2231.               Model = GBCASTWALL_A
  2232.           End
  2233.         AnimationState = JUST_BUILT
  2234.             StateName = STATE_None
  2235.             Animation
  2236.                 AnimationName = GBCASTWALL_A.GBCASTWALL_A
  2237.                 AnimationMode = MANUAL
  2238.             End
  2239.             Flags = START_FRAME_FIRST
  2240.         End
  2241.  
  2242.         ; Need to enforce this model for this state because we can
  2243.         ; repair a numenor upgraded wall.
  2244.         ModelConditionState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  2245.               Model = GBCASTWALL_UA
  2246.           End
  2247.         AnimationState = ACTIVELY_BEING_CONSTRUCTED UPGRADE_NUMENOR_STONEWORK
  2248.             Animation
  2249.                 AnimationName = GBCASTWALL_UA.GBCASTWALL_UA
  2250.                 AnimationMode = MANUAL
  2251.             End
  2252.             StateName = STATE_None
  2253.             Flags = START_FRAME_FIRST
  2254.         End    
  2255.  
  2256.         ModelConditionState = ACTIVELY_BEING_CONSTRUCTED
  2257.               Model = GBCASTWALL_A
  2258.           End
  2259.         AnimationState = ACTIVELY_BEING_CONSTRUCTED
  2260.             Animation
  2261.                 AnimationName = GBCASTWALL_A.GBCASTWALL_A
  2262.                 AnimationMode = MANUAL
  2263.             End
  2264.             StateName = STATE_None
  2265.             Flags = START_FRAME_FIRST
  2266.         End    
  2267.         
  2268.         ; DAMAGED ----------------------------------------------------------------------------------------------------------------
  2269.         ModelConditionState  = DAMAGED UPGRADE_NUMENOR_STONEWORK
  2270.             Model         = GBCASTWALL_UD1
  2271.         End
  2272.         
  2273.         ModelConditionState  = DAMAGED 
  2274.             Model         = GBCASTWALL_D1  
  2275.         End
  2276.  
  2277.         AnimationState = DAMAGED
  2278.             StateName = STATE_None
  2279. ;            EnteringStateFX = FX_MinWallATransitionDamaged
  2280.         End
  2281.  
  2282.         ; REALLYDAMAGED ----------------------------------------------------------------------------------------------------------------
  2283.         TransitionState = TRANS_U_IntoReallyDamaged
  2284.             EnteringStateFX        = FX_BuildingReallyDamaged
  2285.             Animation = D2
  2286.                 AnimationName        = GBCASTWALL_UD2.GBCASTWALL_UD2
  2287.                 AnimationMode        = ONCE
  2288.                 AnimationBlendTime    = 0
  2289.             End
  2290.         End
  2291.         ModelConditionState  = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  2292.             Model         = GBCASTWALL_UD2
  2293.         End
  2294.         AnimationState = REALLYDAMAGED UPGRADE_NUMENOR_STONEWORK
  2295.             StateName = STATE_ReallyDamaged
  2296.              Flags = START_FRAME_LAST
  2297.             Animation                = ReallyDamagedanimation
  2298.                 AnimationName        = GBCASTWALL_UD2.GBCASTWALL_UD2
  2299.                 AnimationMode        = MANUAL
  2300.                 AnimationBlendTime    = 0
  2301.                End
  2302.             BeginScript
  2303.                 Prev = CurDrawablePrevAnimationState()
  2304.                 if Prev == "STATE_None" or Prev == "STATE_Rubble"
  2305.                 then
  2306.                     ; Only play the really damaged anim if we havn't come from another really damaged.
  2307.                     CurDrawableSetTransitionAnimState("TRANS_U_IntoReallyDamaged")
  2308.                 end
  2309.             EndScript
  2310.         End
  2311.  
  2312.         ModelConditionState  = REALLYDAMAGED
  2313.             Model         = GBCASTWALL_D2
  2314.         End
  2315.         AnimationState = REALLYDAMAGED
  2316.             StateName                = STATE_ReallyDamaged
  2317.             Animation                = ReallyDamagedanimation
  2318.                 AnimationName        = GBCASTWALL_D2.GBCASTWALL_D2
  2319.                 AnimationMode        = ONCE
  2320.                End
  2321.         End
  2322.  
  2323.         ; RUBBLE ----------------------------------------------------------------------------------------------------------------
  2324.         TransitionState = TRANS_U_IntoRubble
  2325.             Animation = D3
  2326.                 AnimationName        = GBCASTWALL_UD3.GBCASTWALL_UD3
  2327.                 AnimationMode        = ONCE
  2328.                 AnimationBlendTime = 0
  2329.             End
  2330.         End
  2331.         ModelConditionState  = RUBBLE UPGRADE_NUMENOR_STONEWORK
  2332.             Model         = GBCASTWALL_UD3
  2333.       ParticleSysBone NONE BuildingChunkBitsTrail
  2334.       ParticleSysBone NONE ExplosiveMineFire02
  2335.     End
  2336.         AnimationState = RUBBLE UPGRADE_NUMENOR_STONEWORK
  2337.             StateName = STATE_Rubble
  2338.             Flags = START_FRAME_LAST
  2339.             Animation                = Death
  2340.                 AnimationName        = GBCASTWALL_UD3.GBCASTWALL_UD3
  2341.                 AnimationMode        = MANUAL
  2342.             AnimationBlendTime        = 0
  2343.             End
  2344.             BeginScript
  2345.                 Prev = CurDrawablePrevAnimationState()
  2346.                 if Prev == "STATE_ReallyDamaged" or Prev == "STATE_None" or Prev == "TRANS_U_IntoReallyDamaged"
  2347.                 then
  2348.                     ; Only play the rubble anim if we havn't come from another rubble.
  2349.                     CurDrawableSetTransitionAnimState("TRANS_U_IntoRubble")
  2350.                 end
  2351.             EndScript
  2352.             ;EnteringStateFX    = FX_WallDie    ;this plays only after all the wall debris sink into the ground
  2353.         End
  2354.         
  2355.         ModelConditionState  = RUBBLE
  2356.             Model         = GBCASTWALL_D3
  2357.       ParticleSysBone NONE BuildingChunkBitsTrail
  2358.       ParticleSysBone NONE ExplosiveMineFire02
  2359.     End
  2360.         AnimationState = RUBBLE
  2361.             Animation                =    Death
  2362.                 AnimationName        =    GBCASTWALL_D3.GBCASTWALL_D3
  2363.                 AnimationMode        =    ONCE
  2364.             End
  2365.             StateName = STATE_Rubble
  2366.             EnteringStateFX    = FX_WallDie
  2367.         End      
  2368.  
  2369.          ; UPGRADED ----------------------------------------------------------------------------------------------------------------
  2370.           ModelConditionState = UPGRADE_NUMENOR_STONEWORK
  2371.               Model = GBCASTWALL_U
  2372.           End
  2373.  
  2374.           AnimationState = UPGRADE_NUMENOR_STONEWORK
  2375.             EnteringStateFX = GenericBuildingUpgrade
  2376.         End
  2377.  
  2378.         ModelConditionState  = POST_RUBBLE
  2379.             Model         = None
  2380.         End
  2381.  
  2382.         ModelConditionState  = POST_COLLAPSE
  2383.             Model         = None
  2384.         End
  2385.         
  2386.     End
  2387.     
  2388.   
  2389.     ;----------------------- AUDIO -------------------------
  2390.  
  2391.     VoiceSelect                = Gui_PlotSelect
  2392.  
  2393.     SoundOnDamaged            = BuildingLightDamageStone
  2394.     SoundOnReallyDamaged        = BuildingHeavyDamageStone
  2395.  
  2396.     ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
  2397.         MaxUpdateRangeCap = 800
  2398.          AnimationSound = Sound:WallDie    Animation:GBCASTWALL_UD3.GBCASTWALL_UD3    Frames:0
  2399.     End
  2400.  
  2401.  
  2402.     ; ***DESIGN parameters ***
  2403.     DisplayName        = OBJECT:GondorCastleWall
  2404.     EditorSorting    = STRUCTURE
  2405.     Side            = Men
  2406.     BuildTime        = CASTLE_WALL_REBUILD_TIME
  2407.     BuildCost        = CASTLE_WALL_REBUILD_COST
  2408.       ShroudClearingRange = 160
  2409.  
  2410.     ArmorSet
  2411.         Conditions    = None
  2412.         Armor        = GondorCastleWall
  2413.         DamageFX    = MinasWallADamageFX
  2414.     End
  2415.  
  2416.     ; *** ENGINEERING Parameters ***  
  2417.     KindOf                    = STRUCTURE IMMOBILE WALK_ON_TOP_OF_WALL CHUNK_VENDOR SELECTABLE NOT_AUTOACQUIRABLE ;;;should this get autoacquired, or not? NO! or attack move will fail to enter the gate!
  2418.     RadarPriority            = STRUCTURE
  2419.     VisionRange                = GONDOR_ARCHER_VISION_RANGE
  2420.     KeepSelectableWhenDead    = Yes
  2421.     CommandSet                = GenericSelfRepairCommandSet
  2422.     
  2423.     Body                = ActiveBody ModuleTag_02
  2424.         MaxHealth        = GONDOR_CASTLE_WALL_HEALTH
  2425.         
  2426.         GrabObject = EntThrownBuildingRock
  2427.         GrabFX = FX_WallGrab
  2428.         GrabDamage = 490
  2429.         GrabOffset = X:16 Y:0
  2430.     End
  2431.  
  2432.     Behavior                  = BuildingBehavior BuildingModuleTag
  2433.         NightWindowName         = WINDOW_N01
  2434.     ;    FireWindowName          = WINDOW_F01
  2435.     ;    GlowWindowName            = WINDOW_G01
  2436.     ;    FireName                = FIRE01
  2437.     End
  2438.     
  2439.     Behavior = GettingBuiltBehavior ModuleTag_GettingBuilt
  2440.         SelfBuildingLoop = BuildingConstructionLoop ; Only played if we DON'T spawn a worker
  2441.         SelfRepairFromDamageLoop  = NoSound         ; This doesn't cause an animation, so don't bother playing a sound
  2442.         SelfRepairFromRubbleLoop  = BuildingConstructionLoop
  2443.         SpawnTimer = -1.0 ; Negative means no 'autoheal'
  2444.         RebuildTimeSeconds = CASTLE_WALL_REBUILD_TIME
  2445.     End
  2446.  
  2447.     Behavior = SiegeDockingBehavior ModuleTag_SiegeDocking
  2448.     End
  2449.     
  2450.     Behavior = KeepObjectDie ModuleTag_IWantRubble
  2451.     End
  2452.  
  2453.     Behavior = CastleMemberBehavior ModuleTag_CMB
  2454.         CountsForEvaCastleBreached = Yes
  2455.     End 
  2456.  
  2457.       Behavior = AttributeModifierAuraUpdate ModuleTag_WallBonus
  2458.         StartsActive    = Yes ;If no, requires upgrade to turn on.
  2459.         BonusName        = WallBonus
  2460.         RefreshDelay    = 2000
  2461.         ObjectFilter    = ALL -MACHINE
  2462.         ;Range            = 120        ; Range is overridden to affect people on us since we are a wall
  2463.         ;TargetEnemy        = Yes    ; Alliances are ignored to affect people on us since we are a wall
  2464.     End    
  2465.  
  2466.     Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
  2467.         TriggeredBy                = Upgrade_NumenorStonework
  2468.         AttributeModifier        = NumenorStonework_Bonus
  2469.         CustomAnimAndDuration    = AnimState:UPGRADE_NUMENOR_STONEWORK AnimTime:0
  2470.     End
  2471.  
  2472.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag1
  2473.         DeathTypes                    = ALL
  2474.         StartsActive                = Yes
  2475.         ActiveDuringConstruction    = Yes
  2476.         DeathWeapon                    = CastleWallDeath
  2477.     End    
  2478.  
  2479.      Behavior = FireWeaponWhenDeadBehavior FireDeadTag2
  2480.         DeathTypes                    = ALL
  2481.         StartsActive                = Yes
  2482.         ActiveDuringConstruction    = Yes
  2483.         DeathWeapon                    = StandardWallDeath
  2484.     End    
  2485.  
  2486.     Geometry                        = BOX
  2487.     GeometryMajorRadius                = 22.0
  2488.     GeometryMinorRadius                = 90.0
  2489.     GeometryHeight                    = 53.0
  2490.     GeometryOffset                    = X:-3 Y:0 Z:0
  2491.     
  2492.     AdditionalGeometry                = CYLINDER
  2493.     GeometryMajorRadius                = 26.0
  2494.     GeometryMinorRadius                = 0
  2495.     GeometryHeight                    = 53.0
  2496.     GeometryOffset                    = X:-10 Y:-80 Z:0
  2497.     
  2498.     AdditionalGeometry                = CYLINDER
  2499.     GeometryMajorRadius                = 26.0
  2500.     GeometryMinorRadius                = 0
  2501.     GeometryHeight                    = 53.0
  2502.     GeometryOffset                    = X:-10 Y:80 Z:0
  2503.  
  2504.     AdditionalGeometry                = BOX
  2505.     GeometryMajorRadius                = 18.0
  2506.     GeometryMinorRadius                = 1.0
  2507.     GeometryHeight                    = 53.0
  2508.     GeometryOffset                    = X:-10 Y: 98 Z:0
  2509.     GeometryName                    = Bookend
  2510.     
  2511.     AdditionalGeometry                = BOX
  2512.     GeometryMajorRadius                = 18.0
  2513.     GeometryMinorRadius                = 1.0
  2514.     GeometryHeight                    = 53.0
  2515.     GeometryOffset                    = X:-10 Y:-98 Z:0
  2516.     GeometryName                    = Bookend
  2517.     
  2518.     GeometryContactPoint            = X:-29.397        Y:0.326        Z:108.421        Swoop
  2519.     GeometryContactPoint            = X: 40 Y:-70 Z:0 Grab
  2520.     GeometryContactPoint            = X:-40 Y:-60 Z:0 Grab
  2521.     GeometryContactPoint            = X: 23 Y:-40 Z:0 Grab
  2522.     GeometryContactPoint            = X:-18 Y:-40 Z:0 Grab
  2523.     GeometryContactPoint            = X: 23 Y: 40 Z:0 Grab
  2524.     GeometryContactPoint            = X:-40 Y: 40 Z:0 Grab
  2525.     GeometryContactPoint            = X: 40 Y: 60 Z:0 Grab
  2526.     GeometryContactPoint            = X:-40 Y: 70 Z:0 Grab
  2527.     
  2528.     
  2529.     GeometryIsSmall                    = No
  2530.     GeometryRotationAnchorOffset    = X:375.0 Y:0.0
  2531.     Shadow                            = SHADOW_VOLUME
  2532. End
  2533.  
  2534.