Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. /**
  2. * Base ASPD value taken from the job tables
  3. * @param sd: Player object
  4. * @param status: Player status
  5. * @return base amotion after single/dual weapon and shield adjustments [RENEWAL]
  6. * base amotion after single/dual weapon and stats adjustments [PRE-RENEWAL]
  7. */
  8. int status_base_amotion_pc(struct map_session_data* sd, struct status_data* status)
  9. {
  10. int amotion;
  11. int classidx = pc_class2idx(sd->status.class_);
  12. #ifdef RENEWAL_ASPD
  13. int16 skill_lv, val = 0;
  14. float temp_aspd = 0;
  15.  
  16. amotion = job_info[classidx].aspd_base[sd->weapontype1]; // Single weapon
  17. if (sd->status.weapon > MAX_WEAPON_TYPE)
  18. amotion += job_info[classidx].aspd_base[sd->weapontype2] / 4; // Dual-wield
  19. if (sd->status.shield)
  20. amotion += job_info[classidx].aspd_base[MAX_WEAPON_TYPE];
  21.  
  22. switch(sd->status.weapon) {
  23. case W_BOW:
  24. case W_MUSICAL:
  25. case W_WHIP:
  26. case W_REVOLVER:
  27. case W_RIFLE:
  28. case W_GATLING:
  29. case W_SHOTGUN:
  30. case W_GRENADE:
  31. temp_aspd = status->dex * status->dex / 7.0f + status->agi * status->agi * 0.5f;
  32. break;
  33. default:
  34. temp_aspd = status->dex * status->dex / 5.0f + status->agi * status->agi * 0.5f;
  35. break;
  36. }
  37. temp_aspd = (float)(sqrt(temp_aspd) * 0.25f) + 0xc4;
  38. if ((skill_lv = pc_checkskill(sd,SA_ADVANCEDBOOK)) > 0 && sd->status.weapon == W_BOOK)
  39. val += (skill_lv - 1) / 2 + 1;
  40. if ((skill_lv = pc_checkskill(sd,GS_SINGLEACTION)) > 0 && (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE))
  41. val += ((skill_lv + 1) / 2);
  42. amotion = ((int)(temp_aspd + ((float)(status_calc_aspd(&sd->bl, &sd->sc, true) + val) * status->agi / 200)) - min(amotion, 200));
  43. #else
  44. // Angra Manyu disregards aspd_base and similar
  45. if (pc_checkequip2(sd, ITEMID_ANGRA_MANYU, EQI_ACC_L, EQI_MAX))
  46. return 0;
  47.  
  48. // Base weapon delay
  49. amotion = (sd->status.weapon < MAX_WEAPON_TYPE)
  50. ? (job_info[classidx].aspd_base[sd->status.weapon]) // Single weapon
  51. : (job_info[classidx].aspd_base[sd->weapontype1] + job_info[classidx].aspd_base[sd->weapontype2]) * 7 / 10; // Dual-wield
  52.  
  53. // Percentual delay reduction from stats
  54. amotion -= amotion * (4 * status->agi + status->dex) / 200000;
  55.  
  56. // Raw delay adjustment from bAspd bonus
  57. amotion += sd->bonus.aspd_add;
  58. #endif
  59.  
  60. return amotion;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement