diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-01-18 19:30:22 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-01-18 19:30:22 +0000 |
commit | c84d6f0062cefc26af7a4d55336bc06c68a15ac3 (patch) | |
tree | e7294df5fa57a22e78a2905025100ab438627d78 /src/map/atcommand.c | |
parent | 80342514a6d3370029d6017428afdacce220fc17 (diff) | |
download | hercules-c84d6f0062cefc26af7a4d55336bc06c68a15ac3.tar.gz hercules-c84d6f0062cefc26af7a4d55336bc06c68a15ac3.tar.bz2 hercules-c84d6f0062cefc26af7a4d55336bc06c68a15ac3.tar.xz hercules-c84d6f0062cefc26af7a4d55336bc06c68a15ac3.zip |
- Modified the Storm Gust freeze counter code. It now takes into consideration the ID of the skill before increasing the counter, which should effectively yield the closest aproximation to official (even though the counter will reset if you step out of a SG and into another one, we do not know yet what should happen in such a case).
- Added @homshuffle. It recalculates the homunculus stats, as if the homunc was sent back to level 1, and then releveled. This command is mean to help fix those previously created Homunculus that are much stronger than they should be.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9671 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index f5cacb8fa..95002473e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -312,6 +312,7 @@ ACMD_FUNC(homhungry); //[orn] ACMD_FUNC(homtalk); //[orn] ACMD_FUNC(hominfo); //[Toms] ACMD_FUNC(homstats); //[Skotlex] +ACMD_FUNC(homshuffle); //[Skotlex] ACMD_FUNC(showmobs); //KarLaeda /*========================================== @@ -644,6 +645,7 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_HomTalk, "@homtalk", 10, atcommand_homtalk }, { AtCommand_HomInfo, "@hominfo", 1, atcommand_hominfo }, { AtCommand_HomStats, "@homstats", 1, atcommand_homstats }, + { AtCommand_HomShuffle, "@homshuffle", 60, atcommand_homshuffle }, { AtCommand_ShowMobs, "@showmobs", 10, atcommand_showmobs }, //KarLaeda // add new commands before this line { AtCommand_Unknown, NULL, 1, NULL } @@ -10005,6 +10007,56 @@ int atcommand_homstats( return 0; } +int atcommand_homshuffle( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + struct homun_data *hd; + int lv, i; + TBL_PC* tsd = sd; + + nullpo_retr(-1, sd); + + if ((!message || !*message) && !sd->hd) + { + clif_displaymessage(fd, "usage: @homshuffle <Alchemist's name>"); + clif_displaymessage(fd, "Use this to recalculate your (or someone else's) homunculus growth data"); + return -1; + } + if (message && *message) { + tsd = map_nick2sd((char*)message); + if (!tsd) { + clif_displaymessage(fd, msg_txt(3)); // Character not found. + return -1; + } + if (pc_isGM(tsd) > pc_isGM(sd)) { + clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + return -1; + } + } + + hd = tsd->hd; + if(!merc_is_hom_active(hd)) + return -1; + + lv = hd->homunculus.level; + //Reset values to level 1. + merc_reset_stats(hd); + //Level it back up + for (i = 1; i < lv && hd->exp_next; i++){ + hd->homunculus.exp += hd->exp_next; + merc_hom_levelup(hd); + } + status_calc_homunculus(hd,0); + status_percent_heal(&hd->bl, 100, 100); + clif_misceffect2(&hd->bl,568); + clif_displaymessage(fd, "Homunculus stats altered"); + //Print out the new stats + //This will send the commands to the invoker since they all use this fd regardless of sd value. + atcommand_homstats(fd, tsd, command, message); + return 0; +} + /*========================================== * Show Items DB Info v 1.0 * originally by [Lupus] eAthena |