- Joined
- Oct 9, 2023
- Messages
- 20
So i'm creating custom spells for heroes in my map.
I wanted to create a madness spell which would make mad units attack random units in their range for 5,10 or 17 seconds depending on the ability level.
This is achieved by changing their owner then ordering them to attack a different random unit in range each 1 seconds then changing owner to the owner they were at first.
It seems to work, i tried it on creeps, but theres an issue : when i use it on a unit, i can't re use it on this unit. It'll change their owner, but then the unit won't attack the other units, and will even keep the changed owner. idk why but the second time i use the spell on a unit, all of the actions that goes after the "change owner to player 7 (green)" don't work.
the range of the ability changes too.
I wanted to create a madness spell which would make mad units attack random units in their range for 5,10 or 17 seconds depending on the ability level.
This is achieved by changing their owner then ordering them to attack a different random unit in range each 1 seconds then changing owner to the owner they were at first.
It seems to work, i tried it on creeps, but theres an issue : when i use it on a unit, i can't re use it on this unit. It'll change their owner, but then the unit won't attack the other units, and will even keep the changed owner. idk why but the second time i use the spell on a unit, all of the actions that goes after the "change owner to player 7 (green)" don't work.
-
Events : a unit starts the effect of an ability
-
Conditions : Ability being cast = Madness
-
Actions :
-
If : Level of madness for (Casting unit) = 1
-
Then : Pick every unit in (Region centered at (Target point of Ability being cast) with size 200.00,200.00 and do (actions)
-
If : Owner of picked unit ≠ Owner of casting unit
-
Then :
-
If owner of picked unit = Player 9 (grey)
-
Unit - Change ownership of picked unit to Player 7 green and keep colour
-
For each integer from 0 to 5:
-
[order picked unit to attack (random unit in range: 200)
-
Wait 1 second]
-
Change ownership of picked unit to Player 9 (grey) and keep colour
the range of the ability changes too.