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

[Trigger] Making an absorb system

Status
Not open for further replies.
Level 30
Joined
Jul 23, 2009
Messages
1,029
I need help making an absorb system and Im not familliar at all with jass

I want to make a spell that blocks up to a certain amount of damage from the next damage source

I use the Gdd gui friendly damage detection system (think thats the name) and I belive its possible to use this for the system I want.

Any help is appreciated and reputation shall be given!
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
A damage detection system (like most events) actually fires before the damage occurs, so you just want to increase the unit's max HP by how much damage they will take, heal them that much, wait until the damage actually happens (a 0 second timer does this best), then reduce their max HP.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
A damage detection system (like most events) actually fires before the damage occurs...

That's not true, actually an attack event fires before damage occurs, but DD on the other hand fires 'when' damage occurs...

The problem with DD systems is that it will damage you first before the event takes place, say if you have 10HP left, and
you already have a damage blockade, then your unit will die in that manner...

Imo, it's better to blockade the damage dealt with a timer (set your life at constant) or on every attack (although it's abusable in many cases)...
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
That's not true, actually an attack event fires before damage occurs, but DD on the other hand fires 'when' damage occurs...

The problem with DD systems is that it will damage you first before the event takes place, say if you have 10HP left, and
you already have a damage blockade, then your unit will die in that manner...

Imo, it's better to blockade the damage dealt with a timer (set your life at constant) or on every attack (although it's abusable in many cases)...
I'm not sure how to say this nicely, but: this is wrong, and please don't contradict people with much more experience than you modding wc3 without at least testing your claims first.

Here is a map which disproves your claim:
 

Attachments

  • Damage.w3m
    16.5 KB · Views: 46
Level 40
Joined
Dec 14, 2005
Messages
10,532
try to reduce the HP of your footman to less than the damage dealt, it will fire before the Laster code...
That's the point. Last (the action for the on-damaged event) fires before damage is dealt, but Laster (a 0-second timer later) fires after it's dealt, so you would add HP+maxHP in Last and remove it in Laster, an instantaneous amount of time in the eyes of the player but long enough to capture otherwise lethal damage.
 
Level 30
Joined
Jul 23, 2009
Messages
1,029
Thx for the replies but I still can't get this together :/

I want to make an ability that gives you a 100 hp shield for the next damage source only and then vanish. I have tried Bribe's Damage engine but I don't really know how to do because the amount isn't accurate and sometimes he even gets healed by the block somehow.

Edit: I remade the trigger and now it seems to work fine but somehow it feels wrong that it was this simple.
  • Block
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventTarget Equal to (==) Archmage 0006 <gen>
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventPrevAmt Less than (<) 100.00
        • Then - Actions
          • Set DamageEventAmount = 0.00
        • Else - Actions
          • Set DamageEventAmount = (DamageEventPrevAmt - 100.00)
Does it look okay? He sucessfully take no dmg if the damage dealt is less than or equal to 100
 
Last edited:
Status
Not open for further replies.
Top