Follow up r16632, added check on level up so that the equip is automatically unequipped when you leave the elvmax range, special thanks to mistah_j for pointing out.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16633 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
e6d54bb04a
commit
c282d08040
@ -1584,6 +1584,7 @@ ACMD_FUNC(baselevelup)
|
||||
clif_updatestatus(sd, SP_BASEEXP);
|
||||
clif_updatestatus(sd, SP_NEXTBASEEXP);
|
||||
status_calc_pc(sd, 0);
|
||||
pc_baselevelchanged(sd);
|
||||
if(sd->status.party_id)
|
||||
party_send_levelup(sd);
|
||||
return 0;
|
||||
|
@ -2080,8 +2080,8 @@ void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, in
|
||||
/// 4 = middle of screen, movable with a close button, chrome-less
|
||||
void clif_cutin(struct map_session_data* sd, const char* image, int type)
|
||||
{
|
||||
int fd;
|
||||
|
||||
int fd;
|
||||
|
||||
nullpo_retv(sd);
|
||||
|
||||
fd=sd->fd;
|
||||
|
25
src/map/pc.c
25
src/map/pc.c
@ -5421,12 +5421,12 @@ int pc_follow(struct map_session_data *sd,int target_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pc_checkbaselevelup(struct map_session_data *sd)
|
||||
{
|
||||
int pc_checkbaselevelup(struct map_session_data *sd) {
|
||||
unsigned int next = pc_nextbaseexp(sd);
|
||||
|
||||
if (!next || sd->status.base_exp < next)
|
||||
return 0;
|
||||
|
||||
do {
|
||||
sd->status.base_exp -= next;
|
||||
//Kyoki pointed out that the max overcarry exp is the exp needed for the previous level -1. [Skotlex]
|
||||
@ -5449,8 +5449,7 @@ int pc_checkbaselevelup(struct map_session_data *sd)
|
||||
status_calc_pc(sd,0);
|
||||
status_percent_heal(&sd->bl,100,100);
|
||||
|
||||
if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE)
|
||||
{
|
||||
if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
|
||||
sc_start(&sd->bl,status_skill2sc(PR_KYRIE),100,1,skill_get_time(PR_KYRIE,1));
|
||||
sc_start(&sd->bl,status_skill2sc(PR_IMPOSITIO),100,1,skill_get_time(PR_IMPOSITIO,1));
|
||||
sc_start(&sd->bl,status_skill2sc(PR_MAGNIFICAT),100,1,skill_get_time(PR_MAGNIFICAT,1));
|
||||
@ -5458,9 +5457,7 @@ int pc_checkbaselevelup(struct map_session_data *sd)
|
||||
sc_start(&sd->bl,status_skill2sc(PR_SUFFRAGIUM),100,1,skill_get_time(PR_SUFFRAGIUM,1));
|
||||
if (sd->state.snovice_dead_flag)
|
||||
sd->state.snovice_dead_flag = 0; //Reenable steelbody resurrection on dead.
|
||||
} else
|
||||
if( (sd->class_&MAPID_BASEMASK) == MAPID_TAEKWON )
|
||||
{
|
||||
} else if( (sd->class_&MAPID_BASEMASK) == MAPID_TAEKWON ) {
|
||||
sc_start(&sd->bl,status_skill2sc(AL_INCAGI),100,10,600000);
|
||||
sc_start(&sd->bl,status_skill2sc(AL_BLESSING),100,10,600000);
|
||||
}
|
||||
@ -5469,9 +5466,23 @@ int pc_checkbaselevelup(struct map_session_data *sd)
|
||||
|
||||
if(sd->status.party_id)
|
||||
party_send_levelup(sd);
|
||||
|
||||
pc_baselevelchanged(sd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void pc_baselevelchanged(struct map_session_data *sd) {
|
||||
#ifdef RENEWAL
|
||||
int i;
|
||||
for( i = 0; i < EQI_MAX; i++ ) {
|
||||
if( sd->equip_index[i] >= 0 ) {
|
||||
if( sd->inventory_data[ sd->equip_index[i] ]->elvmax && sd->status.base_level > (unsigned int)sd->inventory_data[ sd->equip_index[i] ]->elvmax )
|
||||
pc_unequipitem(sd, sd->equip_index[i], 3);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
int pc_checkjoblevelup(struct map_session_data *sd)
|
||||
{
|
||||
unsigned int next = pc_nextjobexp(sd);
|
||||
|
@ -924,4 +924,6 @@ int pc_load_combo(struct map_session_data *sd);
|
||||
int pc_add_talisman(struct map_session_data *sd,int interval,int max,int type);
|
||||
int pc_del_talisman(struct map_session_data *sd,int count,int type);
|
||||
|
||||
void pc_baselevelchanged(struct map_session_data *sd);
|
||||
|
||||
#endif /* _PC_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user