- Joined
- May 15, 2009
- Messages
- 192
Hello Hive
I'm trying to create a spell where an Enchantress Hero periodically shields her allied Heroes for 50 points.
The Shield is applied to all allied Heroes, picked through a unit group. The units have a special effect applied to them (A mana shield) and the shield value assigned in a hashtable.
The shield is supposed to stack, so whenever the trigger runs without the unit having taken 50+ damage since last time, another "stack" of 50 points is added to the shield.
I've gotten the shield part working, and the unit seems to be blocking and stacking properly. However the special effect (the mana shield model) attached to the unit doesn't seem to be removed, it just gets thicker and thicker, not dissappearing along with the shield.
Can anyone give me advice to this?
The trigger is twofold, a periodic trigger for applying shield and saving stuff in hashtables, and the actual damagereduction trigger (Thx for Bribe for this bit).
Any help is much appreciated.
I'm trying to create a spell where an Enchantress Hero periodically shields her allied Heroes for 50 points.
The Shield is applied to all allied Heroes, picked through a unit group. The units have a special effect applied to them (A mana shield) and the shield value assigned in a hashtable.
The shield is supposed to stack, so whenever the trigger runs without the unit having taken 50+ damage since last time, another "stack" of 50 points is added to the shield.
I've gotten the shield part working, and the unit seems to be blocking and stacking properly. However the special effect (the mana shield model) attached to the unit doesn't seem to be removed, it just gets thicker and thicker, not dissappearing along with the shield.
Can anyone give me advice to this?
The trigger is twofold, a periodic trigger for applying shield and saving stuff in hashtables, and the actual damagereduction trigger (Thx for Bribe for this bit).
-
Events
-
Time - Every 15.00 seconds of game time
-
-
Warden ShieldBlocking
-
Events
-
Game - DamageModifierEvent becomes Equal to 1.00
-
-
Conditions
-
(DamageEventSource belongs to an enemy of Player 1 (Red)) Equal to True
-
(Unit-type of DamageEventTarget) Not equal to Enchantress (Healer)
-
-
Actions
-
Unit Group - Pick every unit in Ward_Tempug and do (Actions)
-
Loop - Actions
-
-------- Loads the ShieldAmount real from Ward_hash --------
-
Game - Display to (All players) for 2.00 seconds the text: (Shield amount for blocking = + (String(Ward_Tempr1)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DamageEventAmount Greater than or equal to Ward_Tempr1
-
-
Then - Actions
-
-------- If the Damage is greater than or equal to the shield size, the shield is removed, but damage still reduced by however much was left --------
-
Set Ward_ShieldEffect = (Load (Key ShieldEffect) of (Key (Picked unit)) in Ward_hash)
-
Special Effect - Destroy Ward_ShieldEffect
-
Set DamageEventAmount = (DamageEventAmount - Ward_Tempr1)
-
Set Ward_Tempr1 = 0.00
-
Hashtable - Save Ward_Tempr1 as (Key ShieldAmount) of (Key (Picked unit)) in Ward_hash
-
Game - Display to (All players) for 2.00 seconds the text: ([1]Damage down to = + (String(Ward_Tempr1)))
-
-
Else - Actions
-
-------- If the shield is greater than the damage dealt, the shield persists and both remaining shield and damage are reduced --------
-
Set Ward_Tempr1 = (Ward_Tempr1 - DamageEventAmount)
-
Set DamageEventAmount = 0.00
-
Hashtable - Save Ward_Tempr1 as (Key ShieldAmount) of (Key (Picked unit)) in Ward_hash
-
Game - Display to (All players) for 2.00 seconds the text: ([2]Damage down to = + (String(Ward_Tempr1)))
-
-
-
-
-
-
Any help is much appreciated.