Eross Posted August 19, 2021 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
0 TheKingDino Posted August 21, 2021 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
0 Eross Posted August 21, 2021 Author 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
0 TheKingDino Posted August 21, 2021 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
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.
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.