1 | // Copyright (c) Athena Dev Teams - Licensed under GNU GPL |
---|
2 | // For more information, see LICENCE in the main folder |
---|
3 | |
---|
4 | #ifndef _MERCENARY_H_ |
---|
5 | #define _MERCENARY_H_ |
---|
6 | |
---|
7 | #include "status.h" // struct status_data, struct status_change |
---|
8 | #include "unit.h" // struct unit_data |
---|
9 | |
---|
10 | struct h_stats { |
---|
11 | unsigned int HP, SP; |
---|
12 | unsigned short str, agi, vit, int_, dex, luk; |
---|
13 | }; |
---|
14 | |
---|
15 | struct s_homunculus_db { |
---|
16 | int base_class, evo_class; |
---|
17 | char name[NAME_LENGTH]; |
---|
18 | struct h_stats base, gmin, gmax, emin, emax; |
---|
19 | int foodID ; |
---|
20 | int baseASPD ; |
---|
21 | long hungryDelay ; |
---|
22 | unsigned char element, race, base_size, evo_size; |
---|
23 | }; |
---|
24 | |
---|
25 | extern struct s_homunculus_db homuncumlus_db[MAX_HOMUNCULUS_CLASS]; |
---|
26 | enum { HOMUNCULUS_CLASS, HOMUNCULUS_FOOD }; |
---|
27 | enum { |
---|
28 | SP_ACK = 0x00, |
---|
29 | SP_INTIMATE = 0x100, |
---|
30 | SP_HUNGRY = 0x200 |
---|
31 | }; |
---|
32 | |
---|
33 | |
---|
34 | struct homun_data { |
---|
35 | struct block_list bl; |
---|
36 | struct unit_data ud; |
---|
37 | struct view_data *vd; |
---|
38 | struct status_data base_status, battle_status; |
---|
39 | struct status_change sc; |
---|
40 | struct regen_data regen; |
---|
41 | struct s_homunculus_db *homunculusDB; //[orn] |
---|
42 | struct s_homunculus homunculus ; //[orn] |
---|
43 | |
---|
44 | struct map_session_data *master; //pointer back to its master |
---|
45 | int hungry_timer; //[orn] |
---|
46 | unsigned int exp_next; |
---|
47 | char blockskill[MAX_SKILL]; // [orn] |
---|
48 | }; |
---|
49 | |
---|
50 | |
---|
51 | #define homdb_checkid(id) (id >= HM_CLASS_BASE && id <= HM_CLASS_MAX) |
---|
52 | |
---|
53 | // merc_is_hom_alive(struct homun_data *) |
---|
54 | #define merc_is_hom_active(x) (x && x->homunculus.vaporize != 1 && x->battle_status.hp > 0) |
---|
55 | int do_init_merc(void); |
---|
56 | int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag); //albator |
---|
57 | struct view_data* merc_get_hom_viewdata(int class_); |
---|
58 | void merc_damage(struct homun_data *hd,struct block_list *src,int hp,int sp); |
---|
59 | int merc_hom_dead(struct homun_data *hd, struct block_list *src); |
---|
60 | void merc_hom_skillup(struct homun_data *hd,int skillnum); |
---|
61 | int merc_hom_calc_skilltree(struct homun_data *hd) ; |
---|
62 | int merc_hom_checkskill(struct homun_data *hd,int skill_id) ; |
---|
63 | int merc_hom_gainexp(struct homun_data *hd,int exp) ; |
---|
64 | int merc_hom_levelup(struct homun_data *hd) ; |
---|
65 | int merc_hom_evolution(struct homun_data *hd) ; |
---|
66 | void merc_hom_heal(struct homun_data *hd,int hp,int sp); |
---|
67 | int merc_hom_vaporize(struct map_session_data *sd, int flag); |
---|
68 | int merc_resurrect_homunculus(struct map_session_data *sd, unsigned char per, short x, short y); |
---|
69 | void merc_hom_revive(struct homun_data *hd, unsigned int hp, unsigned int sp); |
---|
70 | void merc_reset_stats(struct homun_data *hd); |
---|
71 | int merc_hom_shuffle(struct homun_data *hd); // [Zephyrus] |
---|
72 | void merc_save(struct homun_data *hd); |
---|
73 | int merc_call_homunculus(struct map_session_data *sd); |
---|
74 | int merc_create_homunculus_request(struct map_session_data *sd, int class_); |
---|
75 | int search_homunculusDB_index(int key,int type); |
---|
76 | int merc_menu(struct map_session_data *sd,int menunum); |
---|
77 | int merc_hom_food(struct map_session_data *sd, struct homun_data *hd); |
---|
78 | int merc_hom_hungry_timer_delete(struct homun_data *hd); |
---|
79 | int merc_hom_change_name(struct map_session_data *sd,char *name); |
---|
80 | int merc_hom_change_name_ack(struct map_session_data *sd, char* name, int flag); |
---|
81 | #define merc_stop_walking(hd, type) unit_stop_walking(&(hd)->bl, type) |
---|
82 | #define merc_stop_attack(hd) unit_stop_attack(&(hd)->bl) |
---|
83 | int merc_hom_increase_intimacy(struct homun_data * hd, unsigned int value); |
---|
84 | int merc_hom_decrease_intimacy(struct homun_data * hd, unsigned int value); |
---|
85 | int merc_skill_tree_get_max(int id, int b_class); |
---|
86 | void merc_hom_init_timers(struct homun_data * hd); |
---|
87 | void merc_skill_reload(void); |
---|
88 | void merc_reload(void); |
---|
89 | |
---|
90 | #endif /* _MERCENARY_H_ */ |
---|