Ok lets change the approach a bit
Make an object in the system.ini
//------------------------------------------------------------------------------
ChildObject RainyIvoryTowerVisionPing IvoryTowerVisionBase
VisionRange = MEN_FORTRESS_IVORY_TOWER_VISION_RANGE
// Gives ally troops bonus
Behavior = AttributeModifierAuraUpdate ModuleTag_TroopBonus
StartsActive = Yes //If no, requires upgrade to turn on.
BonusName = PalantirVision
RefreshDelay = 1000
Range = 200
ObjectFilter = ANY +ORC +URUK +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO
End
End
In the experiencelevels.ini you need to make a experiencelevel for the RainyIvoryTowerVisionPing, which gives Upgrade_FarsightRainy.
Give the Object above the Command_SpecialAbilityFarsightRainyUnseen in its commandset.
Add the modules which you added in your hero:
Behavior = DoCommandUpgrade Module_DoCommandUpgrade
TriggeredBy = Upgrade_FarsightRainy
GetUpgradeCommandButtonName = Command_SpecialAbilityFarsightRainyUnseen
End
Behavior = FreezingRainSpecialPower ModuleTag_FreezingRain
SpecialPowerTemplate = SpecialAbilityFarsightRainyUnseen
AttributeModifierAffects = ALL ENEMIES
AntiCategory = LEADERSHIP
AttributeModifierWeatherBased = Yes
WeatherDuration = 30000 ; same time that ivory tower power duration. ;)
ChangeWeather = RAINY
AvailableAtStart = Yes
BurnRateModifier = -100
BurnDecayModifier = 20
End
In your hero you need to change the:
Behavior = OCLSpecialPower ModuleTag_FarsightRainy
SpecialPowerTemplate = SpecialAbilityFarsightRainy
StartsPaused = No
OCL = SpecialPowerIvoryTowerVision
CreateLocation = CREATE_AT_LOCATION
End
change SpecialPowerIvoryTowerVision to SpecialPowerRainyIvoryTowerVision.
In the Objectcreationlist.ini add a new OCL:
ObjectCreationList SpecialPowerRainyIvoryTowerVision
CreateObject
ObjectNames = RainyIvoryTowerVisionPing
Count = 1
End
End
So your hero will need a button that activates the SpecialAbilityFarsightRainy power
Got it?