• 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 faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Mana spell

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,957
You'll need a Unit variable called TempUnit
  • Mana Cast Instant
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Ability (Instant)
    • Actions
      • Custom script: local unit udg_TempUnit = GetTriggerUnit()
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Custom script: set udg_TempUnit = null
  • Mana Cast Target Unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Ability (Target Unit)
    • Actions
      • Custom script: local unit udg_TempUnit = GetSpellTargetUnit()
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Custom script: set udg_TempUnit = null
 

Attachments

  • Mana Ability.w3x
    17.7 KB · Views: 35
Level 14
Joined
Nov 4, 2006
Messages
1,241
the most basic version would be:
  • Mana Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Your ability)
    • Actions
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 100.00)
      • Wait 1.00 game-time seconds
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 100.00)
Edit: too slow :D
 
You'll need a Unit variable called TempUnit
  • Mana Cast Instant
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Ability (Instant)
    • Actions
      • Custom script: local unit udg_TempUnit = GetTriggerUnit()
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Custom script: set udg_TempUnit = null
  • Mana Cast Target Unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Ability (Target Unit)
    • Actions
      • Custom script: local unit udg_TempUnit = GetSpellTargetUnit()
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set mana of TempUnit to ((Mana of TempUnit) + 100.00)
      • Custom script: set udg_TempUnit = null
You don't need to put triggering unit into a local/variable for the mana cast instant, it'll work anyways because its the unit who triggered the trigger.
 
Status
Not open for further replies.
Top