• 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.

[Trigger] Mana refilled at a building

Status
Not open for further replies.
Level 1
Joined
Apr 23, 2014
Messages
475
Anyone, willing to help me can figure this trigger out for me since it's my success to making my first map:)


In my map,(it's even in the idea factory!) i have a unit(contraption), that will attack but mana will be drained every shot, after that he has to refill it's mana at a building( Hellforge), which has a option(some options are substituded by units or upgrades that does somwthing else) that will allow the contraption to be full mana
 
Level 12
Joined
May 20, 2009
Messages
822
but how about refilling

Refilling would be easy...Just copy the Fountain of Mana ability, if you want it to be completely restored instantly set the mana regeneration amount to like, 9999999999.

If you want a cost to it...Just make it a fully-restore Mana Potion.
But, if you still want it to be directly from the building, You could make it a purchasable dummy unit that's invisible and has Spirit Touch, as Spirit Touch is Auto-Cast, make it only affect Player-Units and not Friends, otherwise it'll replenish allies too. Once the unit has performed it's function, remove the unit via trigger.

EX:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Unit That the Dummy Unit is being bought from
    • Actions
      • Unit Group - Pick every unit in (Units of type Your Dummy Mana Replenishing Unit) and do (Actions)
        • Loop - Actions
          • Unit - Add a 5.00 second Generic expiration timer to (Picked unit)
For the Dummy unit, do this:

Art - Animation - Blend Time (Seconds)
Art - Animation - Cast Backswing
Art - Animation - Cast Point

Set all of those Object values to 0.

Base the spell off of Spirit Touch from the Obsidian Statue and do this:

Mana Points Gained - 999999999
Maximum Units Affected - 1
Maximum Units Charged To Caster - 1
Mana Cost - 0

But then again, this only works if that's your only unit. I assumed it was, since it looks like you are just one unit based on what you said... If you have more then one unit, the ability could possibly be cast on a different unit instead of the one you want.

  • Untitled Trigger 001
  • Events
  • Unit - A unit Is attacked
  • Conditions
  • (Unit-type of (Attacking unit)) Equal to Your Unit
  • Actions
  • Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 5.00)
Also, do this instead. All units that are this unit will have their mana drained, and it doesn't matter what player owns them.
 
Status
Not open for further replies.
Top