Can you shorten this up while you're at it? Thanks. hehe
if %belfry <> #true
{
finditem * g_ , %distance . #charid
if #findcnt > 0
{
set %area |
set %charposx #charposx
set %charposy #charposy
set %charposz #charposz
for #findindex 1 #findcnt
{
if ( #findrep = 2 && #findid notin %safeIds && #findid notin *pvmSafeIds ) 3 ;|| ( #findrep < 1 || #findrep > 6 ) 5 ; < CHECK THIS CODE COMMENTED! TO SEE IF TILES WORK WHEN IGNORED
if #findrep = 2 2
set %safeIds %safeIds , #findid , _
set *pvmSafeIds %pvmSafeIds , #findid , _
if #findtype <> yfm && #findtype <> bwe && #findtype <> asc && #findtype <> faj && #findtype <> qaj && #findtype <> xui && #findtype <> zui && #findtype <> jbc && #findtype <> kxb && #findtype <> wwb && #findtype <> ssb && #findtype <> avi && #findtype <> uwgc && #findtype <> fxgc && #findtype <> pac && #findType <> sac && #findtype <> gbc && #findtype <> paj && #findtype <> gaj && #findtype <> iaj
set %area %area , #findx , _ , #findy , |
}
for %w 1 #clicnt
{
if ( %charposx . %w , _ , %charposy . %w notin %area ) && ( %charposx . %w < %charposx + 11 && %charposx . %w > %charposx - 11 && %charposy . %w < %charposy + 11 && %charposy . %w > %charposy - 11 ) && ( %w <> #clinr )
set %area %area , %charposx . %w , _ , %charposy . %w , |
}
set %x #charposx %symbol1 . #charid %x . #charid
set %y #charposy %symbol2 . #charid %y . #charid
set %check 0
set %checkingShit |
set %checkingShit1 |
set %impassable #false
for %i 1 4
{
for %o 0 4
{
if %cursKind . #charid = 4 || %cursKind . #charid = 3 || %cursKind . #charid = 2 || %cursKind . #charid = 1 || %cursKind . #charid = 0
{
set %impassable #false
tile get %x %y 1 #curskind
tile cnt %x %y #curskind
set %tileZ #tilez
set %tileType #tileType
if impassable in #tileFlags || wall in #tileFlags || tree in #tilename 2
set %impassable #true
goto _skipTileCheckYo
if #tileCnt > 1 && %impassable = #false 7
for %tileIndex 2 #tileCnt
{
tile get %x %y %tileIndex #curskind
if impassable in #tileFlags || wall in #tileFlags 2
set %impassable #true
break
}
}
if %impassable = #false && | , %x , _ , %y , | notin %area && ( %x <= #charposx + 10 && %x >= #charposx - 10 && %y <= #charposy + 10 && %y >= #charposy - 10 ) && ( #tilez <= #charposz + 20 && #tilez >= #charposz - 20 ) 7
set %check %check + 1
set %checkX . %check %x
set %checkY . %check %y
if #cursKind >= 0 && #cursKind < 5 2
set %checkZ . %check %tileZ
set %checkT . %check %tileType
set %checkingShit %checkingShit , %x , _ , %y , |
else
set %checkingShit1 %checkingShit1 , %x , _ , %y , |
_skipTileCheckYo:
set %x %x + 1
}
set %y %y + 1
set %x %x - 4
}
}
}
set %random #random % %check + 1
set #ltargetx %checkX . %random
set #ltargety %checkY . %random
if #cursKind >= 0 && #cursKind < 5 2
set #ltargetz %checkZ . %random
set #ltargettile %checkT . %random
if #cursKind > 4
set #ltargetz #charposz
if %belfry = #true
gosub belfryTargetSet
set #ltargetkind 2
event macro 22
set %wait . #charid #sysTime + %spellWait
set #ltargetkind 1
set %casting . #charid #false
set %alreadyTargetted #true