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

Weapon equipment.

Level 4
Joined
Oct 9, 2024
Messages
63
I'm designing an RPG map and want to create weapon items (like swords and axes) that do more than just add extra damage (+2, +6, etc.). My idea is for each weapon to genuinely change the hero's fighting style. For instance, a two-handed axe would make the hero attack slower but hit harder, changing the basic attack speed and adding extra damage.

I also want the hero to have zero damage when they have no weapon equipped, so weapons feel essential to combat. Plus, I'm thinking of limiting the inventory to allow only one weapon at a time. This would make the player choose carefully instead of just collecting multiple weapons.

Any suggestions or feedback on how to make this work well in the game would be very welcome!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
I'm designing an RPG map and want to create weapon items (like swords and axes) that do more than just add extra damage (+2, +6, etc.). My idea is for each weapon to genuinely change the hero's fighting style. For instance, a two-handed axe would make the hero attack slower but hit harder, changing the basic attack speed and adding extra damage.

I also want the hero to have zero damage when they have no weapon equipped, so weapons feel essential to combat. Plus, I'm thinking of limiting the inventory to allow only one weapon at a time. This would make the player choose carefully instead of just collecting multiple weapons.

Any suggestions or feedback on how to make this work well in the game would be very welcome!
1) Gameplay Constants -> Set Hero - Attribute - Primary Damage Bonus to 0. Now your hero's Primary Attribute does not increase attack damage.
2) In the Object Editor -> Set Base Damage to -1. Set Damage Dice and Sides to 1. Now your hero deal 0-0 attack damage.
3) Find the Inventory (Hero) ability and change it's inventory slot count to 1.
4) Use triggers to modify attack cooldown based on weapon type.

The Sword swings once every 1.40 seconds:
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Sword
  • Actions
    • Unit - Set Attack Interval of (Triggering unit) to 1.40 for weapon index: 1
    • Unit - Set Attack Interval of (Triggering unit) to 1.40 for weapon index: 2
The Axe swings once every 2 seconds:
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Axe
  • Actions
    • Unit - Set Attack Interval of (Triggering unit) to 2.00 for weapon index: 1
    • Unit - Set Attack Interval of (Triggering unit) to 2.00 for weapon index: 2
If those triggers don't work then you'll likely need to use weapon index: 0 here:
  • Actions
    • Set Variable WeaponIndex = 0
    • Unit - Set Attack Interval of (Triggering unit) to 2.00 for weapon index: WeaponIndex
These newer functions have a lot of bugs but you can usually find some kind of workaround fix.


Also, these attack interval changes are permanent. So if you lose your Sword you will still have an attack cooldown of 1.40 seconds, which may be undesirable. It should be easy enough to fix though:
  • Events
    • Unit - A unit Loses an item
  • Conditions
    • ((Triggering unit) is a Hero) Equal to True
  • Actions
    • Unit - Set Attack Interval of (Triggering unit) to 3.00 for weapon index: 1
    • Unit - Set Attack Interval of (Triggering unit) to 3.00 for weapon index: 2
^ Now when a Hero loses an item, which we're assuming is a weapon since they only have 1 inventory slot, they will go to their "default" attack interval of 3.00 seconds. Change that value to whatever you think makes sense for being unarmed.
 
Last edited:
Level 4
Joined
Oct 9, 2024
Messages
63
Good explanation! However, limiting the hero to just one inventory slot could be an issue since I want them to use armor and other items too. I’m thinking of something similar to the inventory system in maps like Final Fantasy or Gaia’s Retaliation, where, if you have a weapon equipped, you can’t add another weapon to the inventory until the first one is removed. This way, the hero can focus on one weapon at a time without restricting other types of items.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Good explanation! However, limiting the hero to just one inventory slot could be an issue since I want them to use armor and other items too. I’m thinking of something similar to the inventory system in maps like Final Fantasy or Gaia’s Retaliation, where, if you have a weapon equipped, you can’t add another weapon to the inventory until the first one is removed. This way, the hero can focus on one weapon at a time without restricting other types of items.
 
Top