I have 2 spells that are interacting oddly. They are 100% triggered and based on channel.
Spell 1 - Mortal Wound
Deals damage and stops target from going over 75% max HP for 10 seconds.
It creates a dummy unit that casts a hardcoded Undead Banshee - Curse with 0 in all fields except 10 duration. Puts unit in a hashtable. Runs second trigger every 0.03 seconds, if unit is over 75%, it sets HP to 75%. Removes the buff after 10 seconds and then clears the hashtable.
Spell 2 - Lethal Poison
Poisons the unit and makes it take damage equal to its currently missing HP over the next 10 seconds.
It creates a dummy unit that casts a hardcoded Undead Banshee - Curse with 0 in all fields except 10 duration. Puts unit in a hashtable. Runs second trigger every 0.20 seconds to cause the damage. Removes after 10 seconds.
The hardcoded curse spells are different, one is named BRS-5, the other is named ASN-5. The buffs placed are also different, and only really exist for the graphic effect and the buff tooltip.
My problem is that if a unit has one of the buffs, and the other one is cast, both buffs disappear but the triggered damage still occurs. So my question is do I have to change the SPELLS to be based off different hardcoded spells, or can I have both SPELLS based on curse with a different base BUFF?
Spell 1 - Mortal Wound
Deals damage and stops target from going over 75% max HP for 10 seconds.
It creates a dummy unit that casts a hardcoded Undead Banshee - Curse with 0 in all fields except 10 duration. Puts unit in a hashtable. Runs second trigger every 0.03 seconds, if unit is over 75%, it sets HP to 75%. Removes the buff after 10 seconds and then clears the hashtable.
-
Mortal Wound 01
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to BRS-5 Mortal Wound
-
-
Actions
-
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (0.25 x (Life of (Target unit of ability being cast))) damage of attack type Hero and damage type Normal
-
Special Effect - Create a special effect attached to the weapon, left of (Triggering unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
-
Special Effect - Destroy (Last created special effect)
-
Special Effect - Create a special effect attached to the weapon, right of (Triggering unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
-
Special Effect - Destroy (Last created special effect)
-
Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Objects\Spawnmodels\Orc\Orcblood\OrdBloodWyvernRider.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set temp_point = (Position of (Target unit of ability being cast))
-
Unit - Create 1 D.BRS-5 Mortal Wound for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
-
Custom script: call RemoveLocation(udg_temp_point)
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Undead Banshee - Curse (Target unit of ability being cast)
-
Hashtable - Save 10.00 as (Key duration) of (Key (Target unit of ability being cast)) in H_MortalWound
-
Hashtable - Save 75.00 as (Key hpmax) of (Key (Target unit of ability being cast)) in H_MortalWound
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Target unit of ability being cast) is in G_MortalWound) Equal to False
-
-
Then - Actions
-
Unit Group - Add (Target unit of ability being cast) to G_MortalWound
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Mortal Wound 02 <gen> is on) Equal to False
-
-
Then - Actions
-
Trigger - Turn on Mortal Wound 02 <gen>
-
-
Else - Actions
-
-
-
-
Mortal Wound 02
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in G_MortalWound) Greater than 0
-
-
Then - Actions
-
Unit Group - Pick every unit in G_MortalWound and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load (Key duration) of (Key (Picked unit)) from H_MortalWound) Greater than 0.00
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
-
Special Effect - Destroy (Last created special effect)
-
Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_MortalWound) - R_FRAME_PROJECTILES) as (Key duration) of (Key (Picked unit)) in H_MortalWound
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Percentage life of (Picked unit)) Greater than (Load (Key hpmax) of (Key (Picked unit)) from H_MortalWound)
-
-
Then - Actions
-
Unit - Set life of (Picked unit) to (Load (Key hpmax) of (Key (Picked unit)) from H_MortalWound)%
-
-
Else - Actions
-
-
-
Else - Actions
-
Unit - Remove ~BRS-5 Mortal Wound (Berserker) buff from (Picked unit)
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_MortalWound
-
Unit Group - Remove (Picked unit) from G_MortalWound
-
-
-
-
-
-
Else - Actions
-
Trigger - Turn off (This trigger)
-
-
-
-
Spell 2 - Lethal Poison
Poisons the unit and makes it take damage equal to its currently missing HP over the next 10 seconds.
It creates a dummy unit that casts a hardcoded Undead Banshee - Curse with 0 in all fields except 10 duration. Puts unit in a hashtable. Runs second trigger every 0.20 seconds to cause the damage. Removes after 10 seconds.
-
Lethal Poison 01
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to ASN-5 Lethal Poison
-
-
Actions
-
Set temp_point = (Position of (Target unit of ability being cast))
-
Unit - Create 1 D.ASN-5 Lethal Poison for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
-
Custom script: call RemoveLocation(udg_temp_point)
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Undead Banshee - Curse (Target unit of ability being cast)
-
Hashtable - Save ((1.00 x ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))) / (11.00 - (Real((Level of (Ability being cast) for (Triggering unit)))))) as (Key damage) of (Key (Target unit of ability being cast)) in H_LethalPoison
-
Hashtable - Save (11.00 - (Real((Level of (Ability being cast) for (Triggering unit))))) as (Key duration) of (Key (Target unit of ability being cast)) in H_LethalPoison
-
Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Target unit of ability being cast)) in H_LethalPoison
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Target unit of ability being cast) is in G_LethalPoison) Equal to False
-
-
Then - Actions
-
Unit Group - Add (Target unit of ability being cast) to G_LethalPoison
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Lethal Poison 02 <gen> is on) Equal to False
-
-
Then - Actions
-
Trigger - Turn on Lethal Poison 02 <gen>
-
-
Else - Actions
-
-
-
-
Lethal Poison 02
-
Events
-
Time - Every 0.20 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in G_LethalPoison) Greater than 0
-
-
Then - Actions
-
Unit Group - Pick every unit in G_LethalPoison and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) Greater than 0.00
-
-
Then - Actions
-
Unit - Cause (Load (Key caster) of (Key (Picked unit)) in H_LethalPoison) to damage (Picked unit), dealing ((Load (Key damage) of (Key (Picked unit)) from H_LethalPoison) x R_FRAME_OVERTIME) damage of attack type Hero and damage type Poison
-
Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) - R_FRAME_OVERTIME) as (Key duration) of (Key (Picked unit)) in H_LethalPoison
-
-
Else - Actions
-
Unit - Remove ~ASN-5 Lethal Poison (Assassin) buff from (Picked unit)
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_LethalPoison
-
Unit Group - Remove (Picked unit) from G_LethalPoison
-
-
-
-
-
-
Else - Actions
-
Trigger - Turn off (This trigger)
-
-
-
-
My problem is that if a unit has one of the buffs, and the other one is cast, both buffs disappear but the triggered damage still occurs. So my question is do I have to change the SPELLS to be based off different hardcoded spells, or can I have both SPELLS based on curse with a different base BUFF?