Hello.
Config.lua
(i added it manualy)
blessings = true
blessingOnlyPremium = true
blessingReductionBase = 99
blessingReductionDecrement = 99
eachBlessReduction = 99
talkactions/scripts/bless.lua
Config.lua
(i added it manualy)
blessings = true
blessingOnlyPremium = true
blessingReductionBase = 99
blessingReductionDecrement = 99
eachBlessReduction = 99
talkactions/scripts/bless.lua
Lua:
function onSay(cid, words, param)
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 50000
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)
if isPremium(cid) == false then
doPlayerSendCancel(cid, "You need to be premium at first")
return true
end
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already have been blessed.")
return TRUE
end
end
if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all Bless , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy Blesss.")
end
elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
If player get level for example 1400, after dead he lose 4-6 levels, how to repair it? Should lose max 1 level in my opinion is it possible?
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy Blesss.")
end
end
return FALSE
end