Jump to content


Photo

AI


  • Please log in to reply
38 replies to this topic

#21 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 11:48 AM

I want to say that some code i take from Special Extended Edition mod,because only in this mo i see really advanced AI.

Edited by Vardamir, 11 February 2009 - 11:52 AM.


#22 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 11 February 2009 - 03:09 PM

If you can get the codes to work, more power to you! :blink:
It's best though, if you don't take the codes 1:1, but try to write it your own way, and do this while testing each step. If you do it any other way, you may stumble over stuff that isn't so easy to understand. The S.E.E. codes that you have right now (4.5) are pretty disorganized. I was mmore interested in results and speed than in making it accessible for others.
Oh, and in case you should want to use the coding stuff in any sort of public mod, please don't forget to give credit where it is due. :popcorn:

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#23 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 06:46 PM

Ok,there is scriptevents.xml
<?xml version="1.0"?><SageLuaScriptSection xmlns="http://tempuri.org/ScriptEvents.xsd">	<Events>		<!-- All internal events have a first parameter of self, which is the object receiving the event.  They may have additial parameters, depending			 on the specific event. -->		<InternalEvent Name="OnDamaged" /> <!-- OnDamaged(self, other) other is attacking object, may be nil -->		<InternalEvent Name="OnDestroyed" /> <!-- OnDestroyed(self) No parameters. Note that self is dead, but name and team are still valid. -->		<InternalEvent Name="OnArrived" /> <!-- OnArrived(self) Arrived at the end of a waypoint path.  No parameters. -->		<InternalEvent Name="OnUnitEntered" /> <!-- OnUnitEntered(self, areaName) Unit entered an area. Name of area is parameter. -->		<!-- disabled since its really slow and nobody is using it... [mh, 5/7/2004]--><InternalEvent Name="OnTeamEntered" /> <!-- OnTeamEntered(self, areaName) Sent to the last unit of a team entering an area. -->		<InternalEvent Name="OnUnitExited" /> <!-- OnUnitExited(self, areaName) Unit left an area. Name of area is parameter. -->		<!-- disabled since its really slow and nobody is using it... [mh, 5/7/2004] --><InternalEvent Name="OnTeamExited" /> <!-- OnTeamExited(self, areaName) Sent to the last unit of a team leaving an area. -->		<InternalEvent Name="OnTeamDestroyed" /> <!-- OnTeamDestroyed(self) Sent to the last unit of a team as it is destroyed. -->		<InternalEvent Name="BeScary" /> <!-- Broadcast to a unit when he uses a power that makes him radiate scariness.. -->		<InternalEvent Name="OnAflame" /> <!-- OnAflame(self) Broadcast to allies that I am on fire <img src='http://forums.revora.net/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':blink:' /> -->		<InternalEvent Name="OnQuenched" /> <!-- OnQuenched(self) Broadcast to allies that I am no longer on fire <img src='http://forums.revora.net/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':popcorn:' /> -->		<InternalEvent Name="OnCreated" /> <!-- OnCreated(self) sent when an object has been constructed -->		<InternalEvent Name="OnBuildingComplete" /> <!--OnBuildingComplete sent when an object has completed building. IE construction complete-->		<InternalEvent Name="DamageIncoming" /> <!-- DamageIncoming(self, other, delay, amount) other is shooter, delay is when the damage should hit, amount is how much.  So we can do a defense, or a "Oh heck" animation -->		<InternalEvent Name="OnSlaughtered" /> <!-- OnSlaughtered(self, slaughterer). -->		<InternalEvent Name="OnGenericEvent" /> <!-- self, string -->		<InternalEvent Name="OnBuildVariation" /> <!-- self, real -->		<!-- Scripted events are of two kinds - first is one generated by the ObjectDispatchEvent or ObjectBroadcastEvent script.  The calling is			DispatchedEvent(self, dispatchingObject, arbitraryString)  -->		<scriptedEvent Name="ExampleGuardMe" /> <!-- GuardMe(self, other, string) other is object generating the scripted event.  May be nil. -->		<!-- Second kind of scripted event is a spy event. --> 		<scriptedEvent Name="ExampleSpyMoving" /> <!-- SpyMoving(self, spySelf, parameters...) spySelf is the object self is spying on, parameters is the spied event paramters, may be nil. -->				<scriptedEvent Name="BeAfraidOfBalrog" /> <!-- Becoming afraid of balrog -->		<scriptedEvent Name="BeAfraidOfRampage" /> <!-- Becoming afraid of rampage -->		<scriptedEvent Name="BeAfraidOfPhial" /> <!-- Becoming afraid of Frodo -->		<scriptedEvent Name="BeUncontrollablyAfraid" /> <!-- Becoming afraid whether we like it or not -->		<scriptedEvent Name="BeingEnraged" /> <!-- Be enraged! Revenge!! -->		<scriptedEvent Name="BeAfraidOfGateDamaged" /> <!-- Be afraid of the gate being damaged -->		<scriptedEvent Name="BeTerrified" /> <!-- Run Away! -->				<scriptedEvent Name="ChantForUnit" />		<!-- Chant for a special unit! -->		<scriptedEvent Name="StopChantForUnit" />	<!-- Stop Chant for a special unit! -->		<scriptedEvent Name="BeginChanting" />		<!-- Begin Chanting! -->		<scriptedEvent Name="StopChanting" />		<!-- Stop Chanting! -->				<!-- Cinematic Events -->		<scriptedEvent Name="CinematicRampageDamaged" />				<!-- All ModelCondition and ObjectStatus events have a single parameter of self, which is the object matching the conditions. -->	<ModelConditionEvent Name="OnFire"> <!-- OnFire(self) self is object matching the modelconditions specified. -->		<Conditions>-DYING +AFLAME</Conditions>	</ModelConditionEvent>		<ModelConditionEvent Name="ExampleMovingDamaged">		<Conditions>+MOVING +DAMAGED -AFLAME</Conditions>	</ModelConditionEvent>		<ModelConditionEvent Name="Moving">		<Conditions>+MOVING</Conditions>	</ModelConditionEvent>				<ModelConditionEvent Name="Damaged">			<Conditions>+DAMAGED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ReallyDamaged">			<Conditions>+REALLYDAMAGED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="NOTReallyDamaged">			<Conditions>-REALLYDAMAGED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="RecoverFromTerror">			<Conditions>-EMOTION_TERROR -DYING</Conditions>		</ModelConditionEvent>				<ModelConditionEvent Name="UsingSpecialOne">			<Conditions>+SPECIAL_POWER_1 -UNPACKING -PACKING</Conditions>		</ModelConditionEvent>	   		<ModelConditionEvent Name="UsingSpecialTwo">			<Conditions>+SPECIAL_POWER_2 -UNPACKING -PACKING</Conditions>		</ModelConditionEvent>				<ModelConditionEvent Name="UsingSpecialThree">			<Conditions>+SPECIAL_POWER_3 -UNPACKING -PACKING</Conditions>		</ModelConditionEvent>				<ModelConditionEvent Name="CinematicRampageUser">			<Conditions>+USER_4</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="UsingSpecialThreeNoPacking">			<Conditions>+SPECIAL_POWER_3 -UNPACKING</Conditions>		</ModelConditionEvent>				<ModelConditionEvent Name="UsingSpecialThreeMounted">			<Conditions>+SPECIAL_POWER_3 -UNPACKING -PACKING +MOUNTED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="UsingSpecialThreeMountedNoPacking">			<Conditions>+SPECIAL_POWER_3 -UNPACKING +MOUNTED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="UsingSpecialWeaponThree">			<Conditions>+SPECIAL_WEAPON_THREE</Conditions>		</ModelConditionEvent>				<ModelConditionEvent Name="NOTUsingSpecialWeaponThree">			<Conditions>-SPECIAL_WEAPON_THREE</Conditions>		</ModelConditionEvent>				<ModelConditionEvent Name="OnJustBuilt">				<Conditions>+JUST_BUILT</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="OnSelected">				<Conditions>+SELECTED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="OnDisguised">				<Conditions>+DISGUISED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="OnDisguiseCanceled">				<Conditions>-DISGUISED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ReallyDamagedLastStand">			<Conditions>+REALLYDAMAGED +USER_1</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ReallyDamagedAndAflame">			<Conditions>+REALLYDAMAGED +AFLAME</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ModelConditionStealthed">			<Conditions>+INVISIBLE_STEALTH</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ModelConditionNotStealthed">			<Conditions>-INVISIBLE_STEALTH</Conditions>		</ModelConditionEvent>		<ModelConditionEvent Name="ModelConditionUSER_1">			<Conditions>+USER_1</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="NOTModelConditionUSER_1">			<Conditions>-USER_1</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ModelConditionUSER_2">			<Conditions>+USER_2</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ModelConditionUSER_3">				<Conditions>+USER_3</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ModelConditionUSER_5">				<Conditions>+USER_5</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="ModelConditionUSER_6">				<Conditions>+USER_6</Conditions>		</ModelConditionEvent>		<ModelConditionEvent Name="ModelConditionNOTUSER_6">				<Conditions>-USER_6</Conditions>		</ModelConditionEvent>		<ModelConditionEvent Name="ModelConditionUSER_8">				<Conditions>+USER_8</Conditions>		</ModelConditionEvent>		<ModelConditionEvent Name="OnEnemyNear">				<Conditions>+SPECIAL_ENEMY_NEAR</Conditions>		</ModelConditionEvent>		<ModelConditionEvent Name="OnEnemyNOTNear">				<Conditions>-SPECIAL_ENEMY_NEAR</Conditions>		</ModelConditionEvent>		<ModelConditionEvent Name="OnNotDoingMuch">				<Conditions>-DISGUISED -SPECIAL_ENEMY_NEAR -INVISIBLE_STEALTH -JUST_BUILT -PACKING -UNPACKING -WEAPONSET_ENRAGED -WEAPONSET_RAMPAGE -WEAPONSET_HERO_MODE -WEAPONSTATE_CLOSE_RANGE</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="OnBeingStoned">				<Conditions>+STONED</Conditions>		</ModelConditionEvent>			<ModelConditionEvent Name="OnNotBeingStoned">				<Conditions>-STONED</Conditions>		</ModelConditionEvent>		</Events>	<EventList Name="BaseScriptFunctions">		<!-- If there are any events that need to apply to all units, put them here. jba -->	</EventList>		 <EventList Name="ArgelebFunctions" Inherit="BaseScriptFunctions">	<EventHandler EventName="OnEnemyNear" ScriptFunctionName="BecomeDismounted" DebugSingleStep="false"/>	<EventHandler EventName="OnEnemyNOTNear" ScriptFunctionName="BecomeMounted" DebugSingleStep="false"/>	<EventHandler EventName="Damaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="ReallyDamaged" ScriptFunctionName="OnHeroInjured_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="NOTReallyDamaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="BaseHeroFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="Damaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="ReallyDamaged" ScriptFunctionName="OnHeroInjured_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="NOTReallyDamaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>	</EventList>		<EventList Name="CaptureFlagFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnGenericEvent"	ScriptFunctionName="OnCaptureFlagGenericEvent" DebugSingleStep="false"/>	</EventList>	<EventList Name="TrollFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="ReallyDamaged"	ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>	  <EventHandler EventName="OnCreated" ScriptFunctionName="OnTrollCreated" DebugSingleStep="false"/>	  <EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnTrollGenericEvent" DebugSingleStep="false"/>	  <EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>	</EventList>	<EventList Name="CreepTrollFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="ReallyDamaged"	ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>	  <EventHandler EventName="OnCreated" ScriptFunctionName="OnCreepTrollCreated" DebugSingleStep="false"/>	  <EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnTrollGenericEvent" DebugSingleStep="false"/>	  <EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>	</EventList>	<EventList Name="DrummerTrollFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="BeScary"			ScriptFunctionName="RadiateTerrorEx"			DebugSingleStep="false"/>	</EventList>		<EventList Name="BarrowWightFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>	</EventList>		<EventList Name="SauronFunctions"  Inherit="BaseHeroFunctions">		<EventHandler EventName="OnCreated"			ScriptFunctionName="OnMordorSauronCreated"		DebugSingleStep="false"/>		<EventHandler EventName="BeScary"			ScriptFunctionName="RadiateTerrorEx"			DebugSingleStep="false"/>	</EventList>   	<EventList Name="MumakilFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnCreated" ScriptFunctionName="OnMumakilCreated" DebugSingleStep="false"/>	  <EventHandler EventName="ReallyDamagedAndAflame"	ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>	</EventList>		<EventList Name="SunbeamFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	</EventList>	<EventList Name="TheodenFunctions" Inherit="BaseHeroFunctions">	</EventList>		<EventList Name="BallistaFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnBallistaCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="CatapultFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnCatapultCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="TrebuchetFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnTrebuchetCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="StandardPorterFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>		<EventHandler EventName="OnCreated" ScriptFunctionName="OnPorterCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="StandardPorterFunctions_SEE" Inherit="BaseScriptFunctions">		<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>		<EventHandler EventName="OnCreated" ScriptFunctionName="OnPorterCreated_SEE" DebugSingleStep="false"/>		<EventHandler EventName="ModelConditionUSER_5" ScriptFunctionName="OnPorterCommandSetSwitch2_SEE" DebugSingleStep="false"/>		<EventHandler EventName="ModelConditionUSER_6" ScriptFunctionName="OnPorterCommandSetSwitch1_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="EvilPorterFunctions" Inherit="InfantryFunctions">		<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>		<EventHandler EventName="OnCreated" ScriptFunctionName="OnEvilPorterCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="StandardPeasantFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnPeasantCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="RohanEowynFunctions_SEE" Inherit="BaseHeroFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnRohanEowynCreated_SEE" DebugSingleStep="false"/>		<EventHandler EventName="OnDisguised" ScriptFunctionName="OnRohanEowynDisguised_SEE" DebugSingleStep="false"/>		<EventHandler EventName="OnDisguiseCanceled" ScriptFunctionName="OnRohanEowynDisguiseCanceled_SEE" DebugSingleStep="false"/>		<EventHandler EventName="ModelConditionUSER_1" ScriptFunctionName="OnRohanEowynStealthed_SEE" DebugSingleStep="false"/>		<EventHandler EventName="NOTModelConditionUSER_1" ScriptFunctionName="OnRohanEowynNotStealthed_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="GandalfFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="DamageIncoming" ScriptFunctionName="GandalfConsiderUsingDefensePower" DebugSingleStep="false"/>		<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="GandalfTriggerWizardBlast" DebugSingleStep="false"/>	</EventList>	<EventList Name="GandalfFunctions_SEE" Inherit="BaseHeroFunctions">		<EventHandler EventName="DamageIncoming" ScriptFunctionName="GandalfConsiderUsingDefensePower" DebugSingleStep="false"/>		<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="GandalfTriggerWizardBlast" DebugSingleStep="false"/>			<!--	<EventHandler EventName="ReallyDamaged"	ScriptFunctionName="GandalfTriggerDefensePower_SEE" DebugSingleStep="false"/> -->	</EventList>		 <EventList Name="SarumanFunctions" Inherit="BaseScriptFunctions">		 <!-- <EventHandler EventName="DamageIncoming" ScriptFunctionName="SarumanConsiderUsingDefensePower" DebugSingleStep="false"/> -->	</EventList>   	<EventList Name="BerserkerFunctions" Inherit="InfantryFunctions">		<EventHandler EventName="OnEnemyNear" ScriptFunctionName="OnEvilMenBlackRiderMounting_SEE" DebugSingleStep="false"/>		<EventHandler EventName="OnEnemyNOTNear" ScriptFunctionName="OnEvilMenBlackRiderDismounting_SEE" DebugSingleStep="false"/>		<EventHandler EventName="Damaged" ScriptFunctionName="OnBerserkerDamaged_SEE" DebugSingleStep="false"/>		<EventHandler EventName="ReallyDamaged" ScriptFunctionName="OnBerserkerReallyDamaged_SEE" DebugSingleStep="false"/>	</EventList>   	<EventList Name="LegolasFunctions" Inherit="BaseHeroFunctions">		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnLegolasCreated" DebugSingleStep="false"/>	</EventList> 		<EventList Name="GaladrielFunctions" Inherit="BaseHeroFunctions">		<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	</EventList>	<EventList Name="GaladrielFunctions_SEE" Inherit="BaseHeroFunctions">		<EventHandler EventName="BeScary" ScriptFunctionName="RadiateUncontrollableFear_SEE" DebugSingleStep="false"/>	</EventList>		<EventList Name="MinisTirithGateFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnDamaged" ScriptFunctionName="RadiateGateDamageFear" DebugSingleStep="false"/>  	</EventList>		<EventList Name="InfantryFunctions" Inherit="BaseScriptFunctions">	  <!-- These are events that will apply to all infantry.  Any infantry units should inherit this set. jba -->	  <EventHandler EventName="BeAfraidOfBalrog"			ScriptFunctionName="BecomeAfraidOfBalrog"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfRampage"			ScriptFunctionName="BecomeAfraidOfRampage"		DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"				ScriptFunctionName="BecomeTerrified"			DebugSingleStep="false"/>		  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>	</EventList>		<EventList Name="InfantryBannerFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated"					ScriptFunctionName="OnInfantryBannerCreated"	DebugSingleStep="false"/>	  <!-- These are events that will apply to all infantry.  Any infantry units should inherit this set. jba -->	  <EventHandler EventName="BeAfraidOfBalrog"			ScriptFunctionName="BecomeAfraidOfBalrog"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfRampage"			ScriptFunctionName="BecomeAfraidOfRampage"		DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"				ScriptFunctionName="BecomeTerrified"			DebugSingleStep="false"/>		  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>		  <EventHandler EventName="ModelConditionUSER_8"	ScriptFunctionName="BecomeAdvancedBannerCarrier_SEE" DebugSingleStep="false"/>	</EventList>		<EventList Name="WildInfantryFunctions" Inherit="InfantryFunctions">		<!-- These are events that apply to all wild infantry -->		<EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="WildInfantryBecomeAfraidOfPhial"	DebugSingleStep="false"/>	</EventList>		<EventList Name="CavalryFunctions" Inherit="BaseScriptFunctions">	  <!-- These are events that will apply to all infantry.  Any infantry units should inherit this set. jba -->	  <EventHandler EventName="OnCreated"	ScriptFunctionName="OnCavalryCreated"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfBalrog"	ScriptFunctionName="BecomeAfraidOfBalrog"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfRampage"	ScriptFunctionName="BecomeAfraidOfRampage"		DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"			ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>		  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>	</EventList>	<EventList Name="CavalryBannerFunctions" Inherit="CavalryFunctions">		  <EventHandler EventName="ModelConditionUSER_8"	ScriptFunctionName="BecomeAdvancedBannerCarrier_SEE" DebugSingleStep="false"/>	</EventList>		<EventList Name="RohirrimFunctions" Inherit="CavalryFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnRohirrimCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="SummonedRohirrimFunctions" Inherit="CavalryFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnSummonedRohirrimCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="WildSpiderFunctions" Inherit="CavalryFunctions">		<!-- This contains events specific to the wild spider riders-->		 <EventHandler EventName="OnCreated" ScriptFunctionName="OnWildSpiderRiderCreated" DebugSingleStep="false"/>		 <EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>	</EventList>	<EventList Name="CreepSpiderFunctions" Inherit="CavalryFunctions">		<!-- This contains events specific to the wild spider riders-->		 <EventHandler EventName="OnCreated" ScriptFunctionName="OnCreepSpiderRiderCreated" DebugSingleStep="false"/>		 <EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>	</EventList>	<EventList Name="HaradrimArcherFunctions" Inherit="CavalryFunctions">		<!-- This contains events specific to the wild spider riders-->		 <EventHandler EventName="OnCreated" ScriptFunctionName="OnHaradrimArcherCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="IsengardWildmanFunctions" Inherit="CavalryFunctions">		<!-- This contains events specific to the Isengard Wildmen-->		 <EventHandler EventName="OnCreated" ScriptFunctionName="OnIsengardWildmanCreated" DebugSingleStep="false"/>	</EventList>			<EventList Name="GondorCavalryFunctions" Inherit="CavalryFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnGondorCavalryCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="DwarvenBattleWagonFunctions" Inherit="BaseHeroFunctions">		<EventHandler EventName="OnCreated" ScriptFunctionName="OnGondorCavalryCreated" DebugSingleStep="false"/>		<EventHandler EventName="OnCreated" ScriptFunctionName="OnDwarvenBattleWagonCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="EvilMenBlackRiderFunctions"  Inherit="BaseHeroFunctions">	  <EventHandler EventName="BeAfraidOfBalrog"	ScriptFunctionName="BecomeAfraidOfBalrog"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfRampage"	ScriptFunctionName="BecomeAfraidOfRampage"		DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"			ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>		  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>	  <EventHandler EventName="OnCreated" ScriptFunctionName="OnEvilMenBlackRiderCreated" DebugSingleStep="false"/>	  <EventHandler EventName="OnJustBuilt" ScriptFunctionName="OnEvilMenBlackRiderJustBuilt_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	  <EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>	  <EventHandler EventName="UsingSpecialThree" ScriptFunctionName="OnEvilMenBlackRiderMounting_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="UsingSpecialThreeMounted" ScriptFunctionName="OnEvilMenBlackRiderDismounting_SEE" DebugSingleStep="false"/>	</EventList>			  <EventList Name="WitchkingBlackRiderFunctions">	  <EventHandler EventName="OnCreated" ScriptFunctionName="OnEvilMenBlackRiderCreated" DebugSingleStep="false"/>	  <EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	  <EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>	  <!-- <EventHandler EventName="ModelConditionUSER_1" ScriptFunctionName="OnWitchkingTransitionToFellbeast_SEE" DebugSingleStep="false"/> -->	</EventList>	<EventList Name="WitchkingFellBeastFunctions">	  <EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	  <EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>	  <!-- <EventHandler EventName="ModelConditionUSER_2" ScriptFunctionName="OnWitchkingTransitionToDismounted_SEE" DebugSingleStep="false"/> -->	</EventList>	<EventList Name="KingBrandFunctions" Inherit="BaseHeroFunctions">	  <!-- Nothing -->	</EventList>	<EventList Name="LumberMillfunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnEnemyNear" ScriptFunctionName="OnWorkersEndangered_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="ArcherFunctions" Inherit="InfantryFunctions">	</EventList>		  <EventList Name="GondorArcherFunctions" Inherit="ArcherFunctions">	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnGondorArcherCreated" DebugSingleStep="false"/>	</EventList> 	  <EventList Name="RohanArcherFunctions" Inherit="ArcherFunctions">	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnRohanArcherCreated" DebugSingleStep="false"/>	</EventList> 	  <EventList Name="RohanElvenWarriorFunctions" Inherit="InfantryFunctions">	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnElvenWarriorCreated" DebugSingleStep="false"/>	</EventList> 		<EventList Name="RangerFunctions" Inherit="ArcherFunctions">		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnGondorArcherCreated" DebugSingleStep="false"/>	</EventList>			<EventList Name="FellBeastFunctions">	  <EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	  <EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>	</EventList>	<EventList Name="DragonStrikeDragonFunctions">		<EventHandler EventName="OnCreated"			ScriptFunctionName="DragonStrikeDragonCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="ShelobFunctions" Inherit="BaseHeroFunctions">		  <EventHandler EventName="BeAfraidOfPhial"	ScriptFunctionName="ShelobBecomeAfraidOfPhial" DebugSingleStep="false"/>		  <EventHandler EventName="BeScary"			ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"		ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>	</EventList>	<EventList Name="GwaihirFunctions">	</EventList>	<EventList Name="EntFunctions" Inherit="BaseScriptFunctions">		  <!-- This contains events specific to Ents. -->		  <EventHandler EventName="OnDestroyed"	ScriptFunctionName="BeEnraged"		DebugSingleStep="false"/>				  <EventHandler EventName="BeingEnraged"	ScriptFunctionName="BecomeEnraged"	DebugSingleStep="false"/>				  <EventHandler EventName="OnAflame"		ScriptFunctionName="BecomeEnraged"	DebugSingleStep="false"/>				  <EventHandler EventName="OnQuenched"	ScriptFunctionName="StopEnraged"	DebugSingleStep="false"/>			  <EventHandler EventName="OnCreated"		ScriptFunctionName="OnEntCreated"	DebugSingleStep="false"/>	</EventList>	  <EventList Name="TreeBeardFunctions" Inherit="BaseHeroFunctions">		  <!-- This contains events specific to Ents. -->		  <EventHandler EventName="OnDestroyed"	ScriptFunctionName="BeEnraged"		DebugSingleStep="false"/>				  <EventHandler EventName="BeingEnraged"	ScriptFunctionName="BecomeEnraged"	DebugSingleStep="false"/>				  <EventHandler EventName="OnAflame"		ScriptFunctionName="BecomeEnraged"	DebugSingleStep="false"/>				  <EventHandler EventName="OnQuenched"	ScriptFunctionName="StopEnraged"	DebugSingleStep="false"/>			  <EventHandler EventName="OnCreated"		ScriptFunctionName="OnEntCreated"	DebugSingleStep="false"/>	</EventList>		<EventList Name="InfantryFunctionsRockThrow_SEE" Inherit="InfantryFunctions">		<!-- These are events that apply to all wild infantry -->	<EventHandler EventName="OnCreated"		ScriptFunctionName="OnEntCreated"	DebugSingleStep="false"/>	</EventList>	<EventList Name="MountainGiantFunctions" Inherit="BaseScriptFunctions">		<!-- This contains events specific to Ents. -->		<EventHandler EventName="OnCreated"		ScriptFunctionName="OnMountainGiantCreated"	DebugSingleStep="false"/>		<EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnMountainGiantGenericEvent" DebugSingleStep="false"/>	</EventList>	<EventList Name="MordorGrondFunctions" Inherit="BaseScriptFunctions">		<!-- This contains events specific to the Grond. -->		<EventHandler EventName="OnUnitEntered" ScriptFunctionName="ChantForUnit"		DebugSingleStep="false"/>		<EventHandler EventName="OnUnitExited"	ScriptFunctionName="StopChantForUnit"	DebugSingleStep="false"/>		<EventHandler EventName="OnDestroyed"	ScriptFunctionName="StopChantForUnit"	DebugSingleStep="false"/>			</EventList>	<EventList Name="MordorOrcFunctions" Inherit="InfantryFunctions">		<!-- This contains events specific to the Orc units. -->		<EventHandler EventName="BeginChanting"		ScriptFunctionName="BeginCheeringForGrond"	DebugSingleStep="false"/>		<EventHandler EventName="StopChanting"		ScriptFunctionName="StopCheeringForGrond"	DebugSingleStep="false"/>	</EventList>	<EventList Name="MordorArcherFunctions" Inherit="InfantryFunctions">		<EventHandler EventName="OnCreated"			ScriptFunctionName="OnMordorArcherCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="MordorFighterFunctions" Inherit="MordorOrcFunctions">		<!-- This contains events specific to the MordorFighter. Kris -->		<EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>		<EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid"	 DebugSingleStep="false"/>	</EventList>	<EventList Name="MordorInfantryBannerFunctions" Inherit="MordorOrcFunctions">		<EventHandler EventName="OnCreated"					ScriptFunctionName="OnInfantryBannerCreated"	DebugSingleStep="false"/>	  <!-- This contains events specific to the MordorFighter. Kris -->	  <EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>	  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid"	 DebugSingleStep="false"/>		  <EventHandler EventName="ModelConditionUSER_8"	ScriptFunctionName="BecomeAdvancedBannerCarrier_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="MordorCorsairFunctions" Inherit="InfantryFunctions">		<!-- This contains events specific to the Gondor Fighter horde member. jba -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMordorCorsairCreated" DebugSingleStep="false"/>		<EventHandler EventName="RecoverFromTerror"		ScriptFunctionName="GondorFighterRecoverFromTerror"				DebugSingleStep="false"/>		<EventHandler EventName="BeAfraidOfGateDamaged" ScriptFunctionName="GondorFighterBecomeAfraidOfGateDamaged"		DebugSingleStep="false"/>	</EventList>	<EventList Name="WildGoblinArcherFunctions" Inherit="MordorOrcFunctions">		<!-- This contains events specific to the GoblinArcherFunctions. Kris -->		<EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>		<EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid"	 DebugSingleStep="false"/>		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnWildGoblinArcherCreated" DebugSingleStep="false"/>			</EventList> 	<EventList Name="IsengardFighterFunctions" Inherit="MordorFighterFunctions">	  <!-- This contains events specific to the IsengardFighter. Kris -->	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnIsengardFighterCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="IsengardBannerFunctions" Inherit="MordorFighterFunctions">	  <!-- This contains events specific to the IsengardFighter. Kris -->	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnIsengardFighterCreated" DebugSingleStep="false"/>		  <EventHandler EventName="ModelConditionUSER_8"	ScriptFunctionName="BecomeAdvancedBannerCarrier_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="WargRiderFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnIsengardFighterCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="GothmogFunctions"  Inherit="BaseScriptFunctions">	  <!-- This contains events specific to the IsengardFighter. Kris -->	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnIsengardFighterCreated" DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>	  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid"	 DebugSingleStep="false"/>	  <EventHandler EventName="OnSelected"				ScriptFunctionName="OnGothmogSelected_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="Moving"				ScriptFunctionName="OnGothmogSelected_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="CaptainJacksonFunctions" Inherit="BaseHeroFunctions">		<!-- This contains events specific to the Gondor Fighter horde member. jba -->	  <EventHandler EventName="BeAfraidOfBalrog"			ScriptFunctionName="BecomeAfraidOfBalrog"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfRampage"			ScriptFunctionName="BecomeAfraidOfRampage"		DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"				ScriptFunctionName="BecomeTerrified"			DebugSingleStep="false"/>		  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMordorCorsairCreated" DebugSingleStep="false"/>		<EventHandler EventName="RecoverFromTerror"		ScriptFunctionName="GondorFighterRecoverFromTerror"				DebugSingleStep="false"/>		<EventHandler EventName="BeAfraidOfGateDamaged" ScriptFunctionName="GondorFighterBecomeAfraidOfGateDamaged"		DebugSingleStep="false"/>	</EventList>	<EventList Name="MoriaWargRiderFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMoriaGoblinsSwordCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="IsengardArcherFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardArhcer. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnIsengardArcherCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="HaradrimFunctions" Inherit="InfantryFunctions">		<!-- This contains events specific to the Haradrim -->	</EventList>		<EventList Name="GondorFighterFunctions" Inherit="InfantryFunctions">	  <!-- This contains events specific to the Gondor Fighter horde member. jba -->	  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnGondorFighterCreated" DebugSingleStep="false"/>	  <EventHandler EventName="RecoverFromTerror"		ScriptFunctionName="GondorFighterRecoverFromTerror"				DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfGateDamaged" ScriptFunctionName="GondorFighterBecomeAfraidOfGateDamaged"		DebugSingleStep="false"/>	</EventList> 	<EventList Name="GondorBannerFunctions" Inherit="GondorFighterFunctions">		  <EventHandler EventName="ModelConditionUSER_8"	ScriptFunctionName="BecomeAdvancedBannerCarrier_SEE" DebugSingleStep="false"/>	</EventList> 	<EventList Name="GondorFighterHordeFunctions" Inherit="GondorFighterFunctions">		<!-- This contains events specific to the Gondor Fighter horde brain. Ian -->	</EventList>	<EventList Name="BoromirFunctions" Inherit="BaseScriptFunctions">		<!-- This contains events specific to Boromir -->		<EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>	</EventList>		<EventList Name="BoromirFunctions_SEE" Inherit="BaseHeroFunctions">		<!-- This contains events specific to Boromir -->		<EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>		<EventHandler EventName="ReallyDamagedLastStand"	ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>	</EventList>	<EventList Name="MahudFunctions_SEE" Inherit="BaseScriptFunctions">		<!-- This contains events specific to Boromir -->		<EventHandler EventName="ModelConditionUSER_6"		ScriptFunctionName="ActivateSpecialPowerMahudHorn_SEE"	DebugSingleStep="false"/>		<EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateUncontrollableFear"	DebugSingleStep="false"/>	</EventList>		<EventList Name="AragornFunctions" Inherit="BaseHeroFunctions">		<!-- This contains events specific to Boromir -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnAragornCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="MerryFunctions" Inherit="BaseHeroFunctions">		<!-- These are events that apply to all wild infantry -->	  <EventHandler EventName="OnCreated"		ScriptFunctionName="OnEntCreated"	DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfBalrog"			ScriptFunctionName="BecomeAfraidOfBalrog"		DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfRampage"			ScriptFunctionName="BecomeAfraidOfRampage"		DebugSingleStep="false"/>		  <EventHandler EventName="BeTerrified"				ScriptFunctionName="BecomeTerrified"			DebugSingleStep="false"/>		  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>	</EventList>	<EventList Name="FrodoFunctions" Inherit="MerryFunctions">		<!-- This contains events specific to Frodo -->		<EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiatePhialFear"	DebugSingleStep="false"/>		<EventHandler EventName="ModelConditionUSER_1"		ScriptFunctionName="OnFrodoDisguised_SEE"	DebugSingleStep="false"/>	</EventList>		<EventList Name="FramFunctions" Inherit="FrodoFunctions">		<!-- This contains events specific to Frodo -->		<EventHandler EventName="onCreated"	ScriptFunctionName="MakeMeAlert"	DebugSingleStep="false"/>	</EventList>		<EventList Name="BalrogFunctions" Inherit="BaseScriptFunctions">		<!-- This contains events specific to Balrog -->		<EventHandler EventName="UsingSpecialOne"		ScriptFunctionName="RadiateTerror"				DebugSingleStep="false"/>		<EventHandler EventName="UsingSpecialTwo"		ScriptFunctionName="BalrogTriggerBreatheFire"		DebugSingleStep="false"/>	</EventList>		<EventList Name="DemoMumakilFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnFire"	ScriptFunctionName="GoIntoRampage"  DebugSingleStep="false"/>	</EventList>	<EventList Name="DwarvenGuardianFunctions" Inherit="InfantryFunctions">		<!-- This contains events specific to the Gondor Fighter horde member. jba -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnDwarvenGuardianCreated" DebugSingleStep="false"/>	</EventList>		<!-- Cinematic Lua Event Lists -->	<EventList Name="CinematicMumakilFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="CinematicRampageUser"	ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>	</EventList>	<!-- Generic keep Lua Event Lists -->	<EventList Name="GarrisonableFunctions">		<EventHandler EventName="OnCreated"	ScriptFunctionName="OnGarrisonableCreated" DebugSingleStep="false"/>  </EventList>		<EventList Name="CreateAHeroFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnCreateAHeroFunctions" DebugSingleStep="false"/>		<EventHandler EventName="OnGenericEvent"		ScriptFunctionName="CreateAHeroHideEverything" DebugSingleStep="false"/>		<EventHandler EventName="BeScary"				ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	</EventList> 		<EventList Name="EvilShipFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnEvilShipCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="GoodShipFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnGoodShipCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="ShipWrightFunctions" Inherit="BaseScriptFunctions">		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnShipWrightCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="FortressFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnCreated"		ScriptFunctionName="OnFortressCreated" DebugSingleStep="false"/>	  <EventHandler EventName="OnBeingStoned"		ScriptFunctionName="OnFortressRingStolen_SEE" DebugSingleStep="false"/>	  <EventHandler EventName="OnNotBeingStoned"		ScriptFunctionName="OnFortressRingStolenAftermath_SEE" DebugSingleStep="false"/>	</EventList>	<EventList Name="DormitoryFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnBuildVariation"		ScriptFunctionName="OnDormitoryBuildVariation" DebugSingleStep="false"/>	</EventList>	<EventList Name="GateWatchersFunctions" Inherit="BaseScriptFunctions">	  <EventHandler EventName="OnBuildingComplete"	ScriptFunctionName="OnGateWatcherBuilt" DebugSingleStep="false"/>	  <EventHandler EventName="BeScary"				ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>	</EventList>	<EventList Name="NeutralGollum_RingStealerFunctions" Inherit="BaseScriptFunctions">		  <EventHandler EventName="OnDamaged" ScriptFunctionName="NeutralGollum_RingStealerDamaged" DebugSingleStep="false"/>  		  <EventHandler EventName="OnSlaughtered" ScriptFunctionName="NeutralGollum_RingStealerSlaughtered" DebugSingleStep="false"/>  	</EventList>		<EventList Name="TomBombadil_Functions" Inherit="BaseScriptFunctions">		  <EventHandler EventName="BeScary"				ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>			</EventList>		<EventList Name="NecromancerStatue_Functions" Inherit="BaseScriptFunctions">		  <EventHandler EventName="OnCreated"				ScriptFunctionName="OnNecromancerStatueCreated" DebugSingleStep="false"/>		  <EventHandler EventName="BeScary"				ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>			</EventList>	  <EventList Name="IsengardFellbeastFunctions" Inherit="FellBeastFunctions">	  <EventHandler EventName="OnCreated" ScriptFunctionName="IsengardFellbeastCreated" DebugSingleStep="false"/>	</EventList>			<!-- This contains events specific to the MordorFighter. Kris (Inserted by S?lherokhh)  -->	<EventList Name="MordorOrcFighterFunctions" Inherit="MordorOrcFunctions">	  <EventHandler EventName="OnCreated"	ScriptFunctionName="OnMordorOrcFighterCreated" DebugSingleStep="false"/>	  <EventHandler EventName="BeAfraidOfPhial"			ScriptFunctionName="MordorFighterBecomeAfraidOfPhial"			DebugSingleStep="false"/>	  <EventHandler EventName="BeUncontrollablyAfraid"	ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid"	 DebugSingleStep="false"/>	</EventList>		  <EventList Name="MordorOrcArcherFunctions" Inherit="InfantryFunctions">		<EventHandler EventName="OnCreated"			ScriptFunctionName="OnMordorOrcArcherCreated" DebugSingleStep="false"/>	</EventList>		  <EventList Name="MorannonArcherFunctions" Inherit="InfantryFunctions">		<EventHandler EventName="OnCreated"			ScriptFunctionName="OnMorannonArcherCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="MordorBlackUrukFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMordorBlackUrukCreated" DebugSingleStep="false"/>	</EventList>	<EventList Name="MordorMorgulOrcFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMordorMorgulOrcsCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="GoblinFighterFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMoriaGoblinsSwordCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="GoblinArcherFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMoriaGoblinsBowCreated" DebugSingleStep="false"/>		<EventHandler EventName="UsingSpecialWeaponThree"				ScriptFunctionName="UsingFireArrows_SEE" DebugSingleStep="false"/>		<EventHandler EventName="NOTUsingSpecialWeaponThree"				ScriptFunctionName="NOTUsingFireArrows_SEE" DebugSingleStep="false"/>	</EventList>		<EventList Name="GoblinPikemanFunctions" Inherit="MordorFighterFunctions">		<!-- This contains events specific to the IsengardFighter. Kris -->		<EventHandler EventName="OnCreated"				ScriptFunctionName="OnMoriaGoblinsSpearCreated" DebugSingleStep="false"/>	</EventList>		<EventList Name="UpgradeProviderFunctions" Inherit="BaseScriptFunctions">		<!-- This contains events specific to Ents. -->	<EventHandler EventName="OnCreated"		ScriptFunctionName="OnEntCreated"	DebugSingleStep="false"/>		<EventList Name="CreepSpiderLairFunctions" Inherit="BaseScriptFunctions">		<!-- This contains events specific to Ents. -->	<EventHandler EventName="OnCreated"		ScriptFunctionName="OnCreepSpiderLairCreated_SEE"	DebugSingleStep="false"/>  </EventList></SageLuaScriptSection>

scripts.lua


Argeleb.ini

;------------------------------------------------------------------------------;;	Argeleb.ini;;------------------------------------------------------------------------------; BoromirObject ArnorArgeleb; *** ART Parameters ***   ; SelectPortrait for Heros is portrait behind skill buttons. HP = HeroPortrait.	SelectPortrait = HPArgeleb	   ; ButtonImage for Heros is button image on Hero Select UI to select hero. HI = HeroIcon or HeroImage.	ButtonImage = HIArgeleb	DescriptionStrategic = CONTROLBAR:LW_ToolTip_Argeleb	Draw = W3DScriptedModelDraw ModuleTag_DRAW	   ;WadingParticleSys = EntRipples	  OkToChangeModelColor = No	  		StaticModelLODMode = yes; Will append M or L to the skin name depending on GameLOD		DefaultModelConditionState			Model = AUArgeleb_SKN;RUTheoden_SKN			Skeleton = RUTheoden_SKL		End;Knight Shield	ModelConditionState	= USER_3		Model			= AUArgeleb_SKN		ParticleSysBone = NONE MitrilCoatEffectCon FOLLOWBONE:YES	End		ModelConditionState = WORLD_BUILDER			Model = AUArgeleb_SKN;RUTheoden_SKN			Skeleton = RUTheoden_SKL		End				ModelConditionState = MOUNTED			Model	= AUArgelebM_SKN;RUHHs_Theo_SKN			Skeleton = RUHHs_Theo_SKL			WeaponLaunchBone	= PRIMARY PASSENGERBONE		End 	ModelConditionState		= MOUNTED USER_3		Model				= AUArgelebM_SKN		WeaponLaunchBone		= PRIMARY SPEAR		ParticleSysBone = BAT_SPINE2 MitrilCoatEffectCon FOLLOWBONE:YES	End 	  		AnimationState				= MOUNTED DEBUG ;shift delete to trigger			Animation				AnimationName	   = RUHHs_Theo_IDLA	  				AnimationMode	   = ONCE			End			ParticleSysBone = BAT_HHEAD glowHorseGold FollowBone:Yes						ParticleSysBone = B_HHIPL glowHorseRearGold FollowBone:Yes			ParticleSysBone = BAT_SPINE2 glowGold FollowBone:Yes					End									   ; --- stunned anims		AnimationState				=	MOUNTED FREEFALL 			Animation				=	freefall				AnimationName		=	RUHHs_Theo_FLYC				AnimationMode		=	LOOP			End			Flags					=	RANDOMSTART		End		AnimationState				=	MOUNTED STUNNED_FLAILING 			Animation				=	JustDie				AnimationName		=	RUHHs_Theo_FLYC				AnimationMode		=	LOOP			End			Flags					=	RANDOMSTART		End		AnimationState				=	MOUNTED PASSENGER			Animation				=	grabbed				AnimationName		=	RUHHs_Theo_GBDA				AnimationMode		=	LOOP			End			Flags					=	RANDOMSTART		End				AnimationState				=	MOUNTED DYING SPLATTED DEATH_1			Animation				=	Land				AnimationName		=	RUHHs_Theo_LNDA				AnimationMode		=	ONCE				AnimationBlendTime  =   2			End			FXEvent	= Frame:2 Name:FX_SplatDust		End	   ; This is the no-spawn-horse type of death		AnimationState				=	MOUNTED DYING DEATH_1   ; DEATH_2 Normally has DEATH_2, but just as a backup don't insist			Animation				=	JustDie				AnimationName		=	RUHHs_Theo_DIEA				AnimationMode		=	ONCE			End		End		AnimationState				=	MOUNTED STUNNED_STANDING_UP			Animation				=	StandUp				AnimationName		=	RUHHs_Theo_GTPA				AnimationMode		=	ONCE				AnimationSpeedFactorRange = 3.5 3.5			End		End						AnimationState				=	MOUNTED STUNNED			Animation				=	Land				AnimationName		=	RUHHs_Theo_LNDA				AnimationMode		=	ONCE			End		End						AnimationState						= PARALYZED MOUNTED			Animation				AnimationName				= RUHHs_Theo_IDLA				AnimationMode				= LOOP			End		End		AnimationState		= MOUNTED MOVING FIRING_OR_PREATTACK_A			ShareAnimation		= Yes			Animation		   = RunAndFire				AnimationName	   = RUHHs_Theo_ATRA				AnimationMode	   = LOOP			End			Flags			   = RANDOMSTART 		End			   ; This is what happens when Theo gives his rousing speech		AnimationState				=	MOUNTED MOVING USING_SPECIAL_ABILITY			Animation				=	RousingSpeech				AnimationName		=	RUHHs_Theo_WLKB				AnimationMode		=	LOOP			End		   ;;ParticleSysBone			=	None CalvaryDustTrails		End				AnimationState				=	MOUNTED TURN_LEFT_HIGH_SPEED			Animation				=	TurnLeft				AnimationName		=	RUHHs_Theo_TNL1				AnimationMode		=	LOOP				AnimationSpeedFactorRange= 1.2 1.2				AnimationBlendTime	=	20			End		End				AnimationState				=	MOUNTED TURN_RIGHT_HIGH_SPEED			Animation				=	TurnLeft				AnimationName		=	RUHHs_Theo_TNR1				AnimationMode		=	LOOP				AnimationSpeedFactorRange= 1.2 1.2				AnimationBlendTime	=	20			End		End				AnimationState				=	MOUNTED MOVING TURN_LEFT 			Animation				=	TurnLeft				AnimationName		=	RUHHs_Theo_TRNL				AnimationMode		=	LOOP			End;		   ;ParticleSysBone			=	None CalvaryDustTrails		End		AnimationState				=	MOUNTED MOVING TURN_RIGHT 			Animation				=	TurnRight				AnimationName		=	RUHHs_Theo_TRNR				AnimationMode		=	LOOP			End;		   ;ParticleSysBone			=	None CalvaryDustTrails		End		AnimationState				=	MOUNTED MOVING ACCELERATE			Animation				=	Accelerate				AnimationName		=	RUHHs_Theo_ACCL				AnimationMode		=	LOOP			End		   ;ParticleSysBone			=	None CalvaryDustTrails		End		AnimationState				=	MOUNTED MOVING DECELERATE			Animation				=	Decelerate				AnimationName		=	RUHHs_Theo_DECL				AnimationMode		=	ONCE				AnimationSpeedFactorRange = 0.6 0.6			End		   ;ParticleSysBone			=	None CalvaryDustTrails		End		AnimationState				=	MOUNTED MOVING WALKING			Animation				=	Walk				AnimationName		=	RUHHs_Theo_WLKA				AnimationMode		=	LOOP			End		   ;ParticleSysBone			=	None InfantryDustTrails  		End				AnimationState				=	MOUNTED MOVING BACKING_UP			Animation				=	BackingUp				AnimationName		=	RUHHs_Theo_BAKA				AnimationMode		=	LOOP			End		   ;ParticleSysBone			=	None InfantryDustTrails  		End		AnimationState				=	MOUNTED MOVING			Animation				=	RunA				AnimationName		=	RUHHs_Theo_RUNA				AnimationMode		=	LOOP			End		   ;ParticleSysBone			=	None CalvaryDustTrails  		End				AnimationState						=	PACKING_TYPE_2 MOUNTED			StateName						=	SPELL			Animation						=	SPCC				AnimationName				=	RUHHs_Theo_SPCA				AnimationMode				=	ONCE				AnimationBlendTime	=	20			End		End				AnimationState						=	PACKING_TYPE_1 MOUNTED			StateName						=	SPELL			Animation						=	SPCC				AnimationName				=	RUHHs_Theo_IDLC				AnimationSpeedFactorRange	=	0.842 0.842				AnimationMode				=	ONCE			End				End				AnimationState				=	MOUNTED FIRING_OR_PREATTACK_A			Animation				=	AttackA				AnimationName		=	RUHHs_Theo_ATKA				AnimationMode		=	ONCE				UseWeaponTiming		=	Yes			End			Animation				=	AttackB				AnimationName		=	RUHHs_Theo_ATKB				AnimationMode		=	ONCE				UseWeaponTiming		=	Yes			End			Flags					=	RESTART_ANIM_WHEN_COMPLETE		End		AnimationState				=	MOUNTED ATTACKING			Animation				=	AttackA				AnimationName		=	RUHHs_Theo_ATKA				AnimationMode		=	MANUAL			End		End		AnimationState				= MOUNTED LEVELED			 ; This state clears itself in 3 seconds			StateName				= Idle			Animation				= LevelUp				AnimationName		= RUHHs_Theo_IDLC				AnimationMode		= ONCE				AnimationSpeedFactorRange	=	0.666 0.666			End		End				AnimationState				=	RAISING_FLAG MOUNTED				Animation		   =	CHRA					AnimationName   =	RUHHs_Theo_CHRA					AnimationMode   =	LOOP				End		End		AnimationState				=	EMOTION_TAUNTING MOUNTED				Animation		   =	CHRA					AnimationName   =	RUHHs_Theo_CHRA					AnimationMode   =	LOOP				End		End		AnimationState				= MOUNTED EMOTION_CELEBRATING			Animation				= LevelUp				AnimationName		= RUHHs_Theo_IDLC				AnimationMode		= LOOP			End		End				AnimationState				=	MOUNTED SELECTED			SimilarRestart			=   Yes						StateName				=	AtAttentionIdle			Animation				=	ATNB				AnimationName		=	RUHHs_Theo_IDLH				AnimationMode		=	LOOP			End			BeginScript				Prev = CurDrawablePrevAnimationState()				if Prev == "Idle" then CurDrawableSetTransitionAnimState("TRANS_MountedSelect") end				if Prev == "AtAttentionIdle" then CurDrawableSetTransitionAnimState("TRANS_MountedSelect") end			EndScript		End				TransitionState				=	TRANS_MountedSelect			Animation				=	ATNA				AnimationName		=	RUHHs_Theo_ATNA				AnimationMode		=	ONCE			End		End				AnimationState			= MOUNTED			StateName = Idle			Animation	=	IdleA				AnimationName		=	RUHHs_Theo_IDLA				AnimationPriority	=	20				AnimationMode		=	ONCE				AnimationBlendTime	=	15			End			Animation				=	IdleB				AnimationName		=	RUHHs_Theo_IDLB				AnimationMode		=	ONCE				AnimationBlendTime	=	15			End			Animation				=	IdleC				AnimationName		=	RUHHs_Theo_IDLC				AnimationMode		=	ONCE				AnimationBlendTime	=	15			End			Flags					=	RESTART_ANIM_WHEN_COMPLETE		End	   ; --- Idle Anims		IdleAnimationState			StateName				=	BORED			Animation				=	IDLB				AnimationName		=	RUTheoden_IDLB				AnimationMode		=	ONCE				AnimationPriority	=	1			End			Animation				=	IDLC				AnimationName		=	RUTheoden_IDLC				AnimationMode		=	ONCE				AnimationPriority	=	10			End			Animation				=	IDLD				AnimationName		=	RUTheoden_IDLD				AnimationMode		=	ONCE				AnimationPriority	=	1			End			Animation				=	IDLE				AnimationName		=	RUTheoden_IDLE				AnimationMode		=	ONCE				AnimationPriority	=	1			End			Flags				=	RESTART_ANIM_WHEN_COMPLETE			BeginScript				Prev = CurDrawablePrevAnimationState()				if Prev == "SELECTED"	then CurDrawableSetTransitionAnimState("Transition_SelectedToBored") end				if Prev == "READY"		then CurDrawableSetTransitionAnimState("Transition_ReadyToBored") end			EndScript		End				AnimationState				=	FREEFALL 			Animation				=	freefall				AnimationName		=	RUTheoden_FLYA				AnimationMode		=	LOOP			End			Flags					=	RANDOMSTART		End				AnimationState						=	STUNNED_FLAILING 			Flags							=	RANDOMSTART			Animation						=	RUTheoden_FLYA				AnimationName				=	RUTheoden_FLYA				AnimationMode				=	LOOP				AnimationSpeedFactorRange	= 0.4 0.6			End		End			   ; --- Dying anims		AnimationState						=	DYING SPLATTED DEATH_1			Animation						=	RUTheoden_LNDA				AnimationName				=	RUTheoden_LNDA				AnimationMode				=	ONCE			End		End		AnimationState						=	DYING DEATH_1			Animation						=	RUTheoden_DIEA ; this one sucks.				AnimationName				=	RUTheoden_DIEA				AnimationMode				=	ONCE			End			Animation						=	RUTheoden_DIEB				AnimationName				=	RUTheoden_DIEB				AnimationMode				=	ONCE			End		End		AnimationState						= PARALYZED			Animation				AnimationName				= RUTheoden_IDLB				AnimationMode				= ONCE_BACKWARDS			End			Flags							= START_FRAME_FIRST		End	   ; --- Stunned anims								AnimationState						=	STUNNED_STANDING_UP			Animation						=	RUTheoden_GTPA				AnimationName				=	RUTheoden_GTPA				AnimationMode				=	ONCE				AnimationSpeedFactorRange = 1.5 1.5			End		End		AnimationState						=	STUNNED 			Animation						=	RUTheoden_LNDA				AnimationName				=	RUTheoden_LNDA				AnimationMode				=	ONCE			End		End				AnimationState		= MOVING FIRING_OR_PREATTACK_A			ShareAnimation		= Yes			Animation		   = RunAndFire				AnimationName	   = RUTheoden_ATRA				AnimationMode	   = LOOP			End			Flags			   = RANDOMSTART 		End					   ; Attacking Anims		AnimationState						=	FIRING_OR_PREATTACK_A			Animation						=	ATKA				AnimationName				=	RUTheoden_ATKA				AnimationMode				=	ONCE				UseWeaponTiming				=	Yes			   ;AnimationSpeedFactorRange	=	.826 .826			End			Animation						=	ATKB				AnimationName				=	RUTheoden_ATKB				AnimationMode				=	ONCE			   ;AnimationSpeedFactorRange	=	.9066 .9066			End			Animation						=	ATKC				AnimationName				=	RUTheoden_ATKC				AnimationMode				=	ONCE				UseWeaponTiming				=	Yes			   ;AnimationSpeedFactorRange	=	1.1466 1.1466			End			Animation						=	ATKD				AnimationName				=	RUTheoden_ATKD				AnimationMode				=	ONCE				UseWeaponTiming				=	Yes			   ;AnimationSpeedFactorRange	=	1.0666 1.0666			End		End				AnimationState						=	MOVING ATTACKING			Animation						=	RUTheoden_RUNB				AnimationName				=	RUTheoden_RUNB				AnimationSpeedFactorRange	=	0.4 0.4				AnimationMode				=	LOOP				AnimationBlendTime			=   10				Distance					=	30			End		End						AnimationState						=	MOVING 			Animation						=	RUTheoden_RUNA				AnimationName				=	RUTheoden_RUNA				AnimationMode				=	LOOP				Distance					=	30			End		End		AnimationState						=	PACKING_TYPE_2			StateName						=	SPELL			Animation						=	SPCC				AnimationName				=	RUTheoden_SPCB				AnimationSpeedFactorRange	=	1.1666 1.1666				AnimationMode				=	ONCE				AnimationBlendTime	=	20			End			Animation						=	SPCD				AnimationName				=	RUTheoden_SPCC				AnimationMode				=	ONCE				AnimationBlendTime	=	20			End		End		   ; --------- Click and Hit Reactions ------------		AnimationState						= HIT_REACTION HIT_LEVEL_1			Animation						= Hit_Level_1_a				AnimationName				= RUTheoden_HITA				AnimationMode				= ONCE			End		End			   ;----Emotion Animations		AnimationState				= LEVELED						; This state clears itself in 3 seconds			Animation				= LevelUp				AnimationName		= RUTheoden_CHRB				AnimationMode		= ONCE			End		End				AnimationState				=	EMOTION_CELEBRATING			Animation				=	CHRA				AnimationName		=	RUTheoden_CHRA				AnimationMode		=	ONCE			End			Animation				=	CHRB				AnimationName		=	RUTheoden_CHRB				AnimationMode		=	ONCE			End			Flags					=	RESTART_ANIM_WHEN_COMPLETE		End				AnimationState				=	EMOTION_TAUNTING			Animation				=	CHRB				AnimationName		=	RUTheoden_CHRB				AnimationMode		=	ONCE			End			Flags					=	RESTART_ANIM_WHEN_COMPLETE		End				AnimationState				=	EMOTION_ALERT			StateName				=	READY			Animation				=	ready				AnimationName		=	RUTheoden_IDLA				AnimationMode		=	LOOP				AnimationBlendTime	=	20			End			BeginScript				Prev = CurDrawablePrevAnimationState()				if Prev == "BORED"		then CurDrawableSetTransitionAnimState("Transition_BoredToReady") end				if Prev == "SELECTED"	then CurDrawableSetTransitionAnimState("Transition_SelectedToReady") end			EndScript		End				AnimationState				=	RAISING_FLAG			Animation				=	CHRA				AnimationName		=	RUTheoden_CHRA				AnimationMode		=	ONCE			End			Animation				=	CHRB				AnimationName		=	RUTheoden_CHRB				AnimationMode		=	ONCE			End			Flags					=	RESTART_ANIM_WHEN_COMPLETE		End		AnimationState				=	SELECTED 			StateName				=	SELECTED			Animation				=	ATNB				AnimationName		=	RUTheoden_ATNB				AnimationMode		=	LOOP			End			BeginScript				Prev = CurDrawablePrevAnimationState()				if Prev == "BORED" then CurDrawableSetTransitionAnimState("Transition_BoredToSelected") end				if Prev == "READY" then CurDrawableSetTransitionAnimState("Transition_ReadyToSelected") end				if Prev == "SPELL" then CurDrawableSetTransitionAnimState("Transition_ReadyToSelected") end			EndScript		End						TransitionState Transition_BoredToReady			Animation				=	ready				AnimationName		=	RUTheoden_IDLA				AnimationMode		=	LOOP				AnimationBlendTime	=	20			End		End				TransitionState Transition_ReadyToBored			Animation				=	IDLC				AnimationName		=	RUTheoden_IDLC				AnimationMode		=	ONCE				AnimationBlendTime	=	20			End		End				TransitionState Transition_BoredToSelected			Animation				=	ATNA				AnimationName		=	RUTheoden_ATNA				AnimationMode		=	ONCE			End		End		TransitionState Transition_SelectedToBored			Animation				=	ATNE				AnimationName		=	RUTheoden_ATNE				AnimationMode		=	ONCE			End		End			TransitionState Transition_SelectedToReady			Animation				=	ATNC				AnimationName		=	RUTheoden_ATNA	   ; RUTheoden_ATNC doesn't exist.				AnimationMode		=	ONCE			End		End				TransitionState Transition_ReadyToSelected			Animation				=	ATNC				AnimationName		=	RUTheoden_ATNA	   ; RUTheoden_ATNC doesn't exist				AnimationMode		=	ONCE_BACKWARDS			End			Flags = START_FRAME_LAST		End		AnimationState				=	MOUNTED DYING SPLATTED DEATH_2			Animation				=	Land				AnimationName		=	RUHHs_Theo_LNDA				AnimationMode		=	ONCE				AnimationBlendTime  =   2			End			FXEvent	= Frame:2 Name:FX_SplatDust		End	   ; This is the no-spawn-horse type of death		AnimationState				=	MOUNTED DYING DEATH_2			Animation	=	IdleA				AnimationName		=	RUHHs_Theo_IDLA				AnimationPriority	=	20				AnimationMode		=	ONCE				AnimationBlendTime	=	15			End		End	   ; --- Dying anims		AnimationState						=	DYING SPLATTED DEATH_2			Animation						=	RUTheoden_LNDA				AnimationName				=	RUTheoden_LNDA				AnimationMode				=	ONCE			End		End		AnimationState						=	DYING DEATH_2			Animation				=	IDLB				AnimationName		=	RUTheoden_IDLB				AnimationMode		=	ONCE				AnimationPriority	=	1			End			Animation				=	IDLC				AnimationName		=	RUTheoden_IDLC				AnimationMode		=	ONCE				AnimationPriority	=	10			End		End	End	Draw = W3DScriptedModelDraw DustEffects		DefaultModelConditionState		  Model = None		End		IdleAnimationState		End		AnimationState = MOUNTED MOVING WADING			ParticleSysBone = None FootstepSlash		End		AnimationState = MOUNTED MOVING ACCELERATE			ParticleSysBone = None GenericSiegeTrailDust		End		AnimationState = MOUNTED MOVING ACCELERATE			ParticleSysBone = None GenericSiegeTrailDust		End		AnimationState = MOUNTED MOVING		End	End;   #include "..\..\..\includes\StunDrawModuleSmall.inc"; ***DESIGN parameters ***	Side = Arnor	EditorSorting = UNIT	ThreatLevel = BOROMIR_THREAT_LEVEL	ThingClass = CHARACTER_UNIT	  BuildCost		 = GLOIN_BUILDCOST					  BuildTime		 = 30	ShockwaveResistance = SHOCKWAVE_RESISTANCE_STRONG	;//DisplayMeleeDamage = BOROMIR_DAMAGE				HeroSortOrder = 50		TransportSlotCount = TRANSPORTSLOTCOUNT_HERO	WeaponSet		Conditions		= None 		Weapon			= PRIMARY	ArgelebSword	End	WeaponSet		Conditions			= MOUNTED		Weapon				= PRIMARY	ArgelebSword	End	ArmorSet		Conditions	  = None		Armor		   = ToughHeroArmor		DamageFX		= NormalDamageFX	End	ArmorSet		Conditions	  = MOUNTED		Armor		   = HeroArmorMounted		DamageFX		= NormalDamageFX	End		VisionRange = VISION_HERO_STANDARD					ShroudClearingRange = SHROUD_CLEAR_HERO	MaxVisionBonusPercent = 300%	VisionBonusTestRadius = 200	VisionBonusPercentPerFoot = 1.0%	BountyValue = GONDOR_BOROMIR_BOUNTY_VALUE	DisplayName = OBJECT:ArnorArgeleb	RecruitText = CONTROLBAR:ArnorArgelebRecruit	ReviveText	= CONTROLBAR:ArnorArgelebRevive	Hotkey		= CONTROLBAR:ArnorArgelebHotkey	CrushableLevel = 2 ;What am I?:		0 = for infantry, 1 = for trees, 2 = general vehicles	CommandSet = ArnorArgelebCommandSet 	CommandPoints = 5   ; *** AUTO RESOLVE DATA *** 	AutoResolveUnitType = AutoResolveUnit_Hero	AutoResolveCombatChain = AutoResolve_HeroCombatChain	AutoResolveBody = AutoResolve_TheodenBody		AutoResolveArmor		Armor = AutoResolve_TheodenArmor	End	AutoResolveWeapon		Weapon = AutoResolve_TheodenWeapon	End	AutoResolveLeadership = AutoResolve_TheodenBonus ; *** AUDIO Parameters ***;	VoiceAttack				= ArgelebVoiceAttack	VoiceAttackCharge			= ArgelebVoiceAttackCharge	VoiceAttackMachine		= ArgelebVoiceAttack	VoiceAttackStructure		= ArgelebVoiceAttackBuilding	VoiceCreated			= ArgelebVoiceSalute;this conflicts with his respawn dialogue line -- rehooked to spawn FX	VoiceFullyCreated 		= ArgelebVoiceSalute;this conflicts with his respawn dialogue line -- rehooked to spawn FX	VoiceFear 				= ArgelebVoiceHelpMe	VoiceMove				= ArgelebVoiceMove	VoiceMoveToCamp			= ArgelebVoiceMoveCamp	VoiceMoveWhileAttacking		= ArgelebVoiceHelpMe	VoicePriority			= 84	VoiceRetreatToCastle		= ArgelebVoiceMoveCamp	VoiceSelect				= ArgelebVoiceSelect	VoiceSelectBattle 		= ArgelebVoiceSelectBattle	VoiceGuard				= ArgelebVoiceMove	SoundImpact				= ImpactHorse;BoromirVoiceJoinAnybody	UnitSpecificSounds		VoiceGarrison						= ArgelebVoiceGarrison		VoiceEnterUnitElvenTransportShip	= ArgelebVoiceMove		VoiceInitiateCaptureBuilding		= ArgelebVoiceCaptureBuilding	End	CrowdResponseKey = GoodMen	#include "..\..\..\includes\StandardUnitEvaEvents.inc"	EvaEventDieOwner = BoromirDie					;Eva event to trigger on unit's death. NOTICE THAT this is only for permanent deaths										;For deaths you can respawn from, use the DeathFX	ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior		MaxUpdateRangeCap = 800		AnimationSound = Sound:SwordIntoScabbard1		Animation:GUCaptain_SKL.GUCaptain_HRNA 	Frames:7		AnimationSound = Sound:BoromirHorn			Animation:GUCaptain_SKL.GUCaptain_HRNB 	Frames:0		AnimationSound = Sound:SwordShingClean1		Animation:GUCaptain_SKL.GUCaptain_HRNC 	Frames:5		AnimationSound = Sound:FootstepDirtA		Animation:GUCaptain_SKL.GUCaptain_RUNA 	Frames:10 22		AnimationSound = Sound:FootstepDirtA		Animation:GUCaptain_SKL.GUCaptain_RUNB 	Frames:10 22		AnimationSound = Sound:FootstepDirtA		Animation:GUCaptain_SKL.GUCaptain_ATRA 	Frames:11 23 35 47 		AnimationSound = Sound:FootstepDirtA		Animation:GUCaptain_SKL.GUCaptain_MFDA	Frames:8 20 31 41		AnimationSound = Sound:BodyFallGenericNoArmor	Animation:GUCaptain_SKL.GUCaptain_DTHA 	Frames:116		AnimationSound = Sound:BodyFallSoldier		Animation:GUCaptain_SKL.GUCaptain_LNDA 	Frames:4		AnimationSound = Sound:BodyFallGenericNoArmor	Animation:GUCaptain_SKL.GUCaptain_SPCE 	Frames:82	End	Behavior = LargeGroupAudioUpdate ModuleTag_LGAU		; Tie into LargeGroupAudio system		Key = Humanoid_Male Man Man_Male Unit Infantry Hero	;UnitWeight = 2	End; *** ENGINEERING Parameters ***	RadarPriority = UNIT	KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE HERO ARMY_SUMMARY HEAVY_MELEE_HITTER	PathfindDiameter = 40.0	CamouflageDetectionMultiplier = CAMOUFLAGE_DETECTION_DISTANCE_LONG	Body = RespawnBody ModuleTag_RespawnBody		CheerRadius 			= EMOTION_CHEER_RADIUS		MaxHealth		 		= 3200;BALANCE Eomer Health		PermanentlyKilledByFilter	= NONE	;Who kills me permanently?   		DodgePercent			  = HERO_DODGE_PERCENT	End	Behavior = RespawnUpdate ModuleTag_RespawnUpdate;		DeathAnim				= STUNNED			;Model condition to play when killed-to-respawn		DeathAnim				= DYING			  ;Model condition to play when killed-to-respawn		DeathFX				= FX_GenericHeroDieToRespawn;FXList to play when killed-to-respawn		DeathAnimationTime		= 4966;1133		;How long DeathAnim will take.		InitialSpawnFX			= FX_GenericHeroInitialSpawn		RespawnAnim				= LEVELED			;Animation to play when respawning.		RespawnFX				= FX_ArgelebRespawn	;FXList to play when respawning.		RespawnAnimationTime		= 2000			;Time it takes for respawn to play.		AutoRespawnAtObjectFilter	= NONE +CASTLE_KEEP	;Respawn at this location -- and at it's exit production point if possible.		ButtonImage				= HIArgeleb;HIBorimir_res			;RespawnEntries determine the ruleset for how a character can be revived. Some units may automatically respawn, others	;may require a specific revive action performed on him. You can specify different values for each level... or use Level:Any		RespawnRules =			AutoSpawn:No	Cost:1500		Time:60000		Health:100%	;DEFAULT VALUES		End	Behavior = AutoHealBehavior ModuleTag_BoromirHealing		StartsActive = Yes		HealingAmount = HERO_HEAL_AMOUNT		HealingDelay = 1000		StartHealingDelay = HERO_HEAL_DELAY		HealOnlyIfNotInCombat = Yes	End		  Behavior = SpecialEnemySenseUpdate ModuleTag_ArgelebSeesPikemen	SpecialEnemyFilter = ANY +AngmarHillTrollHorde +AngmarRhudaurSpearman +IsengardPikemanHorde +MordorEasterlingHorde +WildMarauderHorde +ArnorTowerShieldGuardHorde +ElvenGreyHavensSpearmenHorde +ImladrisWarriorHorde +DwarvenPhalanxHorde +ElvenMithlondSentryHorde +GondorTowerShieldGuardHorde +RohanSpearmenHorde ENEMIES	ScanRange = 100	ScanInterval = 2000	End	Behavior = LifetimeUpdate ModuleTag_LifeTime		; Used after 'death' to continue for a certain time before really dying.		WaitForWakeUp = Yes	End		Behavior = StancesBehavior ModuleTag_StancesBehavior		StanceTemplate = Hero		End; --------- MOUNTED HORDER ----------------------------------------------------------------- 	Behavior = SpecialPowerModule ModuleTag_HorseToggleStarter					   		SpecialPowerTemplate	  = SpecialAbilityToggleMounted 		UpdateModuleStartsAttack  = Yes 		StartsPaused = No 	End	Behavior = ToggleMountedSpecialAbilityUpdate ModuleTag_HorseToggle 		SpecialPowerTemplate	= SpecialAbilityToggleMounted 		 	;UnpackingVariation		= 2  		UnpackTime			  = 2000 		PreparationTime		 = 1   		PersistentPrepTime	  = 250 		PackTime				= 2000 		 		OpacityTarget			= .3	; How see-thru to be at peak of change    		AwardXPForTriggering	= 0	End	 ;------------------- AI MOUNTED HORDER -----------------------------------	  // Switch CommandSet when MOUNTED	Behavior = MonitorConditionUpdate ModuleTag_CommandSetSwapper		  WeaponSetFlags = MOUNTED		  WeaponToggleCommandSet = ArnorArgelebCommandSetMounted	End	Behavior = DoCommandUpgrade Module_DoCommandMount			  TriggeredBy = Upgrade_ObjectUnderAIControl_SEE Upgrade_MountNOW		  RequiresAllTriggers = Yes		  GetUpgradeCommandButtonName = Command_ToggleMount	End	Behavior = DoCommandUpgrade Module_DoCommandDismount		  TriggeredBy = Upgrade_ObjectUnderAIControl_SEE Upgrade_DismountNOW		  RequiresAllTriggers = Yes		  GetUpgradeCommandButtonName = Command_ToggleDismount	End;;; LEADERSHIP OF ARTHEDAIN;;;	Behavior = AttributeModifierAuraUpdate ModuleTag_Leadership		StartsActive	= No;If no, requires upgrade to turn on.		BonusName		= GenericHeroLeadership		TriggeredBy		= Upgrade_Level3		RefreshDelay	= 2000		Range			= 200		AntiCategory	= BUFF		ObjectFilter	= GENERIC_BUFF_RECIPIENT_OBJECT_FILTER	End			Behavior = UnpauseSpecialPowerUpgrade ModuleTag_TheodenLeadership		SpecialPowerTemplate = SpecialAbilityFakeLeadership		TriggeredBy = Upgrade_Level3	End	Behavior = SpecialPowerModule ModuleTag_TheodenLeadershipUpdate   		SpecialPowerTemplate	  = SpecialAbilityFakeLeadership		UpdateModuleStartsAttack  = No		StartsPaused = Yes	End;;; ARNOR KNIGHT SHIELD;;;			Behavior = UnpauseSpecialPowerUpgrade ModuleTag_MitrilCoat		SpecialPowerTemplate = SpecialAbilityMitrilCoat		TriggeredBy = Upgrade_Level4 			ConflictsWith	= Upgrade_ObjectUnderAIControl_SEE	End	Behavior = SpecialPowerModule ModuleTag_MitrilCoatUpdate   		SpecialPowerTemplate		= SpecialAbilityMitrilCoat		UpdateModuleStartsAttack	= No		StartsPaused			= Yes		SetModelCondition			= ModelConditionState:USER_3		SetModelConditionTime		= 35.0; This is how long Shield Maiden Lasts		AttributeModifier			= MitrilCoatBonus		AttributeModifierRange		= 1		AttributeModifierAffectsSelf	= Yes		AttributeModifierAffects	= ANY +CAVALRY +INFANTRY		AttributeModifierFX		= FX_MitrilCoatEffect	End	 ;;; ARNOR KNIGHT SHIELD AI;;;			Behavior = UnpauseSpecialPowerUpgrade ModuleTag_MitrilCoat_AI		SpecialPowerTemplate = SpecialAbilityMitrilCoat_AI		TriggeredBy = Upgrade_Level4 Upgrade_ObjectUnderAIControl_SEE	End	Behavior = SpecialPowerModule ModuleTag_MitrilCoatUpdate_AI   		SpecialPowerTemplate		= SpecialAbilityMitrilCoat_AI		UpdateModuleStartsAttack	= No		StartsPaused			= Yes		SetModelCondition			= ModelConditionState:USER_3		SetModelConditionTime		= 35.0; This is how long Shield Maiden Lasts		AttributeModifier			= MitrilCoatBonus		AttributeModifierRange		= 1		AttributeModifierAffectsSelf	= Yes		AttributeModifierAffects	= ANY +CAVALRY +INFANTRY		AttributeModifierFX		= FX_MitrilCoatEffect	End		 Behavior = AutoAbilityBehavior ModuleTag_MitrilCoatAutoAbility_AI	SpecialAbility = SpecialAbilityMitrilCoat_AI   ;StartsActive = Yes   ;MaxScanRange = #SUBTRACT( FARAMIR_WOUNDING_ARROW_RANGE 25 )   ;Query = 1 ANY +HERO +MONSTER +BIG_MONSTER ENEMIESEnd   ;;; KINGS FAVOUR;;;    	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_KingsFavorEnabler		SpecialPowerTemplate = SpecialAbilityKingsFavor		TriggeredBy = Upgrade_Level6		ConflictsWith	= Upgrade_ObjectUnderAIControl_SEE	End		 Behavior = SpecialPowerModule ModuleTag_KingsFavorSpecialPowerModule		SpecialPowerTemplate		= SpecialAbilityKingsFavor 		StartsPaused				= Yes		UpdateModuleStartsAttack	= Yes		InitiateSound				= TheodenVoiceFavor	End		 Behavior = LevelGrantSpecialPower ModuleTag_KingsFavor		SpecialPowerTemplate		= SpecialAbilityKingsFavor		UnpackingVariation			= 2		StartAbilityRange			= 200.0		LevelFX						= FX_LevelUp		Experience					= 150		RadiusEffect				= 150		AcceptanceFilter			= KINGSFAVOR_OBJECTFILTER		UnpackTime					= 3000		PreparationTime				= 0		FreezeAfterTriggerDuration	= 2000; Hold AI for this long after we fire.			End    ;;; KINGS FAVOUR AI;;;    	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_KingsFavorEnabler_AI		SpecialPowerTemplate = SpecialAbilityKingsFavor_AI		TriggeredBy = Upgrade_Level6 Upgrade_ObjectUnderAIControl_SEE	End		 Behavior = SpecialPowerModule ModuleTag_KingsFavorSpecialPowerModule_AI		SpecialPowerTemplate		= SpecialAbilityKingsFavor_AI 		StartsPaused				= Yes		UpdateModuleStartsAttack	= Yes		InitiateSound				= TheodenVoiceFavor	End		 Behavior = LevelGrantSpecialPower ModuleTag_KingsFavor_AI		SpecialPowerTemplate		= SpecialAbilityKingsFavor_AI		UnpackingVariation			= 2		StartAbilityRange			= 200.0		LevelFX						= FX_LevelUp		Experience					= 150		RadiusEffect				= 150		AcceptanceFilter			= KINGSFAVOR_OBJECTFILTER		UnpackTime					= 3000		PreparationTime				= 0		FreezeAfterTriggerDuration	= 2000; Hold AI for this long after we fire.			End 	   Behavior = AutoAbilityBehavior ModuleTag_KingsFavorAutoAbility_AI	SpecialAbility = SpecialAbilityKingsFavor_AI   ;StartsActive = Yes	MaxScanRange = #SUBTRACT( FARAMIR_WOUNDING_ARROW_RANGE 25 )	Query = 1 ANY +INFANTRY +CAVALRY ALLIESEnd   ;;; GLORIOUS CHARGE;;;	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_TheodenGloriousChargeEnabler		SpecialPowerTemplate = SpecialAbilityTheodenGloriousCharge		TriggeredBy = Upgrade_Level8		ConflictsWith	= Upgrade_ObjectUnderAIControl_SEE	End	Behavior = SpecialPowerModule ModuleTag_TheodenGloriousChargeUpdate   		SpecialPowerTemplate	  = SpecialAbilityTheodenGloriousCharge		UpdateModuleStartsAttack  = Yes		StartsPaused = Yes		AttributeModifier = TheodenGloriousCharge		AttributeModifierRange = 200		AttributeModifierAffectsSelf = Yes		AttributeModifierAffects = ANY +CAVALRY		AttributeModifierFX = FX_TheodenGloriousChargeFX	End		Behavior = SpecialAbilityUpdate ModuleTag_GloriousChargeAnimation		UnpackTime			  = 1000		UnpackingVariation		= 1				SpecialPowerTemplate	= SpecialAbilityTheodenGloriousCharge		 PreparationTime		 = 0  		 PersistentPrepTime	  = 0		 PackTime				= 1330	 End	;;; GLORIOUS CHARGE AI;;;	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_TheodenGloriousChargeEnabler_AI		SpecialPowerTemplate = SpecialAbilityTheodenGloriousCharge_AI		TriggeredBy = Upgrade_Level8 Upgrade_ObjectUnderAIControl_SEE	End	Behavior = SpecialPowerModule ModuleTag_TheodenGloriousChargeUpdate_AI   		SpecialPowerTemplate	  = SpecialAbilityTheodenGloriousCharge_AI		UpdateModuleStartsAttack  = Yes		StartsPaused = Yes		AttributeModifier = TheodenGloriousCharge		AttributeModifierRange = 200		AttributeModifierAffectsSelf = Yes		AttributeModifierAffects = ANY +CAVALRY		AttributeModifierFX = FX_TheodenGloriousChargeFX	End		Behavior = SpecialAbilityUpdate ModuleTag_GloriousChargeAnimation_AI		UnpackTime			  = 1000		UnpackingVariation		= 1				SpecialPowerTemplate	= SpecialAbilityTheodenGloriousCharge_AI		 PreparationTime		 = 0  		 PersistentPrepTime	  = 0		 PackTime				= 1330	 End	 Behavior = AutoAbilityBehavior ModuleTag_GloriousChargeAutoAbility_AI	SpecialAbility = SpecialAbilityTheodenGloriousCharge_AI   ;StartsActive = Yes	MaxScanRange = #SUBTRACT( FARAMIR_WOUNDING_ARROW_RANGE 25 )	Query = 1 ANY +HERO +INFANTRY +CAVALRY ALLIES	 End	#include "..\..\..\includes\CaptureBuilding.inc"		Behavior = AIUpdateInterface ModuleTag_03		AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS		MoodAttackCheckRate		= 500		HoldGroundCloseRangeDistance = 40			CanAttackWhileContained = Yes			AILuaEventsList = ArgelebFunctions;BaseHeroFunctions	  End	Behavior = EmotionTrackerUpdate	Module_EmotionTracker		TauntAndPointDistance				= 300		TauntAndPointUpdateDelay			= 10000		AddEmotion			=	Doom_Base		//	AddEmotion			=   BraceForBeingCrushed_Base		//	AddEmotion			=	FearIdle_Base		//	AddEmotion			=	FearBusy_Base		AddEmotion			=	Point_Base		AddEmotion			=	Taunt_Base 		AddEmotion			=	CheerIdle_Base		AddEmotion			=	CheerBusy_Base		//	AddEmotion			=	HeroCheerIdle_Base		//	AddEmotion			=	HeroCheerBusy_Base		AddEmotion			=	Alert_Base		AddEmotion			=	CheerForAboutToCrush_Base	End		LocomotorSet		Locomotor = HeroHumanLocomotor		Condition = SET_NORMAL 		Speed	 = NORMAL_GOOD_HERO_SPEED	End	LocomotorSet		Locomotor = HeroHorseLocomotor		Condition = SET_MOUNTED		Speed	 = NORMAL_CAVALRY_FAST_HORDE_SPEED	End		Behavior = AutoAbilityBehavior ModuleTag_AutoAbilityBehavior	End				Behavior = AutoHealBehavior ModuleTag_ElvenGiftHealing		StartsActive				= No		TriggeredBy					= Upgrade_ElvenGift		HealingAmount				= ELVEN_GIFT_REGEN_AMOUNT		HealingDelay				= ELVEN_GIFT_REGEN_DELAY		StartHealingDelay = HERO_HEAL_DELAY		HealOnlyIfNotInCombat = Yes	End		Behavior = AttributeModifierUpgrade ModuleTag_ElvenGiftBonus		TriggeredBy = Upgrade_ElvenGift		AttributeModifier = SpellBookElvenGifts	End		Behavior = DualWeaponBehavior ModuleTag_13		SwitchWeaponOnCloseRangeDistance = 161	End	Behavior = PhysicsBehavior ModuleTag_04		GravityMult = 1.0		ShockStandingTime		= 4000;msec	End		Behavior = SlowDeathBehavior ModuleTag_05		DeathTypes = ALL 		SinkDelay = 3000		SinkRate = 0.40	; in Dist/Sec		DestructionDelay = 8000		Sound = INITIAL BoromirVoiceDie;		- Where does this stuff go? -;		UnpackTime			  = 2000 ;		PreparationTime		 = 1   ;		PersistentPrepTime	  = 4000 ;		PackTime				= 2000;		WhichSpecialWeapon = 1	End		Behavior = SquishCollide ModuleTag_06	;nothing	End		Behavior = HitReactionBehavior HitReactionBehaviorModuleTag		HitReactionLifeTimer1 = 7; level 1 (light  damage)  hit reaction animations in frames (5 per sec)		HitReactionLifeTimer2 = 15; level 2 (medium damage)  hit reaction animations in frames (5 per sec)		HitReactionLifeTimer3 = 10; level 3 (heavy  damage)  hit reaction animations in frames (5 per sec)		HitReactionThreshold1 = 0.0  ; level 1 (light  damage) threshold trigger		HitReactionThreshold2 = 25.0 ; level 2 (medium damage) threshold trigger		HitReactionThreshold3 = 50.0 ; level 3 (heavy  damage) threshold trigger	End	;///////////////////; AISpecialPowers;///////////////////		  #include "..\..\..\..\includes\Battlestance_SEE.inc"	  #include "..\..\..\..\includes\HeroAIInjuredBehavior_SEE.inc"	Behavior = AISpecialPowerUpdate GondorFighterHordeStanceBattle		CommandButtonName = Command_SetStanceBattle		SpecialPowerAIType = AI_SPECIAL_POWER_STANCEBATTLE	End	Behavior = AISpecialPowerUpdate GondorFighterHordeStanceAggressive		CommandButtonName = Command_SetStanceAggressive		SpecialPowerAIType = AI_SPECIAL_POWER_STANCEAGGRESSIVE	End	Behavior = AISpecialPowerUpdate GondorFighterHordeHoldGround		CommandButtonName = Command_SetStanceHoldGround		SpecialPowerAIType = AI_SPECIAL_POWER_STANCEHOLDGROUND	End	  Behavior = AISpecialPowerUpdate TheodenToggleMountedAI		CommandButtonName = Command_ToggleMount		SpecialPowerAIType = AI_SPECIAL_POWER_TOGGLE_MOUNTED;Modified by S?lherokhh (was AI_SPECIAL_POWER_TOGGLE_MOUNTED)	End		Behavior = AISpecialPowerUpdate ArgelebKnightShieldAI		CommandButtonName = Command_SpecialAbilityKnightShield_AI		SpecialPowerAIType = AI_SPECIAL_POWER_BASIC_SELF_BUFF			SpecialPowerRadius = 50	End		Behavior = AISpecialPowerUpdate SpecialPowerArgelebGiveXPAoE			CommandButtonName = Command_SpecialAbilityArgelebFavor_AI			SpecialPowerAIType = AI_SPECIAL_POWER_GIVEXP_AOE			SpecialPowerRadius = 50.0		End			Behavior = AISpecialPowerUpdate SpecialPowerArgelebGloriousCharge			CommandButtonName = Command_SpecialAbilityArgelebGloriousCharge_AI			SpecialPowerAIType = AI_SPECIAL_POWER_BASIC_SELF_BUFF			SpecialPowerRadius = 100			SpecialPowerRange = 75		End	Geometry = CYLINDER	GeometryMajorRadius = 8.0	GeometryMinorRadius = 8.0	GeometryHeight = 19.2	GeometryIsSmall = Yes  Shadow = SHADOW_DECAL  ShadowSizeX = 20;  ShadowSizeY = 20;  ShadowTexture = ShadowI;End

Edited by m@tt, 13 February 2009 - 06:15 PM.
Added codebox


#24 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 11 February 2009 - 07:16 PM

Thank you. So, tell me one thing. Does the CaH work? If the lua scripts where jumbled up, your CaH's would always have ALL subobjects shown (like weapons different helmets, etc.).


Edit: Some more observations

In 'object.ini' you added:

InheritableModule
  Behavior = ObjectCreationUpgrade ModuleTag_IamAI
	TriggeredBy = Upgrade_EasyAISinglePlayer Upgrade_EasyAIMultiPlayer Upgrade_MediumAISinglePlayer Upgrade_MediumAIMultiPlayer Upgrade_HardAISinglePlayer Upgrade_HardAIMultiPlayer Upgrade_BrutalAISinglePlayer Upgrade_BrutalAIMultiPlayer 
	Delay = 500
	GrantUpgrade = Upgrade_ObjectUnderAIControl
  End 
End

yet in 'argeleb.ini' you use

Behavior = DoCommandUpgrade Module_DoCommandMount	
  TriggeredBy = Upgrade_ObjectUnderAIControl_SEE Upgrade_MountNOW
  RequiresAllTriggers = Yes
  GetUpgradeCommandButtonName = Command_ToggleMount
End

Behavior = DoCommandUpgrade Module_DoCommandDismount
  TriggeredBy = Upgrade_ObjectUnderAIControl_SEE Upgrade_DismountNOW
  RequiresAllTriggers = Yes
  GetUpgradeCommandButtonName = Command_ToggleDismount
End

What i am pointing out is that you copied the 'object.ini' code from my tutorial, yet copied the other stuff from my S.E.E. implementation, where lots of stuff has a '_SEE' appended. That's what i call a blatant typo. If your game crashes, it's also probably because you only defined ONE of the two AI-uprgades. You only need one, but you have used two different ones: 'Upgrade_ObjectUnderAIControl_SEE' and 'Upgrade_ObjectUnderAIControl'. Choose one and stick with it. :popcorn:


One more thing:

If you can get the codes to work, more power to you! :blink:
It's best though, if you don't take the codes 1:1, but try to write it your own way, and do this while testing each step. If you do it any other way, you may stumble over stuff that isn't so easy to understand. The S.E.E. codes that you have right now (4.5) are pretty disorganized. I was mmore interested in results and speed than in making it accessible for others.
Oh, and in case you should want to use the coding stuff in any sort of public mod, please don't forget to give credit where it is due. :p


I just want to point out that you, and in fact everybody, is free to use the coding implementations that i have come up with. I only ask some recognition in return. That's all. It makes me all the more happy that a) someone can put my work to good use and b) there are people out there that actually try to understand the coding mess i created! ;)
As i said already, more power to you! :D

Edited by Sûlherokhh, 11 February 2009 - 08:13 PM.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#25 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 08:24 PM

In fact,i have this in my object :blink:
InheritableModule
	Behavior = ObjectCreationUpgrade ModuleTag_IamAI
		TriggeredBy				= Upgrade_EasyAISinglePlayer Upgrade_EasyAIMultiPlayer Upgrade_MediumAISinglePlayer Upgrade_MediumAIMultiPlayer Upgrade_HardAISinglePlayer Upgrade_HardAIMultiPlayer Upgrade_BrutalAISinglePlayer Upgrade_BrutalAIMultiPlayer			
		Delay					= 500
		GrantUpgrade			= Upgrade_ObjectUnderAIControl_SEE
	End	
End

I delete this many time ago

InheritableModule
  Behavior = ObjectCreationUpgrade ModuleTag_IamAI
	TriggeredBy = Upgrade_EasyAISinglePlayer Upgrade_EasyAIMultiPlayer Upgrade_MediumAISinglePlayer Upgrade_MediumAIMultiPlayer Upgrade_HardAISinglePlayer Upgrade_HardAIMultiPlayer Upgrade_BrutalAISinglePlayer Upgrade_BrutalAIMultiPlayer 
	Delay = 500
	GrantUpgrade = Upgrade_ObjectUnderAIControl
  End 
End


#26 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 11 February 2009 - 08:27 PM

How was i supposed to know that? :blink:

Anyway. Any trouble with the CaH?

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#27 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 08:30 PM

How was i supposed to know that? :popcorn:

Anyway. Any trouble with the CaH?

I don't know,anyway i remake it :blink:

#28 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 11 February 2009 - 08:38 PM

I am asking because with the CaH you can easily see if you have any troubles with the lua scripts. So go, make a CaH, and then test him in-game. If he shows as having no subobjects hidden, you will know.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#29 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 09:12 PM

Now i have this

scriptevents.xml

[codebox]<?xml version="1.0"?>
<SageLuaScriptSection xmlns="http://tempuri.org/S...iptEvents.xsd">
<Events>
<!-- All internal events have a first parameter of self, which is the object receiving the event. They may have additial parameters, depending
on the specific event. -->
<InternalEvent Name="OnDamaged" /> <!-- OnDamaged(self, other) other is attacking object, may be nil -->
<InternalEvent Name="OnDestroyed" /> <!-- OnDestroyed(self) No parameters. Note that self is dead, but name and team are still valid. -->
<InternalEvent Name="OnArrived" /> <!-- OnArrived(self) Arrived at the end of a waypoint path. No parameters. -->
<InternalEvent Name="OnUnitEntered" /> <!-- OnUnitEntered(self, areaName) Unit entered an area. Name of area is parameter. -->
<!-- disabled since its really slow and nobody is using it... [mh, 5/7/2004]--><InternalEvent Name="OnTeamEntered" /> <!-- OnTeamEntered(self, areaName) Sent to the last unit of a team entering an area. -->
<InternalEvent Name="OnUnitExited" /> <!-- OnUnitExited(self, areaName) Unit left an area. Name of area is parameter. -->
<!-- disabled since its really slow and nobody is using it... [mh, 5/7/2004] --><InternalEvent Name="OnTeamExited" /> <!-- OnTeamExited(self, areaName) Sent to the last unit of a team leaving an area. -->
<InternalEvent Name="OnTeamDestroyed" /> <!-- OnTeamDestroyed(self) Sent to the last unit of a team as it is destroyed. -->
<InternalEvent Name="BeScary" /> <!-- Broadcast to a unit when he uses a power that makes him radiate scariness.. -->
<InternalEvent Name="OnAflame" /> <!-- OnAflame(self) Broadcast to allies that I am on fire :blink: -->
<InternalEvent Name="OnQuenched" /> <!-- OnQuenched(self) Broadcast to allies that I am no longer on fire :popcorn: -->
<InternalEvent Name="OnCreated" /> <!-- OnCreated(self) sent when an object has been constructed -->
<InternalEvent Name="OnBuildingComplete" /> <!--OnBuildingComplete sent when an object has completed building. IE construction complete-->
<InternalEvent Name="DamageIncoming" /> <!-- DamageIncoming(self, other, delay, amount) other is shooter, delay is when the damage should hit, amount is how much. So we can do a defense, or a "Oh heck" animation -->
<InternalEvent Name="OnSlaughtered" /> <!-- OnSlaughtered(self, slaughterer). -->
<InternalEvent Name="OnGenericEvent" /> <!-- self, string -->
<InternalEvent Name="OnBuildVariation" /> <!-- self, real -->

<!-- Scripted events are of two kinds - first is one generated by the ObjectDispatchEvent or ObjectBroadcastEvent script. The calling is
DispatchedEvent(self, dispatchingObject, arbitraryString) -->
<scriptedEvent Name="ExampleGuardMe" /> <!-- GuardMe(self, other, string) other is object generating the scripted event. May be nil. -->
<!-- Second kind of scripted event is a spy event. -->
<scriptedEvent Name="ExampleSpyMoving" /> <!-- SpyMoving(self, spySelf, parameters...) spySelf is the object self is spying on, parameters is the spied event paramters, may be nil. -->

<scriptedEvent Name="BeAfraidOfBalrog" /> <!-- Becoming afraid of balrog -->
<scriptedEvent Name="BeAfraidOfRampage" /> <!-- Becoming afraid of rampage -->
<scriptedEvent Name="BeAfraidOfPhial" /> <!-- Becoming afraid of Frodo -->
<scriptedEvent Name="BeUncontrollablyAfraid" /> <!-- Becoming afraid whether we like it or not -->
<scriptedEvent Name="BeingEnraged" /> <!-- Be enraged! Revenge!! -->
<scriptedEvent Name="BeAfraidOfGateDamaged" /> <!-- Be afraid of the gate being damaged -->
<scriptedEvent Name="BeTerrified" /> <!-- Run Away! -->

<scriptedEvent Name="ChantForUnit" /> <!-- Chant for a special unit! -->
<scriptedEvent Name="StopChantForUnit" /> <!-- Stop Chant for a special unit! -->
<scriptedEvent Name="BeginChanting" /> <!-- Begin Chanting! -->
<scriptedEvent Name="StopChanting" /> <!-- Stop Chanting! -->

<!-- Cinematic Events -->
<scriptedEvent Name="CinematicRampageDamaged" />

<!-- All ModelCondition and ObjectStatus events have a single parameter of self, which is the object matching the conditions. -->
<ModelConditionEvent Name="OnFire"> <!-- OnFire(self) self is object matching the modelconditions specified. -->
<Conditions>-DYING +AFLAME</Conditions>
</ModelConditionEvent>
<ModelConditionEvent Name="ExampleMovingDamaged">
<Conditions>+MOVING +DAMAGED -AFLAME</Conditions>
</ModelConditionEvent>
<ModelConditionEvent Name="Moving">
<Conditions>+MOVING</Conditions>
</ModelConditionEvent>
<ModelConditionEvent Name="Damaged">
<Conditions>+DAMAGED</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="ReallyDamaged">
<Conditions>+REALLYDAMAGED</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="NOTReallyDamaged">
<Conditions>-REALLYDAMAGED</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="RecoverFromTerror">
<Conditions>-EMOTION_TERROR -DYING</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="UsingSpecialOne">
<Conditions>+SPECIAL_POWER_1 -UNPACKING -PACKING</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="UsingSpecialTwo">
<Conditions>+SPECIAL_POWER_2 -UNPACKING -PACKING</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="UsingSpecialThree">
<Conditions>+SPECIAL_POWER_3 -UNPACKING -PACKING</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="CinematicRampageUser">
<Conditions>+USER_4</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="OnEnemyNear">
<Conditions>+SPECIAL_ENEMY_NEAR</Conditions>
</ModelConditionEvent>

<ModelConditionEvent Name="OnEnemyNOTNear">
<Conditions>-SPECIAL_ENEMY_NEAR</Conditions>
</ModelConditionEvent>


</Events>

<EventList Name="BaseScriptFunctions">
<!-- If there are any events that need to apply to all units, put them here. jba -->
</EventList>

<EventList Name="CaptureFlagFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnCaptureFlagGenericEvent" DebugSingleStep="false"/>
</EventList>

<EventList Name="ArgelebFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnEnemyNear" ScriptFunctionName="BecomeDismounted" DebugSingleStep="false"/>
<EventHandler EventName="OnEnemyNOTNear" ScriptFunctionName="BecomeMounted" DebugSingleStep="false"/>
<EventHandler EventName="Damaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>
<EventHandler EventName="ReallyDamaged" ScriptFunctionName="OnHeroInjured_SEE" DebugSingleStep="false"/>
<EventHandler EventName="NOTReallyDamaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>
</EventList>

<EventList Name="BaseHeroFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="Damaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>
<EventHandler EventName="ReallyDamaged" ScriptFunctionName="OnHeroInjured_SEE" DebugSingleStep="false"/>
<EventHandler EventName="NOTReallyDamaged" ScriptFunctionName="OnHeroHealed_SEE" DebugSingleStep="false"/>
</EventList>


<EventList Name="TrollFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="ReallyDamaged" ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>
<EventHandler EventName="OnCreated" ScriptFunctionName="OnTrollCreated" DebugSingleStep="false"/>
<EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnTrollGenericEvent" DebugSingleStep="false"/>
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
</EventList>

<EventList Name="CreepTrollFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="ReallyDamaged" ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>
<EventHandler EventName="OnCreated" ScriptFunctionName="OnCreepTrollCreated" DebugSingleStep="false"/>
<EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnTrollGenericEvent" DebugSingleStep="false"/>
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
</EventList>

<EventList Name="DrummerTrollFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="BarrowWightFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
</EventList>

<EventList Name="SauronFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMordorSauronCreated" DebugSingleStep="false"/>
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="MumakilFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMumakilCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="SunbeamFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="TheodenFunctions" Inherit="BaseScriptFunctions">
</EventList>

<EventList Name="BallistaFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnBallistaCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="CatapultFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnCatapultCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="TrebuchetFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnTrebuchetCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="TrollSlingFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnTrollSlingCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="StandardPorterFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
<EventHandler EventName="OnCreated" ScriptFunctionName="OnPorterCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="EvilPorterFunctions" Inherit="InfantryFunctions">
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
<EventHandler EventName="OnCreated" ScriptFunctionName="OnEvilPorterCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="StandardPeasantFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnPeasantCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="GandalfFunctions" Inherit="BaseScriptFunctions">
<!-- <EventHandler EventName="DamageIncoming" ScriptFunctionName="GandalfConsiderUsingDefensePower" DebugSingleStep="false"/> -->
<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="GandalfTriggerWizardBlast" DebugSingleStep="false"/>
</EventList>

<EventList Name="SarumanFunctions" Inherit="BaseScriptFunctions">
<!-- <EventHandler EventName="DamageIncoming" ScriptFunctionName="SarumanConsiderUsingDefensePower" DebugSingleStep="false"/> -->
</EventList>

<EventList Name="LegolasFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnLegolasCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="GaladrielFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="MinisTirithGateFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnDamaged" ScriptFunctionName="RadiateGateDamageFear" DebugSingleStep="false"/>
</EventList>

<EventList Name="InfantryFunctions" Inherit="BaseScriptFunctions">
<!-- These are events that will apply to all infantry. Any infantry units should inherit this set. jba -->
<EventHandler EventName="BeAfraidOfBalrog" ScriptFunctionName="BecomeAfraidOfBalrog" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfRampage" ScriptFunctionName="BecomeAfraidOfRampage" DebugSingleStep="false"/>
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
<EventHandler EventName="BeUncontrollablyAfraid" ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>
</EventList>

<EventList Name="InfantryBannerFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnInfantryBannerCreated" DebugSingleStep="false"/>
<!-- These are events that will apply to all infantry. Any infantry units should inherit this set. jba -->
<EventHandler EventName="BeAfraidOfBalrog" ScriptFunctionName="BecomeAfraidOfBalrog" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfRampage" ScriptFunctionName="BecomeAfraidOfRampage" DebugSingleStep="false"/>
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
<EventHandler EventName="BeUncontrollablyAfraid" ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>
</EventList>

<EventList Name="WildInfantryFunctions" Inherit="InfantryFunctions">
<!-- These are events that apply to all wild infantry -->
<EventHandler EventName="BeAfraidOfPhial" ScriptFunctionName="WildInfantryBecomeAfraidOfPhial" DebugSingleStep="false"/>
</EventList>


<EventList Name="CavalryFunctions" Inherit="BaseScriptFunctions">
<!-- These are events that will apply to all infantry. Any infantry units should inherit this set. jba -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnCavalryCreated" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfBalrog" ScriptFunctionName="BecomeAfraidOfBalrog" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfRampage" ScriptFunctionName="BecomeAfraidOfRampage" DebugSingleStep="false"/>
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
<EventHandler EventName="BeUncontrollablyAfraid" ScriptFunctionName="BecomeUncontrollablyAfraid" DebugSingleStep="false"/>
</EventList>

<EventList Name="RohirrimFunctions" Inherit="CavalryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnRohirrimCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="SummonedRohirrimFunctions" Inherit="CavalryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnSummonedRohirrimCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="WildSpiderFunctions" Inherit="CavalryFunctions">
<!-- This contains events specific to the wild spider riders-->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnWildSpiderRiderCreated" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfPhial" ScriptFunctionName="MordorFighterBecomeAfraidOfPhial" DebugSingleStep="false"/>
</EventList>

<EventList Name="HaradrimArcherFunctions" Inherit="CavalryFunctions">
<!-- This contains events specific to the wild spider riders-->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnHaradrimArcherCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="IsengardWildmanFunctions" Inherit="CavalryFunctions">
<!-- This contains events specific to the Isengard Wildmen-->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnIsengardWildmanCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="GondorCavalryFunctions" Inherit="CavalryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGondorCavalryCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="DwarvenBattleWagonFunctions" Inherit="GondorCavalryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnDwarvenBattleWagonCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="EvilMenBlackRiderFunctions" Inherit="CavalryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnEvilMenBlackRiderCreated" DebugSingleStep="false"/>
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="RadiateUncontrollableFear" DebugSingleStep="false"/>
</EventList>

<EventList Name="ArcherFunctions" Inherit="InfantryFunctions">
</EventList>

<EventList Name="GondorArcherFunctions" Inherit="ArcherFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGondorArcherCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="RohanArcherFunctions" Inherit="ArcherFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnRohanArcherCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="RohanElvenWarriorFunctions" Inherit="InfantryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnElvenWarriorCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="RangerFunctions" Inherit="ArcherFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGondorArcherCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="FellBeastFunctions">
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="DragonStrikeDragonFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="DragonStrikeDragonCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="ShelobFunctions">
<EventHandler EventName="BeAfraidOfPhial" ScriptFunctionName="ShelobBecomeAfraidOfPhial" DebugSingleStep="false"/>
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
<EventHandler EventName="BeTerrified" ScriptFunctionName="BecomeTerrified" DebugSingleStep="false"/>
</EventList>

<EventList Name="GwaihirFunctions">
</EventList>

<EventList Name="EntFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to Ents. -->
<EventHandler EventName="OnDestroyed" ScriptFunctionName="BeEnraged" DebugSingleStep="false"/>
<EventHandler EventName="BeingEnraged" ScriptFunctionName="BecomeEnraged" DebugSingleStep="false"/>
<EventHandler EventName="OnAflame" ScriptFunctionName="BecomeEnraged" DebugSingleStep="false"/>
<EventHandler EventName="OnQuenched" ScriptFunctionName="StopEnraged" DebugSingleStep="false"/>
<EventHandler EventName="OnCreated" ScriptFunctionName="OnEntCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="MountainGiantFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to Ents. -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMountainGiantCreated" DebugSingleStep="false"/>
<EventHandler EventName="OnGenericEvent" ScriptFunctionName="OnMountainGiantGenericEvent" DebugSingleStep="false"/>
</EventList>

<EventList Name="MordorGrondFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to the Grond. -->
<EventHandler EventName="OnUnitEntered" ScriptFunctionName="ChantForUnit" DebugSingleStep="false"/>
<EventHandler EventName="OnUnitExited" ScriptFunctionName="StopChantForUnit" DebugSingleStep="false"/>
<EventHandler EventName="OnDestroyed" ScriptFunctionName="StopChantForUnit" DebugSingleStep="false"/>
</EventList>

<EventList Name="MordorOrcFunctions" Inherit="InfantryFunctions">
<!-- This contains events specific to the Orc units. -->
<EventHandler EventName="BeginChanting" ScriptFunctionName="BeginCheeringForGrond" DebugSingleStep="false"/>
<EventHandler EventName="StopChanting" ScriptFunctionName="StopCheeringForGrond" DebugSingleStep="false"/>
</EventList>

<EventList Name="MordorArcherFunctions" Inherit="InfantryFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMordorArcherCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="MordorFighterFunctions" Inherit="MordorOrcFunctions">
<!-- This contains events specific to the MordorFighter. Kris -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMordorFighterCreated" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfPhial" ScriptFunctionName="MordorFighterBecomeAfraidOfPhial" DebugSingleStep="false"/>
<EventHandler EventName="BeUncontrollablyAfraid" ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid" DebugSingleStep="false"/>
</EventList>

<EventList Name="MordorInfantryBannerFunctions" Inherit="MordorOrcFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnInfantryBannerCreated" DebugSingleStep="false"/>
<!-- This contains events specific to the MordorFighter. Kris -->
<EventHandler EventName="BeAfraidOfPhial" ScriptFunctionName="MordorFighterBecomeAfraidOfPhial" DebugSingleStep="false"/>
<EventHandler EventName="BeUncontrollablyAfraid" ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid" DebugSingleStep="false"/>
</EventList>


<EventList Name="MordorCorsairFunctions" Inherit="InfantryFunctions">
<!-- This contains events specific to the Gondor Fighter horde member. jba -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnMordorCorsairCreated" DebugSingleStep="false"/>
<EventHandler EventName="RecoverFromTerror" ScriptFunctionName="GondorFighterRecoverFromTerror" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfGateDamaged" ScriptFunctionName="GondorFighterBecomeAfraidOfGateDamaged" DebugSingleStep="false"/>
</EventList>

<EventList Name="WildGoblinArcherFunctions" Inherit="MordorOrcFunctions">
<!-- This contains events specific to the GoblinArcherFunctions. Kris -->
<EventHandler EventName="BeAfraidOfPhial" ScriptFunctionName="MordorFighterBecomeAfraidOfPhial" DebugSingleStep="false"/>
<EventHandler EventName="BeUncontrollablyAfraid" ScriptFunctionName="MordorFighterBecomeUncontrollablyAfraid" DebugSingleStep="false"/>
<EventHandler EventName="OnCreated" ScriptFunctionName="OnWildGoblinArcherCreated" DebugSingleStep="false"/>
</EventList>


<EventList Name="IsengardFighterFunctions" Inherit="MordorFighterFunctions">
<!-- This contains events specific to the IsengardFighter. Kris -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnIsengardFighterCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="WargRiderFunctions" Inherit="MordorFighterFunctions">
<!-- This contains events specific to the IsengardFighter. Kris -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnIsengardFighterCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="IsengardArcherFunctions" Inherit="MordorFighterFunctions">
<!-- This contains events specific to the IsengardArhcer. Kris -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnIsengardArcherCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="HaradrimFunctions" Inherit="InfantryFunctions">
<!-- This contains events specific to the Haradrim -->
</EventList>

<EventList Name="GondorFighterFunctions" Inherit="InfantryFunctions">
<!-- This contains events specific to the Gondor Fighter horde member. jba -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGondorFighterCreated" DebugSingleStep="false"/>
<EventHandler EventName="RecoverFromTerror" ScriptFunctionName="GondorFighterRecoverFromTerror" DebugSingleStep="false"/>
<EventHandler EventName="BeAfraidOfGateDamaged" ScriptFunctionName="GondorFighterBecomeAfraidOfGateDamaged" DebugSingleStep="false"/>
</EventList>

<EventList Name="GondorFighterHordeFunctions" Inherit="GondorFighterFunctions">
<!-- This contains events specific to the Gondor Fighter horde brain. Ian -->
</EventList>

<EventList Name="BoromirFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to Boromir -->
<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="RadiateUncontrollableFear" DebugSingleStep="false"/>
</EventList>

<EventList Name="AragornFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to Boromir -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnAragornCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="FrodoFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to Frodo -->
<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="RadiatePhialFear" DebugSingleStep="false"/>
</EventList>

<EventList Name="FramFunctions" Inherit="FrodoFunctions">
<!-- This contains events specific to Frodo -->
<EventHandler EventName="onCreated" ScriptFunctionName="MakeMeAlert" DebugSingleStep="false"/>
</EventList>

<EventList Name="BalrogFunctions" Inherit="BaseScriptFunctions">
<!-- This contains events specific to Balrog -->
<EventHandler EventName="UsingSpecialOne" ScriptFunctionName="RadiateTerror" DebugSingleStep="false"/>
<EventHandler EventName="UsingSpecialTwo" ScriptFunctionName="BalrogTriggerBreatheFire" DebugSingleStep="false"/>
</EventList>

<EventList Name="DemoMumakilFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnFire" ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>
</EventList>

<EventList Name="DwarvenGuardianFunctions" Inherit="InfantryFunctions">
<!-- This contains events specific to the Gondor Fighter horde member. jba -->
<EventHandler EventName="OnCreated" ScriptFunctionName="OnDwarvenGuardianCreated" DebugSingleStep="false"/>
</EventList>

<!-- Cinematic Lua Event Lists -->
<EventList Name="CinematicMumakilFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="CinematicRampageUser" ScriptFunctionName="GoIntoRampage" DebugSingleStep="false"/>
</EventList>

<!-- Generic keep Lua Event Lists -->
<EventList Name="GarrisonableFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGarrisonableCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="CreateAHeroFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnCreateAHeroFunctions" DebugSingleStep="false"/>
<EventHandler EventName="OnGenericEvent" ScriptFunctionName="CreateAHeroHideEverything" DebugSingleStep="false"/>
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="EvilShipFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnEvilShipCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="GoodShipFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnGoodShipCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="ShipWrightFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnShipWrightCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="FortressFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnFortressCreated" DebugSingleStep="false"/>
</EventList>

<EventList Name="DormitoryFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnBuildVariation" ScriptFunctionName="OnDormitoryBuildVariation" DebugSingleStep="false"/>
</EventList>

<EventList Name="GateWatchersFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnBuildingComplete" ScriptFunctionName="OnGateWatcherBuilt" DebugSingleStep="false"/>
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="NeutralGollum_RingStealerFunctions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnDamaged" ScriptFunctionName="NeutralGollum_RingStealerDamaged" DebugSingleStep="false"/>
<EventHandler EventName="OnSlaughtered" ScriptFunctionName="NeutralGollum_RingStealerSlaughtered" DebugSingleStep="false"/>
</EventList>

<EventList Name="TomBombadil_Functions" Inherit="BaseScriptFunctions">
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

<EventList Name="NecromancerStatue_Functions" Inherit="BaseScriptFunctions">
<EventHandler EventName="OnCreated" ScriptFunctionName="OnNecromancerStatueCreated" DebugSingleStep="false"/>
<EventHandler EventName="BeScary" ScriptFunctionName="RadiateTerrorEx" DebugSingleStep="false"/>
</EventList>

</SageLuaScriptSection>[/code]

scripts.lua

[code=auto:0]-- define lua functions
function NoOp(self, source)
end

function BecomeDismounted(self)
ObjectRemoveUpgrade( self, "Upgrade_MountNOW" )
ObjectGrantUpgrade( self, "Upgrade_DismountNOW" )
end

function BecomeMounted(self)
ObjectRemoveUpgrade( self, "Upgrade_DismountNOW" )
ObjectGrantUpgrade( self, "Upgrade_MountNOW" )
end

function kill(self) -- Kill unit self.
ExecuteAction("NAMED_KILL", self);
end

function RadiatePhialFear( self )
ObjectBroadcastEventToEnemies( self, "BeAfraidOfPhial", 75 )
end

function RadiateUncontrollableFear( self )
ObjectBroadcastEventToEnemies( self, "BeUncontrollablyAfraid", 350 )
end

function RadiateGateDamageFear(self)
ObjectBroadcastEventToAllies(self, "BeAfraidOfGateDamaged", 200)
end

function RadiateBalrogFear(self)
ObjectBroadcastEventToEnemies(self, "BeAfraidOfBalrog", 180)
end

function OnMumakilCreated(self)
ObjectHideSubObjectPermanently( self, "Houda", true )
ObjectHideSubObjectPermanently( self, "Houda01", true )
end

function OnTrollCreated(self)
ObjectHideSubObjectPermanently( self, "Trunk01", true )
ObjectGrantUpgrade( self, "Upgrade_SwitchToRockThrowing" )
end

function OnCreepTrollCreated(self)
ObjectHideSubObjectPermanently( self, "Trunk01", true )
ObjectHideSubObjectPermanently( self, "ROCK", true )
end

function OnCaptureFlagGenericEvent(self,data)
local str = ObjectCapturingObjectPlayerSide(self)
if str == nil then
str = ObjectPlayerSide(self)
end


ObjectHideSubObjectPermanently( self, "FLAG_ISENGARD", true)
ObjectHideSubObjectPermanently( self, "FLAG_MORDOR", true)
ObjectHideSubObjectPermanently( self, "FLAG_WILD", true)
ObjectHideSubObjectPermanently( self, "FLAG_MEN", true)
ObjectHideSubObjectPermanently( self, "FLAG_ELVES", true)
ObjectHideSubObjectPermanently( self, "FLAG_DWARVES", true)
ObjectHideSubObjectPermanently( self, "FLAG_ANGMAR", true)

if str == "Isengard" then
ObjectHideSubObjectPermanently( self, "FLAG_ISENGARD", false)
elseif str == "Mordor" then
ObjectHideSubObjectPermanently( self, "FLAG_MORDOR", false)
elseif str == "Men" then
ObjectHideSubObjectPermanently( self, "FLAG_MEN", false)
elseif str == "Dwarves" then
ObjectHideSubObjectPermanently( self, "FLAG_DWARVES", false)
elseif str == "Elves" then
ObjectHideSubObjectPermanently( self, "FLAG_ELVES", false)
elseif str == "Wild" then
ObjectHideSubObjectPermanently( self, "FLAG_WILD", false)
elseif str == "Angmar" then
ObjectHideSubObjectPermanently( self, "FLAG_ANGMAR", false)
elseif str == "Arnor" then
ObjectHideSubObjectPermanently( self, "FLAG_MEN", false)
else
ObjectHideSubObjectPermanently( self, "FLAG_NEUTRAL", false)
end
end


function OnHeroInjured_SEE(self)
-- ObjectRemoveUpgrade( self, "Upgrade_RemoveBeacon_SEE" )
ObjectGrantUpgrade( self, "Upgrade_ReallyDamaged_SEE" )
end

function OnHeroHealed_SEE(self)
ObjectRemoveUpgrade( self, "Upgrade_ReallyDamaged_SEE" )
-- ObjectGrantUpgrade( self, "Upgrade_RemoveBeacon_SEE" )
end

function OnTrollGenericEvent(self,data)

local str = tostring( data )

if str == "show_rock" then
ObjectHideSubObjectPermanently( self, "ROCK", false )
elseif str == "hide_rock" then
ObjectHideSubObjectPermanently( self, "ROCK", true )
end
end

function OnEntCreated(self)
--ObjectShowSubObjectPermanently( self, "ROCK", true )
ObjectGrantUpgrade( self, "Upgrade_SwitchToRockThrowing" )
end

function OnMountainGiantCreated(self)
--ObjectHideSubObjectPermanently( self, "ROCK", true )
ObjectGrantUpgrade( self, "Upgrade_SwitchToRockThrowing" )
end

function OnMountainGiantGenericEvent(self)

local str = tostring( data )

if str == "show_rock" then
ObjectHideSubObjectPermanently( self, "ROCK", false )
elseif str == "hide_rock" then
ObjectHideSubObjectPermanently( self, "ROCK", true )
end
end

function GoIntoRampage(self)
ObjectEnterRampageState(self)

--Broadcast fear to surrounding unit(if we actually rampaged)
if ObjectTestModelCondition(self, "WEAPONSET_RAMPAGE") then
ObjectBroadcastEventToUnits(self, "BeAfraidOfRampage", 250)
end
end

function MakeMeAlert(self)
ObjectEnterAlertState(self)
end

function BeEnraged(self)
--Broadcast enraged to surrounding units.
ObjectBroadcastEventToAllies(self, "BeingEnraged", 500)
end

function BecomeEnraged(self)
ObjectSetEnragedState(self, true)
end

function StopEnraged(self)
ObjectSetEnragedState(self, false)
end

function BecomeUncontrollablyAfraid(self, other)
if not ObjectTestCanSufferFear(self) then
return
end

ObjectEnterUncontrollableCowerState(self, other)
end

function BecomeAfraidOfRampage(self, other)
if not ObjectTestCanSufferFear(self) then
return
end

ObjectEnterCowerState(self, other)
end

function BecomeAfraidOfBalrog(self, other)
if not ObjectTestCanSufferFear(self) then
return
end

ObjectEnterCowerState(self, other)
end

function RadiateTerror(self, other)
ObjectBroadcastEventToEnemies(self, "BeTerrified", 180)
end

function RadiateTerrorEx(self, other, terrorRange)
ObjectBroadcastEventToEnemies(self, "BeTerrified", terrorRange)
end


function BecomeTerrified(self, other)
ObjectEnterRunAwayPanicState(self, other)
end

function BecomeAfraidOfGateDamaged(self, other)
if not ObjectTestCanSufferFear(self) then
return
end

ObjectEnterCowerState(self,other)
end


function ChantForUnit(self) -- Used by units to broadcast the chant event to their own side.
ObjectBroadcastEventToAllies(self, "BeginChanting", 9999)
end

function StopChantForUnit(self) -- Used by units to stop the chant event to their own side.
ObjectBroadcastEventToAllies(self, "StopChanting", 9999)
end

function BeginCheeringForGrond(self)
ObjectSetChanting(self, true)
end

function StopCheeringForGrond(self)
ObjectSetChanting(self, false)
end

function OnMordorArcherCreated(self)
ObjectHideSubObjectPermanently( self, "ARROWFIRE", true )
end

function OnMordorFighterCreated(self)
ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
ObjectHideSubObjectPermanently( self, "FORGED_BLADES", true )
end

function MordorFighterBecomeUncontrollablyAfraid(self,other)
local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")

BecomeUncontrollablyAfraid(self,other) -- Call base function appropriate to many unit types

-- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
-- BecomeAfraidOfTroll may fail, don't play sound if we didn't enter fear state
if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
ObjectPlaySound(self, "MordorFighterEntFear")
end
end

function MordorFighterBecomeAfraidOfPhial(self,other)
local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")

BecomeUncontrollablyAfraid(self,other)
-- BecomeAfraidOfTroll(self,other) -- Call base function appropriate to many unit types

-- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
-- BecomeAfraidOfTroll may fail, don't play sound if we didn't enter fear state
-- if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
-- ObjectPlaySound(self, "MordorFighterEntFear")
-- end
end

function OnMordorCorsairCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "Forged_Blade01", true )
end

function WildInfantryBecomeAfraidOfPhial(self,other)
local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")
BecomeUncontrollablyAfraid(self,other)
end


function ShelobBecomeAfraidOfPhial(self,other)
local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")

BecomeUncontrollablyAfraid(self,other)
-- BecomeAfraidOfTroll(self,other) -- Call base function appropriate to many unit types

-- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
-- BecomeAfraidOfTroll may fail, don't play sound if we didn't enter fear state
-- if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
-- ObjectPlaySound(self, "MordorFighterEntFear")
-- end
end

function OnInfantryBannerCreated(self)
ObjectHideSubObjectPermanently( self, "Glow", true )
end

function OnCavalryCreated(self)
ObjectHideSubObjectPermanently( self, "Glow", true )
end

function OnGondorFighterCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "Hammer1", true )
ObjectHideSubObjectPermanently( self, "Glow", true )
ObjectHideSubObjectPermanently( self, "Glow1", true )
end

function OnAragornCreated(self)
ObjectHideSubObjectPermanently( self, "PLANE02", true )
end

function OnGondorArcherCreated(self)
-- ObjectHideSubObjectPermanently( self, "arrow", true ) -- This gets hidden pending the art being fixed. it is the pre-new-archer-firing-pattern arrow
ObjectHideSubObjectPermanently( self, "FireArowTip", true ) -- This gets hidden because the Fire Arrow upgrade turns it on.
end

function DragonStrikeDragonCreated(self)
ObjectForbidPlayerCommands( self, true )
end

function OnLegolasCreated(self)
-- ObjectHideSubObjectPermanently( self, "arrow02", true ) -- This gets hidden pending the art being fixed. it is the pre-new-archer-firing-pattern arrow
-- ObjectHideSubObjectPermanently( self, "arrow", true ) -- This gets hidden pending the art being fixed. it is the pre-new-archer-firing-pattern arrow
end

function OnRohanArcherCreated(self)
ObjectHideSubObjectPermanently( self, "FireArowTip", true ) -- yes, it's a typo in the art.
-- ObjectHideSubObjectPermanently( self, "ArrowNock", true )
-- ObjectHideSubObjectPermanently( self, "arrow", true )
end

function GondorFighterBecomeAfraid(self, other)
local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")

-- An object has a 100% chance to become afraid.
-- An object has a 66% chance to be feared, 33% chance to run away.
if GetRandomNumber() <= 0.67 then
ObjectEnterFearState(self, other, false) -- become afraid of other.
else --if GetRandomNumber() > 0.67 then
ObjectEnterRunAwayPanicState(self, other) -- run away.

end

if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
ObjectPlaySound(self, "GondorSoldierScream")
end

end


function GondorFighterBecomeAfraidOfGateDamaged(self, other)
local wasAfraid = ObjectTestModelCondition(self, "EMOTION_AFRAID")

BecomeAfraidOfGateDamaged(self,other) -- Call base function appropriate to many unit types

-- Play unit-specific sound, but only when first entering state (not every time troll sends out fear message!)
-- BecomeAfraidOfGateDamaged may fail, don't play sound if we didn't enter fear state

if ( not wasAfraid ) and ObjectTestModelCondition(self, "EMOTION_AFRAID") then
ObjectPlaySound(self, "GondorSoldierScream")
end
end

function GondorFighterRecoverFromTerror(self)
-- Add recovery sound
ObjectPlaySound(self, "GondorSoldierRecoverFromTerror")
end

function SpyMoving(self, other)
print(ObjectDescription(self).." spying movement of "..ObjectDescription(other));
end

--function GandalfConsiderUsingDefensePower(self, other, delay, amount)
-- -- Put up the shield if a big attack is coming and we have time to block it
-- if tonumber(delay) > 1 then
-- if tonumber(amount) >= 100 then
-- ObjectDoSpecialPower(self, "SpecialPowerShieldBubble")
-- return
-- end
-- end
--
-- -- Or, if we are being hit and there are alot of guys arround, do our cool pushback power
-- if tonumber(ObjectCountNearbyEnemies(self, 50)) >= 4 then
-- ObjectDoSpecialPower(self, "SpecialPowerTelekeneticPush")
-- return
-- end
--end

function GandalfTriggerWizardBlast(self)
ObjectCreateAndFireTempWeapon(self, "GandalfWizardBlast")
end

--function SarumanConsiderUsingDefensePower(self, other, delay, amount)
-- -- Put up the shield if a big attack is coming and we have time to block it
--E4 if tonumber(delay) > 1 then
--E4 if tonumber(amount) >= 25 then
--E4 ObjectDoSpecialPower(self, "SpecialPowerShieldBubble")
--E4 return
--E4 end
--E4 end
--
-- -- Or, if we are being hit and there are alot of guys arround, do our cool pushback power
-- if tonumber(ObjectCountNearbyEnemies(self, 50)) >= 4 then
-- ObjectDoSpecialPower(self, "SpecialPowerTelekeneticPush")
-- return
-- end
--end

function BalrogTriggerBreatheFire(self)
ObjectCreateAndFireTempWeapon(self, "MordorBalrogBreath")
end

function OnRohirrimCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "SHIELD", true )
ObjectHideSubObjectPermanently( self, "FireArowTip", true )
end

function OnSummonedRohirrimCreated(self)
ObjectGrantUpgrade( self, "Upgrade_RohanHeavyArmorForRohirrim" )
ObjectGrantUpgrade( self, "Upgrade_RohanHorseShield" )
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
end

function OnGondorCavalryCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "sshield", true )
end

function OnDwarvenBattleWagonCreated(self)
ObjectHideSubObjectPermanently( self, "dwarfHearth", true )
ObjectHideSubObjectPermanently( self, "dwarfHearthFire", true )
ObjectHideSubObjectPermanently( self, "Banner_L", true )
ObjectHideSubObjectPermanently( self, "Glow", true )
end

function OnEvilMenBlackRiderCreated(self)
-- @todo place appropriate functionality here
end

function OnBallistaCreated(self)
ObjectHideSubObjectPermanently( self, "MinedArrow", true )
end

function OnCatapultCreated(self)
ObjectHideSubObjectPermanently( self, "PROJECTILEROCK", true )
ObjectHideSubObjectPermanently( self, "FIREPLANE", true )
end

function OnTrebuchetCreated(self)
ObjectHideSubObjectPermanently( self, "FIREPLANE", true )
end

function OnTrollSlingCreated(self)
ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
end

function OnPorterCreated(self)
ObjectHideSubObjectPermanently( self, "ARROWS", true )
ObjectHideSubObjectPermanently( self, "BRAZIER", true )
ObjectHideSubObjectPermanently( self, "BOWS", true )
ObjectHideSubObjectPermanently( self, "TREBUCHET_FIRE", true )
ObjectHideSubObjectPermanently( self, "SWORDS", true )
ObjectHideSubObjectPermanently( self, "SHIELDS", true )
ObjectHideSubObjectPermanently( self, "ARMOR", true )
ObjectHideSubObjectPermanently( self, "BANNERS", true )
end

function OnEvilPorterCreated(self)
ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
ObjectHideSubObjectPermanently( self, "ARROW_UPGRADE", true )
ObjectHideSubObjectPermanently( self, "ARMOR_UPGRADE", true )
ObjectHideSubObjectPermanently( self, "GOLD", true )
ObjectHideSubObjectPermanently( self, "SWORD_UPGRADES", true )
end

function OnPeasantCreated(self)
ObjectHideSubObjectPermanently( self, "HELMET", true )
ObjectHideSubObjectPermanently( self, "SWORD", true )
ObjectHideSubObjectPermanently( self, "HAMMER", false )
ObjectHideSubObjectPermanently( self, "FORGED_BLADE", true )
ObjectHideSubObjectPermanently( self, "SHIELD", true )
ObjectHideSubObjectPermanently( self, "Broom", true )
end

function OnMordorSauronCreated(self)
ObjectHideSubObjectPermanently( self, "SHARD01", true )
ObjectHideSubObjectPermanently( self, "SHARD02", true )
ObjectHideSubObjectPermanently( self, "SHARD03", true )
ObjectHideSubObjectPermanently( self, "SHARD04", true )
ObjectHideSubObjectPermanently( self, "SHARD05", true )
ObjectHideSubObjectPermanently( self, "SHARD06", true )
ObjectHideSubObjectPermanently( self, "SHARD07", true )
ObjectHideSubObjectPermanently( self, "SHARD08", true )
ObjectHideSubObjectPermanently( self, "SHARD09", true )
ObjectHideSubObjectPermanently( self, "SHARD10", true )
ObjectHideSubObjectPermanently( self, "SHARD11", true )
ObjectHideSubObjectPermanently( self, "SHARD12", true )
ObjectHideSubObjectPermanently( self, "SHARD13", true )
ObjectHideSubObjectPermanently( self, "SHARD14", true )
ObjectHideSubObjectPermanently( self, "SHARD15", true )
ObjectHideSubObjectPermanently( self, "SHARD16", true )
ObjectHideSubObjectPermanently( self, "SHARD17", true )
ObjectHideSubObjectPermanently( self, "SHARD18", true )
ObjectHideSubObjectPermanently( self, "SHARD19", true )
ObjectHideSubObjectPermanently( self, "SHARD20", true )
end

function OnElvenWarriorCreated(self)
ObjectHideSubObject( self, "ARROW", true )
ObjectHideSubObject( self, "ARROWNOCK", true )
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
end

function OnIsengardFighterCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "Glow", true )
end

function OnIsengardWildmanCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "Torch", true )
ObjectHideSubObjectPermanently( self, "FireArowTip", true )
end

function OnWildSpiderRiderCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
ObjectHideSubObject( self, "ARROWNOCK", true )
end

function OnHaradrimArcherCreated(self)
ObjectHideSubObjectPermanently( self, "FireArowTip", true )
ObjectHideSubObject( self, "ArrowNock", true )
end

function OnIsengardArcherCreated(self)
ObjectHideSubObject( self, "ARROWNOCK", true )
ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
end

function OnWildGoblinArcherCreated(self)
ObjectHideSubObjectPermanently( self, "FIREAROWTIP", true )
end

function OnGarrisonableCreated(self)
ObjectHideSubObjectPermanently( self, "GARRISON01", true )
ObjectHideSubObjectPermanently( self, "GARRISON02", true )
end
function OnDwarvenGuardianCreated(self)
ObjectHideSubObjectPermanently( self, "Forged_Blade", true )
ObjectHideSubObjectPermanently( self, "Hammer1", true )
end

function CreateAHeroHideEverything(self)
ObjectHideSubObjectPermanently( self, "SWORD", true )
ObjectHideSubObjectPermanently( self, "BOW", true )
ObjectHideSubObjectPermanently( self, "BOW_03", true )
ObjectHideSubObjectPermanently( self, "BOW_04", true )
ObjectHideSubObjectPermanently( self, "BOW_05", true )
ObjectHideSubObjectPermanently( self, "TRUNK01", true )
ObjectHideSubObjectPermanently( self, "STAFF_LIGHT", true )
ObjectHideSubObjectPermanently( self, "OBJECT01", true )

ObjectHideSubObjectPermanently( self, "SHIELD01", true )
ObjectHideSubObjectPermanently( self, "SHIELD_01", true )
ObjectHideSubObjectPermanently( self, "SPEAR", true )
ObjectHideSubObjectPermanently( self, "SHIELD_B", true )
ObjectHideSubObjectPermanently( self, "SHIELD_C", true )
ObjectHideSubObjectPermanently( self, "SHIELD_D", true )
ObjectHideSubObjectPermanently( self, "B_SHIELD", true )
ObjectHideSubObjectPermanently( self, "WEAPON_A", true )
ObjectHideSubObjectPermanently( self, "WEAPON_B", true )
ObjectHideSubObjectPermanently( self, "WEAPON_C", true )
ObjectHideSubObjectPermanently( self, "WEAPON_D", true )

ObjectHideSubObjectPermanently( self, "AXE02", true )

ObjectHideSubObjectPermanently( self, "AxeWeapon", true )
ObjectHideSubObjectPermanently( self, "Belthronding", true )
-- ObjectHideSubObjectPermanently( self, "Mithlondrecurve", true )
ObjectHideSubObjectPermanently( self, "Dwarf_Axe01", true )
ObjectHideSubObjectPermanently( self, "FireBrand", true )
ObjectHideSubObjectPermanently( self, "FireBrand_SM", true )
ObjectHideSubObjectPermanently( self, "FireBrand_FX01", true )
ObjectHideSubObjectPermanently( self, "FireBrand_FX02", true )
ObjectHideSubObjectPermanently( self, "Gurthang", true )
ObjectHideSubObjectPermanently( self, "Gurthang_SM", true )
ObjectHideSubObjectPermanently( self, "HeroOfTheWestShield", true )
ObjectHideSubObjectPermanently( self, "HeroOfTheWestShield_SM", true )
ObjectHideSubObjectPermanently( self, "MithlondBow", true )
ObjectHideSubObjectPermanently( self, "TrollBane", true )
ObjectHideSubObjectPermanently( self, "TrollBane_SM", true )
ObjectHideSubObjectPermanently( self, "TrollBane_FX01", true )
ObjectHideSubObjectPermanently( self, "TrollBane_FX02", true )
ObjectHideSubObjectPermanently( self, "TrollMace", true )
ObjectHideSubObjectPermanently( self, "TrollSword", true )
ObjectHideSubObjectPermanently( self, "WestronSword", true )
ObjectHideSubObjectPermanently( self, "WestronSword", true )
ObjectHideSubObjectPermanently( self, "WestronSword_SM", true )
ObjectHideSubObjectPermanently( self, "WizardStaff01", true )
ObjectHideSubObjectPermanently( self, "WizStaff01_FX01", true )
ObjectHideSubObjectPermanently( self, "WizStaff01_FX2", true )
ObjectHideSubObjectPermanently( self, "WizStaff01_FX3", true )
ObjectHideSubObjectPermanently( self, "WizStaff01_FX4", true )
ObjectHideSubObjectPermanently( self, "WizardStaff02", true )
ObjectHideSubObjectPermanently( self, "WizStaff02_FX1", true )
ObjectHideSubObjectPermanently( self, "WizardStaff03", true )
ObjectHideSubObjectPermanently( self, "WizStaff03_FX01", true )
ObjectHideSubObjectPermanently( self, "WizStaff03_FX02", true )
ObjectHideSubObjectPermanently( self, "WizardStaff04", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX01", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX02", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX03", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX04", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX05", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX06", true )
ObjectHideSubObjectPermanently( self, "WizStaff04_FX07", true )
ObjectHideSubObjectPermanently( self, "WizardSword", true )
ObjectHideSubObjectPermanently( self, "CMSword01", true )
ObjectHideSubObjectPermanently( self, "CMSword02", true )
ObjectHideSubObjectPermanently( self, "CHEST_00", true )
ObjectHideSubObjectPermanently( self, "CHEST_01", true )
ObjectHideSubObjectPermanently( self, "CHEST_02", true )
ObjectHideSubObjectPermanently( self, "BOOT_00", true )
ObjectHideSubObjectPermanently( self, "BOOT_01", true )
ObjectHideSubObjectPermanently( self, "BOOT_02", true )
ObjectHideSubObjectPermanently( self, "BOOT_03", true )
ObjectHideSubObjectPermanently( self, "BOOT_04", true )
ObjectHideSubObjectPermanently( self, "BOOT_05", true )
ObjectHideSubObjectPermanently( self, "BOOT_06", true )
ObjectHideSubObjectPermanently( self, "SHLD_00", true )
ObjectHideSubObjectPermanently( self, "SHLD_01", true )
ObjectHideSubObjectPermanently( self, "SHLD_02", true )
ObjectHideSubObjectPermanently( self, "SHLD_03", true )
ObjectHideSubObjectPermanently( self, "SHLD_04", true )
ObjectHideSubObjectPermanently( self, "SLDR_00", true )
ObjectHideSubObjectPermanently( self, "SLDR_01", true )
ObjectHideSubObjectPermanently( self, "SLDR_02", true )
ObjectHideSubObjectPermanently( self, "SLDR_03", true )
ObjectHideSubObjectPermanently( self, "SLDR_04", true )
ObjectHideSubObjectPermanently( self, "SLDR_05", true )
ObjectHideSubObjectPermanently( self, "SLDR_06", true )
ObjectHideSubObjectPermanently( self, "Shield_1OG", true )
ObjectHideSubObjectPermanently( self, "Shield_2OG", true )
ObjectHideSubObjectPermanently( self, "HAIR_00", true )
ObjectHideSubObjectPermanently( self, "HAIR_01", true )
ObjectHideSubObjectPermanently( self, "HLMT_00", true )
ObjectHideSubObjectPermanently( self, "HLMT_01", true )
ObjectHideSubObjectPermanently( self, "HLMT_02", true )
ObjectHideSubObjectPermanently( self, "HLMT_03", true )
ObjectHideSubObjectPermanently( self, "HLMT_04", true )
ObjectHideSubObjectPermanently( self, "HLMT_05", true )
ObjectHideSubObjectPermanently( self, "HLMT_06", true )
ObjectHideSubObjectPermanently( self, "HLMT_07", true )
ObjectHideSubObjectPermanently( self, "HLMT_07_LOD1", true )
ObjectHideSubObjectPermanently( self, "HLMT_08", true )
ObjectHideSubObjectPermanently( self, "HLMT_09", true )
ObjectHideSubObjectPermanently( self, "GNLT_00", true )
ObjectHideSubObjectPermanently( self, "GNLT_01", true )
ObjectHideSubObjectPermanently( self, "GNLT_02", true )
ObjectHideSubObjectPermanently( self, "GNLT_03", true )
ObjectHideSubObjectPermanently( self, "GNLT_04", true )
ObjectHideSubObjectPermanently( self, "GNLT_05", true )
ObjectHideSubObjectPermanently( self, "GNLT_06", true )
ObjectHideSubObjectPermanently( self, "GNLT_07", true )
ObjectHideSubObjectPermanently( self, "GNLT_08", true )
ObjectHideSubObjectPermanently( self, "GHLT_08", true )
ObjectHideSubObjectPermanently( self, "GNLT_09", true )
ObjectHideSubObjectPermanently( self, "GNLT_09_LOD1", true )
ObjectHideSubObjectPermanently( self, "GNLT_10", true )
ObjectHideSubObjectPermanently( self, "SPR_01", true )
ObjectHideSubObjectPermanently( self, "PAXE_01", true )
ObjectHideSubObjectPermanently( self, "PAXE_01_LOD1", true )
ObjectHideSubObjectPermanently( self, "SWRD_01", true )
ObjectHideSubObjectPermanently( self, "SWRD_02", true )
ObjectHideSubObjectPermanently( self, "SWRD_03", true )
ObjectHideSubObjectPermanently( self, "SWRD_04", true )
ObjectHideSubObjectPermanently( self, "SWRD_05", true )
ObjectHideSubObjectPermanently( self, "SWD_01", true )
ObjectHideSubObjectPermanently( self, "SWD_02", true )
ObjectHideSubObjectPermanently( self, "SWD_03", true )
ObjectHideSubObjectPermanently( self, "SWD_04", true )
ObjectHideSubObjectPermanently( self, "STFF_05", true )
ObjectHideSubObjectPermanently( self, "STFF_06", true )
ObjectHideSubObjectPermanently( self, "objSLDR_01", true )
ObjectHideSubObjectPermanently( self, "objSLDR_02", true )
ObjectHideSubObjectPermanently( self, "objSLDR_03", true )
ObjectHideSubObjectPermanently( self, "objHLMT_01", true )
ObjectHideSubObjectPermanently( self, "objHLMT_02", true )
ObjectHideSubObjectPermanently( self, "objHLMT_03", true )
ObjectHideSubObjectPermanently( self, "objHLMT_04", true )
ObjectHideSubObjectPermanently( self, "Uruk_Sword_01", true )
ObjectHideSubObjectPermanently( self, "Uruk_Sword_02", true )
ObjectHideSubObjectPermanently( self, "Uruk_Sword_03", true )
ObjectHideSubObjectPermanently( self, "TrollTree", true )
ObjectHideSubObjectPermanently( self, "TrollHammer", true )
ObjectHideSubObjectPermanently( self, "CLUB_01", true )
ObjectHideSubObjectPermanently( self, "CLUB_02", true )
ObjectHideSubObjectPermanently( self, "CLUB_03", true )
ObjectHideSubObjectPermanently( self, "HMR_01", true )
ObjectHideSubObjectPermanently( self, "HMR_02", true )
ObjectHideSubObjectPermanently( self, "HMR_03", true )
ObjectHideSubObjectPermanently( self, "HMR_04", true )
ObjectHideSubObjectPermanently( self, "AXE_01", true )
ObjectHideSubObjectPermanently( self, "AXE_02", true )
ObjectHideSubObjectPermanently( self, "AXE_03", true )
ObjectHideSubObjectPermanently( self, "BARREL", true )
ObjectHideSubObjectPermanently( self, "OBJECT02", true ) -- Barrel on the Orc Raider
ObjectHideSubObjectPermanently( self, "ARROW", true )
ObjectHideSubObjectPermanently( self, "PLANE02", true )
end

function OnCreateAHeroFunctions(self)
CreateAHeroHideEverything(self)
end

function OnEvilShipCreated(self)
ObjectHideSubObjectPermanently( self, "CAULDRON", true )
ObjectHideSubObjectPermanently( self, "CAULDRON_FIRE", true )
ObjectHideSubObjectPermanently( self, "CAULDRON_TOP", true )
ObjectHideSubObjectPermanently( self, "CROWSNEST", true )
ObjectHideSubObjectPermanently( self, "FLAG", true )
ObjectHideSubObjectPermanently( self, "BANNER", true )
end

function OnGoodShipCreated(self)
ObjectHideSubObjectPermanently( self, "UG_FLAMING_01", true )
ObjectHideSubObjectPermanently( self, "UG_FLAMING_02", true )
ObjectHideSubObjectPermanently( self, "UG_FLAMING_FIRE", true )
ObjectHideSubObjectPermanently( self, "UG_ARMOR", true )
ObjectHideSubObjectPermanently( self, "BANNER", true )
end

function OnShipWrightCreated(self)
ObjectHideSubObjectPermanently( self, "GoodPart_A", true )
ObjectHideSubObjectPermanently( self, "GoodPart_B", true )
ObjectHideSubObjectPermanently( self, "EvilPart_A", true )
ObjectHideSubObjectPermanently( self, "EvilPart_B", true )
end

function OnDormitoryBuildVariation(self,variation)

local var = tonumber(variation)

if var == 1 then
ObjectSetGeometryActive( self, "VersionOne", true )
ObjectSetGeometryActive( self, "VersionTwo", false )
elseif var == 2 then
ObjectSetGeometryActive( self, "VersionOne", false )
ObjectSetGeometryActive( self, "VersionTwo", true )
end

end

function OnFortressCreated(self)
ObjectHideSubObjectPermanently( self, "DBFBANNER", true )
ObjectSetGeometryActive( self, "HighTowerGeom", false )
end

function OnGateWatcherBuilt(self)
ObjectDoSpecialPower(self, "SpecialAbilityGateWatchersFear")
end

function NeutralGollum_RingStealerDamaged(self,other)

if ObjectHasUpgrade( other, "Upgrade_RingHero" ) == 0 then
ObjectChangeAllegianceFromNonPlayablePlayer( self, other )
end

end

function NeutralGollum_RingStealerSlaughtered(self,other)
ObjectRemoveUpgrade( other, "Upgrade_RingHero" )
end

function OnNecromancerStatueCreated(self)
ObjectDoSpecialPower(self, "SpecialAbilityGateWatchersFear")
end[/codebox]

Edited by m@tt, 13 February 2009 - 06:08 PM.


#30 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 09:14 PM

I take original ROTWK scripts and add to them scripts,what i need in the game

#31 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 11 February 2009 - 09:21 PM

I am asking because with the CaH you can easily see if you have any troubles with the lua scripts. So go, make a CaH, and then test him in-game. If he shows as having no subobjects hidden, you will know.


bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#32 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 11:02 PM

My CAH is in order :p

#33 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 11 February 2009 - 11:12 PM

That's good. It means there is no typo in your lua codes. :p

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#34 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 11 February 2009 - 11:21 PM

But i still have problem with my hero :p

#35 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 12 February 2009 - 03:18 AM

Okay, then tell us in detail what is wrong with the hero. And when i say in detail i mean for example:
"I do this, that happens. If i do that, this happens. This doesn't happen at all, no matter what i do, but instead it does this and that"
Fill in the things you do and that happen. Otherwise i cannot really analyse the problem.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#36 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 12 February 2009 - 10:41 AM

My hero can't toggle his horse at all(when AI playing).I do every step from your article,but still no result.

#37 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 12 February 2009 - 11:14 AM

So, can YOU toggle the horse if you play him?

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#38 Vardamir

Vardamir
  • Members
  • 71 posts

Posted 12 February 2009 - 02:13 PM

So, can YOU toggle the horse if you play him?

Yes,i can

#39 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 13 February 2009 - 05:54 PM

I am still checking out your codes. In the meantime, would you mind tidying up your past posts? Every one of your posts has a little button at the lowest right corner named Edit. Use it and re-edit your posts.

Replace every instance of this:

'code' Your Text '/code'

with this:

'codebox' Your Text '/codebox'

It will help make the post easier to scroll through. Also it would be nice if you edit your earlier posts in the same manner. They don't have no formatting at all. And lastly it would be nice if you could mark the code sections in a way that makes it easy to recognize if they are actually in your mod ('actual used code') or if they are only sample code that is not used in the exact form ('sample code').

Thank you. This should help me help you. :p

Edit: If you use the FullEdit option, you will see on the left side a collection of buttons called Quick Access that could help you. When you press one of them, it asks you to enter the so to be formatted text. Good luck. :p

Edited by Sûlherokhh, 13 February 2009 - 06:08 PM.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users