- Joined
- Feb 8, 2015
- Messages
- 93
Hello Hive!
I'm in need of some help for a Shield Spell that I'm triggering. The spell is called "Cragskin" (you'll see that in variable names) and it targets an ally, giving them a buff. Based off of Frost Armor.
The spell is supposed to reduce the damage of the next 3 incoming attacks/damage sources by a percentage. So when the buff is on, the trigger should count to 3 (using Bribe's Damage Detection Engine) and reduce those attacks by for instance 45%, then the buff should be removed after 3 attacks.
Problem here is that the hashtable I use to save the Hits-Taken for each affected unit always returns 0, can anyone here spot the problem?
thanks in advance.
I'm in need of some help for a Shield Spell that I'm triggering. The spell is called "Cragskin" (you'll see that in variable names) and it targets an ally, giving them a buff. Based off of Frost Armor.
The spell is supposed to reduce the damage of the next 3 incoming attacks/damage sources by a percentage. So when the buff is on, the trigger should count to 3 (using Bribe's Damage Detection Engine) and reduce those attacks by for instance 45%, then the buff should be removed after 3 attacks.
Problem here is that the hashtable I use to save the Hits-Taken for each affected unit always returns 0, can anyone here spot the problem?
-
Cragskin Activate
-
Events
-
Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
-
Unit - A unit owned by Player 2 (Blue) Starts the effect of an ability
-
Unit - A unit owned by Player 3 (Teal) Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Cragskin
-
-
Actions
-
Set Cragskin_r = (0.25 + (0.15 x (Real((Level of (Ability being cast) for (Triggering unit))))))
-
Set Cragskin_Counteri = 3
-
Hashtable - Save (Real(Cragskin_Counteri)) as (Key HitsCounter) of (Key (Target unit of ability being cast)) in Cragskin_hash
-
-
-
Cragskin HitTaken
-
Events
-
Game - DamageModifierEvent becomes Equal to 1.00
-
-
Conditions
-
(DamageEventTarget has buff Cragskin ) Equal to True
-
-
Actions
-
Game - Display to (All players) the text: Run
-
Set Cragskin_Tempu1 = DamageEventTarget
-
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Matching unit) Equal to Cragskin_Tempu1)) and do (Actions)
-
Loop - Actions
-
Set Cragskin_Tempu2 = (Picked unit)
-
Set Cragskin_Counteri = (Load (Key HitsCounter) of (Key (Picked unit)) from Cragskin_hash)
-
Game - Display to (All players) the text: (String(Cragskin_Counteri))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Cragskin_Counteri Greater than or equal to 1
-
-
Then - Actions
-
Set DamageEventAmount = (DamageEventAmount - (DamageEventAmount x Cragskin_r))
-
Hashtable - Save (Real((Cragskin_Counteri - 1))) as (Key HitsCounter) of (Key (Picked unit)) in Cragskin_hash
-
-
Else - Actions
-
Unit - Remove Cragskin buff from Cragskin_Tempu2
-
-
-
-
-
-