summaryrefslogtreecommitdiff
path: root/src/map/skill.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-30 15:34:50 -0300
committershennetsind <ind@henn.et>2013-06-30 15:34:50 -0300
commit19e25a2d18164ede743c79aba0c92b20ac17bdca (patch)
treef8cf124145d70a157c37bb81395d977f97d2f391 /src/map/skill.h
parent3e54d00ad3e1f6fd56aace6f227c66a5b67eb3ea (diff)
downloadhercules-19e25a2d18164ede743c79aba0c92b20ac17bdca.tar.gz
hercules-19e25a2d18164ede743c79aba0c92b20ac17bdca.tar.bz2
hercules-19e25a2d18164ede743c79aba0c92b20ac17bdca.tar.xz
hercules-19e25a2d18164ede743c79aba0c92b20ac17bdca.zip
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 <ind@henn.et>
Diffstat (limited to 'src/map/skill.h')
-rw-r--r--src/map/skill.h19
1 files changed, 19 insertions, 0 deletions
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
@@ -1714,11 +1714,29 @@ 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;