summaryrefslogtreecommitdiff
path: root/src/map/homunculus.c
diff options
context:
space:
mode:
authormomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-23 18:15:21 +0000
committermomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-23 18:15:21 +0000
commitefbd5d0dd7dbf038333d65d59d0becad59e6e2a4 (patch)
treed5b149d3025ef79222eeaa6c34eb976799649b02 /src/map/homunculus.c
parent7298dd6e6f12729de1571628781c3945ae86f31e (diff)
downloadhercules-efbd5d0dd7dbf038333d65d59d0becad59e6e2a4.tar.gz
hercules-efbd5d0dd7dbf038333d65d59d0becad59e6e2a4.tar.bz2
hercules-efbd5d0dd7dbf038333d65d59d0becad59e6e2a4.tar.xz
hercules-efbd5d0dd7dbf038333d65d59d0becad59e6e2a4.zip
Partial fix for bugreport:4337.
A new field was added to homun_skill_tree.txt containing the minimum level of intimacy to unlock a skill. This is used in some skills where the homunculus has to reach a amount of 910 of intimacy. The default value is 0 and it should only affect evolved homunculus. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16954 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/homunculus.c')
-rw-r--r--src/map/homunculus.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 0bb41ebe4..ab3d811b2 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -40,7 +40,7 @@
#include <math.h>
struct s_homunculus_db homunculus_db[MAX_HOMUNCULUS_CLASS]; //[orn]
-struct skill_tree_entry hskill_tree[MAX_HOMUNCULUS_CLASS][MAX_SKILL_TREE];
+struct homun_skill_tree_entry hskill_tree[MAX_HOMUNCULUS_CLASS][MAX_SKILL_TREE];
static int merc_hom_hungry(int tid, unsigned int tick, int id, intptr_t data);
@@ -194,7 +194,7 @@ int merc_hom_delete(struct homun_data *hd, int emote)
return unit_remove_map(&hd->bl,CLR_OUTSIGHT);
}
-int merc_hom_calc_skilltree(struct homun_data *hd)
+int merc_hom_calc_skilltree(struct homun_data *hd, int flag_evolve)
{
int i, id = 0;
int j, f = 1;
@@ -229,6 +229,9 @@ 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 ].id )
continue; //Skill already known.
+ j = ( flag_evolve ) ? 10 : hd->homunculus.intimacy;
+ if( j < hskill_tree[c][i].intimacylv )
+ continue;
if(!battle_config.skillfree) {
for( j = 0; j < MAX_PC_SKILL_REQUIRE; j++ ) {
if( hskill_tree[c][i].need[j].id &&
@@ -368,7 +371,7 @@ int merc_hom_change_class(struct homun_data *hd, short class_)
hd->homunculusDB = &homunculus_db[i];
hd->homunculus.class_ = class_;
status_set_viewdata(&hd->bl, class_);
- merc_hom_calc_skilltree(hd);
+ merc_hom_calc_skilltree(hd, 1);
return 1;
}
@@ -1164,7 +1167,7 @@ int read_homunculusdb(void)
}
static bool read_homunculus_skilldb_sub(char* split[], int columns, int current)
-{// <hom class>,<skill id>,<max level>[,<job level>],<req id1>,<req lv1>,<req id2>,<req lv2>,<req id3>,<req lv3>,<req id4>,<req lv4>,<req id5>,<req lv5>
+{// <hom class>,<skill id>,<max level>[,<job level>],<req id1>,<req lv1>,<req id2>,<req lv2>,<req id3>,<req lv3>,<req id4>,<req lv4>,<req id5>,<req lv5>,<intimacy lv req>
int k, classid;
int j;
int minJobLevelPresent = 0;
@@ -1199,6 +1202,8 @@ static bool read_homunculus_skilldb_sub(char* split[], int columns, int current)
hskill_tree[classid][j].need[k].id = atoi(split[3+k*2+minJobLevelPresent]);
hskill_tree[classid][j].need[k].lv = atoi(split[3+k*2+minJobLevelPresent+1]);
}
+
+ hskill_tree[classid][j].intimacylv = atoi(split[13+minJobLevelPresent]);
return true;
}
@@ -1206,7 +1211,7 @@ static bool read_homunculus_skilldb_sub(char* split[], int columns, int current)
int read_homunculus_skilldb(void)
{
memset(hskill_tree,0,sizeof(hskill_tree));
- sv_readdb(db_path, "homun_skill_tree.txt", ',', 13, 14, -1, &read_homunculus_skilldb_sub);
+ sv_readdb(db_path, "homun_skill_tree.txt", ',', 13, 15, -1, &read_homunculus_skilldb_sub);
return 0;
}