<event type="preparedeath" name="onPrepareDeath" event="script" value="blessingdeath.lua"/>
function onPrepareDeath(cid)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doCreatureSetDropLoot(cid, true)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
else
doPlayerSendTextMessage(cid, 20, "You have blessings!")
end
end
Add this to creaturescripts.xml
and blessingdeath.luaCode:<event type="preparedeath" name="onPrepareDeath" event="script" value="blessingdeath.lua"/>
:thumbup:LUA:function onPrepareDeath(cid) if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then doCreatureSetDropLoot(cid, true) doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0) else doPlayerSendTextMessage(cid, 20, "You have blessings!") end end
Add this to creaturescripts.xml
and blessingdeath.luaCode:<event type="preparedeath" name="onPrepareDeath" event="script" value="blessingdeath.lua"/>
:thumbup:LUA:function onPrepareDeath(cid) if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then doCreatureSetDropLoot(cid, true) doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0) else doPlayerSendTextMessage(cid, 20, "You have blessings!") end end
return doPlayerSendTextMessage(cid, 20, "You have blessings!")
end
doPlayerSendTextMessage(cid, 20, "You have blessings!")
end
function onSay(cid, words, param, channel)
if getPlayerBlessing(cid, 5) == FALSE then
if getPlayerMoney(cid) >= 250000 then
for i = 1,5 do
doPlayerAddBlessing(cid, i)
end
doSendMagicEffect(getCreaturePosition(cid), 39)
doPlayerRemoveMoney(cid, 250000)
doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
else
doPlayerSendCancel(cid, "You don't have enough money.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You have already been blessed.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return true
end