Jump to content

Recommended Posts

Hey guys,

im searching for the plain function @xP3NG3Rx showed here: LINK
Also im searching for all of the parts this function get used. If you think, why would he need it? Its really simple some of the latest offical stuff needs this function to calculate the distance between player/npc/object and the monster which attacks. Otherwise some skills and attack animations looks a bit strange...

Also im searching for a possible list of all stuff in the mob_proto/item_proto as for example AIFlags, Types, SubTypes, APPLYS and so on. So everybody (me included) could read which type maybe is missing
for him and can implement it himself or via tutorial.

Thanks for reading!

Regards VenTus

Link to comment
https://metin2.dev/topic/20125-search-some-functions-and-lists/
Share on other sites

vor 1 Minute schrieb tierrilopes:

Source, common/length.h

?Funny. I was talking about the newest mob_proto/item_proto from the officals such as AIFlag NORECOVERY, COUNT and so on. It would be much better to get a list of all of this instead of searching for them in the new unpacked protos.

Okay i have done the first function (In nonplayer).
I dont know if it is 100% right, but im gonna share with you (Maybe @xP3NG3Rx can proof the function ?).

float CPythonNonPlayer::GetMonsterHitRange(DWORD dwVnum)
{
	float fHitRange = 100.0f;
	const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
	if (!c_pTable)
		return 70.0f;

	if (c_pTable->wAttackRange * 1.0f != 0.0f)
		fHitRange = c_pTable->wAttackRange * 1.0f;

	return fHitRange;
}


 

@xP3NG3Rx
First of all sorry for the amount of notifications, xP3NG3Rx :)

Would you please share the full Psuedo-Code of all functions where the GetMonsterHitRange is used?
So i will try to "translate" it and also share it.

Thanks in advance.

Psuedo-Code ;

signed int __stdcall CPythonNonPlayer::GetMonsterHitRange(char a1)
{
  signed int v2; // [esp+0h] [ebp-1Ch]
  int v3; // [esp+18h] [ebp-4h]

  v3 = sub_3236B90(a1);
  if ( !v3 )
    return 70.0;
  if ( *(v3 + 272) )
    v2 = *(v3 + 272);
  else
    v2 = 100;
  return v2;
}

Reversed function:

float CPythonNonPlayer::GetMonsterHitRangeByVnum(DWORD raceVnum) const
{
	const TMobTable * p = GetTable(raceVnum);
	if (!p)
		return 70.0f;
	
	if (p->hitRange)
		return p->hitRange;
	
	return 100.0f;
}

Best Regards

Ken

  • Love 2

Do not be sorry, be better.

vor 1 Stunde schrieb Ken:

Psuedo-Code ;


signed int __stdcall CPythonNonPlayer::GetMonsterHitRange(char a1)
{
  signed int v2; // [esp+0h] [ebp-1Ch]
  int v3; // [esp+18h] [ebp-4h]

  v3 = sub_3236B90(a1);
  if ( !v3 )
    return 70.0;
  if ( *(v3 + 272) )
    v2 = *(v3 + 272);
  else
    v2 = 100;
  return v2;
}

Reversed function:


float CPythonNonPlayer::GetMonsterHitRangeByVnum(DWORD raceVnum) const
{
	const TMobTable * p = GetTable(raceVnum);
	if (!p)
		return 70.0f;
	
	if (p->hitRange)
		return p->hitRange;
	
	return 100.0f;
}

Best Regards

Ken

So fine, this is nearly the same as mine. But that wont help me anymore, thanks anyways. I now need every functions pseudo where the function GetMonsterHitRange is called. So i maybe can get the code behind it.

GreetZz

  • Honorable Member

434eace8eb.png

At the moment I still don't know they are using it for special instances or not, because every mob has the same value 0.0 which means 100.0f by default. Of course the calculations are different than before, but still, I'm not sure about this. I tried to make it to my own, but I've caused some problems during the PvP so I had to put back the old one. Maybe one day I will give another try.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2

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.