Xelemeleque - 2011-04-17 06:42:45

Autorem Jest Łabik
Oryginalny Temat


Autor: By Łabik
Opis: Przedmiot po osiągnięciu danego mlvl i użyciu go dodaje nam punkty HP, posiada on również exhausted i się nie kończy. Ilość dodawanego HP jest zmienna wraz z wzrostem lvl.
Testowane na: YurOTS 0.9.4f

W xxx\data\actions\scripts tworzymy nowy plik hp.lua i wklejamy do niego:

Kod:

function onUse(cid, item, frompos, item2, topos) 
mag = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid) 
local exhausted_seconds = 2
local exhausted_storagevalue = 1259 

if mag >= 0 then 
 if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
  doPlayerSay(cid,"Ahhh.. HP.",16) 
  doPlayerAddHealth(cid, (lvl * 2)* 0.98) 
  setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
 else
  doPlayerSendCancel(cid, "You are exhausted.")
 end
else
 doSendMagicEffect(frompos,2) 
 doPlayerSendCancel(cid,"Masz zbyt maly mlvl aby uzyc tego potiona .") 
end
return 1 
end

W xxx\data\actions\actions.xml dodajemy linijkę:

Kod:

<action itemid="ID PRZEDMIOTU" script="hp.lua"/>
www.h2osok.pun.pl www.narutek.pun.pl www.agh1rokis.pun.pl www.ricoe.pun.pl www.k800icentrum.pun.pl