- Joined
- Dec 16, 2017
- Messages
- 367
Hello guys, i've made penance spell from wow, it works fine in test map, in my map,it laggs very hard when i try to heal ally,when i dmg an enemy it works right,what could be the reason? These are the triggers:
-
Penance
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Penance (Priest DISCIPLINE)
-
Actions
- Set PenanceCaster = (Triggering unit)
- Set PenanceTarget = (Target unit of ability being cast)
- Set PenanceDamage = ((Real((Level of Penance (Priest DISCIPLINE) for (Triggering unit)))) x 45.00)
- Set PenanceHeal = ((Real((Level of Penance (Priest DISCIPLINE) for (Triggering unit)))) x 90.00)
- Set PenanceDuration = 6
- Set PenanceCasterPosition = (Position of PenanceCaster)
- Unit - Create 1 Dummy (Unstable Affliction-Warlock Affliction) for (Owner of PenanceCaster) at PenanceCasterPosition facing Default building facing degrees
- Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
- Set PenanceDummy = (Last created unit)
- Unit - Add |r PenanceDummy(Priest DISCIPLINE) to PenanceDummy
- Trigger - Turn on PenanceLoop <gen>
- Trigger - Turn on PenanceStopCast <gen>
-
Events
-
PenanceLoop
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
- Set PenanceTargetPosition = (Position of PenanceTarget)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Current order of PenanceCaster) Equal to (Order(channel))
- PenanceCaster Not equal to No unit
- PenanceTarget Not equal to No unit
- (Life of PenanceCaster) Greater than 0.00
- (Life of PenanceTarget) Greater than 0.00
- (PenanceTarget is visible to (Owner of PenanceCaster)) Equal to True
- (PenanceTarget is Magic Immune) Equal to False
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (PenanceTarget belongs to an enemy of (Owner of PenanceCaster)) Equal to True
-
Then - Actions
- Set PenanceGroup = (Units within 30.00 of PenanceTargetPosition matching ((((Matching unit) belongs to an enemy of (Owner of PenanceCaster)) Equal to True) and (((Matching unit) is dead) Equal to False)))
-
Unit Group - Pick every unit in PenanceGroup and do (Actions)
-
Loop - Actions
- Unit - Order PenanceDummy to Neutral Alchemist - Acid Bomb PenanceTarget
- Unit - Cause PenanceCaster to damage (Picked unit), dealing PenanceDamage damage of attack type Magic and damage type Divine
- Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Set PenanceDuration = (PenanceDuration - 1)
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (PenanceTarget belongs to an ally of (Owner of PenanceCaster)) Equal to True
-
Then - Actions
- Set PenanceGroup = (Units within 30.00 of PenanceTargetPosition matching (((PenanceTarget belongs to an ally of (Owner of PenanceCaster)) Equal to True) and (((Matching unit) is dead) Equal to False)))
-
Unit Group - Pick every unit in PenanceGroup and do (Actions)
-
Loop - Actions
- Unit - Order PenanceDummy to Neutral Alchemist - Acid Bomb PenanceTarget
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + PenanceHeal)
- Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Set PenanceDuration = (PenanceDuration - 1)
-
Loop - Actions
- Else - Actions
-
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)
-
If - Conditions
- (Distance between PenanceCasterPosition and PenanceTargetPosition) Greater than 900.00
-
Then - Actions
- Set PenanceCaster = No unit
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PenanceDuration Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Trigger - Turn off PenanceStopCast <gen>
- Else - Actions
-
If - Conditions
- Custom script: call DestroyGroup(udg_PenanceGroup)
- Custom script: call RemoveLocation(udg_PenanceTargetPosition)
- Custom script: call RemoveLocation(udg_PenanceCasterPosition)
-
Events
-
PenanceStopCast
-
Events
- Unit - A unit Is issued an order with no target
- Unit - A unit Is issued an order targeting a point
- Unit - A unit Is issued an order targeting an object
- Conditions
-
Actions
-
For each (Integer PenanceDuration) from 1 to PenanceDuration, do (Actions)
- Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PenanceCaster Equal to (Triggering unit)
-
Then - Actions
- Set PenanceCaster = No unit
- Else - Actions
-
If - Conditions
-
For each (Integer PenanceDuration) from 1 to PenanceDuration, do (Actions)
-
Events
Last edited: