function onSay(cid, words, param)
local fail = 0
if getPlayerLevel(cid) < 31 then
cost = 2000
else
cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
end
if cost > 20000 then
cost = 20000
end
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
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
end
else
doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
break
end
end
end
if fail == 5 then
doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end
100 = full loss?you have to execute this query in phpmyadmin
SQL:UPDATE players SET loss_experience = 100, loss_mana = 100, loss_skills = 100, loss_containers = 100
function onUse(cid, item, fromPosition, itemEx, toPosition)
local exhaustionInSeconds = 10
local storage = 35321
if(exhaustion.check(cid, storage) == true) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Nie tak szybko, musisz poczekac " .. exhaustion.get(cid, storage) .. " sekund, aby uzyc ksiazki.")
return 0
end
exhaustion.set(cid, storage, exhaustionInSeconds)
local bless = {1, 2, 3, 4, 5}
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless)) then
doPlayerSendCancel(cid, "Masz juz kupione blessy.")
doSendMagicEffect(getPlayerPosition(cid),2)
return TRUE
end
end
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
doPlayerSendTextMessage(cid,24, "Kupiles all blessy.")
doSendMagicEffect(getPlayerPosition(cid), 10)
return true
end