Jump to content

Recommended Posts

  • Active Member

Hi!
Try this:
char.h search:

		//PREVENT_REFINE_HACK
		int		GetRefineTime() const { return m_iRefineTime; }
		void	SetRefineTime() { m_iRefineTime = thecore_pulse(); } 
		int		m_iRefineTime;
		//END_PREVENT_REFINE_HACK

Add this under:

		//PREVENT_ARMOR_WALLHACK
		int		GetArmorUseTime() const { return m_iArmorUseTime; }
		void	SetArmorUseTime() { m_iArmorUseTime = thecore_pulse(); }
		int		m_iArmorUseTime;
		//END_PREVENT_ARMOR_WALLHACK

Then open char_item.cpp and search this in "CHARACTER::EquipItem" function:
 

	if (iWearCell < 0)
		return false;

Add this under:
 

	int equipTime = 5;
	int iPulse = thecore_pulse();

	if (iWearCell == WEAR_BODY)
		SetArmorUseTime();

	if (iWearCell == WEAR_BODY && iPulse - GetArmorUseTime() < PASSES_PER_SEC(equipTime))
	{
		ChatPacket(CHAT_TYPE_INFO, "You can't equip armor so fast");
		return false;
	}

Not tested so I'm not sure it works!
Regards

  • Premium
20 hours ago, .Incredible™ said:
Is there a possibility to allow armor changes only every 5 seconds to prevent the "Wallhack" bug?
 

Or, u can block trade armor in mounts... In ox map... Etc... 

if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

vor 50 Minuten schrieb EnKor:

Or, u can block trade armor in mounts... In ox map... Etc... 

I know, but i want a Cooldown becouse i think you can Crash a core when you Go outside The map with wallhack

  • Active Member
20 hours ago, .Incredible™ said:

I know, but i want a Cooldown becouse i think you can Crash a core when you Go outside The map with wallhack

Sorry, my first post was buggy. I've corrected so, it works fine for me.
do the char.h part again, then go to char_item.cpp and search this:

	if (iWearCell < 0)
		return false;

Paste this under:

	int equipTime = 5;
	int iPulse = thecore_pulse();
	
	if (iWearCell == WEAR_BODY)
	{
		if (iPulse - GetArmorUseTime() < PASSES_PER_SEC(equipTime))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't equip armor so fast"));
			return false;
		}
		else
			SetArmorUseTime();
	}

Regards

  • Love 1
  • 2 years later...
 

 

 You cand use a client side + server side(like the one mentioned above) combination to be sure this is not working.

clientside:

Open uiinventory.py and search:

Spoiler

    def __init__(self):

Add:

Spoiler

        self.lastArmorEquiped = 0

Search:

Spoiler

    def __UseItem(self, slotIndex):
        ItemVNum = player.GetItemIndex(slotIndex)
        item.SelectItem(ItemVNum)

Add under:

Spoiler

        if item.GetItemType() == item.ITEM_TYPE_ARMOR and item.GetItemSubType() == item.ARMOR_BODY:
            if app.GetTime() < self.lastArmorEquiped + 5:
                chat.AppendChat(chat.CHAT_TYPE_INFO, "Poti schimba armura doar peste 5 secunde.")
                return
            else:
                self.lastArmorEquiped = app.GetTime()

Edited by Sobolanescu
  • Metin2 Dev 2
  • Love 2
  • Active Member

In char_item.cpp, search:

	if (iWearCell < 0)
		return false;

Add under:

	if (iWearCell == WEAR_BODY)
	{
		int ArmorUseTime = GetQuestFlag("prevent_wallhack.armor_use_time");
		if (ArmorUseTime)
		{
			if (get_global_time() < ArmorUseTime /* limit */) 
			{
				ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't equip armor so fast"));
				return false;
			}
			else
				SetQuestFlag("prevent_wallhack.armor_use_time", get_global_time() + 3);
		}
	}


In inpug_login.cpp, search:

	ch->StartCheckSpeedHackEvent();

Add under:

	ch->SetQuestFlag("prevent_wallhack.armor_use_time", get_global_time());


It works 100%. I'm using this too
The other two I posted was just a freakin' junk, so sorry for that.
Have a nice day guys! :D

Edited by Heathcliff™
  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.