• 🏆 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] Mana Steal

Status
Not open for further replies.
Level 4
Joined
May 16, 2009
Messages
61
  • Untitled Trigger 007
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Unit-type of (Attacking unit)) Equal to Fel Ravager) or (((Unit-type of (Attacking unit)) Equal to Fel Beast) or ((Unit-type of (Attacking unit)) Equal to Fel Stalker))
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Trigger - Add to Mana Steal <gen> the event (Unit - (Attacked unit) Takes damage)
      • Set ManaSteal = ((Mana of (Attacked unit)) - Mana)
      • Set ManaAttacked = (Attacked unit)
      • Unit - Set mana of ManaAttacked to ManaSteal
  • Mana Steal
    • Events
    • Conditions
      • ((Unit-type of (Damage source)) Equal to Fel Ravager) or (((Unit-type of (Damage source)) Equal to Fel Beast) or ((Unit-type of (Damage source)) Equal to Fel Stalker))
    • Actions
      • Set Damager = (Damage source)
      • Set DamageMana = (Damage taken)
      • Set ManaGain = (Mana of (Damage source))
      • Set Mana = (DamageMana / 4.00)
      • Set ManaPlus = ((Mana of ManaAttacked) - ManaSteal)
      • Unit - Set mana of Damager to (ManaGain + ManaPlus)
This does not seem to be working correctly
 
Level 4
Joined
May 16, 2009
Messages
61
is any of the numbers wrong my unit does about 30 damage it is based off of obsidian destroyer so its mana goes down by 3 every second so it has to keep attacking to regain mana, its max mana is about 900
 
Level 4
Joined
May 16, 2009
Messages
61
hmm then it won't work completely correctly it adds what damage the enemy does to my units mana and it stops taking mana away from the enemy after like 4 hits
 
It might require indexing for better results (=MUI). Plus, i am not really sure if attacked unit could go with an event of type "takes damage". It's like you have two events at the same time.
Anyway, change this:
  • Set ManaGain = (Mana of (Damage source))
  • to this
  • Set ManaGain = (Mana of (Damager))
To be honest, i think one of the reasons i stated above causes this temporary effect of the whole trigger, pausing after 4 hits, or even both reasons.
Both cases seem to be reasonable. Indexing seems to be required, cause you store units within a trigger of a high-refreshing rate event, "A unit is attacked" -> every time the unit attacked is stored within a variable, no matter if it is the same target. Attacking unit vs. Damage source also seems to require a different triggering way, if i were you, i would use a buff on the unit that takes the damage, if the unit has that buff, then set everything with the mana stuff and remove the buff. So, the buff will be displayed for like 0.4 seconds or even less.
 
Status
Not open for further replies.
Top