Kelv
TH.net Regular
- Reaction score
- 7
I changed a spell from a single hero, to a multiple hero spell, and I actually thought that the spell work easier and better, but I cant seem to get the spell to work. I have one trigger that splits all the heroes into two groups at the beginning of the game, into Alliance and Horde heroes. So I have this skill which is an alliance spell. My first trigger is this:
Player 1 is a computer for the alliance, player 6 is a computer for the horde.
My second trigger, which is the spell trigger, is this:
Can anyone see any glitches in my code, aside from leaks? (If you notice there are likes (which I assume there are) feel free to call me out on them, it would be a help, but its not the point of the thread. Thanks for reading
Code:
Manual Select
Events
Unit - A unit Sells a unit
Conditions
((Sold unit) is A Hero) Equal to True
Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Sold unit))) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to False
Then - Actions
Unit - Remove (Picked unit) from the game
Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Move (Sold unit) instantly to (Position of (Picked unit))
Neutral Building - Remove (Unit-type of (Sold unit)) from all marketplaces
Else - Actions
Do nothing
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
Special Effect - Create a special effect at (Position of (Sold unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
Special Effect - Destroy (Last created special effect)
Game - Display to (All players) the text: ((Name of (Owner of (Sold unit))) + ( has chosen: + (Name of (Sold unit))))
Item - Create Replenishment at (Center of (Playable map area))
Hero - Give (Last created item) to (Sold unit)
Selection - Select (Sold unit) for (Owner of (Sold unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Sold unit)) is an ally of Player 1 (Red)) Equal to True
Then - Actions
Unit Group - Add (Sold unit) to Ally_Heroes
Else - Actions
Unit Group - Add (Sold unit) to Horde_Heroes
My second trigger, which is the spell trigger, is this:
Code:
Pray to Naaru
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Pray to Naaru
Actions
Unit Group - Pick every unit in Ally_Heroes and do (Actions)
Loop - 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 80
Then - Actions
Wait 0.50 seconds
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Wait 0.10 seconds
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Real((Level of Pray to Naaru for (Triggering unit)))) x 150.00))
Floating Text - Create floating text that reads (Healed + (String(((Level of Pray to Naaru for (Triggering unit)) x 150)))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
Wait 0.40 seconds
Special Effect - Destroy (Last created special effect)
Trigger - Run (This trigger) (ignoring conditions)
Else - Actions
Game - Display to (All allies of (Owner of (Triggering unit))) for 10.00 seconds the text: ((A'dal: Sorry + (Name of (Owner of (Triggering unit)))) + , My powers are not strong enough.)
Floating Text - Create floating text that reads FAILED! at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
Can anyone see any glitches in my code, aside from leaks? (If you notice there are likes (which I assume there are) feel free to call me out on them, it would be a help, but its not the point of the thread. Thanks for reading