Issue information

Issue ID
#3440
Status
Confirmed
Severity
Fair
Started
Hercules Elf Bot
Jul 28, 2009 21:47
Last Post
Hercules Elf Bot
Dec 25, 2011 17:12
Confirmation
N/A

Hercules Elf Bot - Jul 28, 2009 21:47

Originally posted by [b]Paradox924X[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3440

The code for adding race2 bonuses categorically excludes arrows/ammo from being given the bonus because arrows/ammo are not of type weapon_data like right_weapon and left_weapon but instead just stored directly in the map_session_data struct.
The difference can be seen between SP_ADDRACE and SP_ADDRACE2 from pc.c:
CODE
case SP_ADDRACE:
    if(!sd->state.lr_flag)
        sd->right_weapon.addrace[type2]+=val;
    else if(sd->state.lr_flag == 1)
        sd->left_weapon.addrace[type2]+=val;
    else if(sd->state.lr_flag == 2)
        sd->arrow_addrace[type2]+=val;
    break;

CODE
case SP_ADDRACE2:
    if (!(type2 > 0 && type2 < MAX_MOB_RACE_DB))
        break;
    if(sd->state.lr_flag != 2)
        sd->right_weapon.addrace2[type2] += val;
    else
        sd->left_weapon.addrace2[type2] += val;
    break;

As it can be seen, the bonuses that should be added to Arrows/Ammo simply get stacked onto the left weapon, which is pretty useless to an arrow/ammo user because arrow/ammo attacks stack damage using the right hand bonuses and arrow/ammo bonuses but SP_ADDRACE2 gives neither as seen in battle.c:
CODE
if(sd->state.arrow_atk)
{
    cardfix=cardfix*(100+sd->right_weapon.addrace[tstatus->race]+sd->arrow_addrace[tstatus->race])/100;
    if (!(nk&NK_NO_ELEFIX))
        cardfix=cardfix*(100+sd->right_weapon.addele[tstatus->def_ele]+sd->arrow_addele[tstatus->def_ele])/100;
    cardfix=cardfix*(100+sd->right_weapon.addsize[tstatus->size]+sd->arrow_addsize[tstatus->size])/100;
    cardfix=cardfix*(100+sd->right_weapon.addrace2[t_race2])/100;
    cardfix=cardfix*(100+sd->right_weapon.addrace[is_boss(target)?RC_BOSS:RC_NONBOSS]+sd->arrow_addrace[is_boss(target)?RC_BOSS:RC_NONBOSS])/100;
}

In fact, there isn't even an arrow_addrace2 like there is an arrow_addrace.
The fact alone that arrows and ammo use the same variables isn't comforting because that's just lumping Bow-Users (Thief Classes) + Gunslingers into the same category.

So.. the question is... What's official behavior?

Edit: The Sign, Goblin Leader Card, Lava Golem Card, Elder Card, Orc Lady Card, Kobold Leader Card and Turtle General Card are affected by this.

This post has been edited by Paradox924X: Jul 28 2009, 02:54 PM

Hercules Elf Bot - Dec 25, 2011 17:12

Originally posted by [b]xazax[/b]
Do we really need arrow_addrace? We could just stack arrow bonus with right_weapon.

Anyways with SP_ADDRACE2 even left hand bonus is added to right hand O.o.

Furthermore lot of bonuses are just disabled for arrows. For example: SP_HP_REGEN_RATE. Why? Status recalculations don't always consider bonuses from arrows? ( Did not check yet. )