function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have 5 blessings')
elseif getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) then
doPlayerSendCancel(cid,'You have 4 blessings')
elseif getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) then
doPlayerSendCancel(cid,'You have 3 blessings')
elseif getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) then
doPlayerSendCancel(cid,'You have 2 blessings')
elseif getPlayerBlessing(cid, 1) then
doPlayerSendCancel(cid,'You have 1 blessings')
end
return 1
end
function onSay(cid, words, param)
local bless = 0;
for i = 1, 5 do
if getPlayerBlessing(cid, i) then
bless = bless+1;
end
end
return doPlayerSendCancel(cid,(bless>0) and 'You are blessed by '.. bless ..' Gods.' or 'You are not blessed.') and false;
end
local blessings = {"\nWisdom of Solitude", "\nSpark of the Phoenix", "\nFire of the Suns", "\nSpiritual Shielding", "\nEmbrace of Tibia"}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local result = "Received blessings:"
for i = 1, 5 do
result = getPlayerBlessing(cid, i) and result .. blessings[i] or result
end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 20 > result:len() and "No blessings received." or result)
end