diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-10-03 21:47:47 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-10-03 21:47:47 +0000 |
commit | 9aff15a57af029d3ec66fa9a038cdb4ba265ce3e (patch) | |
tree | f044ec66c090d7397703498a5aff3d13507da5ad /src/map/mercenary.c | |
parent | b61a1f62f63da6ff26f8913bc58573e480ac436b (diff) | |
download | hercules-9aff15a57af029d3ec66fa9a038cdb4ba265ce3e.tar.gz hercules-9aff15a57af029d3ec66fa9a038cdb4ba265ce3e.tar.bz2 hercules-9aff15a57af029d3ec66fa9a038cdb4ba265ce3e.tar.xz hercules-9aff15a57af029d3ec66fa9a038cdb4ba265ce3e.zip |
* Moved the homunculus shuffle code to mercenary.c, fixing the bug in the atcommand not using the bonus evolution stats for homunculus.
* Added a new script command "homshuffle" to reset the homunculus stats using NPC.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11350 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r-- | src/map/mercenary.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 577cbf22b..b23669955 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -834,6 +834,56 @@ void merc_reset_stats(struct homun_data *hd) hd->homunculus.skillpts = 0; } +int merc_hom_shuffle(struct homun_data *hd) +{ + struct map_session_data *sd = hd->master; + int lv, i, skillpts; + unsigned int exp; + struct skill b_skill[MAX_HOMUNSKILL]; + + if (!merc_is_hom_active(hd)) + return 0; + + lv = hd->homunculus.level; + exp = hd->homunculus.exp; + memcpy(&b_skill, &hd->homunculus.hskill, sizeof(b_skill)); + skillpts = hd->homunculus.skillpts; + //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); + } + + clif_displaymessage(sd->fd, "[Homunculus Stats Altered]"); + + if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class) { + // Homunculus Evolucionado + struct s_homunculus *hom = &hd->homunculus; + struct h_stats *max = &hd->homunculusDB->emax, *min = &hd->homunculusDB->emin; + hom->max_hp += rand(min->HP, max->HP); + hom->max_sp += rand(min->SP, max->SP); + hom->str += 10*rand(min->str, max->str); + hom->agi += 10*rand(min->agi, max->agi); + hom->vit += 10*rand(min->vit, max->vit); + hom->int_+= 10*rand(min->int_,max->int_); + hom->dex += 10*rand(min->dex, max->dex); + hom->luk += 10*rand(min->luk, max->luk); + clif_displaymessage(sd->fd, "[Adding Bonus Stats for Evolved Homunculus]"); + } + + hd->homunculus.exp = exp; + memcpy(&hd->homunculus.hskill, &b_skill, sizeof(b_skill)); + hd->homunculus.skillpts = skillpts; + clif_homskillinfoblock(sd); + status_calc_homunculus(hd,0); + status_percent_heal(&hd->bl, 100, 100); + clif_misceffect2(&hd->bl,568); + + return 1; +} + int read_homunculusdb(void) { FILE *fp; |