function onSay(cid, words, param)
local money = doPlayerRemoveMoney(cid, 3000)
local donatorstatus = getPlayerStorageValue(cid,11420)
if donatorstatus >= 0 then
if money == 1 then
doPlayerAddItem(cid,2173,1)
doPlayerSendTextMessage(cid, 22, "You have just purchased an amulet of loss.")
end
else
doPlayerSendCancel(cid, "You need 3k and be a donator to use this command.")
end
return FALSE
end
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "You are now blessed by the Five Gods!" ,1)
else
doPlayerSendCancel(cid, "You don\'t have enough money.")
end
return TRUE
end
function onSay(cid, words, param, channel)
local t, k = {}, getPlayerLevel(cid)
for i = 0, getPlayerInstantSpellCount(cid) - 1 do
local spell = getPlayerInstantSpellInfo(cid, i)
if(spell.level ~= 0 and k >= spell.level) then
if(spell.manapercent > 0) then
spell.mana = spell.manapercent .. "%"
end
table.insert(t, spell)
end
end
table.sort(t, function(a, b) return a.level < b.level end)
local text, prevLevel = "", -1
for i, spell in ipairs(t) do
local line = ""
if(prevLevel ~= spell.level) then
if(i ~= 1) then
line = "\n"
end
line = line .. "Spells for Level " .. spell.level .. "\n"
prevLevel = spell.level
end
text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
end
doShowTextDialog(cid, 2175, text)
return true
end
<talkaction words="!bless" event="script" value="bless.lua"/>
<talkaction words="!aol" event="script" value="aol.lua"/>
<talkaction words="!spells" event="script" value="spellbook.lua" />
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "You are now blessed by the Five Gods!" ,[COLOR="red"]19[/COLOR])
else
doPlayerSendCancel(cid, "You don\'t have enough money.")
end
return TRUE
end
When i died with blessings now i lost every single exp , i was 240 now 1
And how do i make it say with orange text instead of saying : 19:36 Goodspeed [1]: You are now blessed by the Five Gods!
-- [( Made by LucasOlzon from otland.net )] --
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_MAGIC_RED)
end
else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", 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