Untitled diff

Created Diff never expires
4 removals
35 lines
4 additions
35 lines
local cfg = {
local cfg = {
bless = { 1, 2, 3, 4, 5 }
bless = { 1, 2, 3, 4, 5 }
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.aid > 0 then
if item.actionid > 24354 then
if item.aid ~= getPlayerGUID(cid) then
if item.actionid ~= getPlayerGUID(cid) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "Get your filthy hands off Master " .. getPlayerNameByGUID(item.aid) .. "'s Book you thief!")
doPlayerSendCancel(cid, "Get your filthy hands off Master " .. getPlayerNameByGUID(item.actionid) .. "'s Book you thief!")
return true
return true
end
end
end
end
for i = 1, table.maxn(cfg.bless) do
for i = 1, table.maxn(cfg.bless) do
if(getPlayerBlessing(cid, cfg.bless[i])) then
if(getPlayerBlessing(cid, cfg.bless[i])) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You have already recieved Blessings!")
doPlayerSendCancel(cid, "You have already recieved Blessings!")
return true
return true
end
end
end
end
local exstorage = 45001
local exstorage = 45001
if exhaustion.check(cid, exstorage) then
if exhaustion.check(cid, exstorage) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted. Please wait awhile.")
doPlayerSendCancel(cid, "You are exhausted. Please wait awhile.")
return true
return true
end
end
exhaustion.set(cid, exstorage, 120)
exhaustion.set(cid, exstorage, 120)
for i = 1,5 do
for i = 1,5 do
doPlayerAddBlessing(cid, cfg.bless[i])
doPlayerAddBlessing(cid, cfg.bless[i])
end
end
doCreatureSetDropLoot(cid, false)
doCreatureSetDropLoot(cid, false)
doSetItemActionId(item.uid, getPlayerGUID(cid))
doSetItemActionId(item.uid, getPlayerGUID(cid))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
doPlayerSendTextMessage(cid, 21, "You have recieved blessings by Ancient Book!")
doPlayerSendTextMessage(cid, 21, "You have recieved blessings by Ancient Book!")
return true
return true
end
end