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

how to make an heal ability that allows to heal yourself for 500 hp but others for 200

Status
Not open for further replies.
Level 11
Joined
Jul 17, 2013
Messages
544
I alreda have basic wc3 chain ability and i would like to change it. it should heal hero if he targets hisself for 500 hp. while healing hero for 500 hp no one else should be healed with chain ability. but if chain ability is being casted on allies and it reaches hero then he should be normally healed by 200 hp
 
Level 14
Joined
Feb 7, 2020
Messages
386
You will need to use triggers for this effect. A solution would be to create a dummy for both versions of the spell, then cast the appropriate dummy on the target based on whether it is self-targeted or ally-targeted.

The first version would heal for 500 and have a limit of 1 target; the 2nd version would bounce X times and heal for 200 (and with whatever other settings you want).

Determine via the trigger whether it is self-targeted or ally-targeted and cast the appropriate dummy spell.

There's a basic setup tutorial here if you don't know how they work Spells - Dummy Casters
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,509
Edit: Misread the post. I guess i'll leave this here anyway.

Another solution would be to make the heal exclude the caster from it's Targets Allowed and instead
trigger the heal upon casting the spell. The only issue here is that the caster will now ALWAYS be healed by the spell.

A unit starts the effect of an ability

Ability being cast equal to Chain Heal

Set life of casting unit equal to life of casting unit + 500.00
 
Last edited:
If you are on Warcraft 3 V1.31+, then you can alter the abilities data for the unit only. a good place for actives is inside the event starts the effect of an ability which happens right before the ability does it work.
in condition check for the casted ability.
Then in actions have an if one case is the selfcasting the other the other unit casting.
An example
  • Unit SpellEffect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing wave
    • Actions
      • Set Index = ((Level of (Ability being cast) for (Triggering unit)) - 1)
      • Set Ability = (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to (Target unit of ability being cast)
        • Then - Actions
          • Ability - Set Ability: Ability's Real Level Field: Damage per Target ('Ocl1') of Level: Index to 500.00
          • Ability - Set Ability: Ability's Integer Level Field: Number of Targets Hit ('Ocl2') of Level: Index to 1
        • Else - Actions
          • Ability - Set Ability: Ability's Real Level Field: Damage per Target ('Ocl1') of Level: Index to 200.00
          • Ability - Set Ability: Ability's Integer Level Field: Number of Targets Hit ('Ocl2') of Level: Index to 3
This trigger changes the healing to 500 and targets to 1 when the target is the caster otherwise it changes the healing to 200 with 3 targets.
 
Last edited:
Level 11
Joined
Jul 17, 2013
Messages
544
If you are on Warcraft 3 V1.31+, then you can alter the abilities data for the unit only. a good place for actives is inside the event starts the effect of an ability which happens right before the ability does it work.
in condition check for the casted ability.
Then in actions have an if one case is the selfcasting the other the other unit casting.
An example
  • Unit SpellEffect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing wave
    • Actions
      • Set Index = ((Level of (Ability being cast) for (Triggering unit)) - 1)
      • Set Ability = (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to (Target unit of ability being cast)
        • Then - Actions
          • Ability - Set Ability: Ability's Real Level Field: Damage per Target ('Ocl1') of Level: Index to 500.00
          • Ability - Set Ability: Ability's Integer Level Field: Number of Targets Hit ('Ocl2') of Level: Index to 1
        • Else - Actions
          • Ability - Set Ability: Ability's Real Level Field: Damage per Target ('Ocl1') of Level: Index to 200.00
          • Ability - Set Ability: Ability's Integer Level Field: Number of Targets Hit ('Ocl2') of Level: Index to 3
This trigger changes the healing to 500 and targets to 1 when the target is the caster otherwise it changes the healing to 200 with 3 targets.
i did it but it will never work :(
upload_2020-4-11_23-1-6.png
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,509
Begins casting an ability is the event you want to use.

And you want to use Level: 0 instead of Level: 1. Or use the Index variable that Tasyen suggested.

There's a reason for everything he did in his trigger, so why would you expect it to work if you didn't copy it exactly? Compare your two triggers and you can clearly see yours is missing a bunch of stuff.
 
Level 11
Joined
Jul 17, 2013
Messages
544
Begins casting an ability is the event you want to use.

And you want to use Level: 0 instead of Level: 1. Or use the Index variable that Tasyen suggested.

There's a reason for everything he did in his trigger, so why would you expect it to work if you didn't copy it exactly? Compare your two triggers and you can clearly see yours is missing a bunch of stuff.
but i dont understant why lvl 0 for lvl 1? in editor lvl 0 means lvl 1 in game???????


also if targeted self then i want amount of hp to be healed by 200/300/400 on lvl 1/2/3 and if not targeted self then 500/600/700 on lvl 1/2/3 any idea how ican do it easily without using if then else x1000000000 times
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,509
The indexes for these "new" functions start at 0. So 0 = level 1, 1 = level 2, 2 = level 3, etc...

I understand that it's confusing, Blizzard made a big mistake by changing the indexes to start at 0 for these functions in GUI.

And for the heal amount, some arithmetic should do the trick:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Archmage Equal to (Target unit of ability being cast)
      • Then - Actions
        • Set VariableSet HealAmount = (400.00 + (100.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Else - Actions
        • Set VariableSet HealAmount = (100.00 + (100.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
So the heal is equal to 400 + (100*level) or the heal is equal to 100 + (100*level). Another method for doing this is to have dedicated variables for these spells that you set at map initialization.

Like so:
  • Setup Heal Amount
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet HealingWave_Heal[1] = 200.00
      • Set VariableSet HealingWave_Heal[2] = 300.00
      • Set VariableSet HealingWave_Heal[3] = 400.00
      • -------- --------
      • Set VariableSet HealingWave_HealArch[1] = 400.00
      • Set VariableSet HealingWave_HealArch[2] = 500.00
      • Set VariableSet HealingWave_HealArch[3] = 600.00
Then you can reference these variables instead of using arithmetic:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Archmage Equal to (Target unit of ability being cast)
      • Then - Actions
        • Set VariableSet HealAmount = HealingWave_HealArch[(Level of (Ability being cast) for (Triggering unit))]
      • Else - Actions
        • Set VariableSet HealAmount = HealingWave_Heal[(Level of (Ability being cast) for (Triggering unit))]
So if the level of the ability is 2, it will reference HealingWave_Heal[2] or HealingWave_HealArch[2].
 
Last edited:
Level 11
Joined
Jul 17, 2013
Messages
544
The indexes for these "new" functions start at 0. So 0 = level 1, 1 = level 2, 2 = level 3, etc...

I understand that it's confusing, Blizzard made a big mistake by changing the indexes to start at 0 for these functions in GUI.

And for the heal amount, some arithmetic should do the trick:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Archmage Equal to (Target unit of ability being cast)
      • Then - Actions
        • Set VariableSet HealAmount = (400.00 + (100.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Else - Actions
        • Set VariableSet HealAmount = (100.00 + (100.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
So the heal is equal to 400 + (100*level) or the heal is equal to 100 + (100*level). Another method for doing this is to have dedicated variables for these spells that you set at map initialization.

Like so:
  • Setup Heal Amount
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet HealingWave_Heal[1] = 200.00
      • Set VariableSet HealingWave_Heal[2] = 300.00
      • Set VariableSet HealingWave_Heal[3] = 400.00
      • -------- --------
      • Set VariableSet HealingWave_HealArch[1] = 400.00
      • Set VariableSet HealingWave_HealArch[2] = 500.00
      • Set VariableSet HealingWave_HealArch[3] = 600.00
Then you can reference these variables instead of using arithmetic:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Archmage Equal to (Target unit of ability being cast)
      • Then - Actions
        • Set VariableSet HealAmount = HealingWave_HealArch[(Level of (Ability being cast) for (Triggering unit))]
      • Else - Actions
        • Set VariableSet HealAmount = HealingWave_Heal[(Level of (Ability being cast) for (Triggering unit))]
So if the level of the ability is 2, it will reference HealingWave_Heal[2] or HealingWave_HealArch[2].
If you are on Warcraft 3 V1.31+, then you can alter the abilities data for the unit only. a good place for actives is inside the event starts the effect of an ability which happens right before the ability does it work.
in condition check for the casted ability.
Then in actions have an if one case is the selfcasting the other the other unit casting.
An example
  • Unit SpellEffect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing wave
    • Actions
      • Set Index = ((Level of (Ability being cast) for (Triggering unit)) - 1)
      • Set Ability = (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to (Target unit of ability being cast)
        • Then - Actions
          • Ability - Set Ability: Ability's Real Level Field: Damage per Target ('Ocl1') of Level: Index to 500.00
          • Ability - Set Ability: Ability's Integer Level Field: Number of Targets Hit ('Ocl2') of Level: Index to 1
        • Else - Actions
          • Ability - Set Ability: Ability's Real Level Field: Damage per Target ('Ocl1') of Level: Index to 200.00
          • Ability - Set Ability: Ability's Integer Level Field: Number of Targets Hit ('Ocl2') of Level: Index to 3
This trigger changes the healing to 500 and targets to 1 when the target is the caster otherwise it changes the healing to 200 with 3 targets.
You will need to use triggers for this effect. A solution would be to create a dummy for both versions of the spell, then cast the appropriate dummy on the target based on whether it is self-targeted or ally-targeted.

The first version would heal for 500 and have a limit of 1 target; the 2nd version would bounce X times and heal for 200 (and with whatever other settings you want).

Determine via the trigger whether it is self-targeted or ally-targeted and cast the appropriate dummy spell.

There's a basic setup tutorial here if you don't know how they work Spells - Dummy Casters




















i thought of new idea for that spell. how can i also regen mana of all units that are targeted by chain heal? i mean all i would like is to heal also 10/20/30 mana of units that got healed touched by healing wave i tired to make action unit set mana of target unit of ability being cast to target unit of ability being cast +10 but only the main target of healing wave ability received mana and the other 2 that were touched by wave didnt
 
Level 4
Joined
Sep 2, 2016
Messages
48
The first version would heal for 500 and have a limit of 1 target; the 2nd version would bounce X times and heal for 200 (and with whatever other settings you want).
Give the hero 2nd version.
And if he targets himself, make dummy caster cast on him heal for 300HP.
No?
 
Status
Not open for further replies.
Top