- OTS Fans http://www.otsfans.pun.pl/index.php - Actions http://www.otsfans.pun.pl/viewforum.php?id=112 - Przedmiot dający HP http://www.otsfans.pun.pl/viewtopic.php?id=22 |
Xelemeleque - 2011-04-17 06:42:45 |
Autorem Jest Łabik
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"/> |