- Joined
- Jul 29, 2010
- Messages
- 319
How can you detect when Metamorphosis ends?
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.Metamorphosis has a specific buff you can check for periodically with timers, like Abovegame mentioned.
It's Metamorphosis, when you set duration to 0 it doesn't apply the metamorphosis buffIs this metamorphosis or bear form ?
Of Course, why didn't I think of that! thanks manIf 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.
ThanksYou 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 but the dummy unit serves a purpose, it is there to apply a custom version of cursemetamorphoss 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