homunculus.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _HOMUNCULUS_H_
  4. #define _HOMUNCULUS_H_
  5. #include "status.h" // struct status_data, struct status_change
  6. #include "unit.h" // struct unit_data
  7. struct h_stats {
  8. unsigned int HP, SP;
  9. unsigned short str, agi, vit, int_, dex, luk;
  10. };
  11. struct s_homunculus_db {
  12. int base_class, evo_class;
  13. char name[NAME_LENGTH];
  14. struct h_stats base, gmin, gmax, emin, emax;
  15. int foodID ;
  16. int baseASPD ;
  17. long hungryDelay ;
  18. unsigned char element, race, base_size, evo_size;
  19. };
  20. extern struct s_homunculus_db homunculus_db[MAX_HOMUNCULUS_CLASS];
  21. enum { HOMUNCULUS_CLASS, HOMUNCULUS_FOOD };
  22. enum { MH_MD_FIGHTING=1, MH_MD_GRAPPLING };
  23. enum {
  24. HOM_ST_ACTIVE = 0,
  25. HOM_ST_REST = 1,
  26. HOM_ST_MORPH = 2,
  27. };
  28. enum {
  29. SP_ACK = 0x0,
  30. SP_INTIMATE = 0x1,
  31. SP_HUNGRY = 0x2,
  32. };
  33. struct homun_data {
  34. struct block_list bl;
  35. struct unit_data ud;
  36. struct view_data *vd;
  37. struct status_data base_status, battle_status;
  38. struct status_change sc;
  39. struct regen_data regen;
  40. struct s_homunculus_db *homunculusDB; //[orn]
  41. struct s_homunculus homunculus; //[orn]
  42. int masterteleport_timer;
  43. struct map_session_data *master; //pointer back to its master
  44. int hungry_timer; //[orn]
  45. unsigned int exp_next;
  46. char blockskill[MAX_SKILL]; // [orn]
  47. };
  48. #define MAX_HOM_SKILL_REQUIRE 5
  49. struct homun_skill_tree_entry {
  50. short id;
  51. unsigned char max;
  52. unsigned char joblv;
  53. short intimacylv;
  54. struct {
  55. short id;
  56. unsigned char lv;
  57. } need[MAX_HOM_SKILL_REQUIRE];
  58. }; // Celest
  59. #define HOM_EVO 0x100 //256
  60. #define HOM_S 0x200 //512
  61. #define HOM_REG 0x1000 //4096
  62. enum {
  63. // Normal Homunculus
  64. MAPID_LIF = HOM_REG|0x0,
  65. MAPID_AMISTR,
  66. MAPID_FILIR,
  67. MAPID_VANILMIRTH,
  68. // Evolved Homunulus
  69. MAPID_LIF_E = HOM_REG|HOM_EVO|0x0,
  70. MAPID_AMISTR_E,
  71. MAPID_FILIR_E,
  72. MAPID_VANILMIRTH_E,
  73. // Homunculus S
  74. MAPID_EIRA = HOM_S|0x0,
  75. MAPID_BAYERI,
  76. MAPID_SERA,
  77. MAPID_DIETER,
  78. MAPID_ELANOR,
  79. };
  80. #define homdb_checkid(id) (id >= HM_CLASS_BASE && id <= HM_CLASS_MAX)
  81. // merc_is_hom_alive(struct homun_data *)
  82. #define merc_is_hom_active(x) (x && x->homunculus.vaporize == HOM_ST_ACTIVE && x->battle_status.hp > 0)
  83. int do_init_merc(void);
  84. int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag); //albator
  85. struct view_data* merc_get_hom_viewdata(int class_);
  86. int hom_class2mapid(int hom_class);
  87. void merc_damage(struct homun_data *hd);
  88. int merc_hom_dead(struct homun_data *hd);
  89. void merc_hom_skillup(struct homun_data *hd,uint16 skill_id);
  90. int merc_hom_calc_skilltree(struct homun_data *hd, int flag_evolve);
  91. int merc_hom_checkskill(struct homun_data *hd,uint16 skill_id);
  92. int merc_hom_gainexp(struct homun_data *hd,int exp);
  93. int merc_hom_levelup(struct homun_data *hd);
  94. int merc_hom_evolution(struct homun_data *hd);
  95. int hom_mutate(struct homun_data *hd,int homun_id);
  96. void merc_hom_heal(struct homun_data *hd);
  97. int merc_hom_vaporize(struct map_session_data *sd, int flag);
  98. int merc_resurrect_homunculus(struct map_session_data *sd, unsigned char per, short x, short y);
  99. void merc_hom_revive(struct homun_data *hd, unsigned int hp, unsigned int sp);
  100. void merc_reset_stats(struct homun_data *hd);
  101. int merc_hom_shuffle(struct homun_data *hd); // [Zephyrus]
  102. void merc_save(struct homun_data *hd);
  103. int merc_call_homunculus(struct map_session_data *sd);
  104. int merc_create_homunculus_request(struct map_session_data *sd, int class_);
  105. int search_homunculusDB_index(int key,int type);
  106. int merc_menu(struct map_session_data *sd,int menunum);
  107. int merc_hom_food(struct map_session_data *sd, struct homun_data *hd);
  108. int merc_hom_hungry_timer_delete(struct homun_data *hd);
  109. int merc_hom_change_name(struct map_session_data *sd,char *name);
  110. int merc_hom_change_name_ack(struct map_session_data *sd, char* name, int flag);
  111. #define merc_stop_walking(hd, type) unit_stop_walking(&(hd)->bl, type)
  112. #define merc_stop_attack(hd) unit_stop_attack(&(hd)->bl)
  113. int merc_hom_increase_intimacy(struct homun_data * hd, unsigned int value);
  114. int merc_hom_decrease_intimacy(struct homun_data * hd, unsigned int value);
  115. int merc_skill_tree_get_max(int id, int b_class);
  116. void merc_hom_init_timers(struct homun_data * hd);
  117. void merc_skill_reload(void);
  118. void merc_reload(void);
  119. int hom_addspiritball(TBL_HOM *hd, int max);
  120. int hom_delspiritball(TBL_HOM *hd, int count, int type);
  121. #endif /* _HOMUNCULUS_H_ */