• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Mana Ability Triggering

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Hey! I wanna make casting hero gain 100 mana each second after casting this ability on an enemy unit.

  • Arcane Feast P1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Feast (Wrath of Destruction)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Casting unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set ArcaneFeast_1 = (Casting unit)
          • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
          • Wait 1.00 seconds
          • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
          • Wait 1.00 seconds
          • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
          • Wait 1.00 seconds
          • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
          • Wait 1.00 seconds
          • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
          • Wait 1.00 seconds
          • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
          • Set ArcaneFeast_1 = No unit
        • Else - Actions
But it doesn't work for some reason. It gives like mana, but the other mana triggers won't follow. And if I choose to repeat casting, nothing happens at all. So it actually only works ones.
But, the mana the first cast gathers, is strange.
If I have got 80 mana, I suddenly gain 40 mana.
If I have got 10 mana, I suddenly gain 90 mana.

Also, I just found out that it actually repeats the trigger of Percentage of mana of ArcaneFeast_1. So it keeps repeating the percentage, but does not add the 100 mana.
I have a total of 500 mana. But whatever I set the triggers to, I keep ending at 135 mana. If I regenerate over 135, it will degenerate to 135 and keep it up until the trigger ends.

What should I do?

-Alex
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Something like this, sorry if I get it wrong somehow 'cuz I am not really proficient with GUI :p

  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Duration Less than or equal to 5.00
    • Actions
      • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
      • Set Duration = Duration + 1.00
 
Level 8
Joined
Jun 13, 2010
Messages
344
Re

Something like this, sorry if I get it wrong somehow 'cuz I am not really proficient with GUI :p

  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Duration Less than or equal to 5.00
    • Actions
      • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
      • Set Duration = Duration + 1.00

Well looks quite nice. But I would need a casting unit trigger to activate this then. It was ment to activate on cast.
 
Level 8
Joined
Jun 13, 2010
Messages
344
Re

Something like this, sorry if I get it wrong somehow 'cuz I am not really proficient with GUI :p

  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Duration Less than or equal to 5.00
    • Actions
      • Unit - Set mana of ArcaneFeast_1 to ((Percentage mana of ArcaneFeast_1) + 100.00)
      • Set Duration = Duration + 1.00

Cant get this to work at any point sorry.
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
I will try to show you how in pseudo-code

  1. Unit casts ability
  2. Fire Start effect trigger, set duration = 0.00
  3. Turn on periodic trigger
  4. Use an if-then-else in the periodic trigger to add mana and turn the trigger itself off when duration >= 5.00
 
Level 8
Joined
Jun 13, 2010
Messages
344
Could you give me an example in trigger mode?
Cuz I have tried 100 of things... And it just keeps bugging up..
I even tried, doing this:
  • Unit - Set mana of Hero1 to ((Percentage life of (Casting unit)) + 0.00)
 
Status
Not open for further replies.
Top