Browse Source

- Optimized some code about @size changes in chars.
- Fixed #jailtime (Bug Report 853) crash.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12117 54d463be-8e91-2dee-dedb-b68131a5f0ec

zephyrus 17 years ago
parent
commit
4fcaa2f78f
3 changed files with 29 additions and 8 deletions
  1. 6 1
      src/map/charcommand.c
  2. 20 5
      src/map/clif.c
  3. 3 2
      src/map/skill.c

+ 6 - 1
src/map/charcommand.c

@@ -2830,8 +2830,13 @@ int charcommand_jailtime(const int fd, struct map_session_data* sd, const char*
 		return -1;
 		return -1;
 	}
 	}
 
 
+	if (!pl_sd->sc.data[SC_JAILED]) {
+		clif_displaymessage(fd, "This player is not in jail.");
+		return -1;
+	}
+
 	if (pl_sd->sc.data[SC_JAILED]->val1 == INT_MAX) {
 	if (pl_sd->sc.data[SC_JAILED]->val1 == INT_MAX) {
-		clif_displaymessage(fd, "You have been jailed indefinitely.");
+		clif_displaymessage(fd, "This player have been jailed indefinitely.");
 		return 0;
 		return 0;
 	}
 	}
 
 

+ 20 - 5
src/map/clif.c

@@ -98,6 +98,21 @@ static int max_char_id = DEFAULT_MAX_CHAR_ID;
 
 
 int clif_parse (int fd);
 int clif_parse (int fd);
 
 
+/*==========================================
+ * Send specials effect to tarjet
+ *------------------------------------------*/
+int clif_specialeffecttoone(struct block_list *bl, struct block_list *dst, int type)
+{
+	struct map_session_data *sd = (struct map_session_data *)dst;
+
+	WFIFOW(sd->fd,0) = 0x1f3;
+	WFIFOL(sd->fd,2) = bl->id;
+	WFIFOL(sd->fd,6) = type;
+	WFIFOSET(sd->fd, packet_len(0x1f3));
+
+	return 0;
+}
+
 /*==========================================
 /*==========================================
  * mapŽI‚Ìip�Ý’è
  * mapŽI‚Ìip�Ý’è
  *------------------------------------------*/
  *------------------------------------------*/
@@ -3428,15 +3443,15 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
 		clif_refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF);
 		clif_refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF);
 
 
 	switch (bl->type)
 	switch (bl->type)
-	{	// FIXME: 'AREA' causes unneccessary spam since this should be 1:1 communication [ultramage]
+	{
 	case BL_PC:
 	case BL_PC:
 		{
 		{
 			TBL_PC* tsd = (TBL_PC*)bl;
 			TBL_PC* tsd = (TBL_PC*)bl;
 			clif_getareachar_pc(sd, tsd);
 			clif_getareachar_pc(sd, tsd);
 			if(tsd->state.size==2) // tiny/big players [Valaris]
 			if(tsd->state.size==2) // tiny/big players [Valaris]
-				clif_specialeffect(bl,423,AREA);
+				clif_specialeffecttoone(bl, &sd->bl, 423);
 			else if(tsd->state.size==1)
 			else if(tsd->state.size==1)
-				clif_specialeffect(bl,421,AREA);
+				clif_specialeffecttoone(bl, &sd->bl, 421);
 		}
 		}
 		break;
 		break;
 	case BL_NPC:
 	case BL_NPC:
@@ -3450,9 +3465,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
 		{
 		{
 			TBL_MOB* md = (TBL_MOB*)bl;
 			TBL_MOB* md = (TBL_MOB*)bl;
 			if(md->special_state.size==2) // tiny/big mobs [Valaris]
 			if(md->special_state.size==2) // tiny/big mobs [Valaris]
-				clif_specialeffect(bl,423,AREA);
+				clif_specialeffecttoone(bl, &sd->bl, 423);
 			else if(md->special_state.size==1)
 			else if(md->special_state.size==1)
-				clif_specialeffect(bl,421,AREA);
+				clif_specialeffecttoone(bl, &sd->bl, 421);
 		}
 		}
 		break;
 		break;
 	case BL_PET:
 	case BL_PET:

+ 3 - 2
src/map/skill.c

@@ -3094,8 +3094,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 			int class_ = skillid==SA_MONOCELL?1002:mob_get_random_id(2, 1, 0);
 			int class_ = skillid==SA_MONOCELL?1002:mob_get_random_id(2, 1, 0);
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 			mob_class_change(dstmd,class_);
 			mob_class_change(dstmd,class_);
-			if (tsc) {
-				const int scs[] = { SC_QUAGMIRE, SC_PROVOKE, SC_ROKISWEIL,	SC_GRAVITATION, SC_SUITON, SC_STRIPWEAPON, SC_STRIPSHIELD, SC_STRIPARMOR, SC_STRIPHELM, SC_BLADESTOP };
+			if( tsc && dstmd->status.mode&MD_BOSS )
+			{
+				const int scs[] = { SC_QUAGMIRE, SC_PROVOKE, SC_ROKISWEIL, SC_GRAVITATION, SC_SUITON, SC_STRIPWEAPON, SC_STRIPSHIELD, SC_STRIPARMOR, SC_STRIPHELM, SC_BLADESTOP };
 				for (i = SC_COMMON_MIN; i <= SC_COMMON_MAX; i++)
 				for (i = SC_COMMON_MIN; i <= SC_COMMON_MAX; i++)
 					if (tsc->data[i]) status_change_end(bl, i, -1);
 					if (tsc->data[i]) status_change_end(bl, i, -1);
 				for (i = 0; i < ARRAYLENGTH(scs); i++)
 				for (i = 0; i < ARRAYLENGTH(scs); i++)