summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2017-12-23 16:02:48 +0000
committerAsheraf <acheraf1998@gmail.com>2017-12-23 17:45:20 +0000
commit51b68a07b877febe6d7e5242a951d66f11b3dd3c (patch)
tree466397fc920b4578eb861570bf8df17b161d73d6 /src
parent99c34eb5637fc48eba2998e304697b96ad6e89bf (diff)
downloadhercules-51b68a07b877febe6d7e5242a951d66f11b3dd3c.tar.gz
hercules-51b68a07b877febe6d7e5242a951d66f11b3dd3c.tar.bz2
hercules-51b68a07b877febe6d7e5242a951d66f11b3dd3c.tar.xz
hercules-51b68a07b877febe6d7e5242a951d66f11b3dd3c.zip
Replace the use of skill_reproduce_db with AllowReproduce flag
Diffstat (limited to 'src')
-rw-r--r--src/map/skill.c25
-rw-r--r--src/map/skill.h3
2 files changed, 8 insertions, 20 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 88a29b9a8..5f7d1a9f0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -987,7 +987,7 @@ int can_copy (struct map_session_data *sd, uint16 skill_id, struct block_list* b
(skill_id >= GC_DARKCROW && skill_id <= SU_FRESHSHRIMP)))
return 0;
// Reproduce will only copy skills according on the list. [Jobbie]
- else if( sd->sc.data[SC__REPRODUCE] && !skill->dbs->reproduce_db[skill->get_index(skill_id)] )
+ else if (sd->sc.data[SC__REPRODUCE] && (skill->get_inf2(skill_id) & INF2_ALLOW_REPRODUCE) == 0)
return 0;
return 1;
@@ -19849,21 +19849,6 @@ bool skill_parse_row_magicmushroomdb(char* split[], int column, int current)
return true;
}
-bool skill_parse_row_reproducedb(char* split[], int column, int current)
-{
- uint16 skill_id;
- uint16 idx;
- nullpo_retr(false, split);
- skill_id = atoi(split[0]);
- idx = skill->get_index(skill_id);
- if( !idx )
- return false;
-
- skill->dbs->reproduce_db[idx] = true;
-
- return true;
-}
-
bool skill_parse_row_abradb(char* split[], int columns, int current)
{
// skill_id,DummyName,RequiredHocusPocusLevel,Rate
@@ -20168,6 +20153,12 @@ void skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *
} else {
sk->inf2 &= ~INF2_SHOW_SKILL_SCALE;
}
+ } else if (strcmpi(type, "AllowReproduce") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_ALLOW_REPRODUCE;
+ } else {
+ sk->inf2 &= ~INF2_ALLOW_REPRODUCE;
+ }
} else if (strcmpi(type, "None") != 0) {
skilldb_invalid_error(type, config_setting_name(t), sk->nameid);
}
@@ -21280,7 +21271,6 @@ void skill_readdb(bool minimal)
sv->readdb(map->db_path, "spellbook_db.txt", ',', 3, 3, MAX_SKILL_SPELLBOOK_DB, skill->parse_row_spellbookdb);
//Guillotine Cross
sv->readdb(map->db_path, "magicmushroom_db.txt", ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill->parse_row_magicmushroomdb);
- sv->readdb(map->db_path, "skill_reproduce_db.txt", ',', 1, 1, MAX_SKILL_DB, skill->parse_row_reproducedb);
sv->readdb(map->db_path, "skill_improvise_db.txt", ',', 2, 2, MAX_SKILL_IMPROVISE_DB, skill->parse_row_improvisedb);
sv->readdb(map->db_path, "skill_changematerial_db.txt", ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill->parse_row_changematerialdb);
}
@@ -21594,7 +21584,6 @@ void skill_defaults(void)
skill->parse_row_abradb = skill_parse_row_abradb;
skill->parse_row_spellbookdb = skill_parse_row_spellbookdb;
skill->parse_row_magicmushroomdb = skill_parse_row_magicmushroomdb;
- skill->parse_row_reproducedb = skill_parse_row_reproducedb;
skill->parse_row_improvisedb = skill_parse_row_improvisedb;
skill->parse_row_changematerialdb = skill_parse_row_changematerialdb;
skill->usave_add = skill_usave_add;
diff --git a/src/map/skill.h b/src/map/skill.h
index 1e00e488f..c494c0e83 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -123,6 +123,7 @@ enum e_skill_inf2 {
INF2_FREE_CAST_NORMAL = 0x08000,
INF2_FREE_CAST_REDUCED = 0x10000,
INF2_SHOW_SKILL_SCALE = 0x20000,
+ INF2_ALLOW_REPRODUCE = 0x40000,
};
@@ -1897,7 +1898,6 @@ BEGIN_ZEROED_BLOCK; // This block will be zeroed in skill_defaults() as well as
struct s_skill_improvise_db improvise_db[MAX_SKILL_IMPROVISE_DB];
struct s_skill_changematerial_db changematerial_db[MAX_SKILL_PRODUCE_DB];
struct s_skill_spellbook_db spellbook_db[MAX_SKILL_SPELLBOOK_DB];
- bool reproduce_db[MAX_SKILL_DB];
END_ZEROED_BLOCK;
struct s_skill_unit_layout unit_layout[MAX_SKILL_UNIT_LAYOUT];
};
@@ -2121,7 +2121,6 @@ struct skill_interface {
bool (*parse_row_abradb) (char* split[], int columns, int current);
bool (*parse_row_spellbookdb) (char* split[], int columns, int current);
bool (*parse_row_magicmushroomdb) (char* split[], int column, int current);
- bool (*parse_row_reproducedb) (char* split[], int column, int current);
bool (*parse_row_improvisedb) (char* split[], int columns, int current);
bool (*parse_row_changematerialdb) (char* split[], int columns, int current);
/* save new unit skill */