• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit Summon and drains mana over time until 0

Status
Not open for further replies.
Level 1
Joined
Jun 21, 2009
Messages
282
Hey guys, im needing a trigger, for example,once you summon 1 permanet ghost wolf unit, and when you have the ghost wolf out, it drains the casters mana over time, once the mana is drained to 0 the ghost wolf will be removed from the game, and the mana draining will end.

I'm really having trouble with this trigger so if someone could help me please i would really appreciate it :grin: +Rep
 
Level 7
Joined
Jul 20, 2009
Messages
295
Haha, I have done this to my map, I'll copy paste the triggers for you, it is really easy and simple.

  • Summoning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ghost Wolf
    • Actions
      • Set Summoner[(Player number of (Owner of (Casting unit)))] = (Casting unit)
      • Unit - Create 1 Ghost Wolf for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 250.00 towards (Facing of (Casting unit)) degrees) facing (Facing of (Casting unit)) degrees
      • Set Summon[(Player number of (Owner of (Casting unit)))] = (Last created unit)
      • Set Has_Pet[(Player number of (Owner of (Casting unit)))] = True
      • Set Summon_MPCost[(Player number of (Owner of (Casting unit)))] = X
Where X can be any number you want.
Although, you have to make a Thunder Clap spell or any of its kind, for example War Stomp. Then set the AoE to 0 and DMG to 0 etc, to make the spell useless and then name it, Ghost Wolf.
Then on another trigger:

  • Summon MP Cost
    • Events
      • Time - Every Y seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Set mana of Summoner[(Integer A)] to ((Mana of Summoner[(Integer A)]) - (Real(Summon_MPCost[(Integer A)])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Has_Pet[(Integer A)] Equal to True
              • (Mana of Summoner[(Integer A)]) Less than ((Real(Summon_MPCost[(Integer A)]))
            • Then - Actions
              • Set Has_Pet[(Integer A)] = False
              • Set Summon_MPCost[(Integer A)] = 0
              • Special Effect - Create a special effect attached to the origin of Summoner[(Integer A)] using Abilities\Spells\Human\Avatar\AvatarCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Remove Summon[(Integer A)] from the game
              • Set Summoner[(Integer A)] = (No unit)
              • Set Summon[(Integer A)] = (No unit)
            • Else - Actions
Where Y can be any number you want and also the "Integer from 1 to 10" can be changed to the number of players you have.
The Special Effect is Optional, you can remove it if you want or change it to another effect.
 
Last edited:
Level 1
Joined
Jun 21, 2009
Messages
282
Haha, I have done this to my map, I'll copy paste the triggers for you, it is really easy and simple.

  • Summoning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ghost Wolf
    • Actions
      • Unit - Create 1 Ghost Wolf for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 250.00 towards (Facing of (Casting unit)) degrees) facing (Facing of (Casting unit)) degrees
      • Set Summon[(Player number of (Owner of (Casting unit)))] = (Last created unit)
      • Set Has_Pet[(Player number of (Owner of (Casting unit)))] = True
      • Set Summon_MPCost[(Player number of (Owner of (Casting unit)))] = X
Where X can be any number you want.
Although, you have to make a Thunder Clap spell or any of its kind, for example War Stomp. Then set the AoE to 0 and DMG to 0 etc, to make the spell useless and then name it, Ghost Wolf.
Then on another trigger:

  • Summon MP Cost
    • Events
      • Time - Every Y seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Set mana of Hero[(Integer A)] to ((Mana of Hero[(Integer A)]) - (Real(Summon_MPCost[(Integer A)])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Has_Pet[(Integer A)] Equal to True
              • (Mana of Hero[(Integer A)]) Less than ((Real(Summon_MPCost[(Integer A)]))
            • Then - Actions
              • Set Has_Pet[(Player number of (Owner of (Casting unit)))] = False
              • Set Summon_MPCost[(Player number of (Owner of (Casting unit)))] = 0
              • Special Effect - Create a special effect attached to the origin of Hero[(Player number of (Owner of (Casting unit)))] using Abilities\Spells\Human\Avatar\AvatarCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Remove Summon[(Player number of (Owner of (Casting unit)))] from the game
            • Else - Actions
Where Y can be any number you want and also the "Integer from 1 to 10" can be changed to the number of players you have.
The Special Effect is Optional, you can remove it if you want or change it to another effect.

How did you get "= (Last created unit)" ? cant find it
 
Level 7
Joined
Jul 20, 2009
Messages
295
Oh yeah I forgot to put for you the Hero variable.

Hero = Unit

Also see post #2 the first trigger, I have to add this action.

[Edit] - Infact see the two triggers in Post #2 again. I changed the Variable named Hero to Summoner.
By the way this trigger is for 1 Unit per each player only. Is that what you want or you want it to be for many units for each player?
 
Level 1
Joined
Jun 21, 2009
Messages
282
Oh yeah I forgot to put for you the Hero variable.

Hero = Unit

Also see post #2 the first trigger, I have to add this action.

[Edit] - Infact see the two triggers in Post #2 again. I changed the Variable named Hero to Summoner.
By the way this trigger is for 1 Unit per each player only. Is that what you want or you want it to be for many units for each player?

Alright, only problems im having is that you can summon more than 1 of the summoned unit, I need it so you can only have 1 summoned unit, not multiple, does the trigger prevent that? am i doing something wrong? i got it to drain mana by fixing it in the triggers just need to make it so you can only have 1 summoned unit out at a time
 
Status
Not open for further replies.
Top