- Joined
- Jun 5, 2008
- Messages
- 504
First trigger
Iv tried many freaking things and cant get this working properly. The explosion sometimes exlodes too early/possition where it shouldnt explode (i mean the special effect).
Why im trying to do this with periodic? because If i do it with unit comes withing range. I think it would cause lagg at some point of the game when creating too many events.
And i know polar offset leaks twice, but ill fix it later.
Can someone help with this? I would also apriciate if someone could figure out how to make good collision system with gui or with jass/gui combination.
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Blast
-
Actions
- Set Fireball_point[1] = ((Position of (Triggering unit)) offset by 100.00 towards ((Facing of (Triggering unit)) - 20.00) degrees)
- Set Fireball_point[2] = ((Position of (Triggering unit)) offset by 1000.00 towards (Facing of (Triggering unit)) degrees)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Unique_number Less than 1000
-
Then - Actions
- Set Unique_number = (Unique_number + 1)
-
Else - Actions
- Set Unique_number = 1
-
If - Conditions
- Unit - Create 1 Fireball for (Triggering player) at Fireball_point[1] facing Default building facing degrees
- Unit - Order (Last created unit) to Move To Fireball_point[2]
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Set the custom value of (Last created unit) to Unique_number
- Unit Group - Add (Last created unit) to Fireball_group
- Custom script: call RemoveLocation(udg_Fireball_point[1])
- Custom script: call RemoveLocation(udg_Fireball_point[2])
- 2nd: trigger
-
Events
- Time - Every 0.10 seconds of game time
-
Actions
-
For each (Integer A) from 1 to (Number of units in Fireball_group), do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in (Random 1 units from Fireball_group) and do (Actions)
-
Loop - Actions
- Set FireballInt = (Custom value of (Picked unit))
- Set Fireball_point[FireballInt] = (Position of (Picked unit))
- Set Fireball_unit[FireballInt] = (Picked unit)
-
Unit Group - Pick every unit in (Units within 150.00 of Fireball_point[FireballInt] matching (((Matching unit) belongs to an enemy of (Owner of Fireball_unit[FireballInt])) Equal to True)) and do (Actions)
-
Loop - Actions
- Set fireballgroup2 = (Last created unit group)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in fireballgroup2) Greater than 0
-
Then - Actions
- Special Effect - Create a special effect at Fireball_point[FireballInt] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Cause Fireball_unit[FireballInt] to damage (Picked unit), dealing 250.00 damage of attack type Spells and damage type Normal
- Unit - Explode Fireball_unit[FireballInt]
- Unit Group - Remove Fireball_unit[FireballInt] from Fireball_group
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Set Fireball_unit[FireballInt] = No unit
- Custom script: call DestroyGroup(udg_fireballgroup2)
- Custom script: call RemoveLocation(udg_Fireball_point[udg_FireballInt])
-
Loop - Actions
-
Unit Group - Pick every unit in (Random 1 units from Fireball_group) and do (Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to (Number of units in Fireball_group), do (Actions)
Iv tried many freaking things and cant get this working properly. The explosion sometimes exlodes too early/possition where it shouldnt explode (i mean the special effect).
Why im trying to do this with periodic? because If i do it with unit comes withing range. I think it would cause lagg at some point of the game when creating too many events.
And i know polar offset leaks twice, but ill fix it later.
Can someone help with this? I would also apriciate if someone could figure out how to make good collision system with gui or with jass/gui combination.