Zarabustor
Human Being
Hi i want to put together this scripts, i mean that will work as 1 item that will give you mana and health and some attack speed.
Could you please help me?
Health Booster:
Mana Booster:
Could you please help me?
Health Booster:
Code:
local cfg =
{
level = 30000,
itemid = 7443,
newHealth = 150000
}
local storage = 14570
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == cfg.itemid) then
if getPlayerLevel(cid) >= cfg.level then
if getPlayerStorageValue(cid, storage) == -1 then
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+cfg.newHealth))
setPlayerStorageValue(cid, storage, 1)
doSendAnimatedText(getCreaturePosition(cid), "HEALTH!",TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved ".. cfg.newHealth .." extra health points, now your health is ".. getCreatureMaxHealth(cid) .."!")
doRemoveItem(item.uid)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may only use one health booster.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your need level 30,000k!! to use this booster.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return TRUE
end
end
Mana Booster:
Code:
local cfg =
{
level = 30000,
itemid = 7439,
newMana = 150000
}
local storage = 14565
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == cfg.itemid) then
if getPlayerLevel(cid) >= cfg.level then
if getPlayerStorageValue(cid, storage) == -1 then
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
setPlayerStorageValue(cid, storage, 1)
doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_PURPLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved ".. cfg.newMana .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!")
doRemoveItem(item.uid)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may only use one mana booster.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your need level 30,000k!! to use this booster.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return TRUE
end
end