- Cleaned up a bit the homunculus evolution code, and fixed homevolution allowing the homunc to 're-evolve' even though it was already evolved.

- Optimized a bit the skillheal code in regards to Apple of Idun and Sanctuary


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11090 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2007-08-30 04:39:59 +00:00
parent 48ab0fe34b
commit d25b5ad103
6 changed files with 22 additions and 32 deletions

View File

@ -492,7 +492,6 @@ IG_Potion 37
IG_RedBox_2 38 IG_RedBox_2 38
IG_BleuBox 39 IG_BleuBox 39
SC_ALL -1 SC_ALL -1
SC_STONE 0 SC_STONE 0
SC_FREEZE 1 SC_FREEZE 1

View File

@ -8307,11 +8307,8 @@ int atcommand_homevolution(const int fd, struct map_session_data* sd, const char
return -1; return -1;
} }
if (sd->hd->homunculusDB->evo_class) if ( merc_hom_evolution(sd->hd) )
{
merc_hom_evolution(sd->hd) ;
return 0; return 0;
}
clif_displaymessage(fd, "Your homunculus doesn't evolve."); clif_displaymessage(fd, "Your homunculus doesn't evolve.");
return -1; return -1;

View File

@ -3755,24 +3755,20 @@ int charcommand_homevolution(const int fd, struct map_session_data* sd, const ch
return -1; return -1;
} }
if (pl_sd->hd) if ( !merc_is_hom_active(pl_sd->hd) ) {
{ clif_displaymessage(fd, "Target player does not have a homunculus.");
if (pl_sd->hd->homunculusDB->evo_class) return -1;
{ }
merc_hom_evolution(pl_sd->hd);
clif_displaymessage(pl_sd->fd, "Homunculus evolution initiated."); if ( !merc_hom_evolution(pl_sd->hd) ) {
if (pl_sd->fd != fd)
clif_displaymessage(fd, "Homunculus evolution initiated.");
return 0;
}
clif_displaymessage(fd, "Target homunculus cannot evolve."); clif_displaymessage(fd, "Target homunculus cannot evolve.");
return -1; return -1;
} }
else
{ clif_displaymessage(pl_sd->fd, "Homunculus evolution initiated.");
clif_displaymessage(fd, "Target player does not have a homunculus."); if (pl_sd->fd != fd)
} clif_displaymessage(fd, "Homunculus evolution initiated.");
return -1; return 0;
} }
/*========================================== /*==========================================

View File

@ -289,7 +289,7 @@ int merc_hom_evolution(struct homun_data *hd)
struct map_session_data *sd; struct map_session_data *sd;
nullpo_retr(0, hd); nullpo_retr(0, hd);
if(!hd->homunculusDB->evo_class) if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class)
{ {
clif_emotion(&hd->bl, 4) ; //swt clif_emotion(&hd->bl, 4) ; //swt
return 0 ; return 0 ;
@ -297,12 +297,12 @@ int merc_hom_evolution(struct homun_data *hd)
sd = hd->master; sd = hd->master;
if (!sd) if (!sd)
return 0; return 0;
if (!merc_hom_change_class(hd, hd->homunculusDB->evo_class)) { if (!merc_hom_change_class(hd, hd->homunculusDB->evo_class)) {
ShowError("merc_hom_evolution: Can't evolve homunc from %d to %d", hd->homunculus.class_, hd->homunculusDB->evo_class); ShowError("merc_hom_evolution: Can't evolve homunc from %d to %d", hd->homunculus.class_, hd->homunculusDB->evo_class);
return 0; return 0;
} }
//Apply evolution bonuses //Apply evolution bonuses
hom = &hd->homunculus; hom = &hd->homunculus;
max = &hd->homunculusDB->emax; max = &hd->homunculusDB->emax;

View File

@ -8737,10 +8737,8 @@ BUILDIN_FUNC(homunculus_evolution)
{ {
TBL_PC *sd; TBL_PC *sd;
sd=script_rid2sd(st); sd=script_rid2sd(st);
if ( sd->hd && sd->hd->homunculusDB->evo_class && sd->hd->homunculus.intimacy > 91000 ) { if(merc_is_hom_active(sd->hd))
return !merc_hom_evolution(sd->hd) ; merc_hom_evolution(sd->hd);
}
clif_emotion(&sd->hd->bl, 4) ; //swt
return 0; return 0;
} }

View File

@ -6702,6 +6702,8 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
case NPC_EVILLAND: case NPC_EVILLAND:
val1=(skilllv+3)*2; val1=(skilllv+3)*2;
val2=(skilllv>6)?(skillid == PR_SANCTUARY?777:666):skilllv*100; val2=(skilllv>6)?(skillid == PR_SANCTUARY?777:666):skilllv*100;
if (sd && (i = pc_skillheal_bonus(sd, skillid)))
val2 += val2 * i / 100;
break; break;
case WZ_FIREPILLAR: case WZ_FIREPILLAR:
@ -6807,6 +6809,8 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
if(sd){ if(sd){
val1 += pc_checkskill(sd,BA_MUSICALLESSON); val1 += pc_checkskill(sd,BA_MUSICALLESSON);
val2 += 5*pc_checkskill(sd,BA_MUSICALLESSON); val2 += 5*pc_checkskill(sd,BA_MUSICALLESSON);
if ((i = pc_skillheal_bonus(sd, skillid)))
val2 += val2 * i / 100;
} }
break; break;
case DC_SERVICEFORYOU: case DC_SERVICEFORYOU:
@ -7269,9 +7273,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
int heal = sg->val2; int heal = sg->val2;
if (tstatus->hp >= tstatus->max_hp) if (tstatus->hp >= tstatus->max_hp)
break; break;
if (sd && (type = pc_skillheal_bonus(sd, sg->skill_id))) if (tsc && tsc->data[SC_CRITICALWOUND].timer!=-1)
heal += heal * type / 100;
if (tsc && tsc->count && tsc->data[SC_CRITICALWOUND].timer!=-1)
heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100; heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100;
if (status_isimmune(bl)) if (status_isimmune(bl))
heal = 0; /* 黄金蟲カード(ヒール量0) */ heal = 0; /* 黄金蟲カード(ヒール量0) */
@ -7449,9 +7451,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
if (sg->src_id == bl->id) if (sg->src_id == bl->id)
break; break;
heal = sg->val2; heal = sg->val2;
if (sd && (type = pc_skillheal_bonus(sd, sg->skill_id))) if(tsc && tsc->data[SC_CRITICALWOUND].timer!=-1)
heal += heal * type / 100;
if(tsc && tsc->count && tsc->data[SC_CRITICALWOUND].timer!=-1)
heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100; heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100;
clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1); clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
status_heal(bl, heal, 0, 0); status_heal(bl, heal, 0, 0);