Witam,
Zrobi?em superheal , lecz na podstawie mojej manaruny ,wi?c wyskakuje mi (I? moge tego uzywa? tylko na ludziach.)
Chcia?bym aby u?ywa? tego przedmiotu od razu na sobie co? w stylu funkcji w hotkeyach "Use on yourself"
Tutaj kawa?ek skryptu z superheal'a
Zrobi?em superheal , lecz na podstawie mojej manaruny ,wi?c wyskakuje mi (I? moge tego uzywa? tylko na ludziach.)
Chcia?bym aby u?ywa? tego przedmiotu od razu na sobie co? w stylu funkcji w hotkeyach "Use on yourself"
Tutaj kawa?ek skryptu z superheal'a
Code:
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
-- Exhausted Settings --
local exhausted_seconds = 0.5 -- How many seconds manarune will be unavailible to use. --
local exhausted_storagevalue = 1555 -- Storage Value to store exhaust. It MUST be unused! --
-- Exhausted Settings END --
-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local health_minimum = (level * 1) + (mlevel * 5) - 500
local health_maximum = (level * 2) + (mlevel * 5)
-- Mana Formula Settings END --
local health_add = math.random(health_minimum, health_maximum)
-- We check the charges. --
if(item.type > 1) then
-- Exhausted check. --
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
-- Entity is player? --
if(isPlayer(item2.uid) == 1) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Ten przedmiot moze byc uzywany tylko na ludziach.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Jestes wyczerpany.")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Jestes wyczerpany.")
else
if(isPlayer(item2.uid) == 1) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerSay(cid,"[++]HP",1)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Ten przedmiot moze byc uzywany tylko na ludziach.")
end
end
end
return 1
end