- Joined
- May 20, 2008
- Messages
- 138
I am making a MUI spell called flame shock. Flame shock is a damage over time effect that sets the target on fire and deals damage every 3 seconds for 18 seconds. Each player hero can cast flame shock on any enemy target, and have it up on several targets at a time, if two players cast on the same target, the effect stacks.
The problem I am having is with the special effect that sets the target on fire. I create a special effect in the first trigger and save it to a hashtable, "HSHAMAN_flameshockeffect_table".
Here is the casting trigger, I have emphasized the part where the special effect gets created and saved, since that is the important part:
Here is the periodic damage and duration trigger, I have emphasized the part where the special effect SHOULD get loaded and destroyed, however this doesn't work (it's in the final else of the trigger). I have verified that the trigger at least gets to and executes this and the other parts via ingame text messages:
The problem I am having is with the special effect that sets the target on fire. I create a special effect in the first trigger and save it to a hashtable, "HSHAMAN_flameshockeffect_table".
-
Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
-
Hashtable - Save (Key (Last created special effect)) as (Player number of (Owner of (Casting unit))) of (Key (Target unit of ability being cast)) in HSHAMAN_flameshockeffect_table
-
Set HSHAMAN_flameshockeffect = (Load (Integer A) of (Key (Picked unit)) in HSHAMAN_flameshockeffect_table)
-
Special Effect - Destroy HSHAMAN_flameshockeffect
Here is the casting trigger, I have emphasized the part where the special effect gets created and saved, since that is the important part:
-
Shaman Flame Shock
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to (Shaman) Flame Shock
-
-
Actions
-
-------- deal initial damage --------
-
Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 100.00 damage of attack type Spells and damage type Fire
-
-------- save the caster --------
-
Set HSHAMAN_flameshockcaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
-
-------- refresh the flame shock duration and ticks --------
-
Hashtable - Save 18 as (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) in HSHAMAN_flameshocktime_table
-
Hashtable - Save 1 as (Player number of (Owner of (Triggering unit))) of (Key (Target unit of ability being cast)) in HSHAMAN_flameshocktick_table
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
-
Hashtable - Save (Key (Last created special effect)) as (Player number of (Owner of (Casting unit))) of (Key (Target unit of ability being cast)) in HSHAMAN_flameshockeffect_table
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- create a special effect and save that the unit has a buff of flame shock on it --------
-
-------- save the fact that the unit has a flame shock belonging to the owner of the casting unit on it for finishing the time trigger and the lava burst trigger --------
-
Hashtable - Save 1 as (Player number of (Owner of (Casting unit))) of (Key (Target unit of ability being cast)) in HSHAMAN_flameshockstacks_table
-
-------- save the target for the damage dealing and duration trigger --------
-
Unit Group - Add (Target unit of ability being cast) to HSHAMAN_flameshocktargets
-
-------- create text --------
-
Floating Text - Create floating text that reads Flameshock 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% 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)))
-
-
-
Shaman Flame Shock time
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
-------- pick every unit that has been saved as a flame shock target --------
-
Unit Group - Pick every unit in HSHAMAN_flameshocktargets and do (Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
-------- each players flameshock duration has been saved with the players number--------
-
-------- , and it goes through all players with Integer A from 1 to 10,--------
-
-------- 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
-
(Load (Integer A) of (Key (Picked unit)) from HSHAMAN_flameshocktime_table) Greater than 0
-
-
Then - Actions
-
-------- reduce duration for each player --------
-
Set HSHAMAN_flameshocktime = (Load (Integer A) of (Key (Picked unit)) from HSHAMAN_flameshocktime_table)
-
Set HSHAMAN_flameshocktime = (HSHAMAN_flameshocktime - 1)
-
Hashtable - Save HSHAMAN_flameshocktime as (Integer A) of (Key (Picked unit)) in HSHAMAN_flameshocktime_table
-
-------- do ticks --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load (Integer A) of (Key (Picked unit)) from HSHAMAN_flameshocktick_table) Less than 3
-
-
Then - Actions
-
Set HSHAMAN_flameshockticks = (Load (Integer A) of (Key (Picked unit)) from HSHAMAN_flameshocktick_table)
-
Set HSHAMAN_flameshockticks = (HSHAMAN_flameshockticks + 1)
-
Hashtable - Save HSHAMAN_flameshockticks as (Integer A) of (Key (Picked unit)) in HSHAMAN_flameshocktick_table
-
-
Else - Actions
-
-------- at 3 ticks deal damage --------
-
Hashtable - Save 1 as (Integer A) of (Key (Picked unit)) in HSHAMAN_flameshocktick_table
-
Unit - Cause HSHAMAN_flameshockcaster[(Integer A)] to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Fire
-
-
-
-
Else - Actions
-
-------- when the duration of the flameshock has finished, set stacks to 0 so lava burst wont do double damage, and destroy special effect --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load (Integer A) of (Key (Picked unit)) from HSHAMAN_flameshockstacks_table) Equal to 1
-
-
Then - Actions
-
Hashtable - Save 0 as (Integer A) of (Key (Picked unit)) in HSHAMAN_flameshockstacks_table
-
-------- destroy special effect OBS! THIS DOESNT WORK! --------
-
-------- destroy special effect OBS! THIS DOESNT WORK! --------
-
-------- destroy special effect OBS! THIS DOESNT WORK! --------
-
Set HSHAMAN_flameshockeffect = (Load (Integer A) of (Key (Picked unit)) in HSHAMAN_flameshockeffect_table)
-
Special Effect - Destroy HSHAMAN_flameshockeffect
-
-------- destroy special effect OBS! THIS DOESNT WORK! --------
-
-------- destroy special effect OBS! THIS DOESNT WORK! --------
-
-------- destroy special effect OBS! THIS DOESNT WORK! --------
-
-------- dispaly (floating and ingame) text to verify that this part of the trigger is executed --------
-
Game - Display to (All players) the text: else, destroy speci...
-
Floating Text - Create floating text that reads Flameshock 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
-
-
-
-
-
-
-
-
-
Last edited: