[Trigger] Item Ability Request

Level 15
Joined
Jul 19, 2007
Messages
855
Hello I need some help to create an ability that should work on items but I have no idéa how to make it and I'm not sure if it is even possible...

Physical attacks that deal over 50 damage to the Hero have a 40% chance to be negated and deal no damage. After two hits are blocked, this ability will go on cooldown 60 seconds. This ability does not effect spells.
 
Level 4
Joined
Jun 17, 2016
Messages
18
I created this item for you.

A few notes...

- This item functions by having charges, but the item won't disappear upon running out of charges. Each charge represents a hit that can be blocked. You can adjust the maximum number of charges this item can hold in the object editor.

- You can actually hold multiple copies of this item, but it will still only consume 1 charge per block. The copies of the item at the top and to the left will take priority over those to the bottom and right. Of course, if an item is out of charges, it will consume charges from the other available item that's in the inventory.

- Rather than having the cooldown trigger after blocking two hits, a 60 second cooldown will immediately trigger after blocking one hit. After that cooldown ends, a charge will be restored. The wielder of this item can still block another attack if that item still has a charge. This will trigger a separate 60 second cooldown. An item can recharge both of its charges at the same time.

- I left the variables in GUI for you. This will allow you to easily adjust the damage threshold, the chance to block, and the cooldown of each individual charge

- You'll want to change the reference in the code from 'I000' to the item's object ID in your map.
 

Attachments

  • Amulet of Shielding.w3m
    19.7 KB · Views: 5
Level 15
Joined
Jul 19, 2007
Messages
855
I created this item for you.

A few notes...

- This item functions by having charges, but the item won't disappear upon running out of charges. Each charge represents a hit that can be blocked. You can adjust the maximum number of charges this item can hold in the object editor.

- You can actually hold multiple copies of this item, but it will still only consume 1 charge per block. The copies of the item at the top and to the left will take priority over those to the bottom and right. Of course, if an item is out of charges, it will consume charges from the other available item that's in the inventory.

- Rather than having the cooldown trigger after blocking two hits, a 60 second cooldown will immediately trigger after blocking one hit. After that cooldown ends, a charge will be restored. The wielder of this item can still block another attack if that item still has a charge. This will trigger a separate 60 second cooldown. An item can recharge both of its charges at the same time.

- I left the variables in GUI for you. This will allow you to easily adjust the damage threshold, the chance to block, and the cooldown of each individual charge

- You'll want to change the reference in the code from 'I000' to the item's object ID in your map.
Thank you! That's just like I wanted it :thumbs_up:
 
Level 15
Joined
Jul 19, 2007
Messages
855
Hmm it seems like this ability bugs a little. I tested this item on my map and when blocking an attack the first time, the charge cooldown didn't go on and it stayed on 1 charge for the item the rest of the game. Also it seems like it doesn't block piercing damage attacks :-/ Pls fix!
 
Level 4
Joined
Jun 17, 2016
Messages
18
Hmm it seems like this ability bugs a little. I tested this item on my map and when blocking an attack the first time, the charge cooldown didn't go on and it stayed on 1 charge for the item the rest of the game. Also it seems like it doesn't block piercing damage attacks :-/ Pls fix!

It sounds like the item handle variable isn't being referenced correctly by the timer. You didn't adjust the custom script part containing the Hashtable variable, did you? All the variables have been added correctly to your map, right?

When you say "piercing damage attacks," you're talking about the type of attack an archer typically uses, right? I'm not sure why that would even happen. I tested the shielding effect against an enemy with piercing damage, and it worked fine for me.

Basically, it sounds like something didn't get imported correctly into your map. Double check all the variables and the item's raw data, making sure it matches the item's raw data field in the JASS code.

I'll need a little bit more information to properly diagnose the problem here. If you're comfortable with it, you can send me your map and I can have a look.
 
Last edited:
Top