function onSay(cid, words, param)
if (exhaustion.get (cid, 31102)) then
doPlayerSendCancel (cid, "You can use the /blessing command one time per 5 seconds!")
return TRUE
else
exhaustion.set(cid, 31102, 5)
end
local fail = 0
cost = (getPlayerLevel(cid) * 50)
cost2 = (getPlayerLevel(cid) * 50) * 5
for i = 1, 5 do
if getPlayerBlessing(cid, i) then
fail = fail + 1
else
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddBlessing(cid, i)
if i == 5 and not(fail == 5) then
doCreatureSay(cid, "You have bought all blessings for "..cost2.." !", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
end
else
doCreatureSay(cid, "You do not have enough money to buy all the blessings!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
break
end
end
end
if fail == 5 then
doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end