- Joined
- Dec 23, 2011
- Messages
- 40
Can someone please tell how to create a mana shield that absorbs 300 damage?
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
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
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
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))))
Now, in the Set Damage trigger inside of Damage Event, your gonna wanna put this
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
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