local config = {
healthCost = 50000,
healthAmount = 100,
manaCost = 70000,
manaAmount = 100
}
function onSay(cid, words, param)
local fSet, fGet, fAdd = setCreatureMaxHealth, getCreatureMaxHealth, doCreatureAddHealth
local cost, amount = config.healthCost, config.healthAmount
local str = "health"
if(words == "!buymana") then
fSet, fGet, fAdd = setCreatureMaxMana, getCreatureMaxMana, doCreatureAddMana
cost, amount = config.manaCost, config.healthAmount
str = "mana"
end
if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you dont have enough money.")
return TRUE
end
fSet(cid, fGet(cid) + amount)
fAdd(cid, amount)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. amount .. " " .. str .. " points.")
return TRUE
end