Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Base ASPD value taken from the job tables
- * @param sd: Player object
- * @param status: Player status
- * @return base amotion after single/dual weapon and shield adjustments [RENEWAL]
- * base amotion after single/dual weapon and stats adjustments [PRE-RENEWAL]
- */
- int status_base_amotion_pc(struct map_session_data* sd, struct status_data* status)
- {
- int amotion;
- int classidx = pc_class2idx(sd->status.class_);
- #ifdef RENEWAL_ASPD
- int16 skill_lv, val = 0;
- float temp_aspd = 0;
- amotion = job_info[classidx].aspd_base[sd->weapontype1]; // Single weapon
- if (sd->status.weapon > MAX_WEAPON_TYPE)
- amotion += job_info[classidx].aspd_base[sd->weapontype2] / 4; // Dual-wield
- if (sd->status.shield)
- amotion += job_info[classidx].aspd_base[MAX_WEAPON_TYPE];
- switch(sd->status.weapon) {
- case W_BOW:
- case W_MUSICAL:
- case W_WHIP:
- case W_REVOLVER:
- case W_RIFLE:
- case W_GATLING:
- case W_SHOTGUN:
- case W_GRENADE:
- temp_aspd = status->dex * status->dex / 7.0f + status->agi * status->agi * 0.5f;
- break;
- default:
- temp_aspd = status->dex * status->dex / 5.0f + status->agi * status->agi * 0.5f;
- break;
- }
- temp_aspd = (float)(sqrt(temp_aspd) * 0.25f) + 0xc4;
- if ((skill_lv = pc_checkskill(sd,SA_ADVANCEDBOOK)) > 0 && sd->status.weapon == W_BOOK)
- val += (skill_lv - 1) / 2 + 1;
- if ((skill_lv = pc_checkskill(sd,GS_SINGLEACTION)) > 0 && (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE))
- val += ((skill_lv + 1) / 2);
- amotion = ((int)(temp_aspd + ((float)(status_calc_aspd(&sd->bl, &sd->sc, true) + val) * status->agi / 200)) - min(amotion, 200));
- #else
- // Angra Manyu disregards aspd_base and similar
- if (pc_checkequip2(sd, ITEMID_ANGRA_MANYU, EQI_ACC_L, EQI_MAX))
- return 0;
- // Base weapon delay
- amotion = (sd->status.weapon < MAX_WEAPON_TYPE)
- ? (job_info[classidx].aspd_base[sd->status.weapon]) // Single weapon
- : (job_info[classidx].aspd_base[sd->weapontype1] + job_info[classidx].aspd_base[sd->weapontype2]) * 7 / 10; // Dual-wield
- // Percentual delay reduction from stats
- amotion -= amotion * (4 * status->agi + status->dex) / 200000;
- // Raw delay adjustment from bAspd bonus
- amotion += sd->bonus.aspd_add;
- #endif
- return amotion;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement