From 19e25a2d18164ede743c79aba0c92b20ac17bdca Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 30 Jun 2013 15:34:50 -0300 Subject: Fixed Skill Cooldowns Special Thanks to Vylow for bringing this to our attention. Also added support for the client-side cooldown left/total feature (packetver 20120604 and newer) Made Possible Thanks to Yommy =3 Signed-off-by: shennetsind --- src/map/skill.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/map/skill.h') diff --git a/src/map/skill.h b/src/map/skill.h index 921a682a2..338537975 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -1713,12 +1713,30 @@ struct s_skill_magicmushroom_db { }; extern struct s_skill_magicmushroom_db skill_magicmushroom_db[MAX_SKILL_MAGICMUSHROOM_DB]; +/** + * Skill Cool Down Delay Saving + * Struct skill_cd is not a member of struct map_session_data + * to keep cooldowns in memory between player log-ins. + * All cooldowns are reset when server is restarted. + **/ +struct skill_cd { + int duration[MAX_SKILL_TREE];//milliseconds +#if PACKETVER >= 20120604 + int total[MAX_SKILL_TREE]; +#endif + short skidx[MAX_SKILL_TREE];//the skill index entries belong to + short nameid[MAX_SKILL_TREE];//skill id + unsigned int started[MAX_SKILL_TREE]; + unsigned char cursor; +}; + /** * Vars **/ extern int enchant_eff[5]; extern int deluge_eff[5]; DBMap* skilldb_name2id; +DBMap* skillcd_db; // char_id -> struct skill_cd /** * Skill.c Interface @@ -1917,6 +1935,7 @@ struct skill_interface { int (*elementalanalysis) (struct map_session_data *sd, int n, uint16 skill_lv, unsigned short *item_list); int (*changematerial) (struct map_session_data *sd, int n, unsigned short *item_list); int (*get_elemental_type) (uint16 skill_id, uint16 skill_lv); + void (*cooldown_save) (struct map_session_data * sd); } skill_s; struct skill_interface *skill; -- cgit v1.2.3-70-g09d2