Darkelfen 0 Posted March 14, 2016 As we know, there are certain skills of the DoRam which are casted twice, SU_SV_STEM_SPEAR for example. The skill descript states that chance is increased every 30 levels, so I've used this piece of code at skill.c. I've assumed a 5% base chance * Sk_lv/30. case SU_SV_STEM_SPEAR: rate = (sd->status.base_level)/30; if( rnd()%100 < 5*rate ) skill_castend_damage_id(src, bl, SU_SV_STEM_SPEAR, pc_checkskill(sd, SU_SV_STEM_SPEAR), tick, 1); break; @@Rytech, suggested to change it to case SU_SV_STEM_SPEAR: rate = 5 * sd->status.base_level / 30; if( rnd()%100 < rate ) skill_castend_damage_id(src, bl, SU_SV_STEM_SPEAR, pc_checkskill(sd, SU_SV_STEM_SPEAR), tick, 1); break; The problem is that it produces inaccurate results as I'm dividing the base level and then multiplying by 5.For example a level 166 DoRam, would cast a second time at 27%, whilst it should double-cast at 25% chance since every 30 level the chance is increased rather than "every level/30". So I thought that "counting" the times the base level of the DoRam is divided by 30 should suffice, for example: case SU_SV_STEM_SPEAR: for (int number = 1; number <=sd->status.base_level; number ++) { if (number%30 == 0){ count++; } } int rate= 5*count. if( rnd()%100 < rate ) skill_castend_damage_id(src, bl, SU_SV_STEM_SPEAR, pc_checkskill(sd, SU_SV_STEM_SPEAR), tick, 1); break; It seems a little lengthy for me, but in theory, it should return more accurate results from this one. What do you think? Quote Share this post Link to post Share on other sites
Rytech 392 Posted March 15, 2016 You got it all wrong. According to the skill desc on those double cast skills.... If use skill when base level is 30 or higher, Has a chance to activate one more attack. Each level beyond 30 increase a chance to activate additional attack. The chance of it double casting appears once you reach level 30 and go up by chance with each level after. Quote Share this post Link to post Share on other sites