diff options
author | Fate <fate-tmw@googlemail.com> | 2009-09-26 18:08:42 +0000 |
---|---|---|
committer | Fate <fate-tmw@googlemail.com> | 2009-09-26 18:08:42 +0000 |
commit | 3ef2cb492970da40f82df9643c4cfc570bc3aa62 (patch) | |
tree | 16e071b00b764db07d60f7872756bf79c6044dfe /src/char | |
parent | f9f63203fb461e69a9a422d160986daa78eecc51 (diff) | |
download | tmwa-3ef2cb492970da40f82df9643c4cfc570bc3aa62.tar.gz tmwa-3ef2cb492970da40f82df9643c4cfc570bc3aa62.tar.bz2 tmwa-3ef2cb492970da40f82df9643c4cfc570bc3aa62.tar.xz tmwa-3ef2cb492970da40f82df9643c4cfc570bc3aa62.zip |
Initial support for skill pools (available via at commands and
untested scripting commands.) These changes also affect the format
of the skill_db.txt file.
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/char/char.c b/src/char/char.c index fbf512e..98321ec 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -269,8 +269,8 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p) { *(str_p++) = '\t'; for(i = 0; i < MAX_SKILL; i++) - if (p->skill[i].id && p->skill[i].flag != 1) { - str_p += sprintf(str_p, "%d,%d ", p->skill[i].id, (p->skill[i].flag == 0) ? p->skill[i].lv : p->skill[i].flag-2); + if (p->skill[i].id) { + str_p += sprintf(str_p, "%d,%d ", p->skill[i].id, p->skill[i].lv | (p->skill[i].flags << 16)); } *(str_p++) = '\t'; @@ -506,7 +506,8 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p) { if (sscanf(str + next, "%d,%d%n", &tmp_int[0], &tmp_int[1], &len) != 2) return -6; p->skill[tmp_int[0]].id = tmp_int[0]; - p->skill[tmp_int[0]].lv = tmp_int[1]; + p->skill[tmp_int[0]].lv = tmp_int[1] & 0xffff; + p->skill[tmp_int[0]].flags = ((tmp_int[1] >> 16) & 0xffff); next += len; if (str[next] == ' ') next++; @@ -1660,22 +1661,6 @@ int parse_tologin(int fd) { } else if (jobclass == 4042 || jobclass == 4043) { char_dat[i].class = (sex) ? 4042 : 4043; } - // remove specifical skills of classes 19, 4020 and 4042 - for(j = 315; j <= 322; j++) { - if (char_dat[i].skill[j].id > 0 && !char_dat[i].skill[j].flag) { - char_dat[i].skill_point += char_dat[i].skill[j].lv; - char_dat[i].skill[j].id = 0; - char_dat[i].skill[j].lv = 0; - } - } - // remove specifical skills of classes 20, 4021 and 4043 - for(j = 323; j <= 330; j++) { - if (char_dat[i].skill[j].id > 0 && !char_dat[i].skill[j].flag) { - char_dat[i].skill_point += char_dat[i].skill[j].lv; - char_dat[i].skill[j].id = 0; - char_dat[i].skill[j].lv = 0; - } - } } // to avoid any problem with equipment and invalid sex, equipment is unequiped. for (j = 0; j < MAX_INVENTORY; j++) { |