Here's a little script I wrote a long time ago that summons energy vortexes. Might be similarly useful:
set %targetx #CHARPOSX
set %targety #CHARPOSY - 5
;set %creature_type SY ; blade spirits
set %creature_type YI ; energy vortex
repeat
if #FOLLOWERS < 4
gosub Summon
until #FALSE
;-----------------------------------------------
sub Summon
; event macro 15 32 ; blade spirits
event macro 15 57 ; energy vortex
target 20s
set #LTARGETKIND 2
set #LTARGETX %targetx
set #LTARGETY %targety
event macro 22 0
wait 40
return
;-----------------------------------------------
sub Meditate
namespace push
namespace local MED
set !wait %1
set !thresh %2
gosub TM_SyncTextScan
set !mana_target #INT - !thresh
set !success #FALSE
med_loop1:
if #MANA > !mana_target
goto Meditate_skip
if !success = #FALSE
{
gosub TM_SyncTextScan
event macro 13 46
wait 20
}
gosub TM_FindValidTextNoAdvance you_enter_a_meditative_trance
if #RESULT = #TRUE
{
gosub TM_SyncTextScan
if !wait <> #TRUE
goto Meditate_skip
set !success #TRUE
}
gosub TM_FindValidTextNoAdvance you_stop_meditating
if #RESULT = #TRUE
{
gosub TM_SyncTextScan
set !success #FALSE
}
goto med_loop1
Meditate_skip:
namespace pop
return
;-------------------------------------------------------------------------------
; Brings !_jindex up to the most recent #journal entry
sub TM_SyncTextScan
namespace push
namespace local text
set !_jindex #jindex + 1
namespace pop
return
;-------------------------------------------------------------------------------
; %2, %3, %4, etc strings to match
; returns #TRUE for match, #FALSE for no match
; Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
; Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
sub TM_FindValidTextNoAdvance
namespace push
namespace local text
set !temp_lpc #LPC
set #LPC 1000
set !num_args %0
set !first_arg 1
if !_jindex = N/A
set !_jindex #jindex
set !index !first_arg
repeat
set !temp_jindex !_jindex
set !text % . !index
while !temp_jindex <= #jindex
{
scanjournal !temp_jindex
if !text in #journal && :_ , !text notin #journal
{
set !temp_jindex !temp_jindex + 1
set #LPC !temp_lpc
namespace pop
return #TRUE
}
set !temp_jindex !temp_jindex + 1
}
set !index !index + 1
until ( ( !index - !first_arg ) > ( !num_args - 1 ) )
set #LPC !temp_lpc
namespace pop
If you want to use the spellcast subs, you'll need to change the #LTARGETKIND to 2 so the ground will be targeted.
Might be easier to just use the little snippet above.