• 🏆 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!

[Trigger] Applying Variable Type: "Real" to Multiple Heroes

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2018
Messages
81
I am trying to create a variable which is "attached" to a specific hero. Preferably, the variable has to be a "Real" which starts at 1. When a certain item is picked up, or the hero is affected by a certain buff, the "Real" has +0.25 (or whatever) added on. So the "Real" will now remember 1.25 (as appose to just 1). When the item is dropped, or buff is lost, the "Real" will go back to 1 again. These added decimals can stack up indefinitely, but the base is always 1.

I am also trying to work out how I would add this hero specific variable to the end of a damaging trigger so that it would multiply the damage by the amount of the "Real". I am hoping I will be able to make sure that the trigger can detect which hero the "Real" belongs to, because different heroes will not have the same value in their "Real".

In more simplified terms.
Every hero has spell amplification. They all start with 1 spell amplification, so the damage done by the spell is multiplied by 1 (so nothing). Every items/buff they pickup/receive increases their spell amp by a decimal. If they had an item which gave 25% spell amp, when they cast their spell, the spell damage would be multiplied by 1.25 (so itself + 0.25 of itself).

Please help, I am adverse to DDS :(
 
Last edited:
It's often an issue for equipment-like systems.
One want to attach some kind of bonus to an item-id, like damage/life/mana/armor ..., and when the item is equipped the bonus must apply. It's often used in combination with a BonusMod system, to give this various features of extra improvements.

Hashtable is definitly a good suggestion. You would need some kind of setup to save real-values to item-types, and which are loaded then on item pick up.
In case only 1 bonus is used you might even try only with UnixIndexer instead of hashtable. It would suffice, and only one real[array] variable would be needed to define the bonus. It could look like
  • Set SpellDamageBonus[myUnitIndex] = Set SpellDamageBonus[myUnitIndex] + 0.25
In the damage trigger you can multiply always spell damage by using the unix index of attacker again.

If you use JASS you might think of reading this thread. [vJASS] - ItemPower
 
Status
Not open for further replies.
Top