Jump to content

Search some functions and Lists


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
Share on other sites

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;
}


 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.