Eross Posted August 19, 2021 Group: Members Topic Count: 166 Topics Per Day: 0.09 Content Count: 377 Reputation: 12 Joined: 04/05/20 Last Seen: Thursday at 08:11 AM Share Posted August 19, 2021 Hi ! Can you teach me how to make this 10% chance ? Because on this topic they made it 100% .. I dont know how to make it 10% only SUPER NOVICE SPIRIT SKILL - Super Novices above LV 90 have 1% chance to 'erase' the death record - which means, the last 1% EXP loss will be recovered. Quote Link to comment Share on other sites More sharing options...
0 TheKingDino Posted August 21, 2021 Group: Members Topic Count: 13 Topics Per Day: 0.01 Content Count: 68 Reputation: 7 Joined: 02/21/19 Last Seen: December 23, 2023 Share Posted August 21, 2021 (edited) Go to the same line and simply remove a 0 from the 100 after rnd()% it should look like this: if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%10)) { //Erase death count 1% of the casts pc_setparam(dstsd, SP_PCDIECOUNTER, 0); clif_specialeffect(bl, EF_ANGEL2, AREA); //SC_SPIRIT invokes status_calc_pc for us. } Edited August 21, 2021 by TheKingDino 1 Quote Link to comment Share on other sites More sharing options...
0 Eross Posted August 21, 2021 Group: Members Topic Count: 166 Topics Per Day: 0.09 Content Count: 377 Reputation: 12 Joined: 04/05/20 Last Seen: Thursday at 08:11 AM Author Share Posted August 21, 2021 1 minute ago, TheKingDino said: Go to the same line and simply remove a 0 from the 100 after rnd()% it should look like this: if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%10)) { //Erase death count 1% of the casts pc_setparam(dstsd, SP_PCDIECOUNTER, 0); clif_specialeffect(bl, EF_ANGEL2, AREA); //SC_SPIRIT invokes status_calc_pc for us. } Thanks ! I will try this Quote Link to comment Share on other sites More sharing options...
0 TheKingDino Posted August 21, 2021 Group: Members Topic Count: 13 Topics Per Day: 0.01 Content Count: 68 Reputation: 7 Joined: 02/21/19 Last Seen: December 23, 2023 Share Posted August 21, 2021 (edited) If I understand this correctly: The idea is the random number is divisible by 100, aka a 1 in 100 chance. So a 10 would make in a 1 in 10 chance. Because ! means "NOT" and && means "and" when it's checking. % is the modulus operator Someone smarter can correct me if I'm wrong! I'm p sure that's the idea though. Edited August 21, 2021 by TheKingDino Quote Link to comment Share on other sites More sharing options...
Question
Eross
Hi ! Can you teach me how to make this 10% chance ? Because on this topic they made it 100% .. I dont know how to make it 10% only
SUPER NOVICE SPIRIT SKILL
- Super Novices above LV 90 have 1% chance to 'erase' the death record - which means, the last 1% EXP loss will be recovered.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.