I am making a maul and i wanted to make a tower that can cast a modified version of Chain Lightning. the hard part is tring to make it so that when it attacks it casts the spell. I need to make three different levels of it, because the tower upgrades three times.
That is easy. Make the tower be unable to attack... So into its attacks available slot select NONE. Now, you will need an autocastable ability which targets enemy units regardless to their status. Try using a SLOW, with no effects, buffs and so on, that targets all enemy units. NOW, change the icon to whatever you want, check the "Always Autocastable" and set the duration of the spell for both hero and unit to 0.01. Change mana cost to whatever and cooldown to 0.75.
Now, make another spell based on Chain Lightning (Neutral Hostile) and change its damage and number of targeted units to whatever you want. Change Mana Cost to 0. Now let's get to the units again. Make a dummy unit based on the footman. Make the unit have 0.00 collision size, as a model the none.mdl, Check the "Not Seen on the Minimap", or soemthing like that, set food cost to 0, set sight to 0, for both day and night, Change type of movement to Fly, and give it the Locust Ability. Search for it... Now, also give the unit hte Chain Lightning Spell you made. Let's get to the triggers...
Event - an unit starts the effect of an ability COnditions - Ability being cast equal to YourAbility [Slow spell you made] Actions - Create 1 Dummy unit at position of (Casting Unit) for owner of (Casting Unit) - Order (Last Created Unit) to Orc - Far Seer- Chain Lightning (Target Unit of Ability being Cast) - Wait 1 seconds - Remove (Last Created Unit)
That's all... For Multi-instance (because that's what you need), I'll do you a JASS script if this works for you.
Sorry... I didn't know about it so I practically told him how to do it. If he wants to do it himself, he can do it. If he wants it finished... You just solved his problem... And since I heard about this spell several times before... I'll just add it to most frequent...
OK i can make it so that the unit casts chain lightning but the hard part about it is that i need to have 3 different ones. for 3 different Levels of towers.
Another way to achieve something like this (though not perfectly) is to give it a custom "Orb of Lighting (new)" ability, where "Purge (Item 2)" is replaced by chain lightning.
What it does, is give the tower a % chance to cast Chain Lightning on attacking.