- Joined
- Jun 14, 2008
- Messages
- 176
Need help - Making sound appear when unit gets hit with a spell active
Edit: Ok, I figured out the animation, just doesn't disappear right away(anyone know how to make it disappear instantly?) All I need help with is the sound now
First, I am editing someone else's map/spell it's from EotA: Exodus, unprotected map.
It has a spell that creates a shield(with health) around a unit. For example, at level 1, it gives a 200 HP shield that lets the unit take 200 damage without taking actual damage, after 200 HP is dealt, the shield expires.
There is a problem with the spell, the special effect doesn't function correctly(it doesn't disappear), and I also want to make it play sound when a unit gets attacked.
So:
1. When the spell takes effect, it creates a manashield "special effect" attachment onto the unit. It's supposed to disappear once the spell wears off, but it doesn't.
2. I also want to make it play a sound when the unit(with the shield on) gets attacked.
Here's most of the spell(this is the map creator's triggers btw) (Also, I edited out repeating stuff, like for the levels, to make it shorter)
Also, here's my trigger of trying to add a sound effect to heroes(with the ability) that gets attacked.
Edit: Ok, I figured out the animation, just doesn't disappear right away(anyone know how to make it disappear instantly?) All I need help with is the sound now
First, I am editing someone else's map/spell it's from EotA: Exodus, unprotected map.
It has a spell that creates a shield(with health) around a unit. For example, at level 1, it gives a 200 HP shield that lets the unit take 200 damage without taking actual damage, after 200 HP is dealt, the shield expires.
So:
2. I also want to make it play a sound when the unit(with the shield on) gets attacked.
Here's most of the spell(this is the map creator's triggers btw) (Also, I edited out repeating stuff, like for the levels, to make it shorter)
-
Watery Shell Stats
-
Events
- Time - Elapsed game time is 10.00 seconds
- Conditions
-
Actions
- Custom script: call DestroyTrigger(GetTriggeringTrigger())
- Set WateryShellHealth[1] = 200.00
- Set WateryShellKeep[1] = 0.75
-
Events
-
Watery Shell Cast
-
Events
- Unit - Naga Sorceress 0079 <gen> Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Watery Shell
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))] Greater than 0.00
-
Then - Actions
- Special Effect - Destroy WateryShellInstEffect[(Player number of (Owner of (Target unit of ability being cast)))]
- Else - Actions
-
If - Conditions
- Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Human\ManaShield\ManaShieldCaster.mdl
- Set WateryShellInstEffect[(Player number of (Owner of (Target unit of ability being cast)))] = (Last created special effect)
- Set WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))] = (WateryShellHealth[(Level of (Ability being cast) for (Triggering unit))] + (WateryShellKeep[(Level of (Ability being cast) for (Triggering unit))] x WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))]))
- Trigger - Turn on Watery Shell Effect <gen>
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Watery Shell Effect
-
Events
- Unit - Naga Sorceress 0079 <gen> Takes damage
-
Conditions
- WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than 0.00
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than (Damage taken)
-
Then - Actions
- Set WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] = (WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] - (Damage taken))
- Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
-
Else - Actions
- Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))])
- Set WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] = 0.00
- Special Effect - Destroy WateryShellInstEffect[(Player number of (Owner of (Triggering unit)))]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
Also, here's my trigger of trying to add a sound effect to heroes(with the ability) that gets attacked.
-
Watery Shell Cast Sound Effect
-
Events
- Unit - A unit Is attacked
-
Conditions
- WateryShellInstHealth[(Player number of (Owner of (Attacked unit)))] Greater than 0.00
-
Actions
- Sound - Play SpellShieldImpact1 <gen> at 100.00% volume, attached to (Triggering unit)
- Sound - Destroy (Last played sound)
-
Events
Last edited: