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

[Trigger] Can you see any faults that allow for infinite duration transformation?

Level 4
Joined
Mar 9, 2023
Messages
37
Hi! I'm back after quite some time.
I could use help fixing a connection between the two triggers.

I discovered the bug yesterday, which allowed the hero to transform without the 2nd trigger activating, which resulted in no mana being drained. This is the attempted fix, where I moved the
  • Unit - For Unit (Triggering unit), start cooldown of ability (Ability being cast) " over "240.00 seconds.
in the Else action, to be used before the WarlockDrain is turned off. Will this fix the problem, or am I missing something else?



  • WarlockIncarnation
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to [Warlock/Warlock] Demonic Incarnation
          • (Ability being cast) Equal to [Warlock/Varimathras] Demonic Incarnation
          • (Ability being cast) Equal to [Warlock/Eredar] Demonic Incarnation
          • (Ability being cast) Equal to [Warlock/Wrathguard] Demonic Incarnation
          • (Ability being cast) Equal to [Warlock/Hin Onde] Demonic Incarnation
          • (Ability being cast) Equal to [Warlock/Jaina] Demonic Incarnation
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Warlock
              • (Unit-type of (Triggering unit)) Equal to Warlock (Eredar)
              • (Unit-type of (Triggering unit)) Equal to Warlock (Varimathras)
              • (Unit-type of (Triggering unit)) Equal to Warlock (Wrathguard)
              • (Unit-type of (Triggering unit)) Equal to Warlock (Hin Onde)
              • (Unit-type of (Triggering unit)) Equal to Warlock (Dreadlord Jaina)
        • Then - Actions
          • Trigger - Turn on WarlockDrain <gen>
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Desecrate_JFI.mdx
          • Set VariableSet DDE_Delay = 1.90
          • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
          • Animation - Play (Triggering unit)'s spell channel animation
          • Wait 1.90 game-time seconds
          • Sound - Destroy (Last played sound)
          • Sound - Play Sound[(Random integer number between 885 and 888)] at 100.00% volume, skipping the first 0.00 seconds
          • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 40.00%, 40.00%) with 0.00% transparency
          • Special Effect - Create a special effect attached to the right hand of (Triggering unit) using Affliction040.mdx
          • Set VariableSet WarlockHand1 = (Last created special effect)
          • Special Effect - Create a special effect attached to the left hand of (Triggering unit) using Affliction040.mdx
          • Set VariableSet WarlockHand2 = (Last created special effect)
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using CursedSTR097.mdx
          • Set VariableSet WarlockHand3 = (Last created special effect)
        • Else - Actions
          • -------- Connected to 2nd Trigger --------
          • Set VariableSet WarlockMana = 0
          • Animation - Play (Triggering unit)'s spell channel animation
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Desecrate_JFI.mdx
          • Set VariableSet DDE_Delay = 1.90
          • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
          • Special Effect - Destroy WarlockHand1
          • Special Effect - Destroy WarlockHand2
          • Special Effect - Destroy WarlockHand3
          • Unit - For Unit (Triggering unit), start cooldown of ability (Ability being cast) " over "240.00 seconds.
          • Trigger - Turn off WarlockDrain <gen>
          • -------- Ability channel -> reset unit form --------
          • Wait 1.90 game-time seconds
          • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
And
  • WarlockDrain
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet DemonCheck = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Warlock (Demon Form)))
      • Unit Group - Pick every unit in DemonCheck and do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads (- + (String(WarlockMana))) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 25.00%, 25.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - (Real(WarlockMana)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Less than or equal to 5.00
            • Then - Actions
              • Unit - Order (Picked unit) to Night Elf Demon Hunter - Metamorphosis.
              • Animation - Play (Picked unit)'s spell channel animation
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Desecrate_JFI.mdx
              • Set VariableSet DDE_Delay = 1.90
              • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
              • Set VariableSet WarlockMana = 0
              • Special Effect - Destroy WarlockHand1
              • Special Effect - Destroy WarlockHand2
              • Special Effect - Destroy WarlockHand3
              • -------- Cooldowns / end --------
              • Unit - For Unit (Picked unit), start cooldown of ability [Warlock/Varimathras] Demonic Incarnation " over "240.00 seconds.
              • Unit - For Unit (Picked unit), start cooldown of ability [Warlock/Eredar] Demonic Incarnation " over "240.00 seconds.
              • Unit - For Unit (Picked unit), start cooldown of ability [Warlock/Warlock] Demonic Incarnation " over "240.00 seconds.
              • Unit - For Unit (Picked unit), start cooldown of ability [Warlock/Wrathguard] Demonic Incarnation " over "240.00 seconds.
              • Unit - For Unit (Picked unit), start cooldown of ability [Warlock/Hin Onde] Demonic Incarnation " over "240.00 seconds.
              • Unit - For Unit (Picked unit), start cooldown of ability [Warlock/Jaina] Demonic Incarnation " over "240.00 seconds.
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • -------- Still active --------
              • Custom script: set udg_WarlockMana = udg_WarlockMana + 1
      • Custom script: call DestroyGroup(udg_DemonCheck)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
What exactly are you trying to accomplish? As far as I can tell, the whole thing will break if you cancel the channeling early - assuming that you can even cancel it.

Also, setting this every 1.00 second seems unnecessary:
  • Set VariableSet DemonCheck = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Warlock (Demon Form)))
Can't you track the Warlock in a Unit variable? And if there's multiple Warlocks then these triggers will definitely break.

If you attach a demo map and explain exactly what you want to happen then I could probably fix it up for you. I'd need to tinker with it a bit first.
 
Level 19
Joined
Feb 27, 2019
Messages
590
I think the main issue is that the unit is ordered to cast metamorphosis but for whatever reason is unable to do. So how to end the metamorphosis without issuing an order?

First you may test it. Give the casting unit 0 mana regen. Have exactly the amount of mana to cast. Change the periodic event to 0.01 seconds. (For testing purposes) This would show if its unable to cast metamorphosis because its already casting an ability.

Second. Give the casting unit a bit more mana, say 150, then when it has cast the ability order a mountain king with 100% seconds bash stun to attack it so its stunned when the mana runs out. This would show if stuns can interfere with the order.
 
Last edited:
Level 4
Joined
Mar 9, 2023
Messages
37
I think the main issue is that the unit is ordered to cast metamorphosis but for whatever reason is unable to do. So how to end the metamorphosis without issuing an order?
That's likely it. Is the question rhetorical? :p

What exactly are you trying to accomplish? As far as I can tell, the whole thing will break if you cancel the channeling early - assuming that you can even cancel it.

Also, setting this every 1.00 second seems unnecessary:
  • Set VariableSet DemonCheck = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Warlock (Demon Form)))
Can't you track the Warlock in a Unit variable? And if there's multiple Warlocks then these triggers will definitely break.

If you attach a demo map and explain exactly what you want to happen then I could probably fix it up for you. I'd need to tinker with it a bit first.
The character SHOULD be locked into the channel, but I suppose it could be cancelled by other sources. A unit variable seems like a good idea, but there's only 1 Warlock in the map, so that's not a concern. But you're right, it's better not to constantly set the variable. I'll make a demo map if I have the time for it, it's very appreciated ofc.
 
Level 19
Joined
Feb 27, 2019
Messages
590
That's likely it. Is the question rhetorical? :p
It was an attempt to ask others for a solution. (Untested) The possible solutions I had in mind was to add/remove the Chaos ability instead of using the metamorphosis ability or remove/add the metamorphosis ability to the unit when it ends instead of issuing the order.

1. The event begins channeling an ability occurs before the ability has finished its effect. Why not use the event a unit starts the effect of an ability which triggers when the ability has finished its effect?

2. Since in the if then else condition there are 6 unit-types and it seems to be only 1 demon unit-type wouldnt it be better to use: Unit-type of (Triggering unit) NOT equal to Warlock (Demon form)? That way only one condition needs to be checked. Also since there can only be one warlock can not the specific ability be set to a variable such as (Ability being cast) equal to WarlockAbility? Over course: Instead of having any unit event add a specific unit event via actions to the trigger when the Warlock unit is chosen/created.

Additional suggestions: Have a seperate trigger for the Warlock (Demon form) begins casting an ability to stop it. If the starts the effect of an ability interferes with starting cooldown action learn about the frame tic trick by starting a timer at 0.00 seconds and finishing the actions after the timer has expired.
 
Last edited:
Top