Ok, hello guys.
I want to make a spell that basically creates a boulder that moves forward and can only hit a unit ONCE for (75 x Lvl of ability) damage.
Here are my triggers:
Ecerything seemed to work fine with moving and the spells looks MUI etc but the damage is applied every 0.03 seconds inspite of my check for unit is in group "AlreadyHit". Any idea where I was wrong? And also if u find any wrong or not good parts of the spell - pls infor me!
Ty very much
I want to make a spell that basically creates a boulder that moves forward and can only hit a unit ONCE for (75 x Lvl of ability) damage.
Here are my triggers:
-
Rolling Bouldr Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Rolling Boulder
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- RB_Index Equal to 0
-
Then - Actions
- Trigger - Turn on Rolling Bouldr Loop <gen>
- Else - Actions
-
If - Conditions
- Set RB_Index = (RB_Index + 1)
- Set RB_MUI = (RB_MUI + 1)
- Set RB_check[RB_MUI] = True
- Set TempLoc[1] = (Position of (Casting unit))
- Set TempLoc[2] = (Target point of ability being cast)
- Set RB_Angle[RB_MUI] = (Angle from TempLoc[1] to TempLoc[2])
- Set TempLoc[3] = (TempLoc[1] offset by 17.00 towards RB_Angle[RB_MUI] degrees)
- Unit - Create 1 Spell Dummy for (Owner of (Casting unit)) at TempLoc[1] facing RB_Angle[RB_MUI] degrees
- Animation - Change (Last created unit)'s size to (350.00%, 350.00%, 350.00%) of its original size
- Animation - Change (Last created unit)'s animation speed to 65.00% of its original speed
- Special Effect - Create a special effect attached to the origin of (Last created unit) using abilities\weapons\catapult\catapultmissile.mdl
- Set RB_Boulder[RB_MUI] = (Last created unit)
- Set RB_Distance[RB_MUI] = 800.00
- Set RB_Distance_Traveled[RB_MUI] = 0.00
- Set RB_Speed[RB_MUI] = 6.20
- Set RB_AlreadyHit[RB_MUI] = RB_AlreadyHit[RB_MUI]
- Set RB_Damage[RB_MUI] = (75.00 x (Real((Level of Rolling Boulder for (Casting unit)))))
- Custom script: call RemoveLocation(udg_TempLoc[1])
- Custom script: call RemoveLocation(udg_TempLoc[2])
- Custom script: call RemoveLocation(udg_TempLoc[3])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Binding Slam for (Casting unit)) Greater than 0
-
Then - Actions
- Set BS_Level = (Level of Binding Slam for (Casting unit))
- Set TempLoc[1] = (Position of (Casting unit))
- Unit - Create 1 Spell Dummy for (Owner of (Casting unit)) at TempLoc[1] facing Default building facing degrees
- Unit - Add dummy_BS_clap to (Last created unit)
- Unit - Set level of dummy_BS_clap for (Last created unit) to BS_Level
- Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Custom script: call RemoveLocation(udg_TempLoc[1])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Rolling Bouldr Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer RB_loop) from 1 to RB_MUI, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- RB_check[RB_loop] Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- RB_Distance_Traveled[RB_loop] Less than RB_Distance[RB_MUI]
-
Then - Actions
- Set TempLoc[1] = (Position of RB_Boulder[RB_loop])
- Set TempLoc[2] = (TempLoc[1] offset by RB_Speed[RB_loop] towards RB_Angle[RB_loop] degrees)
- Unit - Move RB_Boulder[RB_loop] instantly to TempLoc[2]
- Special Effect - Create a special effect at TempLoc[1] using Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
- Special Effect - Destroy (Last created special effect)
- Set RB_Distance_Traveled[RB_loop] = (RB_Distance_Traveled[RB_loop] + RB_Speed[RB_loop])
- Set TempGroup[1] = (Units within 45.00 of TempLoc[2] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of RB_Boulder[RB_loop])) Equal to True) and (((Matching unit) is
-
Unit Group - Pick every unit in TempGroup[1] and do (Actions)
-
Loop - Actions
- Unit - Cause RB_Boulder[RB_loop] to damage (Picked unit), dealing RB_Damage[RB_loop] damage of attack type Spells and damage type Universal
- Unit Group - Add (Picked unit) to RB_AlreadyHit[RB_loop]
-
Loop - Actions
- Unit Group - Remove all units from TempGroup[1]
- Custom script: call DestroyGroup(udg_TempGroup[1])
- Custom script: call RemoveLocation(udg_TempLoc[1])
- Custom script: call RemoveLocation(udg_TempLoc[2])
-
Else - Actions
- Set TempLoc[1] = (Position of RB_Boulder[RB_loop])
- Unit - Kill RB_Boulder[RB_loop]
- Unit - Remove RB_Boulder[RB_loop] from the game
- Special Effect - Create a special effect at TempLoc[1] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
- Special Effect - Destroy (Last created special effect)
- -------- -------------------- --------
- Set RB_Index = (RB_Index - 1)
- -------- -------------------- --------
- Set RB_Boulder[RB_loop] = No unit
- Set RB_Angle[RB_loop] = 0.00
- Set RB_Distance[RB_loop] = 0.00
- Set RB_Distance_Traveled[RB_loop] = 0.00
- Set RB_Speed[RB_loop] = 0.00
- Set RB_Damage[RB_loop] = 0.00
- Unit Group - Remove all units from RB_AlreadyHit[RB_loop]
- Custom script: call DestroyGroup(udg_RB_AlreadyHit[udg_RB_loop])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- RB_Index Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Set RB_MUI = 0
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer RB_loop) from 1 to RB_MUI, do (Actions)
-
Events
Ecerything seemed to work fine with moving and the spells looks MUI etc but the damage is applied every 0.03 seconds inspite of my check for unit is in group "AlreadyHit". Any idea where I was wrong? And also if u find any wrong or not good parts of the spell - pls infor me!
Ty very much