Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 11:54

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

Advertisement



SendCharacterState question

Discussion on SendCharacterState question within the Metin2 forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
Smile SendCharacterState question

Hello everyone.

From my understanding as I look at the SendCharacterStatePacket function, it requires that the destionation should be a float* (float pointer).

Casting the coordinates into float* like the following:

PHP Code:
float finalDest[2] = { charPos.20.fcharPos.}; 
doesn't seem to do the job. It seems that the character is teleporting in place, while it should move +20.f in the X plane. My coordinates are ok, updating real-time & before the cast is made, so that shouldn't be a problem either.

I've tried casting even the "Y" coord into it (thinking that it requires it), but as the function error says, it requires just "fDest=(x,y)".

I've put a breakpoint on the error and it doesn't seem to get triggered while testing, so I don't really know what I'm doing wrong here.

Any help is appreciated!

Thank you very much!
Aeryas is offline  
Old 02/25/2021, 18:26   #2
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Keep in mind that Metin's PIxelPosition != Metin Coordinates. 100 in PixelPosition equals to 1 Coordinate point.
MrCrisp is offline  
Old 02/25/2021, 21:31   #3
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
Quote:
Originally Posted by MrCrisp View Post
Keep in mind that Metin's PIxelPosition != Metin Coordinates. 100 in PixelPosition equals to 1 Coordinate point.
Thanks, I've checked that also by dividing the player character's entity coordinates by 100 and I get the same result...the character flickers in place, everything dissapears while the "teleport" occurs and it stays in place.

I've tried to cast the coordinates as TPixelPosition as well, but the game crashes if I do it then like so:

PHP Code:
typedef struct VEC3{
    
float x;
    
float y;
    
float z;
}
VEC3, *LPVECTOR3;

typedef VEC3 TPixelPosition;
// some other code, etc etc 
// in the tele function:
TPixelPosition pos;
pos.getPlayerPosition().x;
pos.getPlayerPosition().y;

Tele(pos0.f00); 
I've tried manually setting and inverting coordinate values that I got from the map, same thing happens.

I'm kinda out of ideas to be honest...
Aeryas is offline  
Old 02/25/2021, 22:15   #4
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Quote:
Originally Posted by Aeryas View Post
Thanks, I've checked that also by dividing the player character's entity coordinates by 100 and I get the same result...the character flickers in place, everything dissapears while the "teleport" occurs and it stays in place.

I've tried to cast the coordinates as TPixelPosition as well, but the game crashes if I do it then like so:

PHP Code:
typedef struct VEC3{
    
float x;
    
float y;
    
float z;
}
VEC3, *LPVECTOR3;

typedef VEC3 TPixelPosition;
// some other code, etc etc 
// in the tele function:
TPixelPosition pos;
pos.getPlayerPosition().x;
pos.getPlayerPosition().y;

Tele(pos0.f00); 
I've tried manually setting and inverting coordinate values that I got from the map, same thing happens.

I'm kinda out of ideas to be honest...
I'm not quite sure what you are trying to achieve here. Why do you divide the player coordinates? If you want to send a packet, the data inside the packet needs to be formed such that it applies to the correct form.

The header of the SendCharacterStatePacket function looks like this:
Code:
bool CPythonNetworkStream::SendCharacterStatePacket(const TPixelPosition& c_rkPPosDst, float fDstRot, UINT eFunc, UINT uArg)
The PixePosition argument is just a typedef.
Code:
typedef struct D3DXVECTOR3 {
  FLOAT x;
  FLOAT y;
  FLOAT z;
} D3DXVECTOR3, *LPD3DXVECTOR3;
As mentioned earlier, if you want to "teleport" to some point, you have to multiply your coordinates by 100.

It would be easier if you can provide some snippets of your code, e.g. what you are trying to achieve.
MrCrisp is offline  
Thanks
1 User
Old 02/26/2021, 18:57   #5
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
Thanks alot MrCrisp for the info. My original values of coordinates were returned from the CInstance, so they were already in their normal float values that should be sent back with the state packet. What I did not notice until I mouseovered the minimap, was the fact that the Y position of the mobs was absolute and what was expected to be sent back was the absolute value as well ( in the entity list, their values were negative ). I've overlooked that simple thing and I was a bit dissapointed of myself xD.

In terms of what I'm trying to achieve with these is a ranged waithack & a custom map teleporter mainly. One thing I've noticed tho is that the waithack doesn't work after fixing the issue.

Using "teleport(mobpos) => attack => teleport(backtoprevposition) doesn't seem to attack the mob, even if the packet was sent. I've tried a bot that already does that and that one seems to work, but mine doesn't ��. I'll try to fiddle with some sleep values & see what's going on. If you have a piece of advice on this one, I'll really appreciate it.

Thank you very much once again!
Aeryas is offline  
Thanks
1 User
Old 02/26/2021, 21:42   #6
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Quote:
Originally Posted by Aeryas View Post
Thanks alot MrCrisp for the info. My original values of coordinates were returned from the CInstance, so they were already in their normal float values that should be sent back with the state packet. What I did not notice until I mouseovered the minimap, was the fact that the Y position of the mobs was absolute and what was expected to be sent back was the absolute value as well ( in the entity list, their values were negative ). I've overlooked that simple thing and I was a bit dissapointed of myself xD.

In terms of what I'm trying to achieve with these is a ranged waithack & a custom map teleporter mainly. One thing I've noticed tho is that the waithack doesn't work after fixing the issue.

Using "teleport(mobpos) => attack => teleport(backtoprevposition) doesn't seem to attack the mob, even if the packet was sent. I've tried a bot that already does that and that one seems to work, but mine doesn't ��. I'll try to fiddle with some sleep values & see what's going on. If you have a piece of advice on this one, I'll really appreciate it.

Thank you very much once again!
Glad that you figured it out!

For the range-waithack: Did you send a character state packet? (not sure what the correct name of the packet is)
MrCrisp is offline  
Thanks
1 User
Old 02/26/2021, 22:01   #7
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
Quote:
Originally Posted by MrCrisp View Post
Glad that you figured it out!

For the range-waithack: Did you send a character state packet? (not sure what the correct name of the packet is)
Yes I did...What I've tried so far:

PHP Code:
for (GInstance::iterator entry entList.begin(); entry != entList.end(); entry++) {

    if (!
entry->second->isEnemyPlayer() && entry->second->getIsMyCharacter() != 1) {

        
Vector3 playerPos GetPlayerPosition(Base);
        
Vector3 mobPos entry->second->GetPosition();
        
float dist CalculateDistance(mobPosplayerPos);

        if (
dist <= rangeWaithack) {
            
mobID entry->second->GetMobId();
            
float mobPosF[2] = { mobPos.xabs(mobPos.y) };
            
float myPos[2] = { playerPos.xabs(playerPos.y) };
            
SendStatePacket(mobPosF);
            
SendAttack(0mobID);
            
Sleep(valAOESleep); // that's some sleep I've set so it can reach the target just for testing, so I can adjust it golbally and test different values
                            // doesn't work either with our without it
            
SendStatePacket(myPos);
        }
    }


Also tried getting a single mobID and sending state packet to it from a thread, attacking from a separate thread the mobID, same, doesn't seem to work...

If I outrange the stone for example and take out the distance check, then outrange the stone, I can see that it snaps me to it, so the send state function works. I'm also using it to teleport around thr map and works fine, so that's not the problem.

If I take out the waithack and attack single target just with the send function, it works as well, so the send is working correctly.

I've tested with a bigger paid bot just to make sure that the range works on this server and it does with that one, so that's not somehow limited by the server.
Aeryas is offline  
Old 02/27/2021, 04:16   #8
 
elite*gold: 0
Join Date: Dec 2020
Posts: 47
Received Thanks: 25
it helps that you posted your exact code but its still kinda useless since we dont know what GetPlayerPosition, GetPosition, CalculateDistance and the other functions exactly do.

i assume that the entList is the aliveMap or how ever its called, its made up of a map that contains the vid and the pointer to the instance. is there a difference between entry->first and mobID or are the values equal? if not, your GetMobId is probably broken.
ones-and-zer0es.mpeg is offline  
Thanks
1 User
Old 02/27/2021, 18:48   #9
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
Quote:
Originally Posted by ones-and-zer0es.mpeg View Post
it helps that you posted your exact code but its still kinda useless since we dont know what GetPlayerPosition, GetPosition, CalculateDistance and the other functions exactly do.

i assume that the entList is the aliveMap or how ever its called, its made up of a map that contains the vid and the pointer to the instance. is there a difference between entry->first and mobID or are the values equal? if not, your GetMobId is probably broken.
Cheers, thanks for the reply. The "entList" is indeed a map of all the sorrounding units.

I get their IDs and coordinates, so that's not an issue. Testing the "teleportation" to the mobs seems to be working, sending attack packets works as well, but put together like shown above ( with and without the sleep part ) doesn't seem to be working. That's the only issue I have.

I've tried spam-teleporting on them with different sleep timers between calls and sending packets separately, same result.
Aeryas is offline  
Old 02/28/2021, 22:39   #10
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
Ok, so what I've discovered is that the SendStatePacket function has to "walk" to the unit in order to register hits, therefore it goes hitting one mob, gets back to it's original place and repeats. On my screen it doesn't look like that, it stays in place, but watching it with another character seems to do so.

The problem with that is that it takes too much time to attack the mobs, therefore it seems unreliable to go back & forth. What I've noticed with a premium bot is that that one attacks few mobs at once and never leaves it's original place, it just "shakes" in place ( like mine does when I put no sleep timer between the teleport function and attack phases ). Are they using some other methods? That's what I'm trying to achieve, but with no success.

Thanks for your attention and help, I really appreciate it.
Aeryas is offline  
Old 03/01/2021, 22:38   #11
 
elite*gold: 0
Join Date: Sep 2020
Posts: 30
Received Thanks: 10
What is your bFunc value in TPacketCGMove packet ? When you use this value as 0 you tell the server that character is there so you should be able to use attack packet without any delay.
sad666 is offline  
Thanks
1 User
Old 03/07/2021, 12:03   #12
 
elite*gold: 0
Join Date: Aug 2011
Posts: 9
Received Thanks: 0
Did u solved ? Can u help me "SendCharacterStatePacket"



Quote:
float mobPosF[2] = { x, abs(y) };
float rot = 0.2f;
DWORD Adres = *(DWORD*)irisBattlePointer; //*(DWORD*)irisBattlePointer; 00A09370
DWORD Calls = 0x071D240;
__asm
{

mov ecx,Adres
push mobPosF
push rot
push 2 //funcAttack
push 15 //comboType
call Calls
}
musty19945 is offline  
Old 03/07/2021, 23:13   #13
 
oatuh998's Avatar
 
elite*gold: 0
Join Date: Feb 2021
Posts: 4
Received Thanks: 0
Quote:
Originally Posted by musty19945 View Post
Did u solved ? Can u help me "SendCharacterStatePacket"

you are in wrong area go up and set breakpoint of first of func with started 55 8B EC and its your SendCharacterStatePacket function address
oatuh998 is offline  
Old 03/08/2021, 10:53   #14
 
elite*gold: 0
Join Date: Aug 2011
Posts: 9
Received Thanks: 0
Quote:
Originally Posted by oatuh998 View Post
you are in wrong area go up and set breakpoint of first of func with started 55 8B EC and its your SendCharacterStatePacket function address



Code:
void SendCharacterState(float* mobPos, float myRot, uint8_t efunc, uint8_t args)
{
typedef bool(__thiscall* TeleportPacket)(int, const float*, float, uint8_t, uint8_t);
const auto wPacket = reinterpret_cast<TeleportPacket>(Base + 0x16E990); /* SendCharacterState function call */

if (wPacket) {
wPacket(*reinterpret_cast<uintptr_t*>(Base + myNetPointer), mobPos, myRot, efunc, args);
}

}
Usign :
Code:
float mobPos[2] = { mx, abs(my) }; 
float rot = 10.f; 
SendCharacterState(mobPos,rot,15,0);

but I'm still getting this error.
musty19945 is offline  
Reply


Similar Threads Similar Threads
Bot question...stupid question by the way
12/05/2007 - Conquer Online 2 - 5 Replies
ok i have this litlle problem with CoPartener..that is i cant find it...i looked where i found it before...but when i download it...BOOM...just S3DHook.dll ....evreywhere i look..the same thing...can anybody help me...help a poor noob....by the way...got weed?text2schild.php?smilienummer=1&text=WEEEE EED!' border='0' alt='WEEEEEED!' />



All times are GMT +1. The time now is 11:54.


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.