• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Creating A Special Mana Shield

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
Use Damage Event system like Bribe's than make a event when the abil is cast you cast inner fire (with the mana shield effect) on the hero for effects than set a variable and if damageeventamount > manashieldleft[owner of damage source] than set damageeventamount = damageeventamount - manashieldleft[owner of damage source] and set manashieldleft[owner of damage source] to 0
 
Level 3
Joined
Dec 23, 2011
Messages
40
Use Damage Event system like Bribe's than make a event when the abil is cast you cast inner fire (with the mana shield effect) on the hero for effects than set a variable and if damageeventamount > manashieldleft[owner of damage source] than set damageeventamount = damageeventamount - manashieldleft[owner of damage source] and set manashieldleft[owner of damage source] to 0

I think I will better understand what you said if you send me a map example.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Yeah, it was kinda on the fly lol. But i never send maps because that just means that the requester is too lazy. Ill do it though

First, install GUI damage engine

Than your going to want to setup a trigger that runs when you cast your ability

  • Untitled Trigger 006
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Shield (Neutral Hostile)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ManaShieldUp[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set ManaShieldRemaining[(Player number of (Owner of (Triggering unit)))] = ((ManaShieldRemaining[(Player number of (Owner of (Triggering unit)))] + 150) + (25 x (Level of Mana Shield (Neutral Hostile) for (Triggering unit))))
          • Set ManaShieldUp[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
          • Set ManaShieldRemaining[(Player number of (Owner of (Triggering unit)))] = (300 + (50 x (Level of Mana Shield (Neutral Hostile) for (Triggering unit))))
What this does is, if the mana shield is up than it gives 150 + 25 per ability level but if the shield isn't up than it gives 300 + 50 per ability level

Now, in the Set Damage trigger inside of Damage Event, your gonna wanna put this

  • Untitled Trigger 007
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ManaShieldUp[(Player number of (Owner of DamageEventTarget))] Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageEventAmount Greater than (Real(ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))]))
            • Then - Actions
              • Set DamageEventAmount = (DamageEventAmount - (Real(ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))])))
              • Set ManaShieldUp[(Player number of (Owner of DamageEventTarget))] = False
              • Set ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))] = 0
            • Else - Actions
              • Set DamageEventAmount = 0.00
              • Set ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))] = (ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))] - (Integer(DamageEventAmount)))
        • Else - Actions
This checks, if the unit has mana shield than if the damage dealt is more than mana shield than it turns off mana shield and subtracts leftover damage from the mana shield but if the mana shield is greater than the damage dealt than it just sets damage to 0 and mana shield to mana shield - damage dealt
 
Level 3
Joined
Dec 23, 2011
Messages
40
Yeah, it was kinda on the fly lol. But i never send maps because that just means that the requester is too lazy. Ill do it though

First, install GUI damage engine

Than your going to want to setup a trigger that runs when you cast your ability

  • Untitled Trigger 006
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Shield (Neutral Hostile)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ManaShieldUp[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set ManaShieldRemaining[(Player number of (Owner of (Triggering unit)))] = ((ManaShieldRemaining[(Player number of (Owner of (Triggering unit)))] + 150) + (25 x (Level of Mana Shield (Neutral Hostile) for (Triggering unit))))
          • Set ManaShieldUp[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
          • Set ManaShieldRemaining[(Player number of (Owner of (Triggering unit)))] = (300 + (50 x (Level of Mana Shield (Neutral Hostile) for (Triggering unit))))
What this does is, if the mana shield is up than it gives 150 + 25 per ability level but if the shield isn't up than it gives 300 + 50 per ability level

Now, in the Set Damage trigger inside of Damage Event, your gonna wanna put this

  • Untitled Trigger 007
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ManaShieldUp[(Player number of (Owner of DamageEventTarget))] Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageEventAmount Greater than (Real(ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))]))
            • Then - Actions
              • Set DamageEventAmount = (DamageEventAmount - (Real(ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))])))
              • Set ManaShieldUp[(Player number of (Owner of DamageEventTarget))] = False
              • Set ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))] = 0
            • Else - Actions
              • Set DamageEventAmount = 0.00
              • Set ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))] = (ManaShieldRemaining[(Player number of (Owner of DamageEventTarget))] - (Integer(DamageEventAmount)))
        • Else - Actions
This checks, if the unit has mana shield than if the damage dealt is more than mana shield than it turns off mana shield and subtracts leftover damage from the mana shield but if the mana shield is greater than the damage dealt than it just sets damage to 0 and mana shield to mana shield - damage dealt

This is really nice, except the fact that I don't understand any functions in the triggers or how to make them. Do I really need that GUI damage engine?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Yes you need the GUI damage engine because there is no way to detect or change damage dealt.

What do you not get about the functions? Its alot of Player Number of (Owner of (x)) and arithmetic
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I usually make people write out the triggers themselves, but these are decently complicated for beginners. I'll post a map when i can, cant atm
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Attached is the map. I have a little how-to-use in the "Mana Shield Cast". Also, when you import it to your map, make SURE you have in File > Preferences, "Automatically create unknown variables when pasting trigger data" to true when you paste and you will have to create a "timer" variable named "DmgEvTimer"

If you need some help or explanation on how it works, let me know.

Oh, by the way, i didn't make the ability or the effects i just made the triggering for it
 

Attachments

  • Demo Map Protoss Shields.w3x
    29.9 KB · Views: 42
Status
Not open for further replies.
Top