I am aware that it's leaking groups, yet if I cast this spell 20 times, I can already notice a framerate reduction. It cant be group leakage can it?
I'm pretty new at this triggering thing still, please point out my mistakes and possibly what's making this thing lag.
I'm pretty new at this triggering thing still, please point out my mistakes and possibly what's making this thing lag.
-
Scalper
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Scalper
-
Actions
- Set ScalperCaster = (Triggering unit)
- Set ScalperAngle = (Angle from (Position of ScalperCaster) to (Target point of ability being cast))
- Set ScalperCasterLoc = (Position of ScalperCaster)
- Unit - Create 1 Dummy Scalper for (Owner of ScalperCaster) at ScalperCasterLoc facing ScalperAngle degrees
- Set ScalperDummy = (Last created unit)
- Custom script: call RemoveLocation (udg_ScalperCasterLoc)
- Trigger - Turn on Scalper Loop <gen>
-
Events
-
Scalper Loop
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
- Set ScalperCount = (ScalperCount + 1)
- Set ScalperDummyLoc = (Position of ScalperDummy)
- Unit - Move ScalperDummy instantly to (ScalperDummyLoc offset by 15.00 towards ScalperAngle degrees), facing ScalperAngle degrees
-
Unit Group - Pick every unit in (Units within 120.00 of ScalperDummyLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of S and do (Actions)
-
Loop - Actions
- Unit Group - Add (Picked unit) to ScalperDamageGroup
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in ScalperDamageGroup) Greater than or equal to 1
-
Then - Actions
- Set ScalperCount = 0
- Set ScalperPickedTarget = (Random unit from ScalperDamageGroup)
- Special Effect - Create a special effect attached to the chest of ScalperPickedTarget using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
- Special Effect - Destroy (Last created special effect)
- Unit Group - Remove all units from ScalperDamageGroup
- Unit - Cause ScalperDummy to damage ScalperPickedTarget, dealing (30.00 + (30.00 x (Real((Level of Scalper for ScalperCaster))))) damage of attack type Spells and damage type Lightning
- Unit - Kill ScalperDummy
- Unit - Create 1 Dummy Blank No Vision for (Owner of ScalperCaster) at ScalperDummyLoc facing ScalperDummyLoc
- Set ScalperDoTDummy = (Last created unit)
- Unit - Add a 6.00 second Generic expiration timer to ScalperDoTDummy
- Trigger - Turn on Scalper DoT <gen>
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ScalperCount Greater than or equal to 100
-
Then - Actions
- Set ScalperCount = 0
- Unit - Kill ScalperDummy
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation (udg_ScalperDummyLoc)
-
Events
-
Scalper DoT
-
Events
- Time - Every 0.10 seconds of game time
- Conditions
-
Actions
- Set ScalperDoTCount = (ScalperDoTCount + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (ScalperPickedTarget is alive) Equal to True
-
Then - Actions
- Special Effect - Create a special effect attached to the chest of ScalperPickedTarget using Objects\Spawnmodels\Human\HumanBlood\HumanBloodPriest.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Cause ScalperDoTDummy to damage ScalperPickedTarget, dealing (0.60 x (Real((Level of Scalper for ScalperCaster)))) damage of attack type Spells and damage type Lightning
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ScalperDoTCount Equal to 50
-
Then - Actions
- Set ScalperDoTCount = 0
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
Events
Last edited by a moderator: