• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Morphing ability removes unit's original damage and other triggers.

Status
Not open for further replies.
Level 4
Joined
Jan 1, 2008
Messages
99
The unit, aka Twilight has an ability called 'Faithless'.

Faithless increases Strength by 9 and Intelligence by 6 per level.
It has 5 ranks.

It works perfect for the normal unit.



Twilights also have this ability called Metamorphisis. We all know what Metamorphisis transforms a unit into a Demon unit.

Metamorphisis removes Faithless.


This is Faithless's trigger.

Faithless
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Faithless
Actions
Set Temp_Integer_1 = (Level of Faithless for (Triggering unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Integer_1 Equal to 1
Then - Actions
Unit - Add Faithless 1 to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Integer_1 Equal to 2
Then - Actions
Unit - Remove Faithless 1 from (Triggering unit)
Unit - Add Faithless 2 to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Integer_1 Equal to 3
Then - Actions
Unit - Remove Faithless 2 from (Triggering unit)
Unit - Add Faithless 3 to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Integer_1 Equal to 4
Then - Actions
Unit - Remove Faithless 3 from (Triggering unit)
Unit - Add Faithless 4 to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Integer_1 Equal to 5
Then - Actions
Unit - Remove Faithless 4 from (Triggering unit)
Unit - Add Faithless 5 to (Triggering unit)
Else - Actions

How do I make it so that Meta still keeps Faithless?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Save the level of Faithless to a variable, and then give the morped unit the ability.

I'll take Illidan and his morphing ability as an example. If I give him an ability with a trigger, he loses it when he morphs. But if you do this:

  • Untitled Trigger 045
    • Events
    • Conditions
    • Actions
      • Unit - Add Acid Bomb to Illidan 0101 <gen>
      • Unit - Set level of Acid Bomb for Illidan 0101 <gen> to 2
      • Set Temp_Integer_4 = (Level of Acid Bomb for Illidan 0101 <gen>)

  • Untitled Trigger 046
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer_4 Greater than 0
        • Then - Actions
          • Unit - Add Acid Bomb to (Triggering unit)
          • Unit - Set level of Acid Bomb for (Triggering unit) to Temp_Integer_4
        • Else - Actions
The morphed for will have the same ability at the same level. The wait is very important here, if it is too short, then the unit will not get the ability.

Just make sure "Temp_Integer_4" is a variable that will not get overwritten. Perhaps you could save the level into hashtable.
 
Last edited:
Level 4
Joined
Jan 1, 2008
Messages
99
Save the level of Faithless to a variable, and then give the morped unit the ability.

I'll take Illidan and his morphing ability as an example. If I give him an ability with a trigger, he loses it when he morphs. But if you do this:

  • Untitled Trigger 045
    • Events
    • Conditions
    • Actions
      • Unit - Add Acid Bomb to Illidan 0101 <gen>
      • Unit - Set level of Acid Bomb for Illidan 0101 <gen> to 2
      • Set Temp_Integer_4 = (Level of Acid Bomb for Illidan 0101 <gen>)

  • Untitled Trigger 046
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer_4 Greater than 0
        • Then - Actions
          • Unit - Add Acid Bomb to (Triggering unit)
          • Unit - Set level of Acid Bomb for Illidan 0101 <gen> to Temp_Integer_4
        • Else - Actions
The morphed for will have the same ability at the same level. The wait is very important here, if it is too short, then the unit will not get the ability.

Just make sure "Temp_Integer_4" is a variable that will not get overwritten. Perhaps you could save the level into hashtable.

Another bump in the road is that, when metamorphisis is over, Faithless is removed from the original unit as well. Does this fix that?
 
Status
Not open for further replies.
Top