summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-14 09:31:47 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-14 09:31:47 +0000
commitfefc60d0a202e489ebc0d999f13a0abcc638518a (patch)
treefba77837fbe8e56d7f71cd3a83716a231ba993b6 /src
parente932e59a70601716c75daffa6cc43cbfcf0e2334 (diff)
downloadhercules-fefc60d0a202e489ebc0d999f13a0abcc638518a.tar.gz
hercules-fefc60d0a202e489ebc0d999f13a0abcc638518a.tar.bz2
hercules-fefc60d0a202e489ebc0d999f13a0abcc638518a.tar.xz
hercules-fefc60d0a202e489ebc0d999f13a0abcc638518a.zip
Fixed some homunculus skill offset calculation mistakes (bugreport:363)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11731 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char/int_homun.c4
-rw-r--r--src/char_sql/int_homun.c2
-rw-r--r--src/common/mmo.h2
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/mercenary.c8
-rw-r--r--src/map/pc.c4
7 files changed, 14 insertions, 14 deletions
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 545f0d08c..7f6e971aa 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -97,9 +97,9 @@ int inter_homun_fromstr(char *str,struct s_homunculus *p)
if (sscanf(str+next, "%d,%d,%n", &tmp_int[0], &tmp_int[1], &len) != 2)
return 2;
- if (tmp_int[0] > HM_SKILLBASE && tmp_int[0] <= HM_SKILLBASE+MAX_HOMUNSKILL)
+ if (tmp_int[0] > HM_SKILLBASE && tmp_int[0] < HM_SKILLBASE+MAX_HOMUNSKILL)
{
- i = tmp_int[0] - HM_SKILLBASE -1;
+ i = tmp_int[0] - HM_SKILLBASE;
p->hskill[i].id = tmp_int[0];
p->hskill[i].lv = tmp_int[1];
} else
diff --git a/src/char_sql/int_homun.c b/src/char_sql/int_homun.c
index bc38e07be..25637c6e7 100644
--- a/src/char_sql/int_homun.c
+++ b/src/char_sql/int_homun.c
@@ -199,7 +199,7 @@ int mapif_load_homunculus(int fd)
i = atoi(data);
if( i < HM_SKILLBASE || i >= HM_SKILLBASE + MAX_HOMUNSKILL )
continue;// invalid guild skill
- i = i - HM_SKILLBASE - 1;
+ i = i - HM_SKILLBASE;
homun_pt->hskill[i].id = (unsigned short)atoi(data);
// lv
Sql_GetData(sql_handle, 1, &data, NULL);
diff --git a/src/common/mmo.h b/src/common/mmo.h
index acccc7211..f679d61f5 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -96,7 +96,7 @@
#define DEFAULT_MAX_CHAR_ID 250000
//Base Homun skill.
-#define HM_SKILLBASE 8000
+#define HM_SKILLBASE 8001
#define MAX_HOMUNSKILL 16
#define MAX_HOMUNCULUS_CLASS 16 //[orn]
#define HM_CLASS_BASE 6001
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index ed16dcdf1..325177565 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5666,7 +5666,7 @@ int atcommand_useskill(const int fd, struct map_session_data* sd, const char* co
return -1;
}
- if (skillnum >= HM_SKILLBASE && skillnum <= HM_SKILLBASE+MAX_HOMUNSKILL
+ if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL
&& sd->hd && merc_is_hom_active(sd->hd)) // (If used with @useskill, put the homunc as dest)
bl = &sd->hd->bl;
else
diff --git a/src/map/clif.c b/src/map/clif.c
index 0c5ff0362..a332d38c9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1426,7 +1426,7 @@ int clif_homskillinfoblock(struct map_session_data *sd)
WFIFOW(fd,0)=0x235;
for ( i = 0; i < MAX_HOMUNSKILL; i++){
if( (id = hd->homunculus.hskill[i].id) != 0 ){
- j = id - HM_SKILLBASE - 1 ;
+ j = id - HM_SKILLBASE ;
WFIFOW(fd,len ) = id ;
WFIFOW(fd,len+2) = skill_get_inf(id) ;
WFIFOW(fd,len+4) = 0 ;
@@ -1450,7 +1450,7 @@ void clif_homskillup(struct map_session_data *sd, int skill_num)
int fd=sd->fd, skillid;
WFIFOHEAD(fd, packet_len(0x239));
nullpo_retv(sd);
- skillid = skill_num - HM_SKILLBASE - 1;
+ skillid = skill_num - HM_SKILLBASE;
hd=sd->hd;
@@ -9275,7 +9275,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if (tmp&INF_GROUND_SKILL || !tmp)
return; //Using a ground/passive skill on a target? WRONG.
- if (skillnum >= HM_SKILLBASE && skillnum <= HM_SKILLBASE+MAX_HOMUNSKILL) {
+ if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL) {
clif_parse_UseSkillToId_homun(sd->hd, sd, tick, skillnum, skilllv, target_id);
return;
}
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index ad30afa2c..f0cca5182 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -143,7 +143,7 @@ int merc_hom_calc_skilltree(struct homun_data *hd)
for(i=0;i < MAX_SKILL_TREE && (id = hskill_tree[c][i].id) > 0;i++)
{
- if(hd->homunculus.hskill[id-HM_SKILLBASE-1].id)
+ if(hd->homunculus.hskill[id-HM_SKILLBASE].id)
continue; //Skill already known.
if(!battle_config.skillfree)
{
@@ -158,14 +158,14 @@ int merc_hom_calc_skilltree(struct homun_data *hd)
}
}
if (f)
- hd->homunculus.hskill[id-HM_SKILLBASE-1].id = id ;
+ hd->homunculus.hskill[id-HM_SKILLBASE].id = id ;
}
return 0;
}
int merc_hom_checkskill(struct homun_data *hd,int skill_id)
{
- int i = skill_id - HM_SKILLBASE - 1;
+ int i = skill_id - HM_SKILLBASE;
if(!hd)
return 0;
@@ -192,7 +192,7 @@ void merc_hom_skillup(struct homun_data *hd,int skillnum)
if(hd->homunculus.vaporize)
return;
- i = skillnum - HM_SKILLBASE - 1;
+ i = skillnum - HM_SKILLBASE;
if(hd->homunculus.skillpts > 0 &&
hd->homunculus.hskill[i].id &&
hd->homunculus.hskill[i].flag == 0 && //Don't allow raising while you have granted skills. [Skotlex]
diff --git a/src/map/pc.c b/src/map/pc.c
index 5ce0cae1f..5c46708b1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4544,12 +4544,12 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
{
nullpo_retr(0, sd);
- if(skill_num >= GD_SKILLBASE){
+ if(skill_num >= GD_SKILLBASE && skill_num < GD_SKILLBASE+MAX_GUILDSKILL){
guild_skillup(sd, skill_num);
return 0;
}
- if(skill_num >= HM_SKILLBASE && sd->hd){
+ if(skill_num >= HM_SKILLBASE && skill_num < HM_SKILLBASE+MAX_HOMUNSKILL && sd->hd){
merc_hom_skillup(sd->hd, skill_num);
return 0;
}