• 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 Do not lose magic level/skills?

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,731
Solutions
7
Reaction score
537
Location
Canada
How would I make it so players do not lose skills/magic level on death? I know it is a creaturescript but I am not sure how I would do it; this is for a war server. Maybe in the login.lua, or add a new script completely? Any help is appreciated.
 
Just remove this part from function named onDeath belongs to class Player in file players.cpp. I guess it's better way than disabling it every time.


_
Regards,
sn3ejk
 
I want it to be an ondeath script, not a SQL code. Thanks for the help, I'm currently using a Distro I didnt compile though.

- - - Updated - - -

Would be great if someone could get this working!
 
There are a lot of different ways you can do this. For your purposes, the easiest and most efficient way is to go into config.lua and change:

deathLostPercent = 0

or if using tfs 1.0/0.2:

deathLosePercent = 0

Edit: For only magic/skills, edit playerdeath.lua
 
Last edited:
Used tetra20's suggestion, if I do just SKILLS it makes it so the character doesnt lose experience or magic level or skills, same if I use just MAGIC, or EXPERIENCE.

So I figured I would use all of them in a script and set the losses, but still I have the problem they dont lose anything..

Example:
Code:
function onDeath(cid, corpse, killer)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 15)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MAGIC, 0)
end

The experience is set to have loss, but the character wont lose anything.

Again, revision is 0.3.6 - any help would be greatly appreciated.
 
Last edited:
So I am still trying to get this working, it will either not lose anything at all.. or it will lose level, magic, items, etc.

If someone could help me with this problem that would be beautiful.
 
Used tetra20's suggestion, if I do just SKILLS it makes it so the character doesnt lose experience or magic level or skills, same if I use just MAGIC, or EXPERIENCE.

So I figured I would use all of them in a script and set the losses, but still I have the problem they dont lose anything..

Example:
Code:
function onDeath(cid, corpse, killer)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 15)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MAGIC, 0)
end

The experience is set to have loss, but the character wont lose anything.

Again, revision is 0.3.6 - any help would be greatly appreciated.
Used tetra20's suggestion, if I do just SKILLS it makes it so the character doesnt lose experience or magic level or skills, same if I use just MAGIC, or EXPERIENCE.

So I figured I would use all of them in a script and set the losses, but still I have the problem they dont lose anything..

Example:
Code:
function onDeath(cid, corpse, killer)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 15)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MAGIC, 0)
end

The experience is set to have loss, but the character wont lose anything.

Again, revision is 0.3.6 - any help would be greatly appreciated.


im using this on tfs 0.3.7 but when players dies corpse dissapear... anyone can help me?
 
If corpse dissaper check items file where you can set dissapear time, but if corpse not even showing after player die check your sources :p
whitout the script the corpse is shown but when i add the script the corpse isn't even shown so aren't my source :S

im talking about this script (this bug happen when i install this creaturescript
Code:
function onDeath(cid, corpse, killer)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 15)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MAGIC, 0)
end
 
Back
Top