Jump to content
×
×
  • Create New...

Chat Coloring with Game


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

Hi everyone,
 
In this thread I will show you how to change the color of the chat messages without any client modification. I will use the 2 new ring slots in this example.
 
First of all, the color codes:
 
RED: |cFFFF0000|H|h
GREEN: |cFF00FF00|H|h
BLUE: |cFF0080FF|H|h
YELLOW: |cFFFFFF00|H|h

Open game/unique_item.h and add these:

TEXT_COLOR_RED = ID_OF_THE_ITEM,
TEXT_COLOR_GREEN = ID_OF_THE_ITEM,
TEXT_COLOR_BLUE = ID_OF_THE_ITEM,
TEXT_COLOR_YELLOW = ID_OF_THE_ITEM,

Open game/input_main.cpp and search for this:

const TPacketCGChat* pinfo = reinterpret_cast<const TPacketCGChat*>(data);

Replace with this:

int len;
const TPacketCGChat* pinfo = reinterpret_cast<const TPacketCGChat*>(data);

Remove this:

int len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);

Search for this:

if (CHAT_TYPE_SHOUT == pinfo->type)

Add this over that:

if (ch->IsEquipNewRingItem(TEXT_COLOR_RED))
{
	// RED
	len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s %s", ch->GetName(), "|cFFFF0000|H|h", buf);
}
else if (ch->IsEquipNewRingItem(TEXT_COLOR_GREEN))
{
	// GREEN
	len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s %s", ch->GetName(), "|cFF00FF00|H|h", buf);
}
else if (ch->IsEquipNewRingItem(TEXT_COLOR_BLUE))
{
	// BLUE
	len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s %s", ch->GetName(), "|cFF0080FF|H|h", buf);
}
else if (ch->IsEquipNewRingItem(TEXT_COLOR_YELLOW))
{
	// YELLOW
	len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s %s", ch->GetName(), "|cFFFFFF00|H|h", buf);
}
else
{
	// DEFAULT COLOR
	len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);
}

Open game/char.cpp and add this event:

bool CHARACTER::IsEquipNewRingItem(DWORD dwItemVnum) const
{
	{
		LPITEM u = GetWear(WEAR_RING1);

		if (u && u->GetVnum() == dwItemVnum)
		{
			return true;
		}
	}

	{
		LPITEM u = GetWear(WEAR_RING2);

		if (u && u->GetVnum() == dwItemVnum)
		{
			return true;
		}
	}

	return false;
}

Open game/char.h and search for this:

bool			IsEquipUniqueGroup(DWORD dwGroupVnum) const;

Add this under that:

bool			IsEquipNewRingItem(DWORD dwItemVnum) const;

And now how it looks in the game:
 

Spoiler

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif




If you have any question or suggestion, please just reply to this topic.
 
Kind Regards,
Sanchez

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 5
  • Love 26
  • Confused 1
Link to comment
Share on other sites

cool, I remember they had this in Metin2US before using the same color code system and it was removed because people didn't want to only use it to sell and buy items. I've been looking for this modification for such a long time.

  • Love 1
Link to comment
Share on other sites

cool, I remember they had this in Metin2US before using the same color code system and it was removed because people didn't want to only use it to sell and buy items. I've been looking for this modification for such a long time.

 

UndergroundMt2 used the same system but with python code.

You can append the same color codes over python.

 

@Topic: Not bad

  • Love 1
Link to comment
Share on other sites

  • 2 months later...
  • Premium

You have to add the new slots to the inventorywindow.py:

				## Equipment Slot
				{
					"name" : "Equipment_Base",
					"type" : "image",

					"x" : 10,
					"y" : 33,

					"image" : "d:/ymir work/ui/equipment_bg_with_ring.tga",

					"children" :
					(

						{
							"name" : "EquipmentSlot",
							"type" : "slot",

							"x" : 3,
							"y" : 3,

							"width" : 150,
							"height" : 182,

							"slot" : (
										{"index":EQUIPMENT_START_INDEX+0, "x":39, "y":37, "width":32, "height":64},
										{"index":EQUIPMENT_START_INDEX+1, "x":39, "y":2, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+2, "x":39, "y":145, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+3, "x":75, "y":67, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+4, "x":3, "y":3, "width":32, "height":96},
										{"index":EQUIPMENT_START_INDEX+5, "x":114, "y":67, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+6, "x":114, "y":35, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+7, "x":2, "y":145, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+8, "x":75, "y":145, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+9, "x":114, "y":2, "width":32, "height":32},
										{"index":EQUIPMENT_START_INDEX+10, "x":75, "y":35, "width":32, "height":32},
										## »ő ąÝÁö1
										{"index":item.EQUIPMENT_RING1, "x":2, "y":106, "width":32, "height":32},
										## »ő ąÝÁö2
										{"index":item.EQUIPMENT_RING2, "x":75, "y":106, "width":32, "height":32},
										## »ő ş§Ć®
										{"index":item.EQUIPMENT_BELT, "x":39, "y":106, "width":32, "height":32},
									),
						},
  • Love 1
Link to comment
Share on other sites

Yes, If I have the file with the selected check boxes and tga is correct but are not activate

 

on the subject of flags? Should the value of item selected go to the box? or do I need a special type, flag or antflag?

Link to comment
Share on other sites

  • 4 months later...
  • 5 months later...
  • Premium

Can anyone Post what i have to do in item_proto.txt

 

I try this

 

90014    Gelber Stift    ITEM_RING    NONE    1    NONE    NONE    NONE        0    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0

 

but if i use my Item it goes in the Right Slot but my Chat is still normal

Link to comment
Share on other sites

  • 4 months later...

Can anyone Post what i have to do in item_proto.txt

 

I try this

 

 

 
90014    Gelber Stift    ITEM_RING    NONE    1    NONE    NONE    NONE        0    0    0    0    0    LIMIT_NONE    0    LIMIT_NONE    0    APPLY_NONE    0    APPLY_NONE    0    APPLY_NONE    0    0    0    0    0    0    0    0    0    0

 

 

but if i use my Item it goes in the Right Slot but my Chat is still normal

​Same..

Link to comment
Share on other sites

  • 4 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 0

      max level exp

    2. 8

      Quest States Core Crash Item Dupe Bug Fix

    3. 23

      Umbra / Soft4Win / SNap! scammer exposed!

    4. 46

      Ship Defense (Hydra Dungeon)

    5. 10

      Rodnia Glory | A REAL SPEED SERVER | Start 02.09.2022

    6. 0

      Avery seeks an experienced team manager

    7. 0

      Wear (use) item only on specific map

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.