TFS 0.X Red Skull/Black Skull don't drop ther items

zabuzo

Active Member
Joined
Jun 10, 2016
Messages
159
Best answers
0
Reaction score
26
Where should i change in my source code to when players red skulls / black skulls when they die, they don't lose every items?
Just lose items as players normal.

But red skulls when die drops 3x more EXP/SKILLS/ML
And black skulls when die drops 9x more EXP/SKILLS/ML

I recommend u guys, server owners to do this, i played a server who work just like that and people don't have makers to fuck up new players life





skills is here?
i mean, after
Code:
lostSkillTries = (uint32_t)std::ceil(sumSkillTries * ((double)(percent * lossPercent[LOSS_SKILLS]) / 100.));
add
Code:
if(playerisredskull) lostSkillTries *= 3;
else if(playerisblackskull) lostSkillTries *= 9;
Or it is somewhere else?


and ml is here?
after this line:
lostMana = (uint64_t)std::ceil(sumMana * ((double)(percent * lossPercent[LOSS_MANA]) / 100.));

should add something like
Code:
if(playerisredskull) lostSkillTries *= 3;
else if(playerisblackskull) lostSkillTries *= 9;
Or it is somewhere else?
 

Deatthraz

Intermediate OT User
Joined
May 1, 2013
Messages
326
Best answers
12
Reaction score
112
Location
Mexico
Remove
C++:
skull > SKULL_WHITE ||

Remove
C++:
if(skull < SKULL_RED)
 
OP
zabuzo

zabuzo

Active Member
Joined
Jun 10, 2016
Messages
159
Best answers
0
Reaction score
26
Remove
C++:
skull > SKULL_WHITE ||

Remove
C++:
if(skull < SKULL_RED)
It works! THANK YOU
It's not dropping all items anymore


Could u help me with that other last thing?


How to change the magic level loss?
I tried this:
Code:
        sumMana += manaSpent;
        lostMana = (uint64_t)std::ceil(sumMana * ((double)(percent * lossPercent[LOSS_MANA]) / 100.));
        // ml rates deathpercent
        if(skull == SKULL_RED) lostMana *= 30;
        else if(skull == SKULL_BLACK) lostMana *= 15;
        else lostMana *= 5;
        // end
on: Fir3element/3777 (https://github.com/Fir3element/3777/blob/aef29d0ac94140c5d095cb1f55a34035e42746b3/src/player.cpp#L2297)

But now magic level stop to get down when players die
 

Deatthraz

Intermediate OT User
Joined
May 1, 2013
Messages
326
Best answers
12
Reaction score
112
Location
Mexico
Try with lower values, take 1 as 100%, so if you want for example a red skull losing 30% more then would be *= 1.3, also remove the last else
Personally i recommend you to make it thorugh Lua using the lossPercent function but you gotta be careful since lossPercent can be bugged so easily.
 
OP
zabuzo

zabuzo

Active Member
Joined
Jun 10, 2016
Messages
159
Best answers
0
Reaction score
26
you were right, it bug so easy, sometimes don't remove tries, sometimes remove a lot

there isn't a way instead of take risk to do some shits in
ml

skill

there is a way to make something like:

Code:
if(skills >= 1 && skills <= 40) skillslose = 1;
else if(skills >= 41 && skills <= 60) skillslose = 1.5;
else if(skills >= 61 && skills <= 80) skillslose = 2;
else if(skills >= 81 && skills <= 100) skillslose = 2.5;
else if(skills >= 101) skillslose = 3;


if(ml >= 1 && ml <= 20) mllose = 1;
else if(ml >= 21 && ml <= 30) mllose = 1.5;
else if(ml >= 31 && ml <= 40) mllose = 2;
else if(ml >= 41 && ml <= 60) mllose = 2.5;
else if(ml >= 61) mllose = 3;
 
Top