• 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!

Loosing all exp when dying with blessing.

Ekholmen

New Member
Joined
Dec 12, 2010
Messages
52
Reaction score
0
Location
Sweden
As the title say you loose all exp when dying with bless :S

we are using this code


Code:
function onSay(cid, words, param)
local fail = 0
 
	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
 
	if cost > 20000 then
		cost = 20000
	end
 
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
				end
			else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end


and in our config it says


-- Blessings
-- NOTE: blessingReduction* regards items/containers loss.
-- eachBlessReduction is how much each bless reduces the experience/magic/skills loss.
blessingOnlyPremium = true
blessingReductionBase = 30
blessingReductionDecreament = 5
eachBlessReduction = 8


So what is wrong :/?
 
ok here we go :)

config.lua:
Lua:
    blessingOnlyPremium = false 
    blessingReductionBase = 30 
    blessingReductionDecreament = 5 
    eachBlessReduction = 8

Talkactions.xml:
XML:
	<talkaction words="!bless" event="script" value="bless.lua"/>

bless.lua:
Lua:
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, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 5cc to get blessed!")
        end
    end    
    return 1
end
 
another bless.lua:
Lua:
  function onSay(cid, words, param, channel)
        if getPlayerBlessing(cid, 5) == FALSE then
                if getPlayerMoney(cid) >= 150000 then
                        for i = 1,5 do
                                doPlayerAddBlessing(cid, i)
                        end
                        doSendMagicEffect(getCreaturePosition(cid), 39)
                        doPlayerRemoveMoney(cid, 50000)
						doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
                        doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
                else
                        doPlayerSendCancel(cid, "Sorry, but you dont have 5cc")
                        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
 
here is a bless.lua
Code:
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, 1000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 1k to get blessed!")
        end
    end    
    return 1
end
 
sorry didnt notice :8

edit:
ill post what i found
Code:
  local bless =  {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
            return TRUE
        end
    end
   
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doCreatureSay(cid, "You are now blessed by the Five Gods!" ,1)
       
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
    return TRUE
end
Code:
-- [( Made by LucasOlzon from otland.net )] --
function onSay(cid, words, param)
local fail = 0
 
	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
 
	if cost > 20000 then
		cost = 20000
	end
 
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
				end
			else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end
Code:
local config = {
	price = 50000
}

function onSay(cid, words, param, channel)
	for i = 1, 5 do
		if doPlayerRemoveMoney(cid, config.price) then
			if not getPlayerBlessing(cid, i) then
				doPlayerAddBlessing(cid, i)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1)
				break
			else
				doPlayerSendCancel(cid, "Sorry, you have all the blessings.")
			end
		else
			doPlayerSendCancel(cid, "Sorry, you do not have enough money.")
		end
	end
Code:
local levelNeeded = 30
local basePrice = 2000
local blessLeveled = true
 
function onSay(cid, words, param, channel)
	local level = getPlayerLevel(cid)
 
	if level < levelNeeded then
		return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You need level ' .. levelNeeded .. ' or higher to buy blessings.')
	end
 
	local bless = {}
	local v = (blessLeveled and ((level > 30 and level < 120) and ((level - 30) * 200 + basePrice) or level > 120 and 20000 or level < 30 and basePrice) or 10000)
	for i = 1, 5 do
		if not getPlayerBlessing(cid, i) then
			table.insert(bless, i)
		end
	end
 
	if doPlayerRemoveMoney(cid, v * #bless) then
		for i = 1, #bless do
			doPlayerAddBlessing(cid, bless[i])
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, #bless > 0 and 'You bought ' .. #bless .. ' blessing' .. (#bless > 1 and 's' or '') .. ' for ' .. v * #bless .. ' gold coins.' or 'You already have all blessings.')
		doSendMagicEffect(getThingPos(cid), #bless > 0 and CONST_ME_MAGIC_RED or CONST_ME_POFF)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You don\'t have enough money.')
	end
	return true
end
 
no i have tryed evryone and the bless works but whwn you die whit the bless your ex become 0 if you die without vless your ex i the same wft?
 
Back
Top