I'm playing around with triggers creating a spell here, but after I use the spell ing and some time (seconds) passes a massive lag starts, and I can't figure it out.. Another thing is that, if I don't use the spell at lvl 1 before leveling it up it fails to trigger the damage. It's probably not totally optimized, but I haven't made very many custom spells so, and I've done some reworks. I guess I'm gonna need more, but I'm not sure how.
I uploaded a map containing the spell/trigger/dummy and so on.
I'll appreciate all help =)
Here's the trigger:
I uploaded a map containing the spell/trigger/dummy and so on.
I'll appreciate all help =)
Here's the trigger:
Trigger:
- Untitled Trigger 001 Copy
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to |cffffcc00Z|r Navn
- Actions
- Set B_loc = (Target point of ability being cast)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 1
- Then - Actions
- -------- hhere the integer is set, used to calculate dmg --------
- Set B_integer = (Number of units in (Units within 150.00 of B_loc matching ((((Matching unit) is A structure) Equal to False) or ((((Matching unit) is alive) Equal to True) or ((((Matching unit) is Magic Immune) Equal to False) or (((Owner of (Matching unit)) is an enemy of
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- B_integer Less than or equal to 2
- B_integer Not equal to 0
- Then - Actions
- -------- here is the minimum dmg that only triggers when less than 2 units get hit --------
- Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing 60.00 damage of attack type Spells and damage type Normal
- Else - Actions
- -------- the damage is calculated here --------
- Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 150.00 at B_loc, dealing ((Real(B_integer)) x 25.00) damage of attack type Spells and damage type Normal
- If - Conditions
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 2
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- B_integer Less than or equal to 2
- B_integer Not equal to 0
- Then - Actions
- Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing 100.00 damage of attack type Spells and damage type Normal
- Else - Actions
- Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 225.00 at B_loc, dealing ((Real(B_integer)) x 35.00) damage of attack type Spells and damage type Normal
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of |cffffcc00Z|r Navn for (Triggering unit)) Equal to 3
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- B_integer Less than or equal to 2
- B_integer Not equal to 0
- Then - Actions
- Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing 140.00 damage of attack type Spells and damage type Normal
- Else - Actions
- Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 300.00 at B_loc, dealing ((Real(B_integer)) x 50.00) damage of attack type Spells and damage type Normal
- 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
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- -------- i want it to destroy trees too, so I tried to fix that ^^ --------
- Destructible - Pick every destructible within (75.00 + (75.00 x (Real((Level of |cffffcc00Z|r Navn for (Triggering unit)))))) of B_loc and do (Destructible - Kill (Picked destructible))
- -------- And I figured a little slow could do - --------
- Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at B_loc facing Default building facing degrees
- Unit - Add DummySlam (Neutral Hostile) to (Last created unit)
- Unit - Order (Last created unit) to Neutral - Slam
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- -------- and the special effects - the removal is kinda improvised, but it should work? --------
- Special Effect - Create a special effect at (B_loc offset by 150.00 towards 90.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
- Set B_SE1 = (Last created special effect)
- Special Effect - Create a special effect at (B_loc offset by 150.00 towards 180.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
- Set B_SE2 = (Last created special effect)
- Special Effect - Create a special effect at (B_loc offset by 150.00 towards 270.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
- Set B_SE3 = (Last created special effect)
- Special Effect - Create a special effect at (B_loc offset by 150.00 towards 360.00 degrees) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
- Set B_SE4 = (Last created special effect)
- Wait 2.00 seconds
- Special Effect - Destroy B_SE1
- Special Effect - Destroy B_SE2
- Special Effect - Destroy B_SE3
- Special Effect - Destroy B_SE4
- Custom script: call RemoveLocation(udg_B_loc)
- Events