• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How do I make this kind of ability with the use of triggers?

Status
Not open for further replies.

Gojira2000

G

Gojira2000

Ok I need to make an ability, lets say finger of death heal its castor half the damage it does, can this be done?

Help will be greatly appreciated.
 
Level 12
Joined
Oct 16, 2010
Messages
680
if the spell has fixed amount of damages depending on the lvl
then:

  • Events
    • Unit - Unit starts the effect of an ability
  • Conditions
    • (ability being casted) equal 'your spell'
  • Actions
    • If level 'of your spell' equal 1 then do Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 'value' else (do nothing)
    • If level 'of your spell' equal 2 then do Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 'value') else (do nothing)
    • If level 'of your spell' equal 3 then do Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 'value') else (do nothing)
if the damage is triggered damage ( not a fix amount )

then you need a Damage Engine for detecting the amount
 
Level 9
Joined
Jul 10, 2011
Messages
562
you need a damage detection even if it has fixed amount of damage because if the target has less HP left than damage would be dealt the caster would be healed more than the amount it should be healed.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
^ this guy was right. U must calculate how much the damage doneto the target to heal the caster. But if the damage is pure (mean it goes through everything), I can help u to do this spell without a damage engine.
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
you need a damage detection even if it has fixed amount of damage because if the target has less HP left than damage would be dealt the caster would be healed more than the amount it should be healed.

Not only in this specific case would you leech more life, than you should, but considering resistances, you would do very frequently (except of course you would use pure damage ^). To avoid this, a damage detection system is not necessary. You would only need to store the individual resistances of every unit in your map. Also, if you don't modify any resistances, while the map is running, you can instead store the resistances of every unit type that appears in your map. Given, you don't use a whole lot of different unit types, this could be easier.
 
Level 4
Joined
Aug 22, 2008
Messages
100
Couldnt you do something like this? (This trigger is probably not leak free or MUI but I just meant the life before/after concept) If you set a small casting time at like 0.04 or 0.1 or something. Im just speculating.
  • Finger of Death
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Finger of Death (Archimonde)
    • Actions
      • Set Healthbefore = (Life of (Target unit of ability being cast))
      • Wait 0.10 seconds
      • Set HealthAfter = (Life of (Target unit of ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is alive) Equal to True
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Healthbefore - HealthAfter))
        • Else - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + Healthbefore)
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
"...half the damage it deals..."

Can I assume it ignores any resistance ?

If damage dealt is 500, then it should heal by 250.
By mean of "damage dealt", it is not damage received by the unit, but the damage in the tooltips.

If you cast a damage ability on a unit (let's say it deals 200 dmg) and this unit loses 150 hp as a result of the casting of the spell, wouldn't you say, the spell has dealt 150 damage? (at least that's what i would say, but ofc i may be wrong...)

A tooltip in most cases only depicts the most basic event to happen, when cast. For instance, if you look at standard w3 abilities like stormbolt, the tooltip says "stuns the target for 5 seconds", but if cast on a hero, it will last for 3 seconds. (i know, what he said, wasn't a tooltip, but i think the terminology should remain the same)
 
Status
Not open for further replies.
Top