- Joined
- Feb 25, 2009
- Messages
- 2,004
I've recently recovered some of my old spells which are unfinished so I decided to re-make some of them and share them here.
But I ran into a very weird problem with one of them.
Here are the triggers:
The spell should first pick all enemy units from the target point, then move the caster to each of them and order him to attack them, using base attacks (melee) and having maximum attack speed with the demolish ability for bonus damage.
The only problem is, it doesn't seem to happen the way it should. It does pick the targets and all that, but the caster NEVER moves to them and attack. All other actions from above work perfectly well..
I can't seem to find the problem anywhere, even though I used like an our to debug every single part of it... even using coordinates (X/Y) doesn't seem to work..
So, please help me out with this one.
Thanks in advance.
But I ran into a very weird problem with one of them.
Here are the triggers:
-
SD Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Slice and Dice
-
Actions
- Set SD_Caster[SD_MUI1] = (Triggering unit)
- Set SD_cPoint[SD_MUI1] = (Position of SD_Caster[SD_MUI1])
- Set SD_tPoint[SD_MUI1] = (Target point of ability being cast)
- Set SD_Targets[SD_MUI1] = (Units within 300.00 of SD_tPoint[SD_MUI1] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A flying unit) Equal to False) and (((Matching unit) belongs to an enemy of (Owner
- Unit - Create 1 Projectile Dummy for (Owner of SD_Caster[SD_MUI1]) at SD_cPoint[SD_MUI1] facing SD_tPoint[SD_MUI1]
- Set SD_Dummy[SD_MUI1] = (Last created unit)
- Special Effect - Create a special effect attached to the origin of SD_Dummy[SD_MUI1] using units\orc\Hellscream\Hellscream.mdl
- Set SD_DummyModel[SD_MUI1] = (Last created special effect)
- Animation - Change SD_Dummy[SD_MUI1]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
- Animation - Change SD_Dummy[SD_MUI1]'s animation speed to 0.00% of its original speed
- Animation - Change SD_Caster[SD_MUI1]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
- Unit - Add Maximum Attack Speed to SD_Caster[SD_MUI1]
- Unit - Add Bonus Damage to SD_Caster[SD_MUI1]
- Unit - Turn collision for SD_Caster[SD_MUI1] Off
- Unit - Make SD_Caster[SD_MUI1] Invulnerable
- Custom script: call RemoveLocation (udg_SD_tPoint[udg_SD_MUI1])
- Game - Display to (All players) the text: (String((Number of units in SD_Targets[SD_MUI1])))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SD_MUI1 Equal to 0
-
Then - Actions
- Trigger - Turn on SD Loop <gen>
- Else - Actions
-
If - Conditions
- Set SD_MUI1 = (SD_MUI1 + 1)
-
Events
-
SD Loop
-
Events
- Time - Every 0.10 seconds of game time
- Conditions
-
Actions
-
For each (Integer SD_MUI2) from 0 to (SD_MUI1 - 1), do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in SD_Targets[SD_MUI2] and do (Actions)
-
Loop - Actions
- Custom script: set udg_X = GetUnitX(GetEnumUnit())
- Custom script: set udg_Y = GetUnitY(GetEnumUnit())
- Special Effect - Create a special effect attached to the origin of SD_Caster[SD_MUI2] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call SetUnitPosition (udg_SD_Caster[udg_SD_MUI2], udg_X, udg_Y)
- Unit - Order SD_Caster[SD_MUI2] to Attack (Picked unit)
- Unit Group - Remove (Picked unit) from SD_Targets[SD_MUI2]
- Unit - Order SD_Caster[SD_MUI2] to Stop
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in SD_Targets[SD_MUI2]) Equal to 0
-
Then - Actions
- Set SD_MUI1 = (SD_MUI1 - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SD_MUI1 Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Unit - Remove SD_Dummy[SD_MUI2] from the game
- Special Effect - Destroy SD_DummyModel[SD_MUI2]
- Set SD_Dummy[SD_MUI2] = No unit
- Set SD_Dummy[SD_MUI2] = SD_Dummy[SD_MUI1]
- Set SD_DummyModel[SD_MUI2] = SD_DummyModel[SD_MUI1]
- Unit - Move SD_Caster[SD_MUI2] instantly to SD_cPoint[SD_MUI2]
- Unit - Remove Bonus Damage from SD_Caster[SD_MUI2]
- Unit - Remove Maximum Attack Speed from SD_Caster[SD_MUI2]
- Unit - Turn collision for SD_Caster[SD_MUI2] On
- Unit - Make SD_Caster[SD_MUI2] Vulnerable
- Animation - Change SD_Caster[SD_MUI2]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Set SD_Caster[SD_MUI2] = No unit
- Set SD_Caster[SD_MUI2] = SD_Caster[SD_MUI1]
- Custom script: call DestroyGroup (udg_SD_Targets[udg_SD_MUI2])
- Set SD_Targets[SD_MUI2] = SD_Targets[SD_MUI1]
- Custom script: call RemoveLocation (udg_SD_cPoint[udg_SD_MUI2])
- Set SD_cPoint[SD_MUI2] = SD_cPoint[SD_MUI1]
- Game - Display to (All players) the text: Spell ended
- Set SD_MUI2 = (SD_MUI2 - 1)
- Else - Actions
-
If - Conditions
-
Unit Group - Pick every unit in SD_Targets[SD_MUI2] and do (Actions)
-
Loop - Actions
-
For each (Integer SD_MUI2) from 0 to (SD_MUI1 - 1), do (Actions)
-
Events
The spell should first pick all enemy units from the target point, then move the caster to each of them and order him to attack them, using base attacks (melee) and having maximum attack speed with the demolish ability for bonus damage.
The only problem is, it doesn't seem to happen the way it should. It does pick the targets and all that, but the caster NEVER moves to them and attack. All other actions from above work perfectly well..
I can't seem to find the problem anywhere, even though I used like an our to debug every single part of it... even using coordinates (X/Y) doesn't seem to work..
So, please help me out with this one.
Thanks in advance.