diff options
author | toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-20 18:54:18 +0000 |
---|---|---|
committer | toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-20 18:54:18 +0000 |
commit | 6ae26ef0260b6f25c3f68115c300020a2b5b84b9 (patch) | |
tree | 59212169d7917653a9de6fcf19abfb25a7bac8fa | |
parent | d8515bb0bf7a0c59f38923509ef52ba3a553dae8 (diff) | |
download | hercules-6ae26ef0260b6f25c3f68115c300020a2b5b84b9.tar.gz hercules-6ae26ef0260b6f25c3f68115c300020a2b5b84b9.tar.bz2 hercules-6ae26ef0260b6f25c3f68115c300020a2b5b84b9.tar.xz hercules-6ae26ef0260b6f25c3f68115c300020a2b5b84b9.zip |
- Fixed some Homunc issues with HR servers (capping some values)
- Added @hominfo command to obtain real values (not capped ones)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8378 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 4 | ||||
-rw-r--r-- | src/map/atcommand.c | 30 | ||||
-rw-r--r-- | src/map/atcommand.h | 1 | ||||
-rw-r--r-- | src/map/clif.c | 4 | ||||
-rw-r--r-- | src/map/status.c | 17 |
5 files changed, 44 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 79ecba624..44eba46b3 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -2,7 +2,9 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
-
+2006/08/20
+ * Fixed some Homunc issues with HR servers (capping some values) [Toms]
+ * Added @hominfo command to obtain real values (not capped ones) [Toms]
2006/08/19
* Fixed @homlvup bug [Toms]
* Fixed AM_REST & AM_RESU consumming SP if they fail [Toms]
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; |