From 29fbed7f1f58b7ac3ff5d124e52a2d18278fc21f Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 4 Oct 2006 15:20:50 +0000 Subject: - Modified pc_jobchange so that it automatically removes peco/falcon/cart/homun if the new job you are changing to does not possess the required skill for them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8932 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 4 ++++ src/char_sql/int_guild.c | 2 +- src/map/pc.c | 26 +++++++++++++++++++++----- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index f73180f09..8839a4417 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,10 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2006/10/04 + * Modified pc_jobchange so that it automatically removes + peco/falcon/cart/homun if the new job you are changing to does not possess + the required skill for them. [Skotlex] 2006/10/03 * Fixed a possible crash with @reloadmobdb due to pet loot timers. [Skotlex] diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index 8f9e50acf..1a1ce718a 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -1604,7 +1604,7 @@ int mapif_parse_BreakGuild(int fd,int guild_id) inter_log("guild %s (id=%d) broken" RETCODE,g->name,guild_id); //Remove the guild from memory. [Skotlex] - g = idb_remove(guild_db_, guild_id); + idb_remove(guild_db_, guild_id); return 0; } diff --git a/src/map/pc.c b/src/map/pc.c index 2b2037e9b..7808bdd9c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5508,7 +5508,6 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) pc_setglobalreg (sd, "jobchange_level", sd->change_level); sd->status.class_ = job; - status_set_viewdata(&sd->bl, job); fame_flag = pc_famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK); sd->class_ = (unsigned short)b_class; sd->status.job_level=1; @@ -5523,16 +5522,33 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) pc_unequipitem(sd,sd->equip_index[i],2); // ?”õŠO‚µ } + //Change look + status_set_viewdata(&sd->bl, job); clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris] - if(sd->vd.cloth_color) clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color); + + //Update skill tree. + pc_calc_skilltree(sd); + clif_skillinfoblock(sd); + + //Remove peco/cart/falcon + i = sd->sc.option; + if(i&OPTION_RIDING && !pc_checkskill(sd, KN_RIDING)) + i&=~OPTION_RIDING; + if(i&OPTION_CART && !pc_checkskill(sd, MC_PUSHCART)) + i&=~OPTION_CART; + if(i&OPTION_FALCON && !pc_checkskill(sd, HT_FALCON)) + i&=~OPTION_FALCON; + + if(i != sd->sc.option) + pc_setoption(sd, i); + + if(sd->hd && merc_is_hom_active(sd->hd) && !pc_checkskill(sd, AM_CALLHOMUN)) + merc_hom_vaporize(sd, 0); if(sd->status.manner < 0) clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); - - if(pc_isriding(sd)) //Remove Peco Status to prevent display <> class problems. - pc_setoption(sd,sd->sc.option&~OPTION_RIDING); status_calc_pc(sd,0); pc_checkallowskill(sd); -- cgit v1.2.3-70-g09d2