Hey all,
I have a custom item and hero system in my map (just a bunch of structs holding data) and one of the things I would like to add to my map would be a system that slows you down if you are holding more weight than you can hold.
The formula I have determined is:
Amount Slowed = 0.02 x (WH - WA)
Where, WA is weight allowance, or how much the hero can hold. WH is weight held, or how much the hero is currently holding.
For example, if a hero can hold 150 pounds, and the gear he has weighs him down 165 pounds:
Amount Slowed = 0.02 x (165 - 150) = 0.3 = 30%
I have thought of a couple ways to do this, the most immediate being to use SetUnitMovementSpeed to 70% of the normal and use a system to do the same with attack speed. I tried this out with 100% slowed, and my unit could still move and attack.
Another way I was working on last night was to make 10 different spells based on slow, each at 10% increments, but I couldn't figure out how to get the dummy unit to cast a custom spell. I gave the dummy the spell, then ordered it to cast the spell that the custom spell is based on (slow) and then did some testing to see the movement speed. Each case would slow me by 50%, which i think is the standard slow spell rate.
Has anyone tried to do such a thing and get success?
I have a custom item and hero system in my map (just a bunch of structs holding data) and one of the things I would like to add to my map would be a system that slows you down if you are holding more weight than you can hold.
The formula I have determined is:
Amount Slowed = 0.02 x (WH - WA)
Where, WA is weight allowance, or how much the hero can hold. WH is weight held, or how much the hero is currently holding.
For example, if a hero can hold 150 pounds, and the gear he has weighs him down 165 pounds:
Amount Slowed = 0.02 x (165 - 150) = 0.3 = 30%
I have thought of a couple ways to do this, the most immediate being to use SetUnitMovementSpeed to 70% of the normal and use a system to do the same with attack speed. I tried this out with 100% slowed, and my unit could still move and attack.
Another way I was working on last night was to make 10 different spells based on slow, each at 10% increments, but I couldn't figure out how to get the dummy unit to cast a custom spell. I gave the dummy the spell, then ordered it to cast the spell that the custom spell is based on (slow) and then did some testing to see the movement speed. Each case would slow me by 50%, which i think is the standard slow spell rate.
Has anyone tried to do such a thing and get success?