summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2017-11-05 00:51:34 +0000
committerAsheraf <acheraf1998@gmail.com>2017-11-18 22:45:11 +0000
commit1a4327551900db5e2ecbb754bef7c05f4edfc6dd (patch)
treef60c6951a12ba3b634f5c6b5c40f6c1b62ece349 /src/char
parent41f3237e4537d7105fb47d56b455d31cf33c155c (diff)
downloadhercules-1a4327551900db5e2ecbb754bef7c05f4edfc6dd.tar.gz
hercules-1a4327551900db5e2ecbb754bef7c05f4edfc6dd.tar.bz2
hercules-1a4327551900db5e2ecbb754bef7c05f4edfc6dd.tar.xz
hercules-1a4327551900db5e2ecbb754bef7c05f4edfc6dd.zip
Implement Homunculus autofeeding
Diffstat (limited to 'src/char')
-rw-r--r--src/char/int_homun.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 04f4c8f21..4f382cd3c 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -129,10 +129,10 @@ bool mapif_homunculus_create(struct s_homunculus *hd)
SQL->EscapeStringLen(inter->sql_handle, esc_name, hd->name, strnlen(hd->name, NAME_LENGTH));
if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
- "(`char_id`, `class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`, `rename_flag`, `vaporize`) "
- "VALUES ('%d', '%d', '%d', '%s', '%d', '%u', '%u', '%d', '%d', %d, '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ "(`char_id`, `class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`, `rename_flag`, `vaporize`, `autofeed`) "
+ "VALUES ('%d', '%d', '%d', '%s', '%d', '%u', '%u', '%d', '%d', %d, '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
homunculus_db, hd->char_id, hd->class_, hd->prev_class, esc_name, hd->level, hd->exp, hd->intimacy, hd->hunger, hd->str, hd->agi, hd->vit, hd->int_, hd->dex, hd->luk,
- hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize)) {
+ hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->autofeed)) {
Sql_ShowDebug(inter->sql_handle);
return false;
}
@@ -156,9 +156,9 @@ bool mapif_homunculus_save(const struct s_homunculus *hd)
SQL->EscapeStringLen(inter->sql_handle, esc_name, hd->name, strnlen(hd->name, NAME_LENGTH));
- if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `char_id`='%d', `class`='%d',`prev_class`='%d',`name`='%s',`level`='%d',`exp`='%u',`intimacy`='%u',`hunger`='%d', `str`='%d', `agi`='%d', `vit`='%d', `int`='%d', `dex`='%d', `luk`='%d', `hp`='%d',`max_hp`='%d',`sp`='%d',`max_sp`='%d',`skill_point`='%d', `rename_flag`='%d', `vaporize`='%d' WHERE `homun_id`='%d'",
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `char_id`='%d', `class`='%d',`prev_class`='%d',`name`='%s',`level`='%d',`exp`='%u',`intimacy`='%u',`hunger`='%d', `str`='%d', `agi`='%d', `vit`='%d', `int`='%d', `dex`='%d', `luk`='%d', `hp`='%d',`max_hp`='%d',`sp`='%d',`max_sp`='%d',`skill_point`='%d', `rename_flag`='%d', `vaporize`='%d', `autofeed`='%d' WHERE `homun_id`='%d'",
homunculus_db, hd->char_id, hd->class_, hd->prev_class, esc_name, hd->level, hd->exp, hd->intimacy, hd->hunger, hd->str, hd->agi, hd->vit, hd->int_, hd->dex, hd->luk,
- hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->hom_id)) {
+ hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->autofeed, hd->hom_id)) {
Sql_ShowDebug(inter->sql_handle);
flag = false;
} else {
@@ -196,7 +196,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
nullpo_ret(hd);
memset(hd, 0, sizeof(*hd));
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `homun_id`,`char_id`,`class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`,`rename_flag`, `vaporize` FROM `%s` WHERE `homun_id`='%d'", homunculus_db, homun_id) )
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `homun_id`,`char_id`,`class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`,`rename_flag`, `vaporize`, `autofeed` FROM `%s` WHERE `homun_id`='%d'", homunculus_db, homun_id))
{
Sql_ShowDebug(inter->sql_handle);
return false;
@@ -236,6 +236,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
SQL->GetData(inter->sql_handle, 19, &data, NULL); hd->skillpts = atoi(data);
SQL->GetData(inter->sql_handle, 20, &data, NULL); hd->rename_flag = atoi(data);
SQL->GetData(inter->sql_handle, 21, &data, NULL); hd->vaporize = atoi(data);
+ SQL->GetData(inter->sql_handle, 22, &data, NULL); hd->autofeed = atoi(data);
SQL->FreeResult(inter->sql_handle);
hd->intimacy = cap_value(hd->intimacy, 0, 100000);