diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-10-20 18:30:05 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-10-20 18:30:05 +0000 |
commit | 54a7f124543239c98d696da37c91eb5e2e99b25d (patch) | |
tree | 03c1c0d7148de31a112f2c3d82c7eabf910dd351 /src/map/atcommand.c | |
parent | 1893d0bc7b07a362ac6efcd8de4af056544bad3a (diff) | |
download | hercules-54a7f124543239c98d696da37c91eb5e2e99b25d.tar.gz hercules-54a7f124543239c98d696da37c91eb5e2e99b25d.tar.bz2 hercules-54a7f124543239c98d696da37c91eb5e2e99b25d.tar.xz hercules-54a7f124543239c98d696da37c91eb5e2e99b25d.zip |
- Fixed Charge Atk being able to go through chasm/pits.
- Moved the homunculus DB information from the player structure to the homun structure. Modified the homunculus creation packets to hold this information during creation, also, all initial values are handled by the map-server, the char server only assigns it a homun ID.
- Removed target_id/attacked_id from homun_data as it wasn't really used.
- Codes cleanup (removing of commented code mostly)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9031 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 82d1b4c9a..b8f1c6cab 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9910,7 +9910,7 @@ int atcommand_homlevel( hd = sd->hd;
for (i = 1; i <= level && hd->exp_next; i++){
- sd->homunculus.exp += hd->exp_next;
+ hd->homunculus.exp += hd->exp_next;
merc_hom_levelup(hd);
}
status_calc_homunculus(hd,0);
@@ -9980,7 +9980,7 @@ int atcommand_homfriendly( friendly = atoi(message);
if (merc_is_hom_active(sd->hd)) {
if (friendly > 0 && friendly <= 1000) {
- sd->homunculus.intimacy = friendly * 100 ;
+ sd->hd->homunculus.intimacy = friendly * 100 ;
clif_send_homdata(sd,SP_INTIMATE,friendly);
} else {
return -1;
@@ -10007,9 +10007,10 @@ int atcommand_homhungry( hungry = atoi(message);
if (sd->status.hom_id > 0 && sd->hd) {
+ struct homun_data *hd = sd->hd;
if (hungry >= 0 && hungry <= 100) {
- sd->homunculus.hunger = hungry;
- clif_send_homdata(sd,SP_HUNGRY,sd->homunculus.hunger);
+ hd->homunculus.hunger = hungry;
+ clif_send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
} else {
return -1;
}
@@ -10030,13 +10031,13 @@ int atcommand_homtalk( nullpo_retr(-1, sd);
- if(!sd->status.hom_id || !sd->hd || !sd->homunculus.hp)
+ if(!merc_is_hom_active(sd->hd))
return -1;
if (sscanf(message, "%99[^\n]", mes) < 1)
return -1;
- snprintf(temp, sizeof temp ,"%s : %s",sd->homunculus.name,mes);
+ snprintf(temp, sizeof temp ,"%s : %s",sd->hd->homunculus.name,mes);
clif_message(&sd->hd->bl, temp);
return 0;
@@ -10050,21 +10051,26 @@ int atcommand_hominfo( const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
-
+ struct homun_data *hd;
+ struct status_data *status;
nullpo_retr(-1, sd);
if(!merc_is_hom_active(sd->hd))
return -1;
-
+ hd = sd->hd;
+ status = status_get_status_data(&hd->bl);
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);
+ snprintf(atcmd_output, sizeof(atcmd_output) ,"HP : %d/%d - SP : %d/%d",
+ status->hp, status->max_hp, status->sp, 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);
+ snprintf(atcmd_output, sizeof(atcmd_output) ,"ATK : %d - MATK : %d~%d",
+ status->rhw.atk2 +status->batk, status->matk_min, status->matk_max);
clif_displaymessage(fd, atcmd_output);
- snprintf(atcmd_output, sizeof(atcmd_output) ,"Hungry : %d - Intimacy : %u", sd->homunculus.hunger, sd->homunculus.intimacy/100);
+ snprintf(atcmd_output, sizeof(atcmd_output) ,"Hungry : %d - Intimacy : %u",
+ hd->homunculus.hunger, hd->homunculus.intimacy/100);
clif_displaymessage(fd, atcmd_output);
return 0;
|