Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #003440

  • 2 - Fair

  • Confirmed

Issue Confirmations

  • Yes (0)No (0)
Photo

Race2 Bonuses not being applied for Arrows/Ammo

Posted by Hercules Bot on 28 July 2009 - 09:47 PM

Originally posted by Paradox924X
http://www.eathena.w...er&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

Originally posted by xazax
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. )