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

Lua Death Loss

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,018
Solutions
1
Reaction score
1,040
Location
United States
I've dealt with this issue before, but I cannot remember how it was done.
I'm trying to make it so you don't lose anything on death, this includes your backpack.

I noticed this in config.lua (changed it to 0):
LUA:
deathLostPercent = 0

But this does not work, I am still able to lose the backpack.
Is it because 0 is not a valid number for this option?

I'm lost.

Additional info: the server type is open.
 
deathLostPercent = exp/skill/magic/(maybe EQ)
But containers always is 100%, you will have to change that from somewhere else
 
You could just add blessings on login.

In creaturescripts..
douno if it works.

LUA:
function onLogin(cid)
	if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
		doPlayerSendCancel(cid,'You are already protected.')
	else
		doCreatureSay(cid, "Protected", TALKTYPE_ORANGE_1)
		doPlayerAddBlessing(cid, 1)
		doPlayerAddBlessing(cid, 2)
		doPlayerAddBlessing(cid, 3)
		doPlayerAddBlessing(cid, 4)
		doPlayerAddBlessing(cid, 5)
		end
	return true
end
 
Nope, when I died it says "death penalty was reduced by 100% because it was an unfair fight".
 
doPlayerSetLossPercent(cid, lossType, newPercent)
getPlayerLossPercent(cid, lossType)

loss type vary from 0 - 3

0 = skills?
1 = exp?
2 = equipment?
3 = container (backpack)?

(Not 100% sure about this).

ALOT more useful than adding 5 blessings on default. Since its much easier to customize the loss of the different types.

(I have a very evil debuff magic spell on my Quest OTs :|) ;)
 
Thank you Znote, I'm sure it will work, but I am using an unlimited amulet of loss.
No other amulet is needed, nor will be used, so it's no big deal. Too bad I gotta send rep to others before sending you another.
 

Similar threads

Back
Top