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

Die with bless, lose all items

SpO0KIe

:)
Joined
Feb 28, 2010
Messages
192
Solutions
1
Reaction score
5
As the title says...
When a players dies with bless (without AOL) he loses all his items just like he had redskull. What is the problem ?
I have checked the database and all loss are set to 100.. is that what's wrong or?

Please I need help. And I have searched for an hour now and couldnt find the answer.
 
If it is set to "0" then your blessings aren't being added. In other words, whatever you are using to add blessings is not working.

Using a command or npc?
 
but what do you want?
you want a server zero exp,item,container,etc loss?
i want a zero server so i set preventloss to 100 in vocations.xml and in login.lua doplayerlossitems, 0 and in slitestudio i went to structure and edited some columns, example: "player_loss items" i wrote 0 in default

i disabled the function "bless" cuz it make all chars start from level 1 and lose all items
 
Last edited:
If it is set to "0" then your blessings aren't being added. In other words, whatever you are using to add blessings is not working.

Using a command or npc?
I am using a command (!bless) and it says all blessings are added. And when you die without bless then you lose your BP and maybe some EQ. I want bless to do the same.
 
Maybe your blessing command isn't working. You can try this, I haven't tested it.

Code:
function onSay(cid, words, param, channel)
	local cost = 50000
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			doPlayerSendCancel(cid, "Sorry, you already have all of the blessings.")
			break
		end
		
		return getPlayerMoney(cid) >= cost and doPlayerRemoveMoney(cid, cost) and doPlayerAddBlessing(cid, i) and doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1) or doPlayerSendCancel(cid, "Sorry, you don't have enough money.")
	end
	
	return true
end
 
Use this...
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, 60000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), math.random(19,23))
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the 5 gods!')
			doCreatureSay(cid, "!blessing", TALKTYPE_ORANGE_1)
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
If i helped you please REP++ me :D
 
Lua:
function onDeath(cid, corpse, deathList)
local skull = {4,5}
for i = 1,5 do
  if getPlayerBlessing(cid, i)then
    if (not isInArray(skull, getPlayerSkullType(cid))) then
      doCreatureSetDropLoot(cid, false)
    end
  end
end
return true
end
 
Lua:
function onDeath(cid, corpse, deathList)
local skull = {4,5}
for i = 1,5 do
  if getPlayerBlessing(cid, i)then
    if (not isInArray(skull, getPlayerSkullType(cid))) then
      doCreatureSetDropLoot(cid, false)
    end
  end
end
return true
end

Where should I put that ?
 
Creaturescripts.xml add
Code:
	<event type="preparedeath" name="BlessDeath" event="script" value="blessingdeath.lua"/>
login.lua add
Code:
registerCreatureEvent(cid, "BlessDeath")
blessdeath.lua
Lua:
function onPrepareDeath(cid)
local skull = {4,5}
for i = 1,5 do
  if getPlayerBlessing(cid, i)then
    if (not isInArray(skull, getPlayerSkullType(cid))) then
        doCreatureSetDropLoot(cid, false)
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
	doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
    end
  end
end
return true
end
 
Code:
       doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
	doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
[no need for that, and on death works :)]
 
Creaturescripts.xml add
Code:
	<event type="preparedeath" name="BlessDeath" event="script" value="blessingdeath.lua"/>
login.lua add
Code:
registerCreatureEvent(cid, "BlessDeath")
blessdeath.lua
Lua:
function onPrepareDeath(cid)
local skull = {4,5}
for i = 1,5 do
  if getPlayerBlessing(cid, i)then
    if (not isInArray(skull, getPlayerSkullType(cid))) then
        doCreatureSetDropLoot(cid, false)
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
	doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
    end
  end
end
return true
end

I have the same problem as SpO0KIe. When I use this script, the person who dies looses no items or anything but person with no bless also looses no items. Can someone make a script so when player with bless dies he will lose no items and when player with no bless will die then he will lose items.
 
Back
Top