• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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,240
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?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
That trigger works for evil Illidan at least. You can use his metamorphosis ability, and he won't lose the ability when morphing/unmorphing.

But it depends on how your metamorphosis is done. Is it based on an existing skill or is it triggered? Does the morphing unit get replaced with "unit - replace"?
 
Status
Not open for further replies.
Top