mercenary.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _MERCENARY_H_
  4. #define _MERCENARY_H_
  5. #include "status.h" // struct status_data, struct status_change
  6. #include "unit.h" // struct unit_data
  7. // number of cells that a mercenary can walk to from it's master before being warped
  8. #define MAX_MER_DISTANCE 15
  9. enum {
  10. ARCH_MERC_GUILD,
  11. SPEAR_MERC_GUILD,
  12. SWORD_MERC_GUILD,
  13. };
  14. struct s_mercenary_db {
  15. int class_;
  16. char sprite[NAME_LENGTH], name[NAME_LENGTH];
  17. unsigned short lv;
  18. short range2, range3;
  19. struct status_data status;
  20. struct view_data vd;
  21. struct {
  22. unsigned short id, lv;
  23. } skill[MAX_MERCSKILL];
  24. };
  25. extern struct s_mercenary_db mercenary_db[MAX_MERCENARY_CLASS];
  26. struct mercenary_data {
  27. struct block_list bl;
  28. struct unit_data ud;
  29. struct view_data *vd;
  30. struct status_data base_status, battle_status;
  31. struct status_change sc;
  32. struct regen_data regen;
  33. struct s_mercenary_db *db;
  34. struct s_mercenary mercenary;
  35. char blockskill[MAX_SKILL];
  36. struct map_session_data *master;
  37. int contract_timer;
  38. unsigned devotion_flag : 1;
  39. unsigned int masterteleport_timer;
  40. };
  41. bool merc_class(int class_);
  42. struct view_data * merc_get_viewdata(int class_);
  43. int merc_create(struct map_session_data *sd, int class_, unsigned int lifetime);
  44. int merc_data_received(struct s_mercenary *merc, bool flag);
  45. int mercenary_save(struct mercenary_data *md);
  46. void mercenary_heal(struct mercenary_data *md, int hp, int sp);
  47. int mercenary_dead(struct mercenary_data *md);
  48. int merc_delete(struct mercenary_data *md, int reply);
  49. void merc_contract_stop(struct mercenary_data *md);
  50. int mercenary_get_lifetime(struct mercenary_data *md);
  51. int mercenary_get_guild(struct mercenary_data *md);
  52. int mercenary_get_faith(struct mercenary_data *md);
  53. int mercenary_set_faith(struct mercenary_data *md, int value);
  54. int mercenary_get_calls(struct mercenary_data *md);
  55. int mercenary_set_calls(struct mercenary_data *md, int value);
  56. int mercenary_kills(struct mercenary_data *md);
  57. int mercenary_checkskill(struct mercenary_data *md, uint16 skill_id);
  58. /**
  59. * atcommand.c required
  60. **/
  61. int read_mercenarydb(void);
  62. int read_mercenary_skilldb(void);
  63. int do_init_mercenary(void);
  64. #endif /* _MERCENARY_H_ */