The new trend is to write script directly in your aliases, triggers, etc. For this occasion, I would probably create the following script in your main script file:
Dim Fight
Dim LastTarget
Sub Cast_Shocking_Grasp (AliasName, AliasLine, Wildcards)
LastTarget = Wildcards(1)
Fight = True
Repeat_Shocking_Grasp "Cast_Shocking_Grasp"
End Sub
Sub Repeat_Shocking_Grasp (TimerName)
If Fight Then
World.LogSend World.GetVariable("shockinggrasp") & LastTarget
World.AddTimer "ShockingGraspTimer", 0, 0, 2, "", 5, "Repeat_Shocking_Grasp"
End If
End Sub
Create a Shocking Grasp alias, and in the "Script" box enter "Cast_Shocking_Grasp". When the script is called, it stores the target for your spell in a variable, sets 'Fight' to True, and then immediately calls the "Repeat_Shocking_Grasp" subroutine.
The subroutine "Repeat_Shocking_Grasp" then sends the line once immediately, and creates a timer to call itself again in 2 seconds. This process will repeat until you set "Fight = False" elsewhere, such as in your trigger that detects the mob has been killed. |