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

Passively increase healing

Status
Not open for further replies.
Level 4
Joined
Jan 8, 2012
Messages
66
Okay so this is my first thread on here and just an FYI I'm a real noob when it comes to modding. I am trying to make a passive ability that increases the healing done by my hero by 5% for each level. (So, for example, every skill spent in the passive ability will further increase the healing done by my hero by 5%) Can I get any pointers as to how I'm supposed to trigger this? Thanks for the help!! :)
 
Level 11
Joined
Nov 15, 2007
Messages
781
I should just put this in my sig because I've been linking it all day: http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-201016/

I'm not 100% on how healing works - I think all healing dealt by GUI abilities (heal, holy light, healing wave, healing ward, anything) is just negative damage, but if not you'll have to trigger all of your healing to deal negative damage and then modify it using the damage engine.

Read the description of the damage engine and the comments in the thread for more info on how to use it.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
I really wouldn't suggest using negative damage for healing. Just use the trigger functions for setting life for the healing and use a real value that stores the heal modifier for the unit. If you want the spell to work for more than one unit, you would need to use a global real array along with some kind of indexing system (You can easily find one if you search in the Spells section).

Also, Holy Light and Healing Wave don't deal negative damage so I assume all other healing spells don't as well.
 
I think all healing dealt by GUI abilities (heal, holy light, healing wave, healing ward, anything) is just negative damage, but if not you'll have to trigger all of your healing to deal negative damage and then modify it using the damage engine.
First off, those are object editor abilities. Second they don't do damage that is triggered or detectable (except if you do a unit life comparison)
But if you wanted a damage engine to detect damage healed then use negative damage.
 
Level 11
Joined
Nov 15, 2007
Messages
781
First off, those are object editor abilities

The object editor is part of the graphical user interface ;)

I assumed heal spells dealt negative damage because setting the value of a heal spell to a negative amount makes it deal more damage to ethereal units, but now I realize ethereal units receive more healing as well. Never noticed that value in gameplay constants before.

@watermelon, what is the downside to using negative damage for healing? I've been doing it so I don't need separate systems to detect healing and damage, and it'd be a PITA to redo all of it now if there's some problem.
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
The editor doesnt provide a clean way to do this, you have to do it yourself.

You basically have two options.
1. You use the standard heal abilities and modify them, then you have to write triggers that detect the casting of these abilities and adds some heal manually.
The problem here: you only can use the cast event, there is no event "heal received". Also you cant detect how much hp was healed, so you need to hardcode that.

2. You trigger all your heal and write a function that wraps all all heal calls. In that function you can either check the caster/target for heal improvement buffs or (and that is the clean way) you trigger a custom event.
Example in pseudocode:
JASS:
public function UnitHealTarget takes unit caster, unit target, real amount returns nothing
    // increase current hp of target by amount
    // trigger heal event
endfunction
JASS:
function SomeSpellAction takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = ...
    local real amount = 50.
    call UnitHealTarget(caster, target, amount)
endfunction
JASS:
local trigger t = CreateTrigger()
call TriggerRegisterHealEvent(t)
call TriggerAddAction(t, function() {
    // make sure this call wont trigger the event again
    UnitHealTarget(GetTriggerUnit(), GetHealedUnit(), GetUnitHealbonus(GetTriggerUnit())*GetHealedAmount())
    })
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
@watermelon, what is the downside to using negative damage for healing? I've been doing it so I don't need separate systems to detect healing and damage, and it'd be a PITA to redo all of it now if there's some problem.
The main thing is that negative damage would be affected by any kind of spell damage reduction, like the hero's natural spell reduction or the spell damage reduction ability itself. Even Berserk affects the healing done. Unless you want your healing to act like this, it's better to keep the healing separate from damage.
 
Level 11
Joined
Nov 15, 2007
Messages
781
The main thing is that negative damage would be affected by any kind of spell damage reduction, like the hero's natural spell reduction or the spell damage reduction ability itself. Even Berserk affects the healing done. Unless you want your healing to act like this, it's better to keep the healing separate from damage.

Oh, this isn't a problem for me because all of my spell damage and damage reduction effects are triggered on this particular map due to the amount of damage types required.
 
Status
Not open for further replies.
Top