Hp skripty - sebe + cíl + přepínač od Sarreny

15.12.2012 12:40
#############################################################
# Skript pro prepinani HP skriptu.                          #
#                                                           #
# Pouzivat pouze vlakno "prepinachp"                        #
#  Mody: 1)Zapne pouze HP na sebe                           #
#        2)Zapne HP i cile, i sebe                          #
#############################################################

sub prepinachp()
if not uo.getglobal("prepinachp")=="1" and not uo.getglobal("prepinachp")=="2" then
 uo.setglobal("prepinachp","1")
endif
if uo.getglobal("prepinachp")=="1" then
 uo.setglobal("prepinachp","2")
 uo.charprint(0x0037,"Zapinam HP sebe")
 uo.exec("terminate HP")
 uo.exec("terminate HPcil")
 uo.exec("exec HP")
 uo.exec("terminate prepinachp")
endif
if uo.getglobal("prepinachp")=="2" then
 uo.setglobal("prepinachp","1")
 uo.charprint(0x00FC,"Zapinam HP sebe a cile")
 uo.exec("terminate HP")
 uo.exec("terminate HPcil")
 uo.exec("exec HP")
 uo.exec("exec HPcil")
 uo.exec("terminate prepinachp")
endif
end sub


sub HP()
var HP_priebezne_self
while not uo.dead()
 HP_priebezne_self = uo.gethp("self")
 wait(100)
 if uo.gethp("self") < HP_priebezne_self and not uo.dead() then
  uo.charprint(0x0026,"-" + str(HP_priebezne_self - uo.gethp("self")) + " (" + str(uo.gethp("self")) + ")")
 end if
 if uo.gethp("self") > HP_priebezne_self + 5 and not uo.dead() then
  uo.charprint(0x01FA,"+" + str(uo.gethp("self") - HP_priebezne_self) + " (" + str(uo.gethp("self")) + ")")
 end if
wend
end sub


sub hpcil()
var HP_priebezne_target
while not uo.dead()
 HP_priebezne_target = uo.gethp("laststatus")
 wait(100)
 if uo.gethp("laststatus") < HP_priebezne_target and not uo.dead() then
  uo.charprint(0x0481,""+uo.getname("laststatus")+" -" + str(HP_priebezne_target - uo.gethp("laststatus")) + " (" + str(uo.gethp("laststatus")) + "%)")
 end if
 if uo.gethp("laststatus") > HP_priebezne_target + 5 and not uo.dead() then
  uo.charprint(0x03A8,""+uo.getname("laststatus")+" +" + str(uo.gethp("laststatus") - HP_priebezne_target) + " (" + str(uo.gethp("laststatus")) + "%)")
 end if
wend
end sub