summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-29 08:19:07 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-29 08:19:07 +0000
commite7bae02e70b98330adbf1a44ace9a9939636cd50 (patch)
tree4081aac30fe79be4d8364435dc31439e7b2c8ff5 /src/map
parentb91483219d36a4fb7359a5fdc17cedaf73b18dc5 (diff)
downloadhercules-e7bae02e70b98330adbf1a44ace9a9939636cd50.tar.gz
hercules-e7bae02e70b98330adbf1a44ace9a9939636cd50.tar.bz2
hercules-e7bae02e70b98330adbf1a44ace9a9939636cd50.tar.xz
hercules-e7bae02e70b98330adbf1a44ace9a9939636cd50.zip
Renamed struct 'skill' to 's_skill' to remove naming collisions.
Added defines for mercenary skill ranges. Added a mapping of mercenary skills to the skill db (700-799 atm). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13012 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mercenary.c2
-rw-r--r--src/map/skill.c33
-rw-r--r--src/map/skill.h2
-rw-r--r--src/map/status.c2
4 files changed, 24 insertions, 15 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 6a027029f..c56c36cdb 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -836,7 +836,7 @@ int merc_hom_shuffle(struct homun_data *hd)
struct map_session_data *sd;
int lv, i, skillpts;
unsigned int exp;
- struct skill b_skill[MAX_HOMUNSKILL];
+ struct s_skill b_skill[MAX_HOMUNSKILL];
if (!merc_is_hom_active(hd))
return 0;
diff --git a/src/map/skill.c b/src/map/skill.c
index 1a11d9a0f..e0dddd1f3 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -38,11 +38,14 @@
#define SKILLUNITTIMER_INTERVAL 100
-//Guild Skills are shifted to these to make them stick into the skill array.
+
+// ranges reserved for mapping skill ids to skilldb offsets
#define GD_SKILLRANGEMIN 900
#define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL
#define HM_SKILLRANGEMIN 800
#define HM_SKILLRANGEMAX HM_SKILLRANGEMIN+MAX_HOMUNSKILL
+#define MC_SKILLRANGEMIN 700
+#define MC_SKILLRANGEMAX MC_SKILLRANGEMIN+MAX_MERCSKILL
static struct eri *skill_unit_ers = NULL; //For handling skill_unit's [Skotlex]
static struct eri *skill_timer_ers = NULL; //For handling skill_timerskills [Skotlex]
@@ -73,17 +76,23 @@ int skill_name2id(const char* name)
/// Returns the skill's array index, or 0 (Unknown Skill).
int skill_get_index( int id )
{
- // avoid ranges reserved for mapping guild/homun skills
- if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX )
- return 0;
- if( id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX )
+ // avoid ranges reserved for mapping guild/homun/mercenary skills
+ if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX
+ || id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX
+ || id >= MC_SKILLRANGEMIN && id <= MC_SKILLRANGEMAX )
return 0;
- // map skill number to skill id
+ // map skill id to skill db index
if( id >= GD_SKILLBASE )
id = GD_SKILLRANGEMIN + id - GD_SKILLBASE;
+ else
if( id >= HM_SKILLBASE )
id = HM_SKILLRANGEMIN + id - HM_SKILLBASE;
+ else
+ if( id >= MC_SKILLBASE )
+ id = MC_SKILLRANGEMIN + id - MC_SKILLBASE;
+ else
+ ; // identity
// validate result
if( id <= 0 || id >= MAX_SKILL_DB )
@@ -10791,14 +10800,14 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current)
{// id,range,hit,inf,element,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count,name,description
int id = atoi(split[0]);
int i;
- if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX ) {
- ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with guild skill mapping)!\n");
- return false;
- }
- if( id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX ) {
- ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with homunculus skill mapping)!\n");
+ if( id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX
+ || id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX
+ || id >= MC_SKILLRANGEMIN && id <= MC_SKILLRANGEMAX )
+ {
+ ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with guild/homun/mercenary skill mapping)!\n");
return false;
}
+
i = skill_get_index(id);
if( !i ) // invalid skill id
return false;
diff --git a/src/map/skill.h b/src/map/skill.h
index 03557960d..2509fdf25 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -349,7 +349,7 @@ enum {
ST_WATER,
};
-enum s_skill {
+enum e_skill {
NV_BASIC = 1,
SM_SWORD,
diff --git a/src/map/status.c b/src/map/status.c
index bbc22363e..3341318d0 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1595,7 +1595,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
static int calculating = 0; //Check for recursive call preemption. [Skotlex]
struct status_data b_status, *status;
const struct status_change *sc = &sd->sc;
- struct skill b_skill[MAX_SKILL];
+ struct s_skill b_skill[MAX_SKILL];
int b_weight,b_max_weight;
int i,index;