How to indicate full manapool

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I have a powerful tower in my map!

The powerful tower casts a powerful spell!

But, the tower needs to have full mana to cast the spell.

When the tower has full mana and can cast the spell, I want enemy players be able to "see" that the building is ready to cast the spell.

(So they know when it is time to run away from the tower)



How would you do to make enemy players be able to see when your building is maxed with mana/ready to cast a spell?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Every 1 second
If unit mana equal to max mana of unit
Create special effect overhead of unit
Save last created special effect to a variable
Turn off trigger

Another trigger:

Unit uses an ability
Load special effect from a variable, and destroy it.
Turn on the first trigger.

Do you have only one of these powerful towers, or many?
 
Level 11
Joined
May 31, 2008
Messages
698
This should work:

  • TowerWarning
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set Towers = (Units of type Tower)
      • Unit Group - Pick every unit in Towers and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of (Picked unit)) Less than 98.00
              • ((Picked unit) is in DontAddSFX) Equal to True
            • Then - Actions
              • Special Effect - Destroy SFX[(Custom value of (Picked unit))]
              • Unit Group - Remove (Picked unit) from ProjectileGroup
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of (Picked unit)) Greater than or equal to 98.00
              • ((Picked unit) is in DontAddSFX) Not equal to True
            • Then - Actions
              • Set Int = (Int + 1)
              • Unit - Set the custom value of (Picked unit) to Int
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\Drain\ManaDrainCaster.mdl
              • Set SFX[(Custom value of (Picked unit))] = (Last created special effect)
              • Unit Group - Add (Picked unit) to DontAddSFX
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Int Greater than or equal to 100
                • Then - Actions
                  • Set Int = 0
                • Else - Actions
            • Else - Actions
Int is an integer variable

Btw this creates the "warning effect" when the tower has 98% mana so there will be a little bit more of a warning
 
Level 6
Joined
Dec 27, 2006
Messages
100
  • Test
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Triggering unit)) Equal to (Max mana of (Triggering unit))
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Objects\InventoryItems\Rune\Rune.mdl
          • Set SPECIAL_EFFECT = (Last created special effect)
          • Trigger - Turn off (This trigger)
        • Else - Actions
That should work.
 
Level 11
Joined
May 31, 2008
Messages
698
Pandizzle that is completely wrong. First of all there is no triggering unit and second of all you pretty much copied what Maker did. Also your trigger will jsut turn off and never turn back on, making it only able to be used one time.
 
Level 6
Joined
Dec 27, 2006
Messages
100
Pandizzle that is completely wrong. First of all there is no triggering unit and second of all you pretty much copied what Maker did. Also your trigger will jsut turn off and never turn back on, making it only able to be used one time.

Well I thought it was implied that triggering unit would be replaced with the unit that he wants. Either way I suck at triggering (as you have most likely noticed :thumbs_up:).
 
Status
Not open for further replies.
Top