No I got it perfect, so there!
This is prolly massively inefficient, so please help out if possible.
Make 5 triggers, all integers:
- HeroLevel
- HeroExperience
- HeroStrength
- HeroAgility
- HeroIntelligence
Make the first trigger as follows:
Code:
Event
Unit - A unit owned by Player 1 (Red) Begins channeling an ability
Conditions - none
Actions
Set HeroLevel = (Hero level of (Casting unit))
Set HeroExperience = (Hero experience of (Casting unit))
Set HeroStrength = (Strength of (Casting unit) (Exclude bonuses))
Set HeroAgility = (Agility of (Casting unit) (Exclude bonuses))
Set HeroIntelligence = (Intelligence of (Casting unit) (Exclude bonuses))
Now make another trigger for each person you want to chanage to, one in this example.
Code:
Events
Unit - A unit owned by Player 1 (Red) Begins channeling an ability
Conditions
(Ability being cast) Equal to <your ability>
Action
Unit - Replace (Casting unit) with a <unit two> using The old unit's relative life and mana
Hero - Set (Last replaced unit) Hero-level to HeroLevel, Hide level-up graphics
Hero - Set (Last replaced unit) experience to HeroExperience, Hide level-up graphics
Hero - Set Strength of(Last replaced unit) to HeroStrength, (Permanent or Temporary:Permanent)
Hero - Set Agility of(Last replaced unit) to HeroAgility, (Permanent or Temporary:Permanent)
Hero - Set Intelligence of(Last replaced unit) to HeroIntelligence, (Permanent or Temporary:Permanent)
Now attach <your ability> to the starting unit. Click it and you should change to the next unit.
You can also do items by adding:
Code:
Action
Set HeroItem1 = (Item-type of (Item carried by (Casting unit) in slot 1))
To the first trigger, with HeroItem1 being an item-type variable.
To make it so that both units damage and health and et cetera are the same, make both units stats the same, including: Strength/Agility/Intelligence per Level, hit point base/regen, mana base/regen, et cetera.
Of course I know that this can be improved so expert coders please improve.