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

Created a dragon-slaying sword

Level 4
Joined
Oct 9, 2024
Messages
65
I want to create an item that grants a damage bonus against a specific type of creature when in the hero's inventory. The game already has different unit types, such as undead, but does not include a specific category for draconic creatures. How can I create a sword that increases damage by +15 whenever the hero attacks a dragon?
 
Level 5
Joined
Feb 22, 2025
Messages
78
Create an item preferably Claws of Attack,rename it as u wish, set damage bonus to 0 and ability to none.
In triggers create a trigger event: map ini
store dragon type units into a hashtable, repeat for each dragon.
Create another trigger with event a unit gets attacked,
conditions - attacking unit= hero; attacking unit has that specific item
attacked unit equals to dragons stored in a hashtable
actions: set attacker dmg to current +15
manage how long the bonus lasts or refreshes
Sorry im in u hurry hope this is not confusing 🥹
 
Level 5
Joined
Feb 22, 2025
Messages
78
Haven’t tested it but it should be something like this:
Actions:
If (All Conditions are True) Then Do (Then Actions) Else Do (Else Actions)
If Conditions:
(Load Integer (Unit-Type of (Attacked Unit)) of (Key 0) from Dragon_Hashtable) Equal to 1
Then Actions:
Set Damage_Bonus = (Attacking Unit) Base Damage
Set (Attacking Unit) Base Damage = (Damage_Bonus + 15)
Wait 1.00 seconds
Set (Attacking Unit) Base Damage = Damage_Bonus
Else Actions:
__________
*Maybe u can use timers for duration
 
Level 4
Joined
Oct 9, 2024
Messages
65
I understand your explanation, but these methods have some issues. If I create a necromancer dragon that summons undead onto the battlefield, there is a possibility that the sword could also deal extra damage to them. This happens because, as an activatable damage buff with a duration, the bonus might last long enough for a second attack to be made with +15 against an undead.
 
Level 5
Joined
Feb 22, 2025
Messages
78
I understand your explanation, but these methods have some issues. If I create a necromancer dragon that summons undead onto the battlefield, there is a possibility that the sword could also deal extra damage to them. This happens because, as an activatable damage buff with a duration, the bonus might last long enough for a second attack to be made with +15 against an undead.
Maybe you can do it like this:
Unit - Cause (Attacking Unit) to damage (Attacked Unit), dealing 15.00 damage of attack type Normal and damage type Magic.
Unless u elwant the stats to be displayed in the UI
 
Level 4
Joined
Oct 9, 2024
Messages
65
I just want the damage to be applied correctly and for the dragon's armor to reduce it by the proper percentage.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Undead isn't a Unit-Type, it's a Classification in this context. A Unit-Type is what you see under the "Unit" tab in the Object Editor, it's the blueprints for a Unit (ie: Footman, Paladin, Farm, etc). Anyway, you cannot create your own Classifications but you can recreate the concept of a Classification, which is simply marking the Unit in some way so that your triggers can detect it:
  • Conditions
    • ((Triggering unit) has something unique about it) Equal to True
There's a million ways of doing this, but I personally like to rely on hidden passive Abilities. I use Storm Hammers as the base ability since it has no effects that could interfere. Combine that with the "Takes damage" Event and you can easily increase damage against dragons. Here's a working solution:

Step 1:
In the Object Editor, copy and paste the Storm Hammers ability, set the Art - Button positions to X: 0, Y: -11, and rename it to "Draconic" with the suffix "(Classification)", that way we can easily understand that this is a special ability reserved for classifying our Units beyond the normal means. Hold Shift while opening a field to allow negative values, like when setting the negative Y value.

Step 2:
Copy and paste the new Storm Hammers ability from Step 1 and rename it to "Dragon Sword" with the suffix "(Item)". We're going to give this ability 7 Levels instead of 1. This is because the triggers below will use the Level to represent the number of Dragon Swords a unit has equipped.
The math will be (Ability Level - 1) = Number of swords.

Step 3:
In the Object Editor, create the actual Dragon Sword item. It doesn't need any Abilities, the bonus damage will come from our triggers down below. You can still add extra Abilities to it if you'd like.

Step 4:
In the Object Editor, Add the "Draconic" ability to each of your Dragons that you wish to take bonus damage from this Sword. You can hold Shift to bypass the Ability limit if need be. A unit can have an infinite number of abilities even if the editor seems to say otherwise (the exception being Hero abilities in the Hero Skill Menu).

Step 5:
In the Trigger Editor, create triggers for acquiring and losing the Dragon Sword item:
  • Dragon Sword Acquire
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Dragon Sword
    • Actions
      • Set VariableSet Dragon_Sword_Item_Ability = Dragon Sword (Item)
      • -------- --------
      • -------- If the unit doesn't have the ability yet, Add it and make it permanent (so it's not lost upon death): --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Dragon_Sword_Item_Ability for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Add Dragon_Sword_Item_Ability to (Triggering unit)
          • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, udg_Dragon_Sword_Item_Ability)
        • Else - Actions
      • -------- --------
      • Unit - Increase level of Dragon_Sword_Item_Ability for (Triggering unit)
  • Dragon Sword Lose
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Dragon Sword
    • Actions
      • Unit - Decrease level of Dragon_Sword_Item_Ability for (Triggering unit)
Step 6:
In the Trigger Editor, create a trigger that detects whenever a unit takes damage. This can only be done in version 1.31+, otherwise, you'll need to rely on something like Bribe's Damage Engine. Technically you could use Damage Engine in later versions since it provides many useful features, it's just a big import and I wanted to keep things as simple as possible for you:
  • Dragon Bonus Damage
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage From Normal Attack) Equal to True
      • (Level of Dragon_Sword_Item_Ability for (Damage source)) Greater than 1
      • (Level of Draconic (Classification) for (Damage Target)) Greater than 0
    • Actions
      • -------- Note: This Event happens BEFORE damage is actually taken! --------
      • -------- --------
      • -------- Define how much bonus damage you want the swords to add: --------
      • Set VariableSet Dragon_Sword_Bonus_Damage = 15.00
      • -------- --------
      • -------- Calculate how many swords the unit has: --------
      • Set VariableSet Dragon_Sword_Item_Count = ((Level of Dragon_Sword_Item_Ability for (Damage source)) - 1)
      • -------- --------
      • -------- Calculate the damage based on the number of swords: --------
      • Set VariableSet Dragon_Sword_Bonus_Damage = (Dragon_Sword_Bonus_Damage x (Real(Dragon_Sword_Item_Count)))
      • -------- --------
      • -------- Finally, add this bonus damage to the total damage that the unit is about to take: --------
      • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) + Dragon_Sword_Bonus_Damage)
^ Note: You may want to change the Event to this earlier damage step, I forget how the calculations work:
  • Unit - A unit About to take damage
That's it, you now have an Item that deals (15 x Sword Count) bonus attack damage to any Unit with the Draconic ability. So you just need to Add "Draconic" to your Dragons for it to work. In my example map I added it to the Peasants since it was easier to test on them. (I was in the middle of making this when Axolotol posted, sorry for hijacking the thread)
 

Attachments

  • Dragon Sword 1.w3m
    20.6 KB · Views: 9
Last edited:
Level 4
Joined
Oct 9, 2024
Messages
65
Once again, your help is always very useful, uncle. I believe I’ve understood and can handle it myself. In short, it’s a trigger that makes you deal extra damage to units that have a specific passive ability
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Once again, your help is always very useful, uncle. I believe I’ve understood and can handle it myself. In short, it’s a trigger that makes you deal extra damage to units that have a specific passive ability
Correct, the specific passive ability acts like a Classification.

If you're on the latest patch you can just copy and paste the triggers from my example map.
Just make sure to update the triggers to use the correct Abilities since they will be changed to some random Abilities from your map.
The Rawcodes need to match for copying to work seamlessly. Rawcode = the 4 digit id you create for new objects in the Object Editor.

Also, I edited my previous post because I forgot one thing.

You need to add this Boolean Condition to the "Dragon Bonus Damage" trigger so that it only increases attack damage:
  • Conditions
    • (Damage From Normal Attack) Equal to True
    • ...
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Maybe you can do it like this:
Unit - Cause (Attacking Unit) to damage (Attacked Unit), dealing 15.00 damage of attack type Normal and damage type Magic.
Unless u elwant the stats to be displayed in the UI
You rarely want to use this Event, it occurs before the Unit has even begun playing it's attack animation:
  • Events
    • Unit - A unit is Attacked
That means it can be spammed -> Attack, Stop, Attack, Stop, causing your trigger to fire 10+ times per second without a single attack ever landing. You especially don't want to be pairing it with a Wait. There are some cases where it can be used, like for cancelling attacks upon "friendly fire".

This "Attacked" event, "Begins casting" event, and the "Wait" action are what I'd call the "nooby traps" of the Trigger Editor. They sound like what you want, but unfortunately they cause bugs and unexpected behavior most of the time.

Unit Indexing, Dynamic Indexing, Hashtables, usage of Timers/Periodic Intervals/Unit Groups, these are all tools for creating "over time" effects as well as ensuring that things are MUI (multiple units can share the triggers).

There's also great systems out there that will do all of the hard work for you. Check out the Resources created by these guys: @Bribe, @chopinski, @Daffa. (Sorry for the notifications).
--> Damage Engine, New Bonus, Timed Stuns, Timed Special Effects, etc.
 
Last edited:
Level 5
Joined
Feb 22, 2025
Messages
78
You rarely want to use this Event, it occurs before the Unit has even begun playing it's attack animation:
  • Events
    • Unit - A unit is Attacked
That means it can be spammed -> Attack, Stop, Attack, Stop, causing your trigger to fire 10+ times per second without a single attack ever landing. You especially don't want to be pairing it with a Wait. There are some cases where it can be used, like for cancelling attacks upon "friendly fire".

This "Attacked" event, "Begins casting" event, and the "Wait" action are what I'd call the "nooby traps" of the Trigger Editor. They sound like what you want, but unfortunately they cause bugs and unexpected behavior most of the time.

Unit Indexing, Dynamic Indexing, usage of Timers/Periodic Intervals/Unit Groups, this is how you control timed effects without issues. There's also great systems out there that will do all of the hard work for you. Check out the Resources created by these guys: @Bribe, @chopinski, @Daffa. (Sorry for the notifications).
--> Damage Engine, New Bonus, Timed Stuns, Timed Special Effects, etc.
Yes, I’ve noticed that in the Withering Fire ability- Sylvanas starts the attack animation then i suddenly abort it but the clone still spawns( which is fine); Yes i hate waits but sometimes i bug out how to replace it; ty for resources and ur overall activity and dedication here, no need to be sorry for notif, i like learning here :)
 
Level 5
Joined
Jan 19, 2023
Messages
35
If there is any Unit Classification you are not using you can rename it in "Game Interface" and use that to check if additional damage should be applied.

  • ((Picked unit) is An Ancient) Equal to True

And you can just check if attacking unit has item without the need to create an ability.

  • (DamageFilterSource has an item of type Tome of Experience) Equal to True
Edit: Of course, replace Picked Unit with Damage Source/Target.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
If there is any Unit Classification you are not using you can rename it in "Game Interface" and use that to check if additional damage should be applied.

  • ((Picked unit) is An Ancient) Equal to True

And you can just check if attacking unit has item without the need to create an ability.

  • ((Picked unit) is An Ancient) Equal to True
That's true but you have to be careful, these Classifications all have side effects.

Ancient cannot be targeted by certain abilities, Suicidal cannot be loaded into transports, etc.

The ability solution avoids any weird side effects, I'd say it's the best option besides storing the data in some kind of array/table. The only downside is that it cannot be filtered in the Targets Allowed section of an Attack/Ability, but in this context that's irrelevant.
 
Level 5
Joined
Jan 19, 2023
Messages
35
That's true but you have to be careful, these Classifications all have side effects.

Ancient cannot be targeted by certain abilities, Suicidal cannot be loaded into transports, etc.

The ability solution avoids any weird side effects, I'd say it's the best option besides storing the data in some kind of array/table. The only downside is that it cannot be filtered in the Targets Allowed section of an Attack/Ability, but in this context that's irrelevant.
Yeah, I agree. It would have to be a non-used classification that won't interfere with the map. The ability idea is far better for general use, this is just a cool option if you can make it work.
 
You rarely want to use this Event, it occurs before the Unit has even begun playing it's attack animation:
  • Events
    • Unit - A unit is Attacked
That means it can be spammed -> Attack, Stop, Attack, Stop, causing your trigger to fire 10+ times per second without a single attack ever landing. You especially don't want to be pairing it with a Wait. There are some cases where it can be used, like for cancelling attacks upon "friendly fire".

This "Attacked" event, "Begins casting" event, and the "Wait" action are what I'd call the "nooby traps" of the Trigger Editor. They sound like what you want, but unfortunately they cause bugs and unexpected behavior most of the time.

Unit Indexing, Dynamic Indexing, Hashtables, usage of Timers/Periodic Intervals/Unit Groups, these are all tools for creating "over time" effects as well as ensuring that things are MUI (multiple units can share the triggers).

There's also great systems out there that will do all of the hard work for you. Check out the Resources created by these guys: @Bribe, @chopinski, @Daffa. (Sorry for the notifications).
--> Damage Engine, New Bonus, Timed Stuns, Timed Special Effects, etc.
I think you edited your post, since I didn't get any notification (I triple checked my notification list because I was confused with the @ lol)

Between all those nooby traps, begin casting is actually one of the more useful ones, since this is the only casting event (maybe along with begin channeling) that can be used to interrupt a spell before it completes execution (say, a custom spell that can only target specific units, the checks can be done with this event). I agree it is a major trap for new spell makers and should be avoided until they have decent understanding of how all spell events work (there's a tutorial for this, I recall).

Wait is probably most cursed and should be purged from triggering realm under normal circumstances. Unless one uses Lua and the Precise Wait library in their map, which makes it a game changer.

---

I think Uncle already covered all the necessities to accomplish what is desired for this specific thread.

If there is any Unit Classification you are not using you can rename it in "Game Interface" and use that to check if additional damage should be applied.

  • ((Picked unit) is An Ancient) Equal to True

And you can just check if attacking unit has item without the need to create an ability.

  • (DamageFilterSource has an item of type Tome of Experience) Equal to True
Edit: Of course, replace Picked Unit with Damage Source/Target.

In regards to the classification, this actually comes with how some abilities are initially set up. For example, Holy Light default targeting does not allow Ancient aka Non-Ancient as targeting (it can be modified to allow for Ancient). Another example is Load ability used by Transports has Non-Suicidal as part of their targeting (should be editable). Of course one can modify these restrictions, but it is, in my opinion, easier to use a dummy ability to attain that Classification without dealing with all these nonsense, especially in Altered Melee or mid/late stage of map development.
 
Level 5
Joined
Jan 19, 2023
Messages
35
I think you edited your post, since I didn't get any notification (I triple checked my notification list because I was confused with the @ lol)

Between all those nooby traps, begin casting is actually one of the more useful ones, since this is the only casting event (maybe along with begin channeling) that can be used to interrupt a spell before it completes execution (say, a custom spell that can only target specific units, the checks can be done with this event). I agree it is a major trap for new spell makers and should be avoided until they have decent understanding of how all spell events work (there's a tutorial for this, I recall).

Wait is probably most cursed and should be purged from triggering realm under normal circumstances. Unless one uses Lua and the Precise Wait library in their map, which makes it a game changer.

---

I think Uncle already covered all the necessities to accomplish what is desired for this specific thread.



In regards to the classification, this actually comes with how some abilities are initially set up. For example, Holy Light default targeting does not allow Ancient aka Non-Ancient as targeting (it can be modified to allow for Ancient). Another example is Load ability used by Transports has Non-Suicidal as part of their targeting (should be editable). Of course one can modify these restrictions, but it is, in my opinion, easier to use a dummy ability to attain that Classification without dealing with all these nonsense, especially in Altered Melee or mid/late stage of map development.
Fair enough, I just wanted to point out that it's an option in certain situations. Not all classifications have behaviours that affect every type of map. Giant is completely safe to use iirc.
 
Top