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

Mana Wave

Level 3
Joined
Nov 23, 2023
Messages
14
I want to make the healing wave to recharge mana instead of hit points. How can I do that? I am using version 1.29.2
 
Level 39
Joined
Feb 27, 2007
Messages
5,019
This is actually easiest if you base the spell on Chain Lightning instead of Healing Wave (you will have to change the visuals to match). Since there is no "a unit is healed" event, but there is a "unit is damaged" event. Unfortunately for you, that event is a real pain in the ass to work with in 1.29. Fortunately for you, Bribe has maintained a pre-"any unit takes damage" fork of DamageEngine for users like you to benefit from, which you can find here. The alternative to this is to trigger the entirety of the chaining and the effects yourself, which is quite annoying.

The catch is still that it's hard to know what ability/effect from the source caused the damage, rather than just which unit was damaged. So to get around this you'll make a dummy unit cast the damaging chain lightning effect, since if a unit is damaged by a dummy with that ability we know it must have been damaged by that ability. You then make the 'real' healing wave ability into an ability that does nothing (usually base this on Channel but there are other options if you're thorough about removing everything the ability could do), and dummy cast a chain lightning with a dummy unit instead, look for units damaged by that chain lightning, prevent the damage, and restore mana.
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to USELESS_ABILITY_THAT_DOES_NOTHING
  • Actions
    • Set TempPoint = (Position of (Triggering Unit))
    • Unit - Create 1 DUMMY_UNIT for (Triggering Player) at TempPoint facing Default building facing degrees
    • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
    • Unit - Add DUMMY_CHAIN_LIGHTNING_ABILITY to (Last created unit)
    • Unit - Set level of DUMMY_CHAIN_LIGHTNING_ABILITY for (Last created unit) to (Level of USELESS_ABILITY_THAT_DOES_NOTHING for (Triggering Unit))
    • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
    • Custom script: call RemoveLocation(udg_TempPoint) //match your point variable name here but keep the udg_ prefix

  • Events
    • DamageModifierEvent becomes Equal to 1.00 //This the real variable value event and is being used because DamageEngine sets this to 1.00 when damage can be modified (we need to prevent the CL damage)
  • Conditions
    • ((Level of DUMMY_CHAIN_LIGHTNING_ABILITY) for DamageEventSource) greater than 0
  • Actions
    • Set DamageEventAmount = 0.00
    • Unit - Set current Mana of DamageEventTarget to ((Current mana of DamageEventTarget) + RESTORE_AMOUNT)
    • -------- for your reference the line above uses the actions Unit - Set Property and Unit - Property, which are not obvious based on the names --------
    • -------- If you want the mana restore to scale in some way with spell cast level or target or something, you'll have to account for that here --------
 
Top