• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Mana cost with triggers.

Status
Not open for further replies.
Level 2
Joined
Jul 9, 2008
Messages
25
Is there a trigger action to increase/decrease a unit's mana by a set amount? I'm trying to make a spell that costs 1% of the caster's mana, but all I can find are "Set Mana (To Percentage)" and "Set Mana (To Value)", when I need something more similar to "Damage Target".

Alternatively, I tried to do "Set Mana (To Value)", with the value being the caster's maximum mana, minus a variable (named mana) divided by 100, with another trigger that sets the variable to a caster's max mana whenever a unit casts the spell. But the only mana-related number that a variable can be set to is "percentage mana of (unit)", and I don't know what that means.
 
so.. what exactly are you trying to do? Zap all there mana when they cast it or half of it? If not just go to object editor and put the manacost on the ability...
 
Thanks for the help.

so.. what exactly are you trying to do? Zap all there mana when they cast it or half of it? If not just go to object editor and put the manacost on the ability...

The spell's effect is based on the intelligence of the hero, and I want to give it a mana cost that is not a fixed number, so that the spell is effective at low and high levels without needing more than one rank.
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Sap Mana
    • Actions
      • Set CastingUnit = (Casting unit)
      • Set UnitMana = (Integer((Mana of CastingUnit)))
      • Set Maxunitmana = (Integer((Max mana of CastingUnit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Real(Maxunitmana)) / 100.00) Greater than (Real(UnitMana))
        • Then - Actions
          • Do nothing
          • Custom script: Call Remove Unit (udg_CastingUnit)
          • Custom script: Call Remove Integer (udg_UnitMana)
          • Custom script: Call Remove Integer (udg_Maxunitmana)
        • Else - Actions
          • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) - ((Real(Maxunitmana)) / 100.00))
          • Custom script: Call Remove Unit (udg_CastingUnit)
          • Custom script: Call Remove Integer (udg_UnitMana)
          • Custom script: Call Remove Integer (udg_Maxunitmana)
Im new to the whole trigger leak thing correct me if I'm Wrong.
 
Status
Not open for further replies.
Back
Top