• 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.

[Spell] Item - procentual damage per hit

Status
Not open for further replies.
Level 13
Joined
Sep 11, 2013
Messages
475
Greetings folks!
How can i made an item which give 1% damage of their enemy max life to any unit per each attack + (normal attack)| except to some specific units?

Exemple: Unit 1 attack Unit 2
Unit 1 has 5 damage and item(1% per hit as damage )
Unit 2 has 100 hp

Unit 1 first attack damage = 1% from 100 = 1 + 5 damage = 6 damage => 94 hp
Unit 1 second attack damage = 1% from 100 = 1 + 5 damage = 6 damage => 88 hp
 
Last edited:
So what you want to make is an item that will restore hp to nearby allied units depending on the damage dealt by your hero right? Then use Vampiric Aura. Ok, sorry, I misunderstood your message so you want an item that act like the basic attack of Malthael from Hots. Hmm you will need to use a damage system
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
As Dracula said an approach using a damage detection system is necessary. This is the best I can recommend: Damage Engine 5.9.0.0.

Create the item that should do this. Give it one passive item ability (Like "Item Attack Bonus +1") but change all of that ability's relevant fields to be 0 so the ability doesn't do anything. This is your flag ability to tell if a unit has that item (internally, picking up an item gives the unit that picked up the item all that item's abilities, but item abilities usually don't show on the command card so you never notice). Since you need this check to run every time any unit takes damage from any attack, it's better to do one check for the ability level > 0 rather than to check all 6 item slots using the default "Hero has an item of type" function.

You also need to decide how to flag units that this item should not deal bonus damage to. If it's just a couple unit-types you could manually check against them in the trigger. If which units this shouldn't work on fluctuates over time you could simply add units to (and remove them from) a group when this item shouldn't work vs. them, and then check if units are in the group. Finally you could also make another invisible dummy flag ability that does nothing that would just let you know that the damaged unit should be immune to this item (can be dynamic like the unit group too). All these options are shown below.

You finally must decide if the bonus damage should be pure/true/real damage or if it should be affected by armor and other damage reduction effects on the targeted unit. Depending on what effects exist in your map, this may be a simple step or a complicated step to account for. I assume the damage should also be modified by the target's armor value so we'll use a pre-damage event.

  • Events
    • Game - DamageModifierEvent becomes Less than 0.00 //This event with a less than runs right before damage occurs for all attacks (melee and ranged)
  • Conditions
    • (Level of YOUR_ITEM_ABILITY for DamageEventSource) greater than 0
    • -------- Use any of the following types of filters based on how you want to set it up: --------
    • (Unit-type of DamageEventTarget) not equal to BOSS_THAT_THIS_DOESN'T_WORK_ON
    • (Unit-type of DamageEventTarget) not equal to OTHER_BOSS
    • (DamageEventTarget is in NO_PROC_GROUP) equal to False
    • (Level of NO_PROC_ABILITY for DamageEventTarget) equal to 0
  • Actions
    • Set DamageEventAmount = (DamageEventAmount + (0.01 x (Maximum life of DamageEventTarget)))
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,904
Here's the quickest/easiest way to do this:
  • Example
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • ((Damage source) has an item of type Claws of Attack +15) Equal to True
    • Actions
      • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) + ((Max life of (Damage Target)) x 0.01))
The Condition is a Boolean comparison -> Hero - Hero Has Item Of Type. Change Claws of Attack +15 to your Item.
The Action uses Arithmetic twice to calculate the damage.

If you want to ignore specific units then you need to do as Pyro suggested and decide on some way to categorize them. (Damage Target) is the unit that took the damage so they are the one you need to ignore.

Note that this exact trigger isn't possible on older versions of Warcraft 3.
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
@Uncle
per each attack
Since you need this check to run every time any unit takes damage from any attack, it's better to do one check for the ability level > 0 rather than to check all 6 item slots using the default "Hero has an item of type" function.
Checking all item slots of any unit that deals damage each time it deals damage is a big yikes in my books.
 
Status
Not open for further replies.
Top