VenTus 73 Posted December 1, 2018 Share Posted December 1, 2018 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 More sharing options...
Premium tierrilopes 453 Posted December 1, 2018 Premium Share Posted December 1, 2018 37 minutes ago, VenTus said: list of all stuff in the mob_proto Source, common/length.h Link to comment Share on other sites More sharing options...
VenTus 73 Posted December 1, 2018 Author Share Posted December 1, 2018 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. Link to comment Share on other sites More sharing options...
VenTus 73 Posted December 2, 2018 Author Share Posted December 2, 2018 #Push Link to comment Share on other sites More sharing options...
VenTus 73 Posted December 3, 2018 Author Share Posted December 3, 2018 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 More sharing options...
VenTus 73 Posted December 4, 2018 Author Share Posted December 4, 2018 #Push Link to comment Share on other sites More sharing options...
VenTus 73 Posted December 7, 2018 Author Share Posted December 7, 2018 @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. Link to comment Share on other sites More sharing options...
Ken 905 Posted December 7, 2018 Share Posted December 7, 2018 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 2 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
VenTus 73 Posted December 7, 2018 Author Share Posted December 7, 2018 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 More sharing options...
Honorable Member xP3NG3Rx 19760 Posted December 7, 2018 Honorable Member Share Posted December 7, 2018 (edited) 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 August 25, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now