• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Another day, another problem with P3in

Level 10
Joined
Dec 16, 2017
Messages
373
Hi guys, so here is a new thing of mine, i am trying to use immolation for mana drain of a hero, and while immolation is active, the hero receives base attack damage bonus, when he deactivates it, the damage goes off.

I am having 2 little issues with it now (there were 4, but i figured out 2 of them haha)
So, when the immolation is active and the hero levels the skill, when i deactivate it, it will take the damage back, based on what level of the ability is at that moment, not when it started to cast, so instead of getting -60 dmg, it get's -300 dmg (like maxim level of abbility) and another one would be, if the unit runs out of mana and his immolation deactivates itself, it won't trigger the deactivate with -dmg

  • Iron Forged Job 4
    • Events
      • Game - Button for ability Iron Forged Merchant Job 4 and order Night Elf Demon Hunter - Activate Immolation pressed.
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to |c00FFD700[Mechanic] - |c00FF00FF[Job 4]|r
      • (Ability Cooldown Remaining of (Triggering unit) for ability Iron Forged Merchant Job 4..) Equal to 0.00
      • (Mana of (Triggering unit)) Greater than or equal to (Real((For (Triggering unit), Mana cost of Iron Forged Merchant Job 4, Level (Level of Iron Forged Merchant Job 4 for (Triggering unit)).)))
    • Actions
      • Unit - Set Base Damage of (Triggering unit) to ((Base Damage of (Triggering unit) for weapon index 0) + (60 x (Level of Iron Forged Merchant Job 4 for (Triggering unit)))) for weapon index: 0
  • Iron Forged Job 4 Deactivate
    • Events
      • Game - Button for ability Iron Forged Merchant Job 4 and order Night Elf Demon Hunter - Deactivate Immolation pressed.
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to |c00FFD700[Mechanic] - |c00FF00FF[Job 4]|r
    • Actions
      • Unit - Set Base Damage of (Triggering unit) to ((Base Damage of (Triggering unit) for weapon index 0) - (60 x (Level of Iron Forged Merchant Job 4 for (Triggering unit)))) for weapon index: 0
 
Level 26
Joined
Sep 26, 2009
Messages
2,418
As you have probably figured out, the "Game - Ability Button Pressed" event fires when you click the button even if for example you don't have mana to active the spell.
For skills like Defend, Mana Shield or Immolation, you should use
  • Events
    • Unit - A unit Is issued an order with no target
  • Conditions
    • (Issued order) Equal to (Order(immolation)) //or 'unimmolation' to detect deactivation
As this event fires when the spell is actually off cooldown and unit has enough mana to cast it.

Issue #1:
In your "Iron Forged Job 4" trigger calculate the bonus damage and store it in a variable. In "Iron Forged Job 4 Deactivate" decrease damage by the amount in the variable.
The complexity of this solution may increase if the skill may be used by multiple units at the same time.

Issue #2:
As far as I know, there isn't a convenient way to detect when Immolation stops because caster ran out of mana.
Instead you will need to periodically check the caster's status. Either:
  • check caster's remaining mana... this may not be best solution due to mana regeneration
  • check if caster has the 'Immolation' buff on itself. This is the buff that by default shows the fiery effect around the caster. When immolation has been deactivated by any means, the caster will lose this buff.

Or, since you will need a periodic trigger anyway, you may as well have the spell itself drain no mana and instead you would trigger the mana drain in trigger. The advantage is that you have control on when the spell turns off by default. On the other hand the trigger will be larger than just a check for buff on a unit.
 
Top