• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Hp and Mp bonus

anormalius

New Member
Joined
Dec 27, 2012
Messages
44
Reaction score
1
Hello otland.
I search a diferent scripts in forum but don't found the good script
I need the hp bonus script to add +15% after use the xxxx item and other to add Mp bonus
All scripts go to bonus quest in ot
thanks and sorry for my english
 
@anormalius

Well maybe I can do this for you, what tfs version are you using and you want two separate items one which adds +15% hp bonus and the other which adds +15% mana bonus?
 
this add 15% hp
Code:
function onUse(cid, item, frompos, item2, topos)
local currentmp = getCreatureMaxHealth(cid)
local maxmp = 15
local playerpos = getCreaturePosition(cid)
    if doPlayerRemoveItem(cid, item.itemid, 1) == TRUE then
        doSendMagicEffect(playerpos,14)
        setCreatureMaxHealth(cid, currentmp + maxmp)
        doCreatureAddHealth(cid, currentmp)
        doPlayerSendTextMessage(cid, 22, "You gained " .. maxmp .. " extra mana point!")
    else
        doPlayerSendCancel(cid, "Sorry, not possible!")
    end
return TRUE
end

to change to mana just change
Code:
doCreatureAddMana(cid, currentmp)
and
Code:
doCreatureAddMana
and
Code:
local currentmp = getCreatureMaxMana(cid)

if u need anything for 0.4 msg me in skype ali.elasy1
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local currentmp = getCreatureMaxHealth(cid)
local maxmp = 15
local playerpos = getCreaturePosition(cid)
    if isPlayer(cid) then
        doSendMagicEffect(playerpos,14)
        setCreatureMaxHealth(cid, currentmp + maxmp)
        doCreatureAddHealth(cid, currentmp)
        doPlayerSendTextMessage(cid, 22, "You gained " .. maxmp .. " extra mana point!")
doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid, "Sorry, not possible!")
    end
return TRUE
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local currentmp = getCreatureMaxHealth(cid)
local maxmp = 15
local playerpos = getCreaturePosition(cid)
    if isPlayer(cid) then
        doSendMagicEffect(playerpos,14)
        setCreatureMaxHealth(cid, currentmp + maxmp)
        doCreatureAddHealth(cid, currentmp)
        doPlayerSendTextMessage(cid, 22, "You gained " .. maxmp .. " extra mana point!")
doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid, "Sorry, not possible!")
    end
return TRUE
end

This script is adding 15 HP to max HP not 15%
 
this work now with 10%
Code:
local storage = 80777
function onUse(cid, item, frompos, item2, topos)
local value = getCreatureMaxHealth(cid) / 10
     if getPlayerLevel(cid) >= 8 then
    setCreatureMaxHealth(cid, math.floor(getCreatureMaxHealth(cid)+ value))
     doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doPlayerSendTextMessage(cid, 22, "You add 10% hp to you health!")
    doCreatureSetStorage(cid, storage, math.max(0, getCreatureStorage(cid, storage)) + 1)
     doSendMagicEffect(getCreaturePosition(cid), 30)
    doRemoveItem(item.uid, 1)
    return true
    end
end
 
this work now with 10%
Code:
local storage = 80777
function onUse(cid, item, frompos, item2, topos)
local value = getCreatureMaxHealth(cid) / 10
     if getPlayerLevel(cid) >= 8 then
    setCreatureMaxHealth(cid, math.floor(getCreatureMaxHealth(cid)+ value))
     doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doPlayerSendTextMessage(cid, 22, "You add 10% hp to you health!")
    doCreatureSetStorage(cid, storage, math.max(0, getCreatureStorage(cid, storage)) + 1)
     doSendMagicEffect(getCreaturePosition(cid), 30)
    doRemoveItem(item.uid, 1)
    return true
    end
end

Can put time on it?
 
Check it :p
Code:
local storage = 80777
function onUse(cid, item, frompos, item2, topos)
local value = getCreatureMaxHealth(cid) / 10
if getPlayerLevel(cid) >= 8 then
setCreatureMaxHealth(cid, math.floor(getCreatureMaxHealth(cid)+ value))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doPlayerSendTextMessage(cid, 22, "You add 10% hp to you health!")
doCreatureSetStorage(cid, storage, math.max(0, getCreatureStorage(cid, storage)) + 1)
doSendMagicEffect(getCreaturePosition(cid), 30)
doRemoveItem(item.uid, 1)
end
doPlayerSendTextMessage(cid, 27, "You have received "..it[2].." "..getItemNameById(it[1])..". You can take your reward in "..time.." minutes.")
setPlayerStorageValue(cid, storage, os.time() + time * 60)
else
return doPlayerSendCancel(cid, "You have already received your reward for today.")
end
return true
end
 
Check it :p
Code:
local storage = 80777
function onUse(cid, item, frompos, item2, topos)
local value = getCreatureMaxHealth(cid) / 10
if getPlayerLevel(cid) >= 8 then
setCreatureMaxHealth(cid, math.floor(getCreatureMaxHealth(cid)+ value))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doPlayerSendTextMessage(cid, 22, "You add 10% hp to you health!")
doCreatureSetStorage(cid, storage, math.max(0, getCreatureStorage(cid, storage)) + 1)
doSendMagicEffect(getCreaturePosition(cid), 30)
doRemoveItem(item.uid, 1)
end
doPlayerSendTextMessage(cid, 27, "You have received "..it[2].." "..getItemNameById(it[1])..". You can take your reward in "..time.." minutes.")
setPlayerStorageValue(cid, storage, os.time() + time * 60)
else
return doPlayerSendCancel(cid, "You have already received your reward for today.")
end
return true
end

This error: input:14: 'end' expected (to close 'function' at line 2) near 'else'

And...it's only used once per day, right? Can put vocation limit?
 
Back
Top