summaryrefslogtreecommitdiff
path: root/src/map/pet.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-09-16 11:53:58 -0300
committershennetsind <ind@henn.et>2013-09-16 11:53:58 -0300
commita1bdf6b04263653699c3ea0ec428aadb7b297fec (patch)
tree386004147429a1e06192da586dfb06b0baca0486 /src/map/pet.h
parent4337e65f1dc35d244dc3abf43ed084c43d064b24 (diff)
downloadhercules-a1bdf6b04263653699c3ea0ec428aadb7b297fec.tar.gz
hercules-a1bdf6b04263653699c3ea0ec428aadb7b297fec.tar.bz2
hercules-a1bdf6b04263653699c3ea0ec428aadb7b297fec.tar.xz
hercules-a1bdf6b04263653699c3ea0ec428aadb7b297fec.zip
HPM: Pet.c Interface
Fully Integrated. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pet.h')
-rw-r--r--src/map/pet.h87
1 files changed, 53 insertions, 34 deletions
diff --git a/src/map/pet.h b/src/map/pet.h
index 4060b5382..b0e7cec6d 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _PET_H_
#define _PET_H_
@@ -30,7 +31,6 @@ struct s_pet_db {
struct script_code *equip_script;
struct script_code *pet_script;
};
-extern struct s_pet_db pet_db[MAX_PET_DB];
enum { PET_CLASS,PET_CATCH,PET_EGG,PET_EQUIP,PET_FOOD };
@@ -98,39 +98,58 @@ struct pet_data {
struct map_session_data *msd;
};
-
-
-int pet_create_egg(struct map_session_data *sd, int item_id);
-int pet_hungry_val(struct pet_data *pd);
-void pet_set_intimate(struct pet_data *pd, int value);
-int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type);
-int pet_unlocktarget(struct pet_data *pd);
-int pet_sc_check(struct map_session_data *sd, int type); //Skotlex
-int search_petDB_index(int key,int type);
-int pet_hungry_timer_delete(struct pet_data *pd);
-int pet_data_init(struct map_session_data *sd, struct s_pet *pet);
-int pet_birth_process(struct map_session_data *sd, struct s_pet *pet);
-int pet_recv_petdata(int account_id,struct s_pet *p,int flag);
-int pet_select_egg(struct map_session_data *sd,short egg_index);
-int pet_catch_process1(struct map_session_data *sd,int target_class);
-int pet_catch_process2(struct map_session_data *sd,int target_id);
-int pet_get_egg(int account_id,int pet_id,int flag);
-int pet_menu(struct map_session_data *sd,int menunum);
-int pet_change_name(struct map_session_data *sd,char *name);
-int pet_change_name_ack(struct map_session_data *sd, char* name, int flag);
-int pet_equipitem(struct map_session_data *sd,int index);
-int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd);
-int pet_attackskill(struct pet_data *pd, int target_id);
-int pet_skill_support_timer(int tid, unsigned int tick, int id, intptr_t data); // [Skotlex]
-int pet_skill_bonus_timer(int tid, unsigned int tick, int id, intptr_t data); // [Valaris]
-int pet_recovery_timer(int tid, unsigned int tick, int id, intptr_t data); // [Valaris]
-int pet_heal_timer(int tid, unsigned int tick, int id, intptr_t data); // [Valaris]
-
#define pet_stop_walking(pd, type) unit->stop_walking(&(pd)->bl, type)
#define pet_stop_attack(pd) unit->stop_attack(&(pd)->bl)
-int read_petdb(void);
-int do_init_pet(void);
-int do_final_pet(void);
+struct pet_interface {
+ struct s_pet_db db[MAX_PET_DB];
+ struct eri *item_drop_ers; //For loot drops delay structures.
+ struct eri *item_drop_list_ers;
+ /* */
+ int (*init) (void);
+ int (*final) (void);
+ /* */
+ int (*hungry_val) (struct pet_data *pd);
+ void (*set_intimate) (struct pet_data *pd, int value);
+ int (*create_egg) (struct map_session_data *sd, int item_id);
+ int (*unlocktarget) (struct pet_data *pd);
+ int (*attackskill) (struct pet_data *pd, int target_id);
+ int (*target_check) (struct map_session_data *sd, struct block_list *bl, int type);
+ int (*sc_check) (struct map_session_data *sd, int type);
+ int (*hungry) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*search_petDB_index) (int key, int type);
+ int (*hungry_timer_delete) (struct pet_data *pd);
+ int (*performance) (struct map_session_data *sd, struct pet_data *pd);
+ int (*return_egg) (struct map_session_data *sd, struct pet_data *pd);
+ int (*data_init) (struct map_session_data *sd, struct s_pet *pet);
+ int (*birth_process) (struct map_session_data *sd, struct s_pet *pet);
+ int (*recv_petdata) (int account_id, struct s_pet *p, int flag);
+ int (*select_egg) (struct map_session_data *sd, short egg_index);
+ int (*catch_process1) (struct map_session_data *sd, int target_class);
+ int (*catch_process2) (struct map_session_data *sd, int target_id);
+ int (*get_egg) (int account_id, int pet_id, int flag);
+ int (*unequipitem) (struct map_session_data *sd, struct pet_data *pd);
+ int (*food) (struct map_session_data *sd, struct pet_data *pd);
+ int (*ai_sub_hard_lootsearch) (struct block_list *bl, va_list ap);
+ int (*menu) (struct map_session_data *sd, int menunum);
+ int (*change_name) (struct map_session_data *sd, char *name);
+ int (*change_name_ack) (struct map_session_data *sd, char *name, int flag);
+ int (*equipitem) (struct map_session_data *sd, int index);
+ int (*randomwalk) (struct pet_data *pd, unsigned int tick);
+ int (*ai_sub_hard) (struct pet_data *pd, struct map_session_data *sd, unsigned int tick);
+ int (*ai_sub_foreachclient) (struct map_session_data *sd, va_list ap);
+ int (*ai_hard) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*delay_item_drop) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*lootitem_drop) (struct pet_data *pd, struct map_session_data *sd);
+ int (*skill_bonus_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*recovery_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*heal_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*skill_support_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*read_db) ();
+};
+
+struct pet_interface *pet;
+
+void pet_defaults(void);
#endif /* _PET_H_ */