summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c30
-rw-r--r--src/map/atcommand.h1
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/status.c17
4 files changed, 41 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 5c9983700..00d051284 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -309,6 +309,7 @@ ACMD_FUNC(makehomun); //[orn]
ACMD_FUNC(homfriendly); //[orn]
ACMD_FUNC(homhungry); //[orn]
ACMD_FUNC(homtalk); //[orn]
+ACMD_FUNC(hominfo); //[Toms]
/*==========================================
*AtCommandInfo atcommand_info[]構造体の定義
@@ -638,6 +639,7 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_HomFriendly, "@homfriendly", 60, atcommand_homfriendly },
{ AtCommand_HomHungry, "@homhungry", 60, atcommand_homhungry },
{ AtCommand_HomTalk, "@homtalk", 0, atcommand_homtalk },
+ { AtCommand_HomInfo, "@hominfo", 0, atcommand_hominfo },
// add new commands before this line
{ AtCommand_Unknown, NULL, 1, NULL }
@@ -9923,6 +9925,34 @@ int atcommand_homtalk(
}
/*==========================================
+ * Show homunculus stats
+ *------------------------------------------
+ */
+int atcommand_hominfo(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+
+ nullpo_retr(-1, sd);
+
+ if(!merc_is_hom_active(sd->hd))
+ return -1;
+
+ clif_displaymessage(fd, "Homunculus stats :");
+
+ snprintf(atcmd_output, sizeof(atcmd_output) ,"HP : %d/%d - SP : %d/%d", sd->hd->battle_status.hp, sd->hd->battle_status.max_hp, sd->hd->battle_status.sp, sd->hd->battle_status.max_sp);
+ clif_displaymessage(fd, atcmd_output);
+
+ snprintf(atcmd_output, sizeof(atcmd_output) ,"ATK : %d - MATK : %d~%d", sd->hd->battle_status.rhw.atk2+sd->hd->battle_status.batk, sd->hd->battle_status.matk_min, sd->hd->battle_status.matk_max);
+ clif_displaymessage(fd, atcmd_output);
+
+ snprintf(atcmd_output, sizeof(atcmd_output) ,"Hungry : %d - Intimacy : %d", sd->homunculus.hunger, sd->homunculus.intimacy);
+ clif_displaymessage(fd, atcmd_output);
+
+ return 0;
+}
+
+/*==========================================
* Show Items DB Info v 1.0
* originally by [Lupus] eAthena
*------------------------------------------
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index d3d746bf2..42beb0232 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -281,6 +281,7 @@ enum AtCommandType {
AtCommand_HomFriendly, //[orn]
AtCommand_HomHungry, //[orn]
AtCommand_HomTalk, //[orn]
+ AtCommand_HomInfo, //[Toms]
// end <- Ahem, guys, don't place AtCommands after AtCommand_Unknown! [Skotlex]
AtCommand_Unknown,
AtCommand_MAX
diff --git a/src/map/clif.c b/src/map/clif.c
index bbf7370ce..295de5a15 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1473,8 +1473,8 @@ int clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
WBUFW(buf,29)=sd->homunculus.hunger;
WBUFW(buf,31)=(unsigned short) (sd->homunculus.intimacy / 100) ;
WBUFW(buf,33)=0; // equip id
- WBUFW(buf,35)=status->rhw.atk2+status->batk;
- WBUFW(buf,37)=status->matk_max;
+ WBUFW(buf,35)=cap_value(status->rhw.atk2+status->batk, 0, SHRT_MAX);
+ WBUFW(buf,37)=cap_value(status->matk_max, 0, SHRT_MAX);
WBUFW(buf,39)=status->hit;
WBUFW(buf,41)=status->cri/10; //crit is a +1 decimal value!
WBUFW(buf,43)=status->def + status->vit ;
diff --git a/src/map/status.c b/src/map/status.c
index 7cd27b37a..446ed2213 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2206,12 +2206,12 @@ int status_calc_homunculus(struct homun_data *hd, int first)
status = &hd->base_status;
- status->str = (int) (hom->str / 10);
- status->agi = (int) (hom->agi / 10);
- status->vit = (int) (hom->vit / 10);
- status->dex = (int) (hom->dex / 10);
- status->int_ = (int) (hom->int_ / 10);
- status->luk = (int) (hom->luk / 10);
+ status->str = hom->str / 10;
+ status->agi = hom->agi / 10;
+ status->vit = hom->vit / 10;
+ status->dex = hom->dex / 10;
+ status->int_ = hom->int_ / 10;
+ status->luk = hom->luk / 10;
status->def_ele = hd->homunculusDB->element ; //[orn]
status->ele_lv = 1;
@@ -2220,9 +2220,8 @@ int status_calc_homunculus(struct homun_data *hd, int first)
status->rhw.range = 1 + status->size; //[orn]
status->mode = MD_CANMOVE|MD_CANATTACK|MD_ASSIST|MD_AGGRESSIVE|MD_CASTSENSOR; //[orn]
status->speed = DEFAULT_WALK_SPEED;
- status->aspd_rate = 1000;
- status->def = hom->level/10 + status->vit/5;
- status->mdef = hom->level/10 + status->int_/5;
+ status->def = cap_value(hom->level/10 + status->vit/5, 0, SCHAR_MAX);
+ status->mdef = cap_value(hom->level/10 + status->int_/5, 0, SCHAR_MAX);
status->hp = 1;
status->sp = 1;