local freeBlessMaxLevel = 70
function onLogin(cid)
if(getPlayerLevel(cid) <= freeBlessMaxLevel and not getPlayerBlessing(cid,1)) then
for b=1, 5 do
doPlayerAddBlessing(cid, b)
end
doCreatureSay(cid, 'You got free bless, because your level is lower than 70', TALKTYPE_ORANGE_1)
elseif(getPlayerBlessing(cid,1)) then
doCreatureSay(cid, 'You are bleesed!', TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, 'You are not bleesed. type !bless', TALKTYPE_ORANGE_1)
end
return true
end
local freeBlessMaxLevel = 70
function onLogin(cid)
if(getPlayerLevel(cid) <= freeBlessMaxLevel and not getPlayerBlessing(cid,1)) then
for b=1, 6 do
doPlayerAddBlessing(cid, b)
end
doCreatureSay(cid, 'You got free bless, because your level is lower than 70', TALKTYPE_ORANGE_1)
elseif(getPlayerBlessing(cid,1)) then
doCreatureSay(cid, 'You are bleesed!', TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, 'You are not bleesed. type !bless', TALKTYPE_ORANGE_1)
end
return true
end
function onSay(cid, words, param)
local cost = getBlessingsCost(getPlayerLevel(cid))
if (isPlayerPzLocked(cid) == FALSE) then
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 already been blessed by the gods.")
return false
end
if (doPlayerRemoveMoney(cid,cost)) then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been blessed by the 5 gods!")
else
doPlayerSendCancel(cid,"You need "..cost.." gold coins to buy all 5 bless.")
end
else
doPlayerSendCancel(cid,"You can't buy bless, when you are in a battle.")
end
return false
end
std::bitset<5> bitset(blessings);
switch (bitset.count()) {
case 1:
dropPercent = 70;
break;
case 2:
dropPercent = 45;
break;
case 3:
dropPercent = 25;
break;
case 4:
dropPercent = 10;
break;
case 5:
dropPercent = 0;
break;
default:
dropPercent = 100;
break;