• Vote in May Mapping Competition to select a winner!
  • 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!

TFS 0.X how to define X many skills/lvls loss when player death

zabuzo

Active Member
Joined
Jun 10, 2016
Messages
165
Best answers
0
Reaction score
26
how to make this rulles:
Code:
local totalblessreduction = 0.0
local eachblessreduction = 0.3 -- 5 blesses * eachblessreduction = 1.5
for i = 1, 5 do
    if(getPlayerBlessing(cid, bless[i])) then
        totalblessreduction += eachblessreduction
    end
end



if(skills >= 1 && skills <= 40) skillslose = 0.5
elseif(skills >= 41 && skills <= 60) skillslose = 1
elseif(skills >= 61 && skills <= 80) skillslose = 1.5
elseif(skills >= 81 && skills <= 90) skillslose = 2.0
elseif(skills >= 91 && skills <= 100) skillslose = 2.5
elseif(skills >= 101) skillslose = 3.0
elseif(skull == SKULL_RED) skillslose *= 1.5
elseif(skull == SKULL_BLACK) skillslose *= 3.0
skillslose -= totalblessreduction




if(ml >= 1 && ml <= 20) mllose = 0.5
elseif(ml >= 21 && ml <= 30) mllose = 1.0
elseif(ml >= 31 && ml <= 40) mllose = 1.5
elseif(ml >= 41 && ml <= 60) mllose = 2.0
elseif(ml >= 61 && ml <= 70) mllose = 2.5
elseif(ml >= 71) mllose = 3.0
elseif(skull == SKULL_RED) mllose *= 1.5
elseif(skull == SKULL_BLACK) mllose *= 3.0
mllose -= totalblessreduction
to define a X lvls/skills lose in Y skills like on this block /\


it can be done on LUA or it needs or is better with sources changes?

the only thing about skill loss and ml loss i found on sources are: (Fir3element/3777 (https://github.com/Fir3element/3777/blob/aef29d0ac94140c5d095cb1f55a34035e42746b3/src/player.cpp#L2321) AND Fir3element/3777 (https://github.com/Fir3element/3777/blob/aef29d0ac94140c5d095cb1f55a34035e42746b3/src/player.cpp#L2297))
 
OP
zabuzo

zabuzo

Active Member
Joined
Jun 10, 2016
Messages
165
Best answers
0
Reaction score
26
bump
 
OP
zabuzo

zabuzo

Active Member
Joined
Jun 10, 2016
Messages
165
Best answers
0
Reaction score
26
bump
 
Top