Pārlūkot izejas kodu

- 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://svn.code.sf.net/p/rathena/svn/trunk@8932 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 gadi atpakaļ
vecāks
revīzija
68bac454a6
3 mainītis faili ar 26 papildinājumiem un 6 dzēšanām
  1. 4 0
      Changelog-Trunk.txt
  2. 1 1
      src/char_sql/int_guild.c
  3. 21 5
      src/map/pc.c

+ 4 - 0
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]

+ 1 - 1
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;
 }
 

+ 21 - 5
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);