- Joined
- Nov 24, 2012
- Messages
- 198
I make a ability with trigger like this:
but why if i cast the spell and enemy unit is attack to caster suddenly my Warcraft exit by itself can anyone know how to fix it??
-
Defend
-
Events
- Unit - Footman 0000 <gen> Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Defend
-
Actions
- Set DefendCaster = (Triggering unit)
- Set DefendLife = (Life of DefendCaster)
- Set DefendChance = (Random integer number between 1 and 5)
- Trigger - Turn on Damage Taken <gen>
- Wait 1.00 seconds
- Trigger - Turn off Damage Taken <gen>
-
Events
-
Damage Taken
-
Events
- Unit - Footman 0000 <gen> Takes damage
- Conditions
-
Actions
- Set DefendSource = (Integer((Damage taken)))
- Set DefendAttacker = (Damage source)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DefendChance Equal to 1
-
Then - Actions
- Set DefendSource = (DefendSource - 15)
- Unit - Cause DefendAttacker to damage DefendCaster, dealing (Real(DefendSource)) damage of attack type Normal and damage type Normal
- Floating Text - Create floating text that reads ((String((DefendSource - 15))) + (Name of Defend )) above DefendCaster with Z offset 0.00, using font size 15.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Wait 1.00 seconds
- Floating Text - Change the color of (Last created floating text) to (100.00%, 0.00%, 0.00%) with 50.00% transparency
- Floating Text - Destroy (Last created floating text)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DefendChance Equal to 2
-
Then - Actions
- Set DefendSource = (DefendSource - 20)
- Unit - Cause DefendAttacker to damage DefendCaster, dealing (Real(DefendSource)) damage of attack type Normal and damage type Normal
- Floating Text - Create floating text that reads ((String((DefendSource - 20))) + (Name of Defend )) above DefendCaster with Z offset 0.00, using font size 15.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Wait 1.00 seconds
- Floating Text - Change the color of (Last created floating text) to (100.00%, 0.00%, 0.00%) with 50.00% transparency
- Floating Text - Destroy (Last created floating text)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DefendChance Equal to 3
-
Then - Actions
- Set DefendSource = (DefendSource - 1000000000)
- Unit - Cause DefendAttacker to damage DefendCaster, dealing (Real(DefendSource)) damage of attack type Normal and damage type Normal
- Floating Text - Create floating text that reads (Blocked + (Name of Defend )) above DefendCaster with Z offset 0.00, using font size 15.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Wait 1.00 seconds
- Floating Text - Change the color of (Last created floating text) to (100.00%, 0.00%, 0.00%) with 50.00% transparency
- Floating Text - Destroy (Last created floating text)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DefendChance Equal to 4
-
Then - Actions
- Set DefendSource = (DefendSource - 25)
- Unit - Cause DefendAttacker to damage DefendCaster, dealing (Real(DefendSource)) damage of attack type Normal and damage type Normal
- Floating Text - Create floating text that reads ((String((DefendSource - 25))) + (Name of Defend )) above DefendCaster with Z offset 0.00, using font size 15.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Wait 1.00 seconds
- Floating Text - Change the color of (Last created floating text) to (100.00%, 0.00%, 0.00%) with 50.00% transparency
- Floating Text - Destroy (Last created floating text)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DefendChance Equal to 5
-
Then - Actions
- Set DefendSource = (DefendSource - 10)
- Unit - Cause DefendAttacker to damage DefendCaster, dealing (Real(DefendSource)) damage of attack type Normal and damage type Normal
- Floating Text - Create floating text that reads ((String((DefendSource - 10))) + (Name of Defend )) above DefendCaster with Z offset 0.00, using font size 15.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Wait 1.00 seconds
- Floating Text - Change the color of (Last created floating text) to (100.00%, 0.00%, 0.00%) with 50.00% transparency
- Floating Text - Destroy (Last created floating text)
- Else - Actions
-
If - Conditions
-
Events