Jump to content

Some Src TuTs


Recommended Posts

  • Former Staff

1. Enable 6-7 opt: (Europe, Singapore, Vietnam)

Spoiler

In char_item.cpp search twice (two times) for:



				if (LC_IsEurope() || LC_IsSingapore() || LC_IsVietnam())
					return false;

You can either delete or comment both.

MMZ7c.png

2. Change the Success Rate on attaching a Stone to an Item

Spoiler

In char_item.cpp search for:



				if (number(1, 100) <= 30)

Change the 30 with any number you want (between 1-100).

jUEVb.png

3. Remove 3% tax when selling an Item

Spoiler

In shop.cpp and shop_manager.cpp search for:



			iVal = 3;

Change the 3 with 0.

https://metin2.download/picture/Ez37W785ZQ25z6G6dL7TSVfP7MuoIyd7/.png

4. Enable Selling an Item by 0 yang in NPC shop

Spoiler

In shop.cpp search for:



	if (r_item.price <= 0)

Delete the = after the <.

https://metin2.download/picture/tvmYFJasazRoAdIumsTSmsUF7U007aHx/.png

5. Enable pc_change_name (Europe)

Spoiler

In questlua_pc.cpp search for:



		if ( LC_IsEurope() )
		{
			lua_pushnumber(L, 5);
			return 1;
		}

You can either delete or comment it.

https://metin2.download/picture/r2wj3JnJFhxVI1r76LWvSL9HU9s9g3dN/.png

6. Enable Selling 70024 (5kE6e.png) and 70035 (deBgh.png) in NPC shop

Spoiler

In shop.cpp search for:



		if (quest::CQuestManager::instance().GetEventFlag("hivalue_item_sell") == 0)
		{
			if (item->GetVnum() == 70024 || item->GetVnum() == 70035)
			{
				return SHOP_SUBHEADER_GC_END;
			}
		}

and

		if (quest::CQuestManager::instance().GetEventFlag("hivalue_item_sell") == 0)
		{
			if (item.vnum == 70024 || item.vnum == 70035)
			{
				continue;
			}
		}

You can either delete or comment both.
Fkp2f.png

7. Disable 6/7 Bonuses (fJFFg.png - wZcyg.png)on Costumes

Spoiler

In char_item.cpp search for:



				case 71051 :

Inside case 71051 :, above that:



				if (item2->GetAttributeSetIndex() == -1)

Add this:



			if (item2->GetType() == ITEM_COSTUME)
			{
				ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cant add 6/7 bonuses on costumes"));
				return false;
			}

https://metin2.download/picture/KH70BPG2hjkBJ6ObJibTtVppGIlYv3SV/.png

8. Edit Shutdown Time (when doing /shutdown command)

Spoiler

In cmd_general.cpp search for:



    Shutdown(10);

Change the 10 with any number you want. Time is setup by seconds.

https://metin2.download/picture/WqbHNoU4PfLcuL6XVHaYrix8mu64S0W1/.png

9. Edit Max Level

Spoiler

In length.h search for:



				    PLAYER_EXP_TABLE_MAX    = 120,
				    PLAYER_MAX_LEVEL_CONST    = 120,

Change the 120 with any number you want.

hNcKb.png

Now you'll have to edit the exp table, so for that open constant.cpp and search for:



const DWORD exp_table_common[PLAYER_EXP_TABLE_MAX + 1] =

You'll have to add new lines to the table.  It's easy, just follow its logic.

10. Delete Glass (KtD2e.png) need for link items in chat:

Spoiler

In input_main.cpp search for:



int ProcessTextTag(LPCHARACTER ch, const char * c_pszText, size_t len)
{
	//2012.05.17 ±è¿ë¿í
	//0 : Á¤»óÀûÀ¸·Î »ç¿ë
	//1 : ±Ý°­°æ ºÎÁ·
	//2 : ±Ý°­°æÀÌ ÀÖÀ¸³ª, °³ÀλóÁ¡¿¡¼­ »ç¿ëÁß
	//3 : ±³È¯Áß
	//4 : ¿¡·¯
	int hyperlinks;
	bool colored;


Above:
	//2012.05.17 ±è¿ë¿í
add:
	return 0;

1X3Ye.png  

11. Dice and ÁÖ»çŔ§ fix

Spoiler

In cmd_general.cpp search for:



ACMD(do_dice)

Replace all the function with this:



ACMD(do_dice)
{
	ch->ChatPacket(CHAT_TYPE_INFO, "This command has been disabled.");
}

9LF5f.png

12. Disable Players drop Yang to the floor

Spoiler

In cmd_general.cpp search for:



bool CHARACTER::DropGold(int gold)

Replace all the function with this:



bool CHARACTER::DropGold(int gold)
{
	return false;
}

zoPye.png

13. Bonus Change Time 0min for Players

Spoiler

In char_item.cpp search for:



	if (pPC)
	{
		DWORD dwNowMin = get_global_time() / 60;

		DWORD dwLastChangeItemAttrMin = pPC->GetFlag(msc_szLastChangeItemAttrFlag);

		if (dwLastChangeItemAttrMin + dwChangeItemAttrCycle > dwNowMin)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼Ó¼ºÀ» ¹Ù²ÛÁö %dºÐ À̳»¿¡´Â ´Ù½Ã º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù.(%d ºÐ ³²À½)"),
					dwChangeItemAttrCycle, dwChangeItemAttrCycle - (dwNowMin - dwLastChangeItemAttrMin));
			return false;
		}

		pPC->SetFlag(msc_szLastChangeItemAttrFlag, dwNowMin);
	}

You can either delete or comment it.

rVSdb.png

14. Change the time from dropped items

Spoiler

In item.h search for:



	void	StartDestroyEvent(int iSec=300);

Change the 300 with any number you want.

9jFje.png

Now in char_item.cpp search for:



    pkItemToDrop->StartDestroyEvent();

Add any number you want inside the ().

7oeJb.png

15. Make a New Mount to be able to Attack

Spoiler

In char_item.cpp search for:



    case 20118:

Under that case add a new line with the id of your new mount.

https://metin2.download/picture/Ca0eTldU1exRUGH5f4KKG69V7nw4muYR/.png

Now, in order to make damage while being mounted you'll need to add the mount in binary.  So in InstanceBase.cpp do the same thing you did above.

16. Edit Max Status Points

Spoiler

In cmd_general.cpp search for:



#define MAX_STAT 90

Change the 90 with any number you want.

OOf3h.png

17. Remove and edit limit_time (alias TimeBomb)

Spoiler

In limit_time.h search for:



#define ENABLE_LIMIT_TIME

Comment that line.

LVPcg.png

If you want just to change the time then open update_limit_time.py and search for:



limitTime = time.mktime(time.localtime()) + 3600 * 24 * 180 * 2

Edit it as you like.

fK9lh.png

Now type on the machine and then compile.



gmake limit_time 

 

18. Emotions without Emotion Mask (u2fCf.png)

Spoiler

In cmd_emoticon.cpp search for:



bool CHARACTER_CanEmotion(CHARACTER& rch)
{
	// °áÈ¥½Ä ¸Ê¿¡¼­´Â »ç¿ëÇÒ ¼ö ÀÖ´Ù.
	if (marriage::WeddingManager::instance().IsWeddingMap(rch.GetMapIndex()))
		return true;

	// ¿­Á¤ÀÇ °¡¸é Âø¿ë½Ã »ç¿ëÇÒ ¼ö ÀÖ´Ù.
	if (rch.IsEquipUniqueItem(UNIQUE_ITEM_EMOTION_MASK))
		return true;

	if (rch.IsEquipUniqueItem(UNIQUE_ITEM_EMOTION_MASK2))
		return true;

	return false;
}

Replace all the function with this:



bool CHARACTER_CanEmotion(CHARACTER& rch) 
{

	return true;

}

7y6Cb.png

19. Fix War Crash Bug

Spoiler

In cmd_emoticon.cpp search for:



	if (*arg2)
	{
		str_to_number(type, arg2);

		if (type >= GUILD_WAR_TYPE_MAX_NUM)
			type = GUILD_WAR_TYPE_FIELD;
	}

Replace all the function with this:



	if (*arg2)
	{
		str_to_number(type, arg2);

		if (type >= GUILD_WAR_TYPE_MAX_NUM || type < 0)
			type = GUILD_WAR_TYPE_FIELD;
	}

rDQOd.png

20. Edit GM Commands Authority

Spoiler

Example, in cmd.cpp search for:



    { "shutdown",    do_shutdown,        0,            POS_DEAD,    GM_HIGH_WIZARD    },

Change the GM_HIGH_WIZARD to GM_IMPLEMENTOR



    { "shutdown",    do_shutdown,        0,            POS_DEAD,    GM_IMPLEMENTOR    },

FdC9c.png

Now only a GM with GM_IMPLEMENTOR authority (gmlist table) will be able to do the /shutdown command.

21. Get Status Points after Level 90

Spoiler

In char.cpp search for:



    if (GetLevel() < 91) PointChange(POINT_STAT, 1);

and

	if(iLv <= 90)
		PointChange(POINT_STAT, ((MINMAX(1, iLv, 90) - 1) * 3) + GetPoint(POINT_LEVEL_STEP) - GetPoint(POINT_STAT));

Change the 91 and the two 90's with any number you want (your server max level for example).

pPe1d.png

22. Remove Potions when Levelup

Spoiler

In char.cpp search for:



	if (GetLevel() <= 10)
		AutoGiveItem(27001, 2);
	else if (GetLevel() <= 30)
		AutoGiveItem(27002, 2);
	else
	{
		AutoGiveItem(27002, 2);
//		AutoGiveItem(27003, 2);
	}

You can either delete or comment it.

cZ33g.png  

23. Edit Rates Values

Spoiler

In priv_manager.cpp search for:



	value = MINMAX(0, value, 200);
	value = MINMAX(0, value, 100);
	value = MINMAX(0, value, 50);
	value = MINMAX(0, value, 50);
	value = MINMAX(0, value, 100);
	value = MINMAX(0, value, 200);

Change the 50's, 100's and 200's to 1000 for example.

24. Fix Client Version Check

Spoiler

In config.cpp search for:



        if (version > date)

Change the > with !=

9HuEh.png


Pay attention to tabulations.
Keep in mind that this is just a re-upload of them tut's, some of them can be found way more completed.

If you find something wrong feel free to say.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Think 1
  • Good 1
  • Love 1
  • Love 29
Link to comment
Share on other sites

  • Developer
2 minutes ago, Krusty said:

how can i change the time from time_bomb to one day?


limitTime = time.mktime(time.localtime()) + 3600 * 24 * 365 * 1

is this right?

seconds * minutes * hours * days * years

So to one day, keep only de 3600s (which is 60 * 60 * 1).

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

  • 2 years later...
  • Premium
31 minutes ago, Traceur3RUN said:

if(version != date)

 

it stupid idiot fix because how to connect to game with this?

just edit binary to again timestamp and thats all.

 

and you also need change in client binary to work it right? because i do and nothing happen

If version from game and client is different, the outdated client message triggers.

So...you need to have them equal, for example both as: 123450

Link to comment
Share on other sites

18 minut temu, tierrilopes napisał:

If version from game and client is different, the outdated client message triggers.

So...you need to have them equal, for example both as: 123450

oh, i found my mistake. now works. but one message how to add std.count each second ? like when you logout 9..8...7...6..5.4..3..2..1

Link to comment
Share on other sites

  • 2 years later...

Announcements



×
×
  • Create New...

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.