Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 15:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



What's the most appropriate approach to code range damage and range pickup

Discussion on What's the most appropriate approach to code range damage and range pickup within the Metin2 forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2011
Posts: 17
Received Thanks: 3
What's the most appropriate approach to code range damage and range pickup

Hey guys!

So, I have coded a cheat that works completely fine in which I can attack by range and pick items by range aswell. The problem is that when I use both at the same time my character keeps flickering and doesn't look as smooth as other professional cheats.

My question is: how to code so both can work properly?

Currently, I create two threads that execute functions for ranged damage and ranged pickup. The code looks something like this:

Code:
void sendAttackWrapper()
{
if(!isPressed(VK_SPACE)) return false;

TPixelPosition mobPos = getPixelPosition(mobVID);

if ((mobPos.x <= 1 or mobPos.y <= 1) or (myPos.x <= 1 or myPos.y <= 1)) return; // checks if mob position is something valid

DWORD instType = getInstanceType(mobVID);

if(instType != 0 and instType != 2) return; // if is not a mob or is not a metin, skip to the next one

float dst = getCharacterDistance(mobVID);

if(dst > args.dst) return; // if distance to the mob is bigger than the maximum distance intended, returns;

WaitForSingleObject(isPlayerAround, INFINITE); // waits if the object is signaled -> only signaled if there's a player around

Teleport(mobPos);
sendAttackPacket(mobVID);
Teleport(playerPos);
}
The code for picking is kinda the same, but applied to items.

Is the best approach actually using separate threads? I also thought on putting pickup in between sendAttackPacket and teleport calls, but after the mob is dead, if the player didn't had time to pickup the item, it wouldn't be able to teleport back to that location.

What can I do to stop this flickering?

Thanks
theashmaster is offline  
Old 07/03/2022, 15:43   #2


 
Rucksackträger''s Avatar
 
elite*gold: 506
The Black Market: 131/0/0
Join Date: Feb 2014
Posts: 880
Received Thanks: 380
I think the flickering is the fix from GF.
Rucksackträger' is offline  
Old 07/04/2022, 12:11   #3
 
elite*gold: 0
Join Date: Sep 2020
Posts: 30
Received Thanks: 10
the flickering happens when you try to jump more than 2000 pixel at once. so if you want to increase that range have to separate your jumps. also try to transition between attack and pick instead of perform both at the same time because you should consider that your server position not the client one. it seems like they pick two different points that 2000 away from each other.
sad666 is offline  
Thanks
1 User
Old 07/22/2022, 21:16   #4
 
elite*gold: 0
Join Date: Jun 2011
Posts: 17
Received Thanks: 3
Quote:
Originally Posted by Rucksackträger' View Post
I think the flickering is the fix from GF.
I'm actually not coding on GF servers xD

Quote:
Originally Posted by sad666 View Post
the flickering happens when you try to jump more than 2000 pixel at once. so if you want to increase that range have to separate your jumps. also try to transition between attack and pick instead of perform both at the same time because you should consider that your server position not the client one. it seems like they pick two different points that 2000 away from each other.
The issue was not the distance, causa I was teleporting in small ranges. But I managed to fix the issue by simple creating a std::mutex to avoid teleporting to attack and to pick an item at the same time. That pretty much fixed the issue.

Thanks!
theashmaster is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
growth of the appropriate servers autopot
07/26/2009 - SRO Private Server - 7 Replies
#edited



All times are GMT +1. The time now is 15:29.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.