• 🏆 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!

Detect Metamorphosis End?

Status
Not open for further replies.
Level 21
Joined
Dec 4, 2007
Messages
1,478
Metamorphosis has a specific buff you can check for periodically with timers, like Abovegame mentioned.
 
Level 8
Joined
Jul 29, 2010
Messages
319
Metamorphosis has a specific buff you can check for periodically with timers, like Abovegame mentioned.
I have a hero who is using metamorphosis to transform into his alternate the way it's meant to be used, however, his alternate is a mount so I have no duration set for metamorphosis, the amount of time spent on his mount is unlimited, and for some reason when it's like this it doesn't apply the metamorphosis buff, so I've got a trigger that adds a buff manually, the point of the buff is to give the hero a 15% chance to miss an attack (since he's on horseback) and I want to be able to detect when the metamorphosis ends so that I can remove the buff so that he only has that 15% chance to miss, while he is using his mount.
 
Level 8
Joined
Jan 28, 2016
Messages
486
If you've set the Duration - Hero to zero (Duration - Unit actually determines the transformation time), then you can use a trigger to detect when a unit casts or orders Metamorphosis and remove the specific buff by checking which unit type is at the time of casting.
 
Level 8
Joined
Jul 29, 2010
Messages
319
If you've set the Duration - Hero to zero (Duration - Unit actually determines the transformation time), then you can use a trigger to detect when a unit casts or orders Metamorphosis and remove the specific buff by checking which unit type is at the time of casting.
Of Course, why didn't I think of that! :D thanks man
  • Mount
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mount
    • Actions
      • Unit - Create 1 Dummy Unit for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Curse (Dummy) to (Last created unit)
      • Unit - Add a 1.00 second Water Elemental expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Undead Banshee - Curse (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Paladin(Mount)
        • Then - Actions
          • Unit - Remove Mounted buff from (Triggering unit)
        • Else - Actions
 
Level 8
Joined
Jan 28, 2016
Messages
486
You could do something like this to make it more accurate:
  • Mount
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(metamorphosis))
      • (Level of Mount for (Triggering unit)) Greater than 0
    • Actions
      • Set Caster = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Caster) Equal to Paladin
        • Then - Actions
          • Set TempLocation = (Position of Caster)
          • Unit - Create 1 Dummy for (Owner of Caster) at TempLocation facing Default building facing degrees
          • Set TempUnit = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to TempUnit
          • Unit - Add Curse to TempUnit
          • Unit - Order TempUnit to Undead Banshee - Curse Caster
          • Custom script: call RemoveLocation( udg_TempLocation )
        • Else - Actions
          • Unit - Remove Mounted buff from Caster
 
Level 8
Joined
Jul 29, 2010
Messages
319
You could do something like this to make it more accurate:
  • Mount
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(metamorphosis))
      • (Level of Mount for (Triggering unit)) Greater than 0
    • Actions
      • Set Caster = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Caster) Equal to Paladin
        • Then - Actions
          • Set TempLocation = (Position of Caster)
          • Unit - Create 1 Dummy for (Owner of Caster) at TempLocation facing Default building facing degrees
          • Set TempUnit = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to TempUnit
          • Unit - Add Curse to TempUnit
          • Unit - Order TempUnit to Undead Banshee - Curse Caster
          • Custom script: call RemoveLocation( udg_TempLocation )
        • Else - Actions
          • Unit - Remove Mounted buff from Caster
Thanks :)
 
Level 18
Joined
Nov 21, 2012
Messages
835
metamorphoss is casted twice: normal form-->alternate and vice versa
all you have to do is check for unit type, no dummy needed
  • me
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Hunter
        • Then - Actions
          • Game - Display to (All players) the text: morph to alternate
        • Else - Actions
          • Game - Display to (All players) the text: morph to normal
 
Level 8
Joined
Jul 29, 2010
Messages
319
metamorphoss is casted twice: normal form-->alternate and vice versa
all you have to do is check for unit type, no dummy needed
  • me
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Hunter
        • Then - Actions
          • Game - Display to (All players) the text: morph to alternate
        • Else - Actions
          • Game - Display to (All players) the text: morph to normal
Thanks but the dummy unit serves a purpose, it is there to apply a custom version of curse
 
Status
Not open for further replies.
Top