pet.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _PET_H_
  4. #define _PET_H_
  5. #define MAX_PET_DB 300
  6. #define MAX_PETLOOT_SIZE 30 // [Valaris] - Changed to MAX_PETLOOT_SIZE [Skotlex]
  7. struct s_pet_db {
  8. short class_;
  9. char name[NAME_LENGTH],jname[NAME_LENGTH];
  10. short itemID;
  11. short EggID;
  12. short AcceID;
  13. short FoodID;
  14. int fullness;
  15. int hungry_delay;
  16. int r_hungry;
  17. int r_full;
  18. int intimate;
  19. int die;
  20. int capture;
  21. int speed;
  22. char s_perfor;
  23. int talk_convert_class;
  24. int attack_rate;
  25. int defence_attack_rate;
  26. int change_target_rate;
  27. struct script_code *script;
  28. };
  29. extern struct s_pet_db pet_db[MAX_PET_DB];
  30. enum { PET_CLASS,PET_CATCH,PET_EGG,PET_EQUIP,PET_FOOD };
  31. int pet_create_egg(struct map_session_data *sd, int item_id);
  32. int pet_hungry_val(struct pet_data *pd);
  33. int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type);
  34. int pet_unlocktarget(struct pet_data *pd);
  35. int pet_sc_check(struct map_session_data *sd, int type); //Skotlex
  36. int search_petDB_index(int key,int type);
  37. int pet_hungry_timer_delete(struct pet_data *pd);
  38. int pet_data_init(struct map_session_data *sd, struct s_pet *pet);
  39. int pet_birth_process(struct map_session_data *sd, struct s_pet *pet);
  40. int pet_recv_petdata(int account_id,struct s_pet *p,int flag);
  41. int pet_select_egg(struct map_session_data *sd,short egg_index);
  42. int pet_catch_process1(struct map_session_data *sd,int target_class);
  43. int pet_catch_process2(struct map_session_data *sd,int target_id);
  44. int pet_get_egg(int account_id,int pet_id,int flag);
  45. int pet_menu(struct map_session_data *sd,int menunum);
  46. int pet_change_name(struct map_session_data *sd,char *name);
  47. int pet_change_name_ack(struct map_session_data *sd, char* name, int flag);
  48. int pet_equipitem(struct map_session_data *sd,int index);
  49. int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd);
  50. int pet_attackskill(struct pet_data *pd, int target_id);
  51. int pet_skill_support_timer(int tid, unsigned int tick, int id, int data); // [Skotlex]
  52. int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
  53. int pet_recovery_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
  54. int pet_heal_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
  55. #define pet_stop_walking(pd, type) { if((pd)->ud.walktimer != -1) unit_stop_walking(&(pd)->bl, type); }
  56. #define pet_stop_attack(pd) { if((pd)->ud.attacktimer != -1) unit_stop_attack(&(pd)->bl); }
  57. int read_petdb(void);
  58. int do_init_pet(void);
  59. int do_final_pet(void);
  60. #endif /* _PET_H_ */