-
Posts
79 -
Joined
-
Last visited
-
Days Won
1 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by SamuraiHUN
-
-
-
Why comment the char.cpp function? I don't understand.
battle.cpp my function:float CalcAttackRating(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreTargetRating) { int attacker_dx = pkAttacker->GetPolymorphPoint(POINT_DX); int attacker_lv = pkAttacker->GetLevel(); int victim_dx = pkVictim->GetPolymorphPoint(POINT_DX); int victim_lv = pkAttacker->GetLevel(); int iARSrc = MIN(90, (attacker_dx * 4 + attacker_lv * 2) / 6); int iERSrc = MIN(90, (victim_dx * 4 + victim_lv * 2) / 6); float fAR = ((float) iARSrc + 210.0f) / 300.0f; // fAR = 0.7 ~ 1.0 if (bIgnoreTargetRating) return fAR; // ((Edx * 2 + 20) / (Edx + 110)) * 0.3 float fER = ((float) (iERSrc * 2 + 5) / (iERSrc + 95)) * 3.0f / 10.0f; return fAR - fER; }
if (pMob) { iAtt = GetLevel() * 2 + GetPolymorphPoint(POINT_ST) * 2; lev + con iDef = GetLevel() + GetPolymorphPoint(POINT_HT) + pMob->m_table.wDef; }
-
What have you changed? The error just started sometime ago.
-
You can tab just as well in notepad++, if you turn off the feature not to replace it with spaces. Remove the check mark
https://metin2.download/picture/99QCB63N201gMtHLDn9maX1ZNf4Do7aX/.png
-
How to Update Client src c++20
Thanks lot of @ Mali
First, we open the client source with visual studio 2022.
Select all projects and right click on them -> properties -> General -> c++ language standard -> Here we choose c++20.
https://metin2.download/video/Q0tB47SEBj0LU7q27Sy64U11018tamx5/.mp4
need to make some step from this topic
If you don't understand something, you can ask your questions here.
- 187
- 2
- 1
- 3
- 1
- 1
- 70
- 10
- 97
-
-
How to Update Client src c++17
Step 1:
First, we open the client source with visual studio 2019/2022.
Select all projects and right click on them -> properties -> General -> c++ language standard -> Here we choose c++17.
https://metin2.download/picture/hT48lN0hPs6zA9z2IQkOY0gQV2Ady3ip/.gif
Step 2:
In each file (ctrl + shift +f) , we search for the following & delete them:
using namespace std;
Step 3:
Now the following details need to be modified (every file):
string pair make_pair vector
to
std::string std::pair std::make_pair std::vector
Step 4:
Open Eterbase project stl.h file and delete this code:
namespace std { template <class _Ty> class void_mem_fun_t : public unary_function<_Ty *, void> { public: explicit void_mem_fun_t(void (_Ty::*_Pm)()) : _Ptr(_Pm) {} void operator()(_Ty *_P) const {((_P->*_Ptr)()); } private: void (_Ty::*_Ptr)(); }; template<class _Ty> inline void_mem_fun_t<_Ty> void_mem_fun(void (_Ty::*_Pm)()) { return (void_mem_fun_t<_Ty>(_Pm)); } template<class _Ty> class void_mem_fun_ref_t : public unary_function<_Ty, void> { public: explicit void_mem_fun_ref_t(void (_Ty::*_Pm)()) : _Ptr(_Pm) {} void operator()(_Ty& _X) const { return ((_X.*_Ptr)()); } private: void (_Ty::*_Ptr)(); }; template<class _Ty> inline void_mem_fun_ref_t<_Ty> void_mem_fun_ref(void (_Ty::*_Pm)()) { return (void_mem_fun_ref_t< _Ty>(_Pm)); } // TEMPLATE CLASS mem_fun1_t template<class _R, class _Ty, class _A> class void_mem_fun1_t : public binary_function<_Ty *, _A, _R> { public: explicit void_mem_fun1_t(_R (_Ty::*_Pm)(_A)) : _Ptr(_Pm) {} _R operator()(_Ty *_P, _A _Arg) const { return ((_P->*_Ptr)(_Arg)); } private: _R (_Ty::*_Ptr)(_A); }; // TEMPLATE FUNCTION mem_fun1 template<class _R, class _Ty, class _A> inline void_mem_fun1_t<_R, _Ty, _A> void_mem_fun1(_R (_Ty::*_Pm)(_A)) { return (void_mem_fun1_t<_R, _Ty, _A>(_Pm)); } }
Step 5:
In each file (ctrl + shift +f) , we search for the following & modify them:
std::void_mem_fun
to
std::mem_fn
this
std::auto_ptr
to:
std::unique_ptr
Step 6:
Open userinterface/userinterface.cpp
Search this:
extern "C" { extern int _fltused; volatile int _AVOID_FLOATING_POINT_LIBRARY_BUG = _fltused; };
add under this:
extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }
Step 7:
Open Speherelib/spherepack.h
modify this:
inline void LostChild(SpherePack *pack);
to:
void LostChild(SpherePack *pack);
Step 8:
open etherBase/cipher.h
search this:
#include <cryptopp/cryptlib.h> #pragma warning(pop)
add under this:
using CryptoPP::byte;
Step 9
Open etherpack/Eterpack.h
#include <boost/unordered_map.hpp> #include <boost/shared_array.hpp>
modify to:
#include <unordered_map>
Replace all file this:
boost::
to:
std::
Open etherpack/EterpackManager.h & EterPackPolicy_CSHybridCrypt.h
modify this:
#include <boost/unordered_map.hpp>
to
#include <unordered_map>
Open GameLib/Area.cpp
remove this:
#include <boost/algorithm/string.hpp>
and this:
boost::algorithm::to_lower(attrFileName);
modify to:
std::transform(attrFileName.begin(), attrFileName.end(), attrFileName.begin(), [](unsigned char c) { return std::tolower(c); });
You can also delete the boost in the include folder.
If you don't understand something, you can ask your questions here.
thanks for @ Mali and @xXIntelXx some detail.
- 2
- 7
- 1
- 8
-
3 hours ago, Tatsumaru said:
Amazing how much you give to this community. More than one would cram their offers with what you share for free.
Have you ever heard of voicechat? Maybe you could try to make such a system. This is just a suggestion.
I think it would only be a good idea to have a guild | group version, so that everyone can hear everyone else, which would lead to a lot of conflict.
-
3 hours ago, HaiosMotan said:
Here is the video
Here is my uiChat.py
Hidden Content
- Give reaction to this post to see the hidden content.
just compared like 5 times with the uichat.py you posted above.
(also re-checked the client source part)
and here is the error the people get
0922 10:53:17367 :: Traceback (most recent call last): 0922 10:53:17367 :: File "uiChat.py", line 1205, in OnRender 0922 10:53:17368 :: File "uiChat.py", line 1150, in Refresh 0922 10:53:17368 :: File "uiChat.py", line 1174, in RefreshBoardViewState 0922 10:53:17368 :: AttributeError 0922 10:53:17368 :: : 0922 10:53:17368 :: 'int' object has no attribute 'GetGlobalPosition' 0922 10:53:17368 ::
as i understand, when you warp Destroy will set self.btnChatSizing = 0
and will remain like that,it will not set
self.btnChatSizing = btnChatSizing again
commenting #define ENABLE_CHATTING_WINDOW_RENEWAL
in local_inc.h (disabling the sistem) solves the problem,the error doesn't appear anymore.
Is it possible that you didn't call locale_inc.h from the Userinterface project somewhere?
-
-
ui.py
class Window(object):
search this:
def GetLocalPosition(self): return wndMgr.GetWindowLocalPosition(self.hWnd)
add under this:
def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd)
I don't know why lordsas wanted to add it to the Dragbutton class.
-
-
Have python side svsideoi?
-
2 hours ago, centarus said:
if app.ENABLE_DS_SET: self.tooltipItem.BindInterface(self)
add this before:
self.tooltipItem = uiToolTip.ItemToolTip()
interfacemodule.py
-
#ifdef ENABLE_PLAYER_PER_ACCOUNT5 PyModule_AddIntConstant(poModule, "ENABLE_PLAYER_PER_ACCOUNT5", 1); #else PyModule_AddIntConstant(poModule, "ENABLE_PLAYER_PER_ACCOUNT5", 0); #endif
but i don't know why use this wolfman. This system have a cringe code.
- 1
-
#problem solved. Thank you @Ikarus_.
I found the pythontextail.cpp one line differential. -
Hello guys, i have one question, what function set player, mob name?
npc, myshop, offlineshop, pet/mount work perfectly, but player, mob didn't show name(s), level, rank, guild. Have anyone idea?
Spoiler -
My bugs opponent this.
I saw npc/shop name but i didn't saw mob/characte name.
void CHARACTER::EncodeInsertPacket(LPENTITY entity) { LPDESC d; if (!(d = entity->GetDesc())) return; // ±ćµĺŔ̸§ ąö±× ĽöÁ¤ ÄÚµĺ LPCHARACTER ch = (LPCHARACTER)entity; ch->SendGuildName(GetGuild()); // ±ćµĺŔ̸§ ąö±× ĽöÁ¤ ÄÚµĺ TPacketGCCharacterAdd pack; pack.header = HEADER_GC_CHARACTER_ADD; pack.dwVID = m_vid; #if defined(__WJ_SHOW_MOB_INFO__) if (IsMonster() || IsStone()) { pack.dwLevel = GetLevel(); pack.dwAIFlag = IsMonster() ? GetAIFlag() : 0; } else { pack.dwLevel = 0; pack.dwAIFlag = 0; } #endif pack.bType = GetCharType(); pack.angle = GetRotation(); pack.x = GetX(); pack.y = GetY(); pack.z = GetZ(); pack.wRaceNum = GetRaceNum(); if (IsPet()) { pack.bMovingSpeed = 150; } else { pack.bMovingSpeed = GetLimitPoint(POINT_MOV_SPEED); } pack.bAttackSpeed = GetLimitPoint(POINT_ATT_SPEED); pack.dwAffectFlag[0] = m_afAffectFlag.bits[0]; pack.dwAffectFlag[1] = m_afAffectFlag.bits[1]; pack.bStateFlag = m_bAddChrState; int iDur = 0; if (m_posDest.x != pack.x || m_posDest.y != pack.y) { iDur = (m_dwMoveStartTime + m_dwMoveDuration) - get_dword_time(); if (iDur <= 0) { pack.x = m_posDest.x; pack.y = m_posDest.y; } } d->Packet(&pack, sizeof(pack)); if (IsPC() == true || m_bCharType == CHAR_TYPE_NPC) { TPacketGCCharacterAdditionalInfo addPacket; memset(&addPacket, 0, sizeof(TPacketGCCharacterAdditionalInfo)); addPacket.header = HEADER_GC_CHAR_ADDITIONAL_INFO; addPacket.dwVID = m_vid; addPacket.awPart[CHR_EQUIPPART_ARMOR] = GetPart(PART_MAIN); addPacket.awPart[CHR_EQUIPPART_WEAPON] = GetPart(PART_WEAPON); addPacket.awPart[CHR_EQUIPPART_HEAD] = GetPart(PART_HEAD); addPacket.awPart[CHR_EQUIPPART_HAIR] = GetPart(PART_HAIR); #ifdef __ACCE_COSTUME_SYSTEM__ addPacket.awPart[CHR_EQUIPPART_ACCE] = GetPart(PART_ACCE); #endif addPacket.bPKMode = m_bPKMode; addPacket.dwMountVnum = GetMountVnum(); addPacket.bEmpire = m_bEmpire; addPacket.dwLevel = 0; addPacket.dwGuildID = 0; #if defined(__OFFLINE_PRIVATE_SHOP_SYSTEM__) addPacket.dwMyShopVID = (IsPC() ? COfflineShopManager::Instance().GetOfflineShopVID(GetPlayerID()) : 0); #endif strlcpy(addPacket.name, GetName(), sizeof(addPacket.name)); if (IsPC() == true) addPacket.dwLevel = GetLevel(); if (GetGuild() != NULL) { addPacket.dwGuildID = GetGuild()->GetID(); } addPacket.sAlignment = m_iAlignment / 10; d->Packet(&addPacket, sizeof(TPacketGCCharacterAdditionalInfo)); } if (iDur) { TPacketGCMove pack; EncodeMovePacket(pack, GetVID(), FUNC_MOVE, 0, m_posDest.x, m_posDest.y, iDur, 0, (BYTE)(GetRotation() / 5)); d->Packet(&pack, sizeof(pack)); TPacketGCWalkMode p; p.vid = GetVID(); p.header = HEADER_GC_WALK_MODE; p.mode = m_bNowWalking ? WALKMODE_WALK : WALKMODE_RUN; d->Packet(&p, sizeof(p)); } if (entity->IsType(ENTITY_CHARACTER) && GetDesc()) { LPCHARACTER ch = (LPCHARACTER)entity; if (ch->IsWalking()) { TPacketGCWalkMode p; p.vid = ch->GetVID(); p.header = HEADER_GC_WALK_MODE; p.mode = ch->m_bNowWalking ? WALKMODE_WALK : WALKMODE_RUN; GetDesc()->Packet(&p, sizeof(p)); } } if (GetMyShop()) { TPacketGCShopSign p; p.bHeader = HEADER_GC_SHOP_SIGN; p.dwVID = GetVID(); strlcpy(p.szSign, m_stShopSign.c_str(), sizeof(p.szSign)); d->Packet(&p, sizeof(TPacketGCShopSign)); } #ifdef __OFFLINE_PRIVATE_SHOP_SYSTEM__ if (IsOfflineShopNPC() && (GetRaceNum() == 30000 || (GetRaceNum() >= 30002 && GetRaceNum() <= 30008))) { if (entity->IsType(ENTITY_CHARACTER)) { LPOFFLINESHOP shop = GetOfflineShop(); if (shop) { TPacketGCShopSign p; p.bHeader = HEADER_GC_OFFLINE_SHOP_SIGN; p.dwVID = GetVID(); p.bBorderStyle = shop->GetBorderStyle(); strlcpy(p.szSign, shop->GetShopSign(), sizeof(p.szSign)); d->Packet(&p, sizeof(TPacketGCShopSign)); } } } #endif if (entity->IsType(ENTITY_CHARACTER)) { sys_log(3, "EntityInsert %s (RaceNum %d) (%d %d) TO %s", GetName(), GetRaceNum(), GetX() / SECTREE_SIZE, GetY() / SECTREE_SIZE, ((LPCHARACTER)entity)->GetName()); } }
void CHARACTER::UpdatePacket() { if (IsPC() && (!GetDesc() || !GetDesc()->GetCharacter())) return; if (GetSectree() == NULL) return; TPacketGCCharacterUpdate pack; pack.header = HEADER_GC_CHARACTER_UPDATE; pack.dwVID = m_vid; pack.awPart[CHR_EQUIPPART_ARMOR] = GetPart(PART_MAIN); pack.awPart[CHR_EQUIPPART_WEAPON] = GetPart(PART_WEAPON); pack.awPart[CHR_EQUIPPART_HEAD] = GetPart(PART_HEAD); pack.awPart[CHR_EQUIPPART_HAIR] = GetPart(PART_HAIR); #ifdef __ACCE_COSTUME_SYSTEM__ pack.awPart[CHR_EQUIPPART_ACCE] = GetPart(PART_ACCE); #endif pack.bMovingSpeed = GetLimitPoint(POINT_MOV_SPEED); pack.bAttackSpeed = GetLimitPoint(POINT_ATT_SPEED); pack.bStateFlag = m_bAddChrState; pack.dwAffectFlag[0] = m_afAffectFlag.bits[0]; pack.dwAffectFlag[1] = m_afAffectFlag.bits[1]; pack.dwGuildID = GetGuild() ? GetGuild()->GetID() : 0; pack.sAlignment = m_iAlignment / 10; // pack.dwLevel = IsPC() ? GetLevel() : 0; pack.dwLevel = GetLevel(); pack.bPKMode = m_bPKMode; pack.dwMountVnum = GetMountVnum(); #if defined(__OFFLINE_PRIVATE_SHOP_SYSTEM__) pack.dwMyShopVID = (IsPC() ? COfflineShopManager::Instance().GetOfflineShopVID(GetPlayerID()) : 0); #endif PacketAround(&pack, sizeof(pack)); }
FoV System with button
in Features & Metin2 Systems
Posted · Edited by Metin2 Dev
Core X - External 2 Internal
Metin2 Download
Hi guys, I thought to publish for you the adjustable version of the fov system.
Video
Github: