• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Attacking uses mana trigger....

Status
Not open for further replies.
Level 7
Joined
Aug 30, 2008
Messages
346
I need a trigger that whenever the unit attacks it uses up mana, and it cannot attack unless it has mana.
i need this in gui since im not good at jass and most likely this trigger is quite simple....( not sure though).

I am making a map similar to that of the zombie survival which uses this trigger, (created by somaz)
Willing to give reputation to the person who replies..:thumbs_up:
 
Its quite simple actually.

  • Mana cost attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Footman
    • Actions
      • Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 1.00)
      • If ((Mana of (Attacking unit)) Equal to 0.00) then do (Unit - Order (Attacking unit) to Stop) else do (Do nothing)
Use the condition to make it only count for the unit-type who should. The If/Then/Else automaticly orders the unit not to attack when mana is 0. To add more unit type's whom's mana is drained, use extra condition and OR
 
Another way of this is to create a new spell based on orb of lightning (new) and maybe finger of death. For orb of lightning (new) set the
chances to hit hero/summons/units %: 100 and set the effect ability to the finger of death dealing no damage, no animation effects, no cooldown and set the desired mana cost. The advantage of this, rather than GUI triggers, is that it uses the mana after it hits instead of using the mana even without the attack reaching the target. Disadvantage of this is that the spell is orb effect and will not stack will some other orb effect spells like life steal and such...

Then like what M4stah said create a trigger that disables him to attack if its mana is low than the desired mana required to attack.

  • Test
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Mana of (Attacking unit)) Less than "mana cost every attack"
      • (Level of Orb of lightning (new) for (Attacking unit)) Greater than 0
    • Actions
      • Unit - Order (Attacking unit) to Stop
 
Last edited:
If i am using the orb effect thingy (lightning)
is it possible to make them have a chance to miss?

ok i have tried both and it both works, thanks :D still wondering if they are able to miss though,
+REP
so i have another question, how do i make a unit morph into another unit using an item, the used item does not expire,and if the currently morphed unit drops the item he had used to morph, it will go back into his inventory or become undroppable until he uses it again to become his original unit, or uses another morphing item.

CAn this be done in triggers? i wonder
 
Status
Not open for further replies.
Back
Top