• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

bless + prevent losing items

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
 
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
u still lose level and skills.
 
PHP:
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;

???
 
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 :p
 
this work too i already use

PHP:
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
 
I make it shorter:
Lua:
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

But that only adds blessing, dont prevent 100% looting.. You have 0.01% to lose items.... :/ With mine, you dont lose any item if you have bless :p (with the script that i posted before...)
 
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 :p

and this is what? and where do i post it?
 
Back
Top