Fixed some homunculus skill offset calculation mistakes (bugreport:363)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11731 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2007-11-14 09:31:47 +00:00
parent 8cbd792cbd
commit b5cf6976a2
8 changed files with 16 additions and 14 deletions

View File

@ -3,6 +3,8 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/11/15
* Fixed some homunculus skill offset calculation mistakes (bugreport:363)
2007/11/14 2007/11/14
* Fixed skill_castnodex_db.txt not being parsed correctly * Fixed skill_castnodex_db.txt not being parsed correctly
* Fixed a search&replace typo in skill_db.txt * Fixed a search&replace typo in skill_db.txt

View File

@ -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) if (sscanf(str+next, "%d,%d,%n", &tmp_int[0], &tmp_int[1], &len) != 2)
return 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].id = tmp_int[0];
p->hskill[i].lv = tmp_int[1]; p->hskill[i].lv = tmp_int[1];
} else } else

View File

@ -199,7 +199,7 @@ int mapif_load_homunculus(int fd)
i = atoi(data); i = atoi(data);
if( i < HM_SKILLBASE || i >= HM_SKILLBASE + MAX_HOMUNSKILL ) if( i < HM_SKILLBASE || i >= HM_SKILLBASE + MAX_HOMUNSKILL )
continue;// invalid guild skill continue;// invalid guild skill
i = i - HM_SKILLBASE - 1; i = i - HM_SKILLBASE;
homun_pt->hskill[i].id = (unsigned short)atoi(data); homun_pt->hskill[i].id = (unsigned short)atoi(data);
// lv // lv
Sql_GetData(sql_handle, 1, &data, NULL); Sql_GetData(sql_handle, 1, &data, NULL);

View File

@ -96,7 +96,7 @@
#define DEFAULT_MAX_CHAR_ID 250000 #define DEFAULT_MAX_CHAR_ID 250000
//Base Homun skill. //Base Homun skill.
#define HM_SKILLBASE 8000 #define HM_SKILLBASE 8001
#define MAX_HOMUNSKILL 16 #define MAX_HOMUNSKILL 16
#define MAX_HOMUNCULUS_CLASS 16 //[orn] #define MAX_HOMUNCULUS_CLASS 16 //[orn]
#define HM_CLASS_BASE 6001 #define HM_CLASS_BASE 6001

View File

@ -5666,7 +5666,7 @@ int atcommand_useskill(const int fd, struct map_session_data* sd, const char* co
return -1; 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) && sd->hd && merc_is_hom_active(sd->hd)) // (If used with @useskill, put the homunc as dest)
bl = &sd->hd->bl; bl = &sd->hd->bl;
else else

View File

@ -1426,7 +1426,7 @@ int clif_homskillinfoblock(struct map_session_data *sd)
WFIFOW(fd,0)=0x235; WFIFOW(fd,0)=0x235;
for ( i = 0; i < MAX_HOMUNSKILL; i++){ for ( i = 0; i < MAX_HOMUNSKILL; i++){
if( (id = hd->homunculus.hskill[i].id) != 0 ){ if( (id = hd->homunculus.hskill[i].id) != 0 ){
j = id - HM_SKILLBASE - 1 ; j = id - HM_SKILLBASE ;
WFIFOW(fd,len ) = id ; WFIFOW(fd,len ) = id ;
WFIFOW(fd,len+2) = skill_get_inf(id) ; WFIFOW(fd,len+2) = skill_get_inf(id) ;
WFIFOW(fd,len+4) = 0 ; 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; int fd=sd->fd, skillid;
WFIFOHEAD(fd, packet_len(0x239)); WFIFOHEAD(fd, packet_len(0x239));
nullpo_retv(sd); nullpo_retv(sd);
skillid = skill_num - HM_SKILLBASE - 1; skillid = skill_num - HM_SKILLBASE;
hd=sd->hd; hd=sd->hd;
@ -9275,7 +9275,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if (tmp&INF_GROUND_SKILL || !tmp) if (tmp&INF_GROUND_SKILL || !tmp)
return; //Using a ground/passive skill on a target? WRONG. 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); clif_parse_UseSkillToId_homun(sd->hd, sd, tick, skillnum, skilllv, target_id);
return; return;
} }

View File

@ -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++) 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. continue; //Skill already known.
if(!battle_config.skillfree) if(!battle_config.skillfree)
{ {
@ -158,14 +158,14 @@ int merc_hom_calc_skilltree(struct homun_data *hd)
} }
} }
if (f) if (f)
hd->homunculus.hskill[id-HM_SKILLBASE-1].id = id ; hd->homunculus.hskill[id-HM_SKILLBASE].id = id ;
} }
return 0; return 0;
} }
int merc_hom_checkskill(struct homun_data *hd,int skill_id) 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) if(!hd)
return 0; return 0;
@ -192,7 +192,7 @@ void merc_hom_skillup(struct homun_data *hd,int skillnum)
if(hd->homunculus.vaporize) if(hd->homunculus.vaporize)
return; return;
i = skillnum - HM_SKILLBASE - 1; i = skillnum - HM_SKILLBASE;
if(hd->homunculus.skillpts > 0 && if(hd->homunculus.skillpts > 0 &&
hd->homunculus.hskill[i].id && hd->homunculus.hskill[i].id &&
hd->homunculus.hskill[i].flag == 0 && //Don't allow raising while you have granted skills. [Skotlex] hd->homunculus.hskill[i].flag == 0 && //Don't allow raising while you have granted skills. [Skotlex]

View File

@ -4544,12 +4544,12 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
{ {
nullpo_retr(0, sd); 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); guild_skillup(sd, skill_num);
return 0; 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); merc_hom_skillup(sd->hd, skill_num);
return 0; return 0;
} }