Jump to content
  • 0

how to color name RGB?


Killusion

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  11/17/15
  • Last Seen:  

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  623
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

Really? source request?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

2 hours ago, Killusion said:

Ingame? or in forums?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

something like this?

https://streamable.com/0dfi9

you can contact @Functor for this. ^_~

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

2 hours ago, Haruka Mayumi said:

something like this?

https://streamable.com/0dfi9

you can contact @Functor for this. ^_~

This is gnna be out of topic, but are those auras the ones that functor has as well? xD

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  136
  • Reputation:   48
  • Joined:  06/18/12
  • Last Seen:  

21 minutes ago, Hijirikawa said:

This is gnna be out of topic, but are those auras the ones that functor has as well? xD

Yes. He offers Aura and Nickname.

Auras - 75$
Color Nicks - 45$
 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  11/17/15
  • Last Seen:  

Thank you to everyone but I just want to know if it can be done.
I am studying it.

On 7/24/2019 at 12:31 PM, Haruka Mayumi said:

something like this?

https://streamable.com/0dfi9

you can contact @Functor for this. ^_~

Good job;)

/// Validates and processes global messages
/// 008c <packet len>.W <text>.?B (<name> : <message>) 00 (CZ_REQUEST_CHAT)
/// There are various variants of this packet.
void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
{
const char* text = (char*)RFIFOP(fd,4);
int textlen = RFIFOW(fd,2) - 4;
int gm_lvl = pc_get_group_level(sd);
char *name, *message, *fakename = NULL;
int namelen, messagelen;
		 unsigned long player = strtoul("0x55AE3A",NULL,0); //normal player color leaf
	unsigned long GM20 = strtoul("0xFFA500",NULL,0); //GM level 20 to 39 color orange
	unsigned long GM40 = strtoul("0xCD00CD",NULL,0); //GM level 40 to 59 color magenta3
	unsigned long GM60 = strtoul("0x006400",NULL,0); //GM level 60 to 79 color dark green
	unsigned long GM80 = strtoul("0x00008B",NULL,0); //GM level 80 to 98 color dark blue
	unsigned long admin = strtoul("0xFF0000",NULL,0); //Admin color red
bool is_fake;
// validate packet and retrieve name and message
if( !clif_process_message(sd, 0, &name, &namelen, &message, &messagelen) )
  return;
if( is_atcommand(fd, sd, message, 1)  )
  return;
if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
  return;
if( battle_config.min_chat_delay )
{ //[Skotlex]
  if (DIFF_TICK(sd->cantalk_tick, gettick()) > 0)
   return;
  sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
}
/**
  * Fake Name Design by FatalEror (bug report #9)
  **/
if( ( is_fake = ( sd->fakename[0] ) ) ) {
  fakename = (char*) aMalloc(strlen(sd->fakename)+messagelen+3);
  strcpy(fakename, sd->fakename);
  strcat(fakename, " : ");
  strcat(fakename, message);
  textlen = strlen(fakename) + 1;
}
		// send message to others (using the send buffer for temp. storage)
		WFIFOHEAD(fd, 12 + textlen);
		WFIFOW(fd,0) = 0x2C1;
		WFIFOW(fd,2) = 12 + textlen;
		WFIFOL(fd,4) = sd->bl.id;
		if(gm_lvl == 99){
				WFIFOL(fd,8) = (admin & 0x0000FF) << 16 | (admin & 0x00FF00) | (admin & 0xFF0000) >> 16;
		}
		else if (gm_lvl==0){
				WFIFOL(fd,8) = (player & 0x0000FF) << 16 | (player & 0x00FF00) | (player & 0xFF0000) >> 16;
		}
	else if (gm_lvl >=20 && gm_lvl<=39)
	{
				WFIFOL(fd,8) = (GM20 & 0x0000FF) << 16 | (GM20 & 0x00FF00) | (GM20 & 0xFF0000) >> 16;
	}
	else if (gm_lvl >=40 && gm_lvl <= 59)
	{
		WFIFOL(fd,8) = (GM40 & 0x0000FF) << 16 | (GM40 & 0x00FF00) | (GM40 & 0xFF0000) >> 16;
	}
	else if (gm_lvl >=60 && gm_lvl <= 79)
	{
		WFIFOL(fd,8) = (GM60 & 0x0000FF) << 16 | (GM60 & 0x00FF00) | (GM60 & 0xFF0000) >> 16;
	}
	else if (gm_lvl >=80 && gm_lvl <= 98)
	{
		WFIFOL(fd,8) = (GM80 & 0x0000FF) << 16 | (GM80 & 0x00FF00) | (GM80 & 0xFF0000) >> 16;
	}
safestrncpy((char*)WFIFOP(fd,8), is_fake ? fakename : text, textlen);
//FIXME: chat has range of 9 only
clif_send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
// send back message to the speaker
if( is_fake ) {
  WFIFOW(fd,0) = 0x8e;
  WFIFOW(fd,2) = textlen + 4;
  safestrncpy((char*)WFIFOP(fd,4), fakename, textlen);
  aFree(fakename);
} else {
  memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
  WFIFOW(fd,0) = 0x8e;
}
WFIFOSET(fd, WFIFOW(fd,2));
#ifdef PCRE_SUPPORT
// trigger listening npcs
map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl);
#endif
// Chat logging type 'O' / Global Chat
log_chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
}

i need use item/npc script and I don't want to use gm lv

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  183
  • Reputation:   15
  • Joined:  06/10/12
  • Last Seen:  

28 minutes ago, Killusion said:

/// Validates and processes global messages
/// 008c <packet len>.W <text>.?B (<name> : <message>) 00 (CZ_REQUEST_CHAT)
/// There are various variants of this packet.
void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
{
const char* text = (char*)RFIFOP(fd,4);
int textlen = RFIFOW(fd,2) - 4;
int gm_lvl = pc_get_group_level(sd);
char *name, *message, *fakename = NULL;
int namelen, messagelen;
		 unsigned long player = strtoul("0x55AE3A",NULL,0); //normal player color leaf
	unsigned long GM20 = strtoul("0xFFA500",NULL,0); //GM level 20 to 39 color orange
	unsigned long GM40 = strtoul("0xCD00CD",NULL,0); //GM level 40 to 59 color magenta3
	unsigned long GM60 = strtoul("0x006400",NULL,0); //GM level 60 to 79 color dark green
	unsigned long GM80 = strtoul("0x00008B",NULL,0); //GM level 80 to 98 color dark blue
	unsigned long admin = strtoul("0xFF0000",NULL,0); //Admin color red
bool is_fake;
// validate packet and retrieve name and message
if( !clif_process_message(sd, 0, &name, &namelen, &message, &messagelen) )
  return;
if( is_atcommand(fd, sd, message, 1)  )
  return;
if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
  return;
if( battle_config.min_chat_delay )
{ //[Skotlex]
  if (DIFF_TICK(sd->cantalk_tick, gettick()) > 0)
   return;
  sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
}
/**
  * Fake Name Design by FatalEror (bug report #9)
  **/
if( ( is_fake = ( sd->fakename[0] ) ) ) {
  fakename = (char*) aMalloc(strlen(sd->fakename)+messagelen+3);
  strcpy(fakename, sd->fakename);
  strcat(fakename, " : ");
  strcat(fakename, message);
  textlen = strlen(fakename) + 1;
}
		// send message to others (using the send buffer for temp. storage)
		WFIFOHEAD(fd, 12 + textlen);
		WFIFOW(fd,0) = 0x2C1;
		WFIFOW(fd,2) = 12 + textlen;
		WFIFOL(fd,4) = sd->bl.id;
		if(gm_lvl == 99){
				WFIFOL(fd,8) = (admin & 0x0000FF) << 16 | (admin & 0x00FF00) | (admin & 0xFF0000) >> 16;
		}
		else if (gm_lvl==0){
				WFIFOL(fd,8) = (player & 0x0000FF) << 16 | (player & 0x00FF00) | (player & 0xFF0000) >> 16;
		}
	else if (gm_lvl >=20 && gm_lvl<=39)
	{
				WFIFOL(fd,8) = (GM20 & 0x0000FF) << 16 | (GM20 & 0x00FF00) | (GM20 & 0xFF0000) >> 16;
	}
	else if (gm_lvl >=40 && gm_lvl <= 59)
	{
		WFIFOL(fd,8) = (GM40 & 0x0000FF) << 16 | (GM40 & 0x00FF00) | (GM40 & 0xFF0000) >> 16;
	}
	else if (gm_lvl >=60 && gm_lvl <= 79)
	{
		WFIFOL(fd,8) = (GM60 & 0x0000FF) << 16 | (GM60 & 0x00FF00) | (GM60 & 0xFF0000) >> 16;
	}
	else if (gm_lvl >=80 && gm_lvl <= 98)
	{
		WFIFOL(fd,8) = (GM80 & 0x0000FF) << 16 | (GM80 & 0x00FF00) | (GM80 & 0xFF0000) >> 16;
	}
safestrncpy((char*)WFIFOP(fd,8), is_fake ? fakename : text, textlen);
//FIXME: chat has range of 9 only
clif_send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
// send back message to the speaker
if( is_fake ) {
  WFIFOW(fd,0) = 0x8e;
  WFIFOW(fd,2) = textlen + 4;
  safestrncpy((char*)WFIFOP(fd,4), fakename, textlen);
  aFree(fakename);
} else {
  memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
  WFIFOW(fd,0) = 0x8e;
}
WFIFOSET(fd, WFIFOW(fd,2));
#ifdef PCRE_SUPPORT
// trigger listening npcs
map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl);
#endif
// Chat logging type 'O' / Global Chat
log_chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
}

i need use item/npc script and I don't want to use gm lv

this command is working on rathena actual?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...