- Joined
- May 20, 2008
- Messages
- 138
So, I'm currently triggering stackable damage over time spells in GUI using hashtables. I'm creating two spells that work in synergy
Lacerate
Instantly deals 200 damage and then deals 100 damage over 15 seconds to a unit. Stacks up to 3 times.
Pulverize
Deals 180 damage and reduces enemy armor by 2. Consumes all charges of Lacerate on the target to determine bonus damage. 120 bonus damage per charge.
This is handled through three triggers:
"Druid Lacerate cast" detects when lacerate is cast and adds a stack of Lacerate to the targetted unit, saved as an integer in a hashtable as Player number of (Owner of Triggering Unit) of Key(Target Unit of Ability Being Cast). The targetted unit is then saved in a unit group to be accessed in the next trigger:
"Druid Lacerate damage" is a preiodic event that picks all units in the unit group and deals damage to them depending on the number of stacks. The number of stacks each player has on the target is loaded from the hashtable and determines the damage dealt. Both these triggers are working exactly as they should.
The "Druid Pulverize cast BROKEN" trigger detects when Pulverize is cast on a target and is supposed to load the number of stacks of Lacerate the casting player has on the targetted unit from the hashtable, similar to the "Druid Lacerate damage" trigger. However, while the "Druid Lacerate damage" correctly loads for example 2 stacks if a player has cast Lacerate on the target 2 times, the "Druid Pulverize cast BROKEN" for some reason loads that there are 0 stacks of Lacerate on the targetted unit, even if the periodic trigger is running at the same time, loading the correct number of stacks both before and after "Druid Pulverize cast BROKEN" fails to load the correct number of stacks! Here is a screenshot to illustrate what I mean:
http://imageshack.us/photo/my-images/42/debuge.jpg/
The "2 stacks of lacerate" message is generated by the periodic trigger "Druid Lacerate damage".
The "0 stacks of lacerate" message is generated by the trigger that fires when Pulverize is cast "Druid Pulverize cast BROKEN".
What this image illustrates is how the periodic damage event detects the number of stacks and fires correctly, while the Pulverize cast, made between the periodic event "ticks", does not.
Here are all my triggers (the first two work perfectly as far as I can tell):
Lacerate
Instantly deals 200 damage and then deals 100 damage over 15 seconds to a unit. Stacks up to 3 times.
Pulverize
Deals 180 damage and reduces enemy armor by 2. Consumes all charges of Lacerate on the target to determine bonus damage. 120 bonus damage per charge.
This is handled through three triggers:
"Druid Lacerate cast" detects when lacerate is cast and adds a stack of Lacerate to the targetted unit, saved as an integer in a hashtable as Player number of (Owner of Triggering Unit) of Key(Target Unit of Ability Being Cast). The targetted unit is then saved in a unit group to be accessed in the next trigger:
"Druid Lacerate damage" is a preiodic event that picks all units in the unit group and deals damage to them depending on the number of stacks. The number of stacks each player has on the target is loaded from the hashtable and determines the damage dealt. Both these triggers are working exactly as they should.
The "Druid Pulverize cast BROKEN" trigger detects when Pulverize is cast on a target and is supposed to load the number of stacks of Lacerate the casting player has on the targetted unit from the hashtable, similar to the "Druid Lacerate damage" trigger. However, while the "Druid Lacerate damage" correctly loads for example 2 stacks if a player has cast Lacerate on the target 2 times, the "Druid Pulverize cast BROKEN" for some reason loads that there are 0 stacks of Lacerate on the targetted unit, even if the periodic trigger is running at the same time, loading the correct number of stacks both before and after "Druid Pulverize cast BROKEN" fails to load the correct number of stacks! Here is a screenshot to illustrate what I mean:
http://imageshack.us/photo/my-images/42/debuge.jpg/
The "2 stacks of lacerate" message is generated by the periodic trigger "Druid Lacerate damage".
The "0 stacks of lacerate" message is generated by the trigger that fires when Pulverize is cast "Druid Pulverize cast BROKEN".
What this image illustrates is how the periodic damage event detects the number of stacks and fires correctly, while the Pulverize cast, made between the periodic event "ticks", does not.
Here are all my triggers (the first two work perfectly as far as I can tell):
-
Druid Lacerate cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to (Druid) Lacerate
-
Actions
- -------- deal initial damage --------
- Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 200.00 damage of attack type Chaos and damage type Normal
- -------- save the caster --------
- Set HDRUID_Lacerate_caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
- -------- refresh the lacerate DoT duration --------
- Hashtable - Save 15 as (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) in HDRUID_Laceratetime_table
- -------- Add another stack of Lacerate unless the unit already has 3 stacks --------
- Set GEN_INTEGER_1 = (Load (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) from HDRUID_Laceratestacks_table)
- Game - Display to (All players) the text: (String(GEN_INTEGER_1))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GEN_INTEGER_1 Less than 3
-
Then - Actions
- Set GEN_INTEGER_1 = (GEN_INTEGER_1 + 1)
- Game - Display to (All players) the text: (String(GEN_INTEGER_1))
- Else - Actions
-
If - Conditions
- Hashtable - Save GEN_INTEGER_1 as (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) in HDRUID_Laceratestacks_table
- -------- add debuff effect --------
- Unit - Add (Druid) Lacerate effect to (Target unit of ability being cast)
- -------- save the target in a unit group to be loaded in the periodic event trigger --------
- Unit Group - Add (Target unit of ability being cast) to HDRUID_Lacerate_targets
- -------- create text --------
- Floating Text - Create floating text that reads ((String(GEN_INTEGER_1)) + stacks of Lacerate) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 75.00%, 0.00%), and 0.00%
-
Events
-
transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Casting unit)) Equal to (Matching player)))
-
Druid Lacerate damage
-
Events
- Time - Every 1.00 seconds of game time
-
Conditions
- (Number of units in HDRUID_Lacerate_targets) Greater than 0
-
Actions
- -------- pick every unit that has been saved as a flame shock target --------
-
Unit Group - Pick every unit in HDRUID_Lacerate_targets and do (Actions)
-
Loop - Actions
- -------- boolean sätts till att alla spelares DoT är färdig. Om det visar sig att den inte är färdig för någon spelare sätts den till "false". Annars om den behålls som true så kollar triggern det efter, och i
-
Loop - Actions
-
Events
-
såna fall tas enheten i Explshot_targets bort s --------
- Set HDRUID_Lacerate_finished = True
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
- Set GEN_INTEGER_1 = (Load (Integer A) of (Key (Picked unit)) from HDRUID_Laceratetime_table)
- -------- each players flameshock duration has been saved as (key - players number), this goes trhough all the units and checks if the flameshock duration on them is greater than 0 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GEN_INTEGER_1 Greater than 0
-
Then - Actions
- -------- reduce duration for each player --------
- Set GEN_INTEGER_1 = (GEN_INTEGER_1 - 1)
- Hashtable - Save GEN_INTEGER_1 as (Integer A) of (Key (Picked unit)) in HDRUID_Laceratetime_table
- -------- the flameshock duration is not finished --------
- Set HDRUID_Lacerate_finished = False
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- GEN_INTEGER_1 Equal to 12
- GEN_INTEGER_1 Equal to 9
- GEN_INTEGER_1 Equal to 6
- GEN_INTEGER_1 Equal to 3
- GEN_INTEGER_1 Equal to 0
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- -------- load the number of stacks and heal --------
- Set GEN_INTEGER_2 = (Load (Integer A) of (Key (Picked unit)) from HDRUID_Laceratestacks_table)
- Unit - Cause HDRUID_Lacerate_caster[(Integer A)] to damage (Picked unit), dealing (20.00 x (Real(GEN_INTEGER_2))) damage of attack type Spells and damage type Fire
- Game - Display to (All players) the text: ((String(GEN_INTEGER_2)) + stacks of lacerate)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GEN_INTEGER_1 Equal to 0
-
Then - Actions
- -------- set stacks to 0, heal is finsiehd --------
- Hashtable - Save 0 as (Integer A) of (Key (Picked unit)) in HDRUID_Laceratestacks_table
- -------- final damage, remove fire effect --------
- Floating Text - Create floating text that reads Lacerate fades above (Picked unit) with Z offset -50.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Player number of (Matching player)) Equal to (Integer A)))
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- HDRUID_Lacerate_finished Equal to True
-
Then - Actions
- Unit - Remove (Druid) Lacerate effect from (Picked unit)
- Unit Group - Remove (Picked unit) from HDRUID_Lacerate_targets
- Else - Actions
-
If - Conditions
-
Druid Pulverize cast BROKEN
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to (Druid) Pulverize
-
Actions
- -------- Load the number of Lacerate stacks the owner of the Pulverize caster has on the target --------
- Set GEN_INTEGER_1 = (Load (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) from HDRUID_Laceratestacks_table)
- Game - Display to (All players) the text: ((String(GEN_INTEGER_1)) + stacks of lacerate PULVERIZE)
- -------- Deal extra damage if more stacks than 0 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GEN_INTEGER_1 Greater than 0
-
Then - Actions
- -------- If there are stacks of Lacerate on the target, remove all stacks and deal extra damage --------
- Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (180.00 + (120.00 x (Real(GEN_INTEGER_1)))) damage of attack type Chaos and damage type Normal
- Hashtable - Save 0 as (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) in HDRUID_Laceratestacks_table
- -------- Show --------
- Floating Text - Create floating text that reads Lacerate fades above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
- Floating Text - Hide (Last created floating text) for (All players)
- Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
-
Else - Actions
- -------- if there are no stacks of Lacerate on the target, deal normal damage --------
- Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 180.00 damage of attack type Chaos and damage type Normal
-
If - Conditions
- Set GEN_TEMP_POINT_single = (Position of (Target unit of ability being cast))
- Unit - Create 1 Dummy Caster for (Owner of (Triggering unit)) at GEN_TEMP_POINT_single facing Default building facing degrees
- Unit - Hide (Last created unit)
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Add (Druid) Faerie Fire dummy to (Last created unit)
- Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Target unit of ability being cast)
- Custom script: call RemoveLocation(udg_GEN_TEMP_POINT_single)
-
Events