kimokimo
Kimo
as the title say how i can make bless prevent losing items on death?
function onSay(cid, words, param, channel)
if getPlayerBlessing(cid, 5) == FALSE then
if getPlayerMoney(cid) >= 100000 then
for i = 1,5 do
doPlayerAddBlessing(cid, i)
end
doSendMagicEffect(getCreaturePosition(cid), 39)
doPlayerRemoveMoney(cid, 100000)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
doCreatureSetDropLoot(cid, false)
else
doPlayerSendCancel(cid, "Sorry, but you dont have 10cc")
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
-- Blessings
-- NOTE: blessingReduction* regards items/containers loss.
-- eachBlessReduction is how much each bless reduces the experience/magic/skills loss.
blessingOnlyPremium = false
blessingReductionBase = 15
blessingReductionDecreament = 5
eachBlessReduction = 8
u still lose level and skills.LUA:function onSay(cid, words, param, channel) if getPlayerBlessing(cid, 5) == FALSE then if getPlayerMoney(cid) >= 100000 then for i = 1,5 do doPlayerAddBlessing(cid, i) end doSendMagicEffect(getCreaturePosition(cid), 39) doPlayerRemoveMoney(cid, 100000) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!") doCreatureSetDropLoot(cid, false) else doPlayerSendCancel(cid, "Sorry, but you dont have 10cc") 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
and to stop skill loss goto config.lua
LUA:-- Blessings -- NOTE: blessingReduction* regards items/containers loss. -- eachBlessReduction is how much each bless reduces the experience/magic/skills loss. blessingOnlyPremium = false blessingReductionBase = 15 blessingReductionDecreament = 5 eachBlessReduction = 8
UPDATE `players` SET `loss_experience` = 10;
UPDATE `players` SET `loss_mana` = 10;
UPDATE `players` SET `loss_skills` = 10;
UPDATE `players` SET `loss_containers` = 10;
UPDATE `players` SET `loss_items` = 10;
local array = {
PLAYERLOSS_EXPERIENCE,
PLAYERLOSS_MANA,
PLAYERLOSS_SKILLS,
PLAYERLOSS_CONTAINERS,
PLAYERLOSS_ITEMS
}
function onPrepareDeath(cid, deathList)
if getPlayerBlessing(cid, 5) == TRUE then
for i = 1, #array do
doPlayerSetLossPercent(cid, array[i], 0)
end
end
return true
end
function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 60000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
doSendAnimatedText(getPlayerPosition(cid), "BLESS!", 11)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
end
end
return 1
end
function onSay(cid, words, param)
for i = 1, 5 do
if getPlayerBlessing(cid, i) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 60000) == TRUE then
doPlayerAddBlessing(cid, i)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
doSendAnimatedText(getPlayerPosition(cid), "BLESS!", 11)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
end
end
return 1
end
LUA:local array = { PLAYERLOSS_EXPERIENCE, PLAYERLOSS_MANA, PLAYERLOSS_SKILLS, PLAYERLOSS_CONTAINERS, PLAYERLOSS_ITEMS } function onPrepareDeath(cid, deathList) if getPlayerBlessing(cid, 5) == TRUE then for i = 1, #array do doPlayerSetLossPercent(cid, array[i], 0) end end return true end
This should work![]()