;==================================
; Script Name: Champ Supporter.
; Author: CAMOTbIK
; Version: 0.5 Beta
; Client Tested with: 6.0.14.3
; EUO version tested with: 1.58
; Revision Date: 29.12.2009
; Public Release:
; Purpose: As a support character you ressurect and heal your friends.
; Pick up droped power scrolls and pick up gold wich will be stored in your beetle.
;==================================
set %ghost JS_KS_ZU_KV ; JS-HUMAN_WOMAN,KS-HUMAN_MALE,ZU-ELF_MAN,KV-ELF_WOMAN
set %alive HS_IS_XU_AV ; HS-HUMAN_WOMAN,IS-HUMAN_MALE,XU-ELF_MAN,AV-ELF_WOMAN
set %friends XXXX_XXXX_XXXX_XXXX ; Friends
set %ps EWH
set %bandages ZLF
set %beetletype ZGB
set %timer_hiding #sCnt
set %timer_healing #sCnt
set %timer_ressurecting #sCnt
ignoreitem #CHARID
repeat
gosub check_alive
gosub check_dead
gosub grab_gold
gosub grab_ps
gosub grab_bandages
gosub hide
while #charghost = yes
wait 0
until #charghost = yes
sub check_alive
finditem %alive G_1
if #FINDCNT > 0 && #FINDID in %friends
{
if #sCnt < %timer_already_healed && #FINDID in %already_healed
return
set #LTARGETID #FINDID
finditem %bandages C_ , #BACKPACKID ; bandages
if #FINDCNT > 0
{
set #LTARGETKIND 1
set #lobjectid #findid
event macro 17 0
target 5s
event macro 22 0
gosub hide
set %timer_healing ( #sCnt + 10 )
set %_jindex #jindex
set %return #false
repeat
if #sCnt > %timer_healing
{
set %timer_healing ( #sCnt + 10 )
set %return #true
}
if #jindex >= %_jindex
{
scanjournal %_jindex
if barely in #journal || finish in #journal || reach in #journal
{
set %return #true
set %timer_healing ( #sCnt + 10 )
}
if being in #journal
{
set %already_healed #ltargetid
set %timer_already_healed ( #sCnt + 40 )
}
set %_jindex %_jindex + 1
}
wait 0
until %return #true
}
else
{
msg $
msg /support character is out of bandages!!!$
msg /drop some bandages near #charname who is standing #CHARPOSX #CHARPOSY $
wait 1s
}
}
return
sub check_dead
finditem %ghost G_1
if #FINDCNT > 0 && #FINDID in %friends
{
if #sCnt < %timer_already_ressurected && #FINDID in %already_ressurected
return
set #LTARGETID #FINDID
finditem %bandages C_ , #BACKPACKID ; bandages
if #FINDCNT > 0
{
set #LTARGETKIND 1
set #lobjectid #findid
event macro 17 0
target 5s
event macro 22 0
gosub hide
set %timer_ressurect ( #sCnt + 10 )
set %_jindex #jindex
set %return #false
repeat
if #sCnt > %timer_ressurect
{
set %timer_ressurect ( #sCnt + 10 )
set %return #true
}
if #jindex >= %_jindex
{
scanjournal %_jindex
if unable in #journal || reach in #journal || being in #journal
{
set %return #true
}
if able in #journal
{
set %already_ressurected #ltargetid
set %timer_already_ressurected ( #sCnt + 30 )
}
set %_jindex %_jindex + 1
}
wait 0
until %return #true
}
else
{
msg $
msg /support character is out of bandages!!!$
msg /drop some bandages near #charname who is standing #CHARPOSX #CHARPOSY $
wait 1s
}
}
return
sub grab_gold
finditem POF G_2
if #FINDCNT > 0
{
set %gold #FINDID
set %stack #findstack
set #lobjectid #CHARID
event macro 17
wait 10
finditem %beetletype G_1
if #FINDCNT > 0
{
set %beetle #FINDID
exevent drag %gold %stack
wait 10
exevent dropc %beetle
wait 20
set #lobjectid %beetle
event macro 17
}
}
return
sub grab_ps
finditem %ps G_2
if #FINDCNT > 0
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc #BACKPACKID
wait 10
}
return
sub grab_bandages
finditem %bandages G_2
if #FINDCNT > 0
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc #BACKPACKID
wait 10
}
return
sub hide
if H in #charStatus
return
if #sCnt > %timer_hiding
{
event macro 13 21
set %timer_hiding ( #sCnt + 10 )
}
return