Lightning - Create Lightning Effect
Points - that's for you to find out by trying many times. I ment positioning them in form of a pentagon around the caster.
Lightning effects - Use triggers.
Code:Lightning - Create Lightning Effect
:thup:
Hmmm... Using triggers doesn't require units at all. Only points.
Edit: Angles = 360 : 5 = 72
A point every 72' 100-500 units away from the caster (or how many you want).
Events
Unit - A unit Starts the effect of an ability
Conditions
Ability beeing cast equal to "Your Pentagon Ability"
Actions
set Point = Unit Position of Triggering Unit
set Point1 = (Point) offset by 200 towards 270 degrees (That's up)
set Point2 = (Point) offset by 200 towards 342 degrees
set Point3 = (Point) offset by 200 towards 54 degrees
set Point4 = (Point) offset by 200 towards 126 degrees
set Point5 = (Point) offset by 200 towards 198 degrees
custom script: call RemoveLocation (Udg_Point)
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point1 to target Point2
set Lightning1 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point2 to target Point3
set Lightning2 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point3 to target Point4
set Lightning3 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point4 to target Point5
set Lightning4 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point5 to target Point1
set Lightning5 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point1 to target Point3
set Lightning6 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point1 to target Point4
set Lightning7 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point2 to target Point4
set Lightning8 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point2 to target Point5
set Lightning9 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point3 to target Point5
set Lightning10 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point3 to target Point1
set Lightning11 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point4 to target Point1
set Lightning12 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point4 to target Point2
set Lightning13 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point5 to target Point2
set Lightning14 = Last Created Lightning Effect
Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point5 to target Point3
set Lightning15 = Last Created Lightning Effect
custom script: call RemoveLocation (Udg_Point1)
custom script: call RemoveLocation (Udg_Point2)
custom script: call RemoveLocation (Udg_Point3)
custom script: call RemoveLocation (Udg_Point4)
custom script: call RemoveLocation (Udg_Point5)
Wait "How much do you want" seconds
Destroy Lightning1
Destroy Lightning2
Destroy Lightning3
Destroy Lightning4
Destroy Lightning5
Destroy Lightning6
Destroy Lightning7
Destroy Lightning8
Destroy Lightning9
Destroy Lightning10
Destroy Lightning11
Destroy Lightning12
Destroy Lightning13
Destroy Lightning14
Destroy Lightning15
You know how to trigger? Because using the unit metod requires triggering (and hard).
Use a Trigger:
Code:Events Unit - A unit Starts the effect of an ability Conditions Ability beeing cast equal to "Your Pentagon Ability" Actions set Point = Unit Position of Triggering Unit set Point1 = (Point) offset by 200 towards 270 degrees (That's up) set Point2 = (Point) offset by 200 towards 342 degrees set Point3 = (Point) offset by 200 towards 54 degrees set Point4 = (Point) offset by 200 towards 126 degrees set Point5 = (Point) offset by 200 towards 198 degrees custom script: call RemoveLocation (Udg_Point) Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point1 to target Point2 set Lightning1 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point2 to target Point3 set Lightning2 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point3 to target Point4 set Lightning3 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point4 to target Point5 set Lightning4 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point5 to target Point1 set Lightning5 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point1 to target Point3 set Lightning6 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point1 to target Point4 set Lightning7 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point2 to target Point4 set Lightning8 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point2 to target Point5 set Lightning9 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point3 to target Point5 set Lightning10 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point3 to target Point1 set Lightning11 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point4 to target Point1 set Lightning12 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point4 to target Point2 set Lightning13 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point5 to target Point2 set Lightning14 = Last Created Lightning Effect Create a "Any Lightning Effect" (Use Finger of Death for a red one) lightning effect from source Point5 to target Point3 set Lightning15 = Last Created Lightning Effect custom script: call RemoveLocation (Udg_Point1) custom script: call RemoveLocation (Udg_Point2) custom script: call RemoveLocation (Udg_Point3) custom script: call RemoveLocation (Udg_Point4) custom script: call RemoveLocation (Udg_Point5) Wait "How much do you want" seconds Destroy Lightning1 Destroy Lightning2 Destroy Lightning3 Destroy Lightning4 Destroy Lightning5 Destroy Lightning6 Destroy Lightning7 Destroy Lightning8 Destroy Lightning9 Destroy Lightning10 Destroy Lightning11 Destroy Lightning12 Destroy Lightning13 Destroy Lightning14 Destroy Lightning15
To make the spell MPI (for several players to be able to use it) use arrays.
A nice trigger without memory leaks ^^
Pentagon
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Create Polygon
Actions
Set Sides = 5
Set Size = 500.00
Set Pentagon_caster = (Triggering unit)
For each (Integer A) from 1 to Sides, do (Actions)
Loop - Actions
Lightning - Destroy PentagonLight[(Integer A)]
For each (Integer A) from 1 to Sides, do (Actions)
Loop - Actions
Set pos1 = (Position of Pentagon_caster)
Set pos2 = (pos1 offset by Size towards ((360.00/(Interger(Sides))) x (Real((Integer A)) + (Facing of Pentagon_caster)) degrees))
Set pos3 = (pos1 offset by Size towards ((360.00/(Interger(Sides)) x (Real(((Integer A) + 1))+ (Facing of Pentagon_caster)) degrees))
Lightning - Create a Drain Life lightning effect from source pos2 to target pos3
Custom script: call RemoveLocation(udg_pos1)
Custom script: call RemoveLocation(udg_pos2)
Custom script: call RemoveLocation(udg_pos3)
Set PentagonLight[(Integer A)] = (Last created lightning effect)
Countdown Timer - Start Pentagon_Timer as a One-shot timer that will expire in 10.00 seconds
Trigger - Turn on Pentagon Move <gen>
Trigger - Turn on Pentagon Expires <gen>
Trigger - Turn off (This trigger)
Pentagon Move
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to Sides, do (Actions)
Loop - Actions
Set pos1 = (Position of Pentagon_caster)
Set pos2 = (pos1 offset by Size towards ((360.00/(Interger(Sides)) x (Real((Integer A))+ (Facing of Pentagon_caster)) degrees))
Set pos3 = (pos1 offset by Size towards ((360.00/(Interger(Sides)) x (Real(((Integer A) + 1))+ (Facing of Pentagon_caster)) degrees))
Lightning - Move PentagonLight[(Integer A)] to source pos2 and target pos3
Custom script: call RemoveLocation(udg_pos1)
Custom script: call RemoveLocation(udg_pos2)
Custom script: call RemoveLocation(udg_pos3)
Pentagon Expires
Events
Time - Pentagon_Timer expires
Conditions
Actions
Trigger - Turn off Pentagon Move <gen>
Set Pentagon_caster = No unit
Set Sides = 0
Set Size = 0.00
For each (Integer A) from 1 to Sides, do (Actions)
Loop - Actions
Lightning - Destroy PentagonLight[(Integer A)]
Trigger - Turn off (This trigger)
Trigger - Turn on Pentagon <gen>