Jump to content

Darkelfen

Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by Darkelfen


  1. 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?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.