summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-14 21:30:32 +0100
committerHaru <haru@dotalux.com>2015-12-28 18:36:00 +0100
commit7ac8f603c647790aee85106e97fc9f7672e4d436 (patch)
tree93d3b846d7dcf30df6429cc170e0a3959c6ee9bc /src
parent5db7c13c4a37bc688a464d369beab0bc31984bd5 (diff)
downloadhercules-7ac8f603c647790aee85106e97fc9f7672e4d436.tar.gz
hercules-7ac8f603c647790aee85106e97fc9f7672e4d436.tar.bz2
hercules-7ac8f603c647790aee85106e97fc9f7672e4d436.tar.xz
hercules-7ac8f603c647790aee85106e97fc9f7672e4d436.zip
Added elemental_id enum, replaced numeric elemental IDs with enum members
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/mmo.h3
-rw-r--r--src/map/elemental.c46
-rw-r--r--src/map/elemental.h22
-rw-r--r--src/map/skill.c24
4 files changed, 61 insertions, 34 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index ff41c00d8..3c556636c 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -196,9 +196,6 @@
#define MAX_ELEMENTALSKILL 42
#define EL_SKILLBASE 8401
#define MAX_ELESKILLTREE 3
-#define MAX_ELEMENTAL_CLASS 12
-#define EL_CLASS_BASE 2114
-#define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1)
// The following system marks a different job ID system used by the map server,
// which makes a lot more sense than the normal one. [Skotlex]
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 36dee32ba..a6fe94ab2 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -121,28 +121,32 @@ int elemental_create(struct map_session_data *sd, int class_, unsigned int lifet
//per individual bonuses
switch(db->class_){
- case 2114:
- case 2115:
- case 2116: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10)
+ case ELEID_EL_AGNI_S:
+ case ELEID_EL_AGNI_M:
+ case ELEID_EL_AGNI_L:
+ //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10)
ele.atk += summon_level * 20;
ele.atk2 += summon_level * 20;
ele.hit += summon_level * 10;
break;
- case 2117:
- case 2118:
- case 2119: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20)
+ case ELEID_EL_AQUA_S:
+ case ELEID_EL_AQUA_M:
+ case ELEID_EL_AQUA_L:
+ //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20)
ele.mdef += summon_level * 10;
ele.matk += summon_level * 20;
break;
- case 2120:
- case 2121:
- case 2122: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10)
+ case ELEID_EL_VENTUS_S:
+ case ELEID_EL_VENTUS_M:
+ case ELEID_EL_VENTUS_L:
+ //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10)
ele.flee += summon_level * 20;
ele.matk += summon_level * 10;
break;
- case 2123:
- case 2124:
- case 2125: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5)
+ case ELEID_EL_TERA_S:
+ case ELEID_EL_TERA_M:
+ case ELEID_EL_TERA_L:
+ //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5)
ele.def += summon_level * 25;
ele.atk += summon_level * 5;
ele.atk2 += summon_level * 5;
@@ -687,17 +691,17 @@ int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *s
if( DIFF_TICK(tick,ed->last_spdrain_time) >= 10000 ){// Drain SP every 10 seconds
int sp = 5;
- switch(ed->vd->class_){
- case 2115:
- case 2118:
- case 2121:
- case 2124:
+ switch (ed->vd->class_) {
+ case ELEID_EL_AGNI_M:
+ case ELEID_EL_AQUA_M:
+ case ELEID_EL_VENTUS_M:
+ case ELEID_EL_TERA_M:
sp = 8;
break;
- case 2116:
- case 2119:
- case 2122:
- case 2125:
+ case ELEID_EL_AGNI_L:
+ case ELEID_EL_AQUA_L:
+ case ELEID_EL_VENTUS_L:
+ case ELEID_EL_TERA_L:
sp = 11;
break;
}
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 1618c0d15..1a98670e0 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -29,6 +29,25 @@
#include <stdarg.h>
/**
+ * Enums
+ */
+/// Elemental IDs
+enum elemental_id {
+ ELEID_EL_AGNI_S = 2114, ///< EL_AGNI_S / Agni
+ ELEID_EL_AGNI_M = 2115, ///< EL_AGNI_M / Agni
+ ELEID_EL_AGNI_L = 2116, ///< EL_AGNI_L / Agni
+ ELEID_EL_AQUA_S = 2117, ///< EL_AQUA_S / Aqua
+ ELEID_EL_AQUA_M = 2118, ///< EL_AQUA_M / Aqua
+ ELEID_EL_AQUA_L = 2119, ///< EL_AQUA_L / Aqua
+ ELEID_EL_VENTUS_S = 2120, ///< EL_VENTUS_S / Ventus
+ ELEID_EL_VENTUS_M = 2121, ///< EL_VENTUS_M / Ventus
+ ELEID_EL_VENTUS_L = 2122, ///< EL_VENTUS_L / Ventus
+ ELEID_EL_TERA_S = 2123, ///< EL_TERA_S / Tera
+ ELEID_EL_TERA_M = 2124, ///< EL_TERA_M / Tera
+ ELEID_EL_TERA_L = 2125, ///< EL_TERA_L / Tera
+};
+
+/**
* Defines
**/
#define MIN_ELETHINKTIME 100
@@ -40,6 +59,9 @@
#define EL_SKILLMODE_PASIVE 0x1
#define EL_SKILLMODE_ASSIST 0x2
#define EL_SKILLMODE_AGGRESSIVE 0x4
+#define MAX_ELEMENTAL_CLASS 12
+#define EL_CLASS_BASE ELEID_EL_AGNI_S
+#define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1)
#define elemental_stop_walking(ed, type) (unit->stop_walking(&(ed)->bl, (type)))
#define elemental_stop_attack(ed) (unit->stop_attack(&(ed)->bl))
diff --git a/src/map/skill.c b/src/map/skill.c
index 0422e277f..dc3ebe62e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9423,13 +9423,17 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( !sd->ed )
break;
- switch(sd->ed->db->class_){
- case 2115:case 2124:
- case 2118:case 2121:
+ switch (sd->ed->db->class_) {
+ case ELEID_EL_AGNI_M:
+ case ELEID_EL_AQUA_M:
+ case ELEID_EL_VENTUS_M:
+ case ELEID_EL_TERA_M:
duration = 6000;
break;
- case 2116:case 2119:
- case 2122:case 2125:
+ case ELEID_EL_AGNI_L:
+ case ELEID_EL_AQUA_L:
+ case ELEID_EL_VENTUS_L:
+ case ELEID_EL_TERA_L:
duration = 9000;
break;
}
@@ -18570,11 +18574,11 @@ int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) {
int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) {
int type = 0;
- switch( skill_id ) {
- case SO_SUMMON_AGNI: type = 2114; break;
- case SO_SUMMON_AQUA: type = 2117; break;
- case SO_SUMMON_VENTUS: type = 2120; break;
- case SO_SUMMON_TERA: type = 2123; break;
+ switch (skill_id) {
+ case SO_SUMMON_AGNI: type = ELEID_EL_AGNI_S; break;
+ case SO_SUMMON_AQUA: type = ELEID_EL_AQUA_S; break;
+ case SO_SUMMON_VENTUS: type = ELEID_EL_VENTUS_S; break;
+ case SO_SUMMON_TERA: type = ELEID_EL_TERA_S; break;
}
type += skill_lv - 1;