Browse Source

Fixed typo in script command merge to dispbottom (follow-up to 4f09d08)
- Special Thank @Euphy

icxbb-xx 10 years ago
parent
commit
2ca6cd7760
2 changed files with 20 additions and 44 deletions
  1. 2 9
      doc/script_commands.txt
  2. 18 35
      src/map/script.c

+ 2 - 9
doc/script_commands.txt

@@ -3762,18 +3762,11 @@ be seen by anyone else.
 
 
 ---------------------------------------
 ---------------------------------------
 
 
-*dispbottom "<message>";
-
-This command will send the given message into the invoking character's chat 
-window.
-
----------------------------------------
-
-*dispbottomcolor "<message>",<color>,<accound_id>;
+*dispbottom "<message>",<color>;
 
 
 This command will send the given message with color into the invoking character's chat 
 This command will send the given message with color into the invoking character's chat 
 window. The color format is in RGB (0xRRGGBB). The color is
 window. The color format is in RGB (0xRRGGBB). The color is
-by default green (0xFFFFFF).
+by default green
 
 
 ---------------------------------------
 ---------------------------------------
 
 

+ 18 - 35
src/map/script.c

@@ -13403,16 +13403,28 @@ BUILDIN_FUNC(atcommand) {
 	return atcommand_sub(st,0);
 	return atcommand_sub(st,0);
 }
 }
 
 
-/*==========================================
- * Displays a message for the player only (like system messages like "you got an apple" )
- *------------------------------------------*/
+/** Displays a message for the player only (like system messages like "you got an apple" )
+* dispbottom("<message>"{,<color>})
+* @param message 
+* @param color Hex color default (Green)
+* @author [Napster]
+*/
 BUILDIN_FUNC(dispbottom)
 BUILDIN_FUNC(dispbottom)
 {
 {
 	TBL_PC *sd=script_rid2sd(st);
 	TBL_PC *sd=script_rid2sd(st);
+	int color;
 	const char *message;
 	const char *message;
 	message=script_getstr(st,2);
 	message=script_getstr(st,2);
-	if(sd)
-		clif_disp_onlyself(sd,message,(int)strlen(message));
+
+	if (script_hasdata(st,3))
+		color = script_getnum(st,3); // <color>
+
+	if(sd) {
+		if (script_hasdata(st,3))
+			clif_messagecolor2(sd, color, message);
+		else
+			clif_disp_onlyself(sd, message, (int)strlen(message));
+	}
 	return SCRIPT_CMD_SUCCESS;
 	return SCRIPT_CMD_SUCCESS;
 }
 }
 
 
@@ -19110,34 +19122,6 @@ BUILDIN_FUNC(countspiritball) {
 	return SCRIPT_CMD_SUCCESS;
 	return SCRIPT_CMD_SUCCESS;
 }
 }
 
 
-/** Send message with color to player
-* dispbottomcolor("<message>"{,<color>{,<Account ID>}})
-* @param message 
-* @param color Hex color default (Green)
-* @param account_id Target player (Optional)
-* @author [Napster]
-*/
-BUILDIN_FUNC(dispbottomcolor)
-{
-	TBL_PC *sd;
-	int color;
-	const char *mes = script_getstr(st,2);
-
-	if (script_hasdata(st,3))
-		color = script_getnum(st,3); // <color>
-	else
-		color = 0xFFFFFF; // Default color
-
-	if (script_hasdata(st,4))
-		sd = map_id2sd(script_getnum(st,4)); // <Account ID>
-	else
-		sd = script_rid2sd(st); // Attached player
-
-	if (sd)
-		clif_messagecolor2(sd, color, mes);
-	return SCRIPT_CMD_SUCCESS;
-}
-
 #include "../custom/script.inc"
 #include "../custom/script.inc"
 
 
 // declarations that were supposed to be exported from npc_chat.c
 // declarations that were supposed to be exported from npc_chat.c
@@ -19467,7 +19451,7 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(deletepset,"i"), // Delete a pattern set [MouseJstr]
 	BUILDIN_DEF(deletepset,"i"), // Delete a pattern set [MouseJstr]
 #endif
 #endif
 	BUILDIN_DEF(preg_match,"ss?"),
 	BUILDIN_DEF(preg_match,"ss?"),
-	BUILDIN_DEF(dispbottom,"s"), //added from jA [Lupus]
+	BUILDIN_DEF(dispbottom,"s?"), //added from jA [Lupus]
 	BUILDIN_DEF(getusersname,""),
 	BUILDIN_DEF(getusersname,""),
 	BUILDIN_DEF(recovery,"i???"),
 	BUILDIN_DEF(recovery,"i???"),
 	BUILDIN_DEF(getpetinfo,"i"),
 	BUILDIN_DEF(getpetinfo,"i"),
@@ -19681,7 +19665,6 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(addspiritball,"ii?"),
 	BUILDIN_DEF(addspiritball,"ii?"),
 	BUILDIN_DEF(delspiritball,"i?"),
 	BUILDIN_DEF(delspiritball,"i?"),
 	BUILDIN_DEF(countspiritball,"?"),
 	BUILDIN_DEF(countspiritball,"?"),
-	BUILDIN_DEF(dispbottomcolor,"s??"),
 
 
 #include "../custom/script_def.inc"
 #include "../custom/script_def.inc"