;
; ******************************
; * Targeter ver 2,25 *
; *<<>><<>><<>><<>><<>><<>><<>>*
; * Romek_z_Jawora *
; ******************************
;
;
; Targeter uzywa TargetNext do wybrania celu,
; -pomija wiekszosc NPC
; -ma mozliwosc stworzenie okienka, ktore zawiera liste ostatnich celow
; -przy otwartym okienku, mozliwosc wybierania pomiedzy ostatnimi celami
; -komunikuje informacje o celu na 3 sposoby
;
; Mozliwosc przypomnienia celu
;
; Do niektorych zmiennych nalezy wpisac #true badz #false
;------------------------------------------
;UWAGA: jezeli nie uzywasz, ktoregos z przyciskow nadaj mu jakas wartosc np: NIEUZYWAMKLAWISZA
set %nastepny F4 ;wyszukiwanie celu
set %nastepnymod ;SHIFT/ALT/CTRL
set %pokazcel F2 ;oznaczanie aktualnego celu [X]
set %pokazcelmod ;SHIFT/ALT/CTRL
;------------------------------------------
set %znajomi OWZAEB_VOWI_RYNQXB_DUTQEB_BDEWGB_FSACPB_KCZNXB_RGLBMC_NDFPCB_GKQVGB_SBCVJC_LLBXEB_PVWXEB_XKPOB_WUFSKB_WSMFHB_QFETCB_HNVZDB_FULCBC_LZGT_WUFSKB_UPAGC_IJELFB_VVOYLC_ZLCADC
;------------------------------------------
set %wybieracblue #true ; jesli #false - bedzie omijac postacie blue
;------------------------------------------
set %delay 100
;------------------------------------------
set %setuotitle #true ; czy ustawiac napis tytule okna (mozna latwo edytowac sposob prezentacji tekstu)
set %exmsgme #true ; czy wyswietlac informacje o celu nad nasza glowa
set %exmsgcolme 58 ; kolor
set %exmsgtarget #true ; czy wyswietlac informacje o celu nad jego glowa
set %exmsgcoltarget 4000 ; kolor
set %sysmessage #true ; czy wyswietlac informacje o celu w wiadomosci systemowej
set %sysmsgcol 88 ; kolor
;------------------------------------------
set %okienko #true ; czy ma tworzyc okienko
set %LiczbaPrzyciskow 10 ; ile ma zapamietywac celi/ile ma stworzyc przyciskow
;------------------------------------------
set %typy HS_IS_AV_XU_FH_YG
;------------------------------------------
ignoreitem %znajomi 2
if #charid in %znajomi
ignoreitem #charid 2
;gosub IgnorujZnajomych
if %okienko
{
set #lpc 200
set %cele 0
menu window title Targeter
menu clear
menu window color $333333
set %koniec 66
menu window size 200 %koniec
menu image create rysunek 0 0 200 800
menu image create rysunek1 0 0 200 200
menu image create rysunek2 32 0 100 100
menu image create rysunek3 96 0 100 100
menu image create rysunek4 160 0 100 100
gosub rysujmozajke rysunek1
gosub rysujmozajke rysunek2
gosub rysujmozajke rysunek3
gosub rysujmozajke rysunek4
menu font bgcolor $333333
menu font color $aaaaa
menu font name verdana
menu font size 17
menu font style b
menu font align center
menu text tytul 45 19 Targeter
set %n 0
menu show
set #lpc 10
}
set #menubutton N/A
set %cel #ltargetid
;------------------------------------------
repeat
onhotkey %nastepny %nastepnymod
gosub szukaj
if %cel <> #ltargetid && #ltargetid <> YC
{
;if %okienko
; gosub ZmianaCelu
;gosub wyswietl
set %cel #ltargetid
}
onhotkey %pokazcel %pokazcelmod
gosub pokazcel
if #menubutton <> N/A
gosub Przycisk
until #false
;------------------------------------------
sub szukaj
szukaj:
onhotkey %nastepny %nastepnymod
goto szukaj
ignoreitem reset 1
ignoreitem #charid 1
set #sysmsgcol 78
event sysmessage [Targeter]: Szukam
nastepny:
finditem %typy G
if #findkind = -1
{
set #sysmsgcol 50
event sysmessage [Targeter]: Brak celu
set #ltargetid YC
if %setuotitle
setuotitle Ultima Online - #charname ( , #shard , )
return
}
repeat
until ( #systime - %systime ) >= %delay
event macro 26 0
set %systime #systime
for #findindex 1 #findcnt
{
if #findid = #ltargetid
goto skok
}
goto nastepny
skok:
finditem #ltargetid G
event property #ltargetid
ignoreitem #ltargetid 1
if #findtype notin %typy
goto nastepny
if #findrep in 2_7 || ( ! %wybieracblue && #findrep = 1 )
goto nastepny
if #findid in %znajomi || #findid = #charid
goto nastepny
if - in #property && oszt notin %property
goto nastepny
gosub wyswietl
if %okienko
gosub ZmianaCelu
set %imie N/A
return
sub wyswietl
gosub oczyscimie
if %setuotitle
setuotitle Ultima Online - #charname ( , #shard , ) | [Targeter]: %imie
if %exmsgme
event exmsg #charid 3 %exmsgcolme %imie
if %exmsgtarget
gosub pokazcel
if %sysmessage
{
set #sysmsgcol %sysmsgcol
event sysmessage [Targeter]: %imie
}
set %cel #ltargetid
return
sub oczyscimie
gosub RemoveSurname
set %imie %Name
return
event property #ltargetid
set %p 1
str pos #property -
if #strres > 0
set %p #strres + 2
str pos #property $
set %k #strres
str pos #property (
if #strres <> 0 && #strres < %k
set %k #strres
str pos #property [
if #strres <> 0 && #strres < %k
set %k #strres
set %k %k - %p
str mid #property %p %k
set %imie #strres
return
sub pokazcel
pokazcel:
onhotkey %pokazcel %pokazcelmod
goto pokazcel
fintitem #ltargetid G_16
if #findkind <> -1
event ExMsg #ltargetid 3 %exmsgcoltarget [-> \/ <-]
return
sub rysujmozajke
for %i 0 14
menu Image PixLine %1 0 %i ffffffffffffffffffffffffffffffffffffffffffff
for %i 17 31
menu Image PixLine %1 0 %i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
for %i 34 49
menu Image PixLine %1 0 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
for %i 52 66
menu Image PixLine %1 0 %i jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
for %i 0 14
menu Image PixLine %1 16 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
for %i 17 31
menu Image PixLine %1 16 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
for %i 34 49
menu Image PixLine %1 16 %i llllllllllllllllllllllllllllllllllllllllllll
for %i 52 66
menu Image PixLine %1 16 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
for %i 0 14
menu Image PixLine %1 32 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
for %i 17 31
menu Image PixLine %1 32 %i gggggggggggggggggggggggggggggggggggggggggggg
for %i 34 49
menu Image PixLine %1 32 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
for %i 52 66
menu Image PixLine %1 32 %i jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
for %i 0 14
menu Image PixLine %1 48 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
for %i 17 31
menu Image PixLine %1 48 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
for %i 34 49
menu Image PixLine %1 48 %i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
for %i 52 66
menu Image PixLine %1 48 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
return
sub DodajButton
menu font bgcolor $333333
menu font color $aaaaa
if %cele = 1
{
menu font bgcolor $aaaaa
menu font color $333333
}
menu font size 8
menu font style b
menu font align center
set %wys 43 + %cele * 23
set %nazwa target , %cele
menu Button %nazwa 0 %wys 200 23
set %koniec %koniec + 23
menu window size 200 %koniec
return
sub Przycisk
if ! %okienko
return
if #menubutton = CLOSED
set %okienko #false
str del #menubutton 1 6
set %ktory #strres
set #menubutton N/A
if %ktory = 1 && #ltargetid = %temp1
{
set #sysmsgcol 50
event sysmessage [Targeter]: To jest aktualny target
gosub pokazcel
return
}
set #lpc 40
set %temp1 %tab . %ktory
set %temp2 %tabimiona . %ktory
gosub PrzesunListe 2 %ktory
set %tabimiona1 %temp2
set %tab1 %temp1
menu set Target1 %tabimiona1
set #ltargetid %tab1
gosub wyswietl
set #lpc 10
return
sub ZmianaCelu
if %tab1 = #ltargetid
return
if %imie = N/A
gosub oczyscimie
set #lpc 40
for %i 2 %cele
{
if #ltargetid = %tab . %i
{
set %temp1 %tab . %i
set %temp2 %tabimiona . %i
gosub PrzesunListe 2 %i
set %tabimiona1 %temp2
set %tab1 %temp1
menu set Target1 %tabimiona1
set %imie N/A
return
}
}
if %cele < %LiczbaPrzyciskow
{
set %cele %cele + 1
gosub DodajButton
}
if %cele > 1
gosub PrzesunListe 2 %cele
set %tabimiona1 %imie
set %tab1 #ltargetid
menu set Target1 %tabimiona1
set %imie N/A
set #lpc 10
return
sub PrzesunListe
for %i %2 %1
{
set %j %i - 1
set %tabimiona . %i %tabimiona . %j
set %tab . %i %tab . %j
menu set Target , %i %tabimiona . %i
}
return
sub IgnorujZnajomych
str count %znajomi _
set %ile #strres
set %idp 1
if %ile > 0
{
for %i 1 %ile
{
str pos %znajomi _ %i
set %idk #strres - %idp
str mid %znajomi %idp %idk
ignoreitem #strres 2
set %idp %idp + %idk + 1
}
}
str mid %znajomi %idp 100
ignoreitem #strres 2
return
sub RemoveSurname
event property #ltargetid
set %Name #property
set #lpc 300
str Count %Name #spc , #spc
if #strres > 0
{
set %DspcCnt #strres
str Pos %Name #spc , #spc %DspcCnt
set %x #strres
str Len %Name
set %dl #strres - %x + 1
str Del %Name %x %dl
set %Name #strres
}
str Pos %Name (
if #strres = 0
{
str Pos %Name $
if #strres > 0
{
str Del %Name #strres 1
set %Name #strres
}
}
else
{
set %x #strres - 1
str Len %Name
set %dl #strres - %x + 1
str Del %Name %x %dl
set %Name #strres
}
str Count %Name #spc
if #strres = 0
return
for %i 1 #strres
{
str Pos %Name #spc 1
set %dlugosc #strres - 1
str Mid %Name 1 %dlugosc
if %i = 1
{
set %str #strres
str Len %str
str Del %str #strres 1
}
set %str _ , #strres , _
if %str in _Wyjet_spod_Prawa_Lotrowsk_Lajdack_Nieprzyjemn_Porywcz_Porzadn_Uprzejm_Dobr_Uczciw_Godn_Zaufania_Odrazajac_Podl_Wredn_Niehonorow_Niecn_Wyrozniajac_sie_Przyzwoit_Honorow_Powazan_Zacn_Niegodziw_Okrutn_Haniebn_Pogardy_Glosn_Szanowan_Szacunku_Podziwu_Znan_Wielk_Przerazajac_Zl_Nikczemn_Zlowrog_Nieslawn_Znamienit_Oslawion_Szlachetn_Wybitn_Wspanial_Mroczn_Pozbawion_Honoru_Sir_Dama_Lord_Lady_
{
set %dlugosc %dlugosc + 1
str Del %Name 1 %dlugosc
set %Name #strres
}
else
break
}
str Left %Name 1
if #strres = #spc
{
str Del %Name 1 1
set %Name #strres
}
str Pos %Name #spc , - , #spc , Oszust
if #strres > 0
{
set %x #strres
str Len %Name
set %dl #strres - %x + 1
str Del %Name %x %dl
set %Name #strres
}
if Sir in %Name
{
str del %Name 1 3
set %Name #strres
}
if Dama in %Name || Lady in %Name || Lord in %Name
{
str del %Name 1 4
set %Name #strres
}
str count %Name #spc
if #strres > 0
{
str pos %Name #spc #strres
set %x #strres - 1
str left %Name 1 %x
set %Name #strres
}
set #lpc 10
return