• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Items with Negative Stats?

Status
Not open for further replies.
Level 4
Joined
Dec 24, 2016
Messages
42
Hi Everyone,

I have been wondering about how to make items negatively affect users; for example, an equip item that increases your attack damage but reduces your maximum Health, or an item that gives spell immunity at the cost of Mana regeneration (Elder Scrolls style). Setting a negative value to a field in the Object Editor is impossible so there has to be a set of triggers.

Is there a way to do this without having to constantly debuff an item-user with a dummy? Specifically with the cases stated above, I have played around with setting it so that maximum health for a unit is always a fraction [ex. 300/500 HP, triggers prevent it from going up further], but then auto-healers would constantly waste Mana on this unit (very impractical). For the other case, I would be periodically draining Mana (via Trigger) to counter Mana regeneration, but then if the same unit buys a +Mana regeneration item, it would no longer matter (unless I change the tick based on item gains, which would clunk up the trigger load if I have to write triggers for every single Mana regeneration item; don't want to do that).

Whether or not there is a simple method, for having solutions to this problem, I am wondering if there is even a method for doing this that will not come off shoddy or impractical-looking when other people play the map. I want it to look good as picking up the item and seeing instant stat increases.

I should specify that I do not use vJass, and I would very well prefer GUI. If the above scenarios cannot be achieved with GUI, I might as well remove the mechanic entirely.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Setting a negative value to a field in the Object Editor is impossible so there has to be a set of triggers.
Nope, negative, wrong.
Create an ability and shift double click the attributes.
Then you can add negative attributes.

So for negative mana regeneration, just modify the Sobi Mask ability, set mana regeneration to negative and add it to the item.
 
Level 4
Joined
Dec 24, 2016
Messages
42
Nope, negative, wrong.
Create an ability and shift double click the attributes.
Then you can add negative attributes.

Oh. Wow. I never even knew a trick like that was possible. Thank you for this information.

However, as for the negative Mana regeneration, I should have specified that negative Mana regeneration was not my intention (Thread is no longer about Negative Stats, is it? xD). Instead, I wanted to remove Mana regeneration from a unit with a single item so that equipping other Mana regeneration items would be meaningless. From what it seems, negative Mana regeneration does not take into account other bonus regeneration.

Thank you so much for your help. but I might just make another thread about this other topic.
 
Level 10
Joined
Sep 16, 2016
Messages
269
Instead, I wanted to remove Mana regeneration from a unit with a single item so that equipping other Mana regeneration items would be meaningless. From what it seems, negative Mana regeneration does not take into account other bonus regeneration.


Store units that acquire no-regeneration into a group along with its current hp/mana. Make a periodic timer that check its current hp/mana, if they are different from stored value, set them back.
 
Level 4
Joined
Dec 24, 2016
Messages
42
Store units that acquire no-regeneration into a group along with its current hp/mana. Make a periodic timer that check its current hp/mana, if they are different from stored value, set them back.

I appreciate the suggestion. However, if I am interpreting this right, I feel your method would disallow the use of mana potions, mana siphoning, and mana burn. I want to just get rid of natural Mana Regeneration and bonus item Mana Regeneration (I am willing to allow Brilliance Aura to work as well). If I implement triggers that change the variable for current mana, that would require an update of the variable for every instance where mana is used, burnt, healed, increased, removed, siphoned; the former 3 are simple enough and would require a line of code for all abilities (which I have around 60 custom castable abilities), but setting up a trigger for the periodic draining of mana (via Mana Siphon) does not seem feasible; especially for a single item.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
You could give all units 0 mana regen base and trigger the regen yourself (for units and for items). BonusMod makes this pretty easy (there's an add-on for flat- or percentage-based mana regen) by doing all the periodic regen for you.
 
Level 4
Joined
Dec 24, 2016
Messages
42
You could give all units 0 mana regen base and trigger the regen yourself (for units and for items). BonusMod makes this pretty easy (there's an add-on for flat- or percentage-based mana regen) by doing all the periodic regen for you.

Thank you for the suggestion, but I kind of figured this out. I plan to set it so all Mana-Regen-based items regenerate mana for all heroes (with the items) via Trigger. It should be quite simple since I will probably use at most 8 items with Mana Regeneration (some with flat or %-based amounts). That way, I can allow Brilliance Auras to work (decided to allow them to regenerate through the cursed item). That along side the use of Item actives like Mana Potions would create enough variety in types of Mana Regeneration. I plan to make it so equipping the "cursed item" would disable the mana regeneration triggers for the respective unit.
 
Status
Not open for further replies.
Top