I'm having some problems with my custom doom skill. I want it to do a countdown instead of dealing damage per second and when the timer reaches 0 the victim dies. I've solved that. But my problem is the counter itself. I have made a map where you choose your own hero. At the point where the hero spawns a timer appears as soon as the map starts. It doesn't do anything, it just counts down from 20. I want to get rid of that timer.
My second problem is that I want doom to be transferable. If a unit that has been struck by doom attacks another unit the attacked unit gets the counter (which doesn't reset).
I found the code in an other forum and tried to adapt it to my map. So if you answer PLEASE DUMB IT DOWN
Here is the code for my doom spell. Doom_Group is a unit group. The initial value is empty.
Doom_Level is an integer array with the size initial value 0 and the value is 1.
My second problem is that I want doom to be transferable. If a unit that has been struck by doom attacks another unit the attacked unit gets the counter (which doesn't reset).
I found the code in an other forum and tried to adapt it to my map. So if you answer PLEASE DUMB IT DOWN
Here is the code for my doom spell. Doom_Group is a unit group. The initial value is empty.
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Curse of Doom
-
Actions
- Unit Group - Add (Target unit of ability being cast) to Doom_Group
-
Events
- Unit - A unit Is attacked
-
Conditions
-
And - All (Conditions) are true
- Conditions
- ((Triggering unit) is in Doom_Group) Equal to True
-
And - All (Conditions) are true
-
Actions
- Unit Group - Remove (Attacking unit) from Doom_Group
- Unit Group - Add (Attacked unit) to Doom_Group
Doom_Level is an integer array with the size initial value 0 and the value is 1.
-
Events
- Unit - A unit Starts the effect of an ability
- (Ability being cast) Equal to Curse of Doom
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Doom_Level[(Player number of (Triggering player))] Equal to 1
-
Then - Actions
- Set DoomSecondsRemaining = 40
- Set DoomTarget = (Target unit of ability being cast)
- Set TempPoint = (Position of DoomTarget)
-
If - Conditions
- Trigger - Turn on (This trigger)
- Wait until (DoomSecondsRemaining Equal to 0), checking every 1.00 seconds
-
Trigger - Turn off (This trigger)
-
Unit - Kill DoomTarget
-
Else - Actions
- Do nothing
-
Else - Actions
-
Unit - Kill DoomTarget
-
Events
- Time - Every 1.00 seconds of game time
-
Conditions
- DoomSecondsRemaining Not equal to 0
-
Actions
- Set TempPoint = (Position of DoomTarget)
- Floating Text - Create floating text that reads (String(DoomSecondsRemaining)) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 40.00%, 0.00%), and 0.00% transparency
- Set DoomSecondsRemaining = (DoomSecondsRemaining - 1)
- Wait 1.00 seconds
- Floating Text - Destroy (Last created floating text)
- Custom script: call RemoveLocation(udg_TempPoint)
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Item-type of (Item being manipulated)) Equal to Curse of Doom
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Doom_Level[(Player number of (Owner of (Triggering unit)))] Less than or equal to 2
-
Then - Actions
- Set Doom_Level[(Player number of (Owner of (Triggering unit)))] = (Doom_Level[(Player number of (Owner of (Triggering unit)))] + 1)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)