Hello, guys
I tried to make an ability that similar to 'False Promise' in DOTA, the ability can add a shield(with limited hit-point) to a target unit, reduces damage to the unit, if the shield broke, the unit die. So I create a new ability, based on Anti-magic Shell, set the duration time to 0.01. And created three triggers(see below) to reduce the damage and set the HP of the shield to 5000, if the target unit taken over 5000 damage, then kill the target unit.
This trigger sometimes work, but sometimes not, I don't know what's the problem, please help me complete this trigger. Thanks!
Here are the variables:
EnegyShield_Damage Real Array (1)
EnegyShield_DamageTotal Real Array (1)
EnegyShield_Effect Specail Effect Array (1)
EnegyShield_HP Real Array (1)
EnegyShield_Target Unit Array (1)
Here are the triggers:
I tried to make an ability that similar to 'False Promise' in DOTA, the ability can add a shield(with limited hit-point) to a target unit, reduces damage to the unit, if the shield broke, the unit die. So I create a new ability, based on Anti-magic Shell, set the duration time to 0.01. And created three triggers(see below) to reduce the damage and set the HP of the shield to 5000, if the target unit taken over 5000 damage, then kill the target unit.
This trigger sometimes work, but sometimes not, I don't know what's the problem, please help me complete this trigger. Thanks!
Here are the variables:
EnegyShield_Damage Real Array (1)
EnegyShield_DamageTotal Real Array (1)
EnegyShield_Effect Specail Effect Array (1)
EnegyShield_HP Real Array (1)
EnegyShield_Target Unit Array (1)
Here are the triggers:
-
Enegy Shield
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Enegy Shield
-
Actions
- Set EnegyShield_Target[1] = No unit
- Special Effect - Destroy EnegyShield_Effect[1]
- Set EnegyShield_Target[1] = (Target unit of ability being cast)
- Special Effect - Create a special effect attached to the origin of EnegyShield_Target[1] using war3mapImported\EnergyShield_Full.mdx
- Set EnegyShield_Effect[1] = (Last created special effect)
- Trigger - Turn on Enegy Shield Damage <gen>
- Trigger - Add to Enegy Shield Damage <gen> the event (Unit - EnegyShield_Target[1] Takes damage)
- Trigger - Turn on Enegy Shield Limit <gen>
- Wait (30.00 x (Real((Level of Enegy Shield for (Triggering unit))))) seconds
- Special Effect - Destroy EnegyShield_Effect[1]
- Trigger - Turn off Enegy Shield Damage <gen>
- Trigger - Turn off Enegy Shield Limit <gen>
-
Events
-
Enegy Shield Damage
- Events
- Conditions
-
Actions
- Set EnegyShield_HP[1] = (Life of EnegyShield_Target[1])
- Set EnegyShield_Damage[1] = (Damage taken)
- Unit - Set life of EnegyShield_Target[1] to (EnegyShield_HP[1] + EnegyShield_Damage[1])
- Set EnegyShield_DamageTotal[1] = (EnegyShield_DamageTotal[1] + EnegyShield_Damage[1])
-
Enegy Shield Limit
-
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
- EnegyShield_DamageTotal[1] Greater than or equal to 5000.00
-
Then - Actions
- Special Effect - Create a special effect attached to the origin of EnegyShield_Target[1] using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
- Special Effect - Destroy (Last created special effect)
- Special Effect - Destroy EnegyShield_Effect[1]
- Unit - Kill EnegyShield_Target[1]
- Set EnegyShield_DamageTotal[1] = 0.00
- Trigger - Turn off Enegy Shield Damage <gen>
- Trigger - Turn off (This trigger)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
Last edited: