Jump to content
  • 0
karazu

bHPVanishRate and bSPVanishRate

Question

I just saw this post in rathena,
 

 

/*=========================================== * Perform battle drain effects (HP/SP loss) *-------------------------------------------*/void battle_drain(TBL_PC *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int boss){    struct weapon_data *wd;    int64 *damage;    int type, thp = 0, tsp = 0, rhp = 0, rsp = 0, hp, sp, i;    for (i = 0; i < 4; i++) {        //First two iterations: Right hand        if (i < 2) { wd = &sd->right_weapon; damage = &rdamage; }        else { wd = &sd->left_weapon; damage = &ldamage; }        if (*damage <= 0) continue;        //First and Third iterations: race, other two boss/nonboss state        if (i == 0 || i == 2)            type = race;        else            type = boss?RC_BOSS:RC_NONBOSS;        hp = wd->hp_drain[type].value;        if (wd->hp_drain[type].rate)            hp += battle_calc_drain(*damage, wd->hp_drain[type].rate, wd->hp_drain[type].per);        sp = wd->sp_drain[type].value;        if (wd->sp_drain[type].rate)            sp += battle_calc_drain(*damage, wd->sp_drain[type].rate, wd->sp_drain[type].per);        if (hp) {            if (wd->hp_drain[type].type)                rhp += hp;            thp += hp;        }        if (sp) {            if (wd->sp_drain[type].type)                rsp += sp;            tsp += sp;        }    }    if (sd->bonus.sp_vanish_rate && rnd()%1000 < sd->bonus.sp_vanish_rate)        status_percent_damage(&sd->bl, tbl, 0, (unsigned char)sd->bonus.sp_vanish_per, false);    if (sd->bonus.hp_vanish_rate && rnd()%1000 < sd->bonus.hp_vanish_rate        && tbl->type == BL_PC && (map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg))        status_percent_damage(&sd->bl, tbl, (unsigned char)sd->bonus.hp_vanish_per, 0, false);        if( sd->sp_gain_race_attack[race] )        tsp += sd->sp_gain_race_attack[race];    if( sd->hp_gain_race_attack[race] )        thp += sd->hp_gain_race_attack[race];    if (!thp && !tsp) return;    status_heal(&sd->bl, thp, tsp, battle_config.show_hp_sp_drain?3:1);    if (rhp || rsp)        status_zap(tbl, rhp, rsp);} 

So bHPVanishRate already implemented in rathena?

Share this post


Link to post
Share on other sites

4 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.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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