summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-31 13:43:19 -0300
committershennetsind <ind@henn.et>2013-07-31 13:43:19 -0300
commit2fbec282b9b3eb84f710d5537f70e6bc221187b3 (patch)
tree22c81ca938d2d9c0bf23822bd9d4fd7941ca1511 /src/map
parent0bec4034abe023e3f3759506ac95237aa2d82512 (diff)
downloadhercules-2fbec282b9b3eb84f710d5537f70e6bc221187b3.tar.gz
hercules-2fbec282b9b3eb84f710d5537f70e6bc221187b3.tar.bz2
hercules-2fbec282b9b3eb84f710d5537f70e6bc221187b3.tar.xz
hercules-2fbec282b9b3eb84f710d5537f70e6bc221187b3.zip
Fixed Bug #7602
@homlvup/@homlevel now functions for homun-s http://hercules.ws/board/tracker/issue-7602-homlevel-homlvup/ Also adjusted @makehomun so that it resurrects the homun when call isn't possible (for when used with -1), prior to this it'd do nothing when homun was dead and not vaporised. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 8fd9e6043..367025f4f 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6813,7 +6813,8 @@ ACMD(homlevel)
{
TBL_HOM * hd;
int level = 0;
-
+ enum homun_type htype;
+
nullpo_retr(-1, sd);
if ( !message || !*message || ( level = atoi(message) ) < 1 ) {
@@ -6827,11 +6828,35 @@ ACMD(homlevel)
}
hd = sd->hd;
+
+ if((htype = homun->class2type(hd->homunculus.class_)) == -1) {
+ ShowError("atcommand_homlevel: invalid homun class %d (player %s)\n", hd->homunculus.class_,sd->status.name);
+ return false;
+ }
+
+ switch( htype ) {
+ case HT_REG:
+ case HT_EVO:
+ if( hd->homunculus.level >= battle_config.hom_max_level ) {
+ snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(1478), hd->homunculus.level); // Homun reached its maximum level of '%d'
+ clif->message(fd, atcmd_output);
+ return true;
+ }
+ break;
+ case HT_S:
+ if( hd->homunculus.level >= battle_config.hom_S_max_level ) {
+ snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(1478), hd->homunculus.level); // Homun reached its maximum level of '%d'
+ clif->message(fd, atcmd_output);
+ return true;
+ }
+ break;
+ default:
+ ShowError("atcommand_homlevel: unknown htype '%d'\n",htype);
+ return false;
+ }
- if ( battle_config.hom_max_level == hd->homunculus.level ) // Already reach maximum level
- return true;
-
- do{
+
+ do {
hd->homunculus.exp += hd->exp_next;
} while( hd->homunculus.level < level && homun->levelup(hd) );
@@ -6903,7 +6928,10 @@ ACMD(makehomun) {
homunid = atoi(message);
if( homunid == -1 && sd->status.hom_id && !homun_alive(sd->hd) ) {
- homun->call(sd);
+ if( !sd->hd->homunculus.vaporize )
+ homun->ressurect(sd, 100, sd->bl.x, sd->bl.y);
+ else
+ homun->call(sd);
return true;
}