- Joined
- Jul 9, 2008
- Messages
- 253
Hello everybody, I'm in need for some help for a spell I tried to make but didn't work out.
So it should spawn 3 fireballs, launch them in 3 different directions (based on the facing of the hero) and should explode on unit impact.
So far it only spawned the units who then disappeared after a second.
Trigger 1:
~Quetzalcotl
So it should spawn 3 fireballs, launch them in 3 different directions (based on the facing of the hero) and should explode on unit impact.
So far it only spawned the units who then disappeared after a second.
Trigger 1:
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Blazing Strike
-
Actions
- Set BSUnit = (Casting unit)
- Set BSOwner = (Owner of BSUnit)
- Set BSType = BS Dummy
- Set BSUnitAngle = (Facing of BSUnit)
- Set BSUnitPoint = (Position of BSUnit)
- -------- ---------------------- --------
- Set BSDistance = 400.00
- Set BSAgility = (Agility of BSUnit (Include bonuses))
- Set BSDamage = (30.00 + ((Real(BSAgility)) x 2.00))
- -------- ---------------------- --------
- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------
- Set BSProjectileAngle = (BSUnitAngle + 0.00)
- Unit - Create 1 BSType for BSOwner at BSUnitPoint facing BSProjectileAngle degrees
- Set BSProjectile = (Last created unit)
- Unit - Add a 1.00 second Generic expiration timer to BSProjectile
- -------- ---------------------- --------
- Hashtable - Save Handle OfBSProjectile as 0 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSDistance as 1 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSDamage as 2 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSProjectileAngle as 3 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save Handle OfBSOwner as 4 of (Key (Last created unit)) in BSHashTable
- Unit Group - Add BSProjectile to BSProjectiles
- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------
- Set BSProjectileAngle = (BSUnitAngle - 30.00)
- Unit - Create 1 BSType for BSOwner at BSUnitPoint facing BSProjectileAngle degrees
- Set BSProjectile = (Last created unit)
- Unit - Add a 1.00 second Generic expiration timer to BSProjectile
- -------- ---------------------- --------
- Hashtable - Save Handle OfBSProjectile as 0 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSDistance as 1 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSDamage as 2 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSProjectileAngle as 3 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save Handle OfBSOwner as 4 of (Key (Last created unit)) in BSHashTable
- Unit Group - Add BSProjectile to BSProjectiles
- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------
- Set BSProjectileAngle = (BSUnitAngle + 30.00)
- Unit - Create 1 BSType for BSOwner at BSUnitPoint facing BSProjectileAngle degrees
- Set BSProjectile = (Last created unit)
- Unit - Add a 1.00 second Generic expiration timer to BSProjectile
- -------- ---------------------- --------
- Hashtable - Save Handle OfBSProjectile as 0 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSDistance as 1 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSDamage as 2 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save BSProjectileAngle as 3 of (Key (Last created unit)) in BSHashTable
- Hashtable - Save Handle OfBSOwner as 4 of (Key (Last created unit)) in BSHashTable
- Unit Group - Add BSProjectile to BSProjectiles
- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------
- Custom script: call RemoveLocation(udg_BSUnitPoint)
- -------- ---------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Blazing Strike New <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on Blazing Strike New <gen>
- Else - Actions
-
If - Conditions
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in BSProjectiles) Greater than 0
-
Then - Actions
-
Unit Group - Pick every unit in BSProjectiles and do (Actions)
-
Loop - Actions
- Set BSProjectile = (Load 0 of (Key (Picked unit)) in BSHashTable)
- Set BSDistance = (Load 1 of (Key (Picked unit)) from BSHashTable)
- Set BSDamage = (Load 2 of (Key (Picked unit)) from BSHashTable)
- Set BSProjectileAngle = (Load 3 of (Key (Picked unit)) from BSHashTable)
- Set BSOwner = (Load 4 of (Key (Picked unit)) in BSHashTable)
- Set BSProjectileLocation = (Position of BSProjectile)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (BSProjectile is dead) Equal to True
-
Then - Actions
- Set BSProjectileLocation = (Position of BSProjectile)
- Special Effect - Create a special effect at BSProjectileLocation using Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Unit Group - Remove (Picked unit) from BSProjectiles
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in BSHashTable
- Custom script: call RemoveLocation( udg_BSProjectileLocation )
-
Else - Actions
- Set BSProjectileLocation = (Position of BSProjectile)
- Set BSProjectileEnd = (BSProjectileLocation offset by (BSDistance x 0.03) towards BSProjectileAngle degrees)
- Set BSGroup = (Units within 50.00 of BSProjectileLocation matching ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an ally of BSOwner) Equal to True)))
-
Unit Group - Pick every unit in BSGroup and do (Actions)
-
Loop - Actions
- Set BSPickedUnits = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- BSPickedUnits Not equal to No unit
-
Then - Actions
- Unit - Cause BSProjectile to damage BSPickedUnits, dealing BSDamage damage of attack type Spells and damage type Normal
- Unit - Kill BSProjectile
-
Else - Actions
- Unit - Move BSProjectile instantly to BSProjectileEnd
-
If - Conditions
-
Loop - Actions
- Custom script: call RemoveLocation( udg_BSProjectileLocation )
- Custom script: call RemoveLocation( udg_BSProjectileEnd )
- Custom script: call DestroyGroup(udg_BSGroup)
-
If - Conditions
- Custom script: call RemoveLocation( udg_BSProjectileLocation )
-
Loop - Actions
-
Unit Group - Pick every unit in BSProjectiles and do (Actions)
-
Else - Actions
- Trigger - Turn off (This trigger)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
~Quetzalcotl