D
domg839
Guest
I want to add a abiltiy to a weapon so when you hit someoen there is a chance to give back hp. So like a 5% chance to give the hero 100 hp.
[U][B]Events[/B][/U]
Unit - A unit Is attacked
[U][B]Conditions[/B][/U]
(Unit-type of (Attacking unit)) Equal to Crusader
[U][B]Actions[/B][/U]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 20) Equal to 1
Then - Actions
Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Add Heal to (Last created unit)
Unit - Order (Last created unit) to Human Priest - Heal (Attacking unit)
Else - Actions
Code:[U][B]Events[/B][/U] Unit - A unit Is attacked [U][B]Conditions[/B][/U] (Unit-type of (Attacking unit)) Equal to Crusader [U][B]Actions[/B][/U] If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Random integer number between 1 and 20) Equal to 1 Then - Actions Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees Unit - Add a 3.00 second Generic expiration timer to (Last created unit) Unit - Add Heal to (Last created unit) Unit - Order (Last created unit) to Human Priest - Heal (Attacking unit) Else - Actions
Then just edit heal to how much you want it to heal.
How about this?
Events
Unit - A unit Is attacked
Conditions
Attacking unit (has item of type(Healing Sword)) equal to true
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or Equal to 5
Then - Actions
Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Add Holy Light to (Last created unit)
Unit - Order (Last created unit) to Human Paladin - Holy Light (Attacking unit)
Else - Actions