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

Creation of a passive skill

Status
Not open for further replies.

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
Hi!

I need help with the creation of a passive skill that works exactly opposite of Ursa Warriors (DotA) Fury Swipes. (each successive attack does +25 more damage)
I want every successive attack from each specific unit to deal, say, 7 less damage for each attack. How would you recommend I do this? It is very important that this does not count for all units. I'll clarify with an example.

"Monster A" attacks the caster 1 time dealing normal damage.
"Monster A" attacks the caster 1 time again, dealing normal damage minus 7.
"Monster B" attacks the caster 1 time, dealing normal damage.
"Monster A" attacks the caster 1 time, dealing normal damage minus 14.

I thought that this could be a debuff/effect, but didn't understand how I could make it stack. Also, this effect shall not last longer than 4 seconds max.

I started out with an "Unit - A unit Is attacked"-event, and followed up with this condition; (((Attacked unit) is A Hero) Equal to True) and ((Unit-type of (Attacked unit)) Equal to Ooze)

I couldn't find any action that suited what I was looking for, while still maintaining it unique for every attacker.

Any help appreciated.
- Esa
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
  • Untitled Trigger 052
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set u1 = (Attacking unit)
      • Custom script: set udg_i1 = GetHandleId(udg_u1)
      • Custom script: set udg_i2 = LoadInteger( udg_Hash , udg_i1 , StringHash("hits") )
      • Custom script: set udg_u2 = LoadUnitHandle( udg_Hash , udg_i1 , StringHash("target") )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • u2 Equal to (Triggering unit)
        • Then - Actions
          • Set i2 = (i2 + 1)
          • Custom script: call SaveInteger( udg_Hash , udg_i1 , StringHash("hits") , udg_i2 + 1 )
        • Else - Actions
          • Set i2 = 1
          • Custom script: call SaveUnitHandle( udg_Hash , udg_i1 , StringHash("target") , GetTriggerUnit() )
      • Custom script: call SaveInteger( udg_Hash , udg_i1 , StringHash("hits") , udg_i2 )
      • Game - Display to Player Group - Player 1 (Red) the text: (Hits: + (String(i2)))
Add conditions and something that applies the buff.
 
Level 12
Joined
Nov 20, 2007
Messages
660
  • melee initialization
    • events
      • map initialization
    • conditions
    • actions
      • hashtable - create a hashtable
      • set hash = (last created hashtable)
  • untitled trigger 052
    • events
      • unit - a unit is attacked
    • conditions
    • actions
      • set u1 = (attacking unit)
      • custom script: Set udg_i1 = gethandleid(udg_u1)
      • custom script: Set udg_i2 = loadinteger( udg_hash , udg_i1 , stringhash("hits") )
      • custom script: Set udg_u2 = loadunithandle( udg_hash , udg_i1 , stringhash("target") )
      • if (all conditions are true) then do (then actions) else do (else actions)
        • if - conditions
          • u2 equal to (triggering unit)
        • then - actions
          • set i2 = (i2 + 1)
          • custom script: Call saveinteger( udg_hash , udg_i1 , stringhash("hits") , udg_i2 + 1 )
        • else - actions
          • set i2 = 1
          • custom script: Call saveunithandle( udg_hash , udg_i1 , stringhash("target") , gettriggerunit() )
      • custom script: Call saveinteger( udg_hash , udg_i1 , stringhash("hits") , udg_i2 )
      • game - display to player group - player 1 (red) the text: (hits: + (string(i2)))
add conditions and something that applies the buff.

no triggers needed
 

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
No, this is not activated on chance, and it doesn't reduce the attack damage of the hero. It's supposed to reduce incoming attack damage by 7, uniquely for every attacking unit. It's a passive ability that stays on all the time.
 

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
Hm, if I do that, won't the additional levels show up? I mean, the damage reduction should stack indefinitely, but I don't want an indefinite amount of levels on the ability to show up for the hero that has the skill. I can't alter the skill level and how it works in triggers either. :p

meh, maybe I should just go back to creating music, that's easier than this `-´
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Grow up people...

Needs an attack damage detection system with a 0 timer to undo dealt damage as well as a minor system to keep track of hits and the expiry of the damage reduction.

Applying a negative fierlord buff to the affected units to give the reduction is logcally out the question due to it conflicting with multiple other attack effects which could seriously bug units (for example, a really strong fire arrow spell key to an attacker's sucess would have to be rendered unusable).

This is only really a problem if made as an aura as you can not destroy events properly. As a passive it should not be too hard.
 
Status
Not open for further replies.
Top