Jump to content

xP3NG3Rx

Honorable Member
  • Posts

    838
  • Joined

  • Days Won

    392
  • Feedback

    100%

Posts posted by xP3NG3Rx

  1. I don't think so that this will help you, but here it is what you asked for.

    Spoiler
    PyObject * playerGetElementByVID(PyObject* poSelf, PyObject* poArgs)
    {
    	DWORD dwVID = 0;
    	if (!PyTuple_GetUnsignedLong(poArgs, 0, &dwVID))
    		return Py_BadArgument();
    
    	CInstanceBase * pTargetInstance = CPythonCharacterManager::Instance().GetInstancePtr(dwVID);
    	if (!pTargetInstance)
    		return Py_BuildValue("i", 0);
    
    	CItemData * pPendantItem = NULL;
    	const DWORD dwItemVnum = pTargetInstance->GetPart(CRaceData::PART_PENDANT);
    	if (CItemManager::Instance().GetItemDataPointer(dwItemVnum, &pPendantItem))
    	{
    		for (BYTE i = 0; i < CItemData::ITEM_APPLY_MAX_NUM; ++i)
    		{
    			CItemData::TItemApply ItemApply;
    			if (!pPendantItem->GetApply(i, &ItemApply))
    				return Py_BuildException();
    
    			switch (ItemApply.wType)
    			{
    			case CItemData::APPLY_ENCHANT_ELECT:
    				return Py_BuildValue("i", CPythonNonPlayer::RACE_FLAG_ATT_ELEC);
    				break;
    			case CItemData::APPLY_ENCHANT_FIRE:
    				return Py_BuildValue("i", CPythonNonPlayer::RACE_FLAG_ATT_FIRE);
    				break;
    			case CItemData::APPLY_ENCHANT_ICE:
    				return Py_BuildValue("i", CPythonNonPlayer::RACE_FLAG_ATT_ICE);
    				break;
    			case CItemData::APPLY_ENCHANT_WIND:
    				return Py_BuildValue("i", CPythonNonPlayer::RACE_FLAG_ATT_WIND);
    				break;
    			case CItemData::APPLY_ENCHANT_EARTH:
    				return Py_BuildValue("i", CPythonNonPlayer::RACE_FLAG_ATT_EARTH);
    				break;
    			case CItemData::APPLY_ENCHANT_DARK:
    				return Py_BuildValue("i", CPythonNonPlayer::RACE_FLAG_ATT_DARK);
    				break;
    			default:
    				continue;
    			}
    		}
    	}
    
    	return Py_BuildValue("i", 0);
    }
    Spoiler
    int __cdecl playerGetElementByVID(int a1, int a2)
    {
        int result; // eax
        char v3; // al
        __int16 v4[4]; // [esp+8h] [ebp-1Ch] BYREF
        int i; // [esp+10h] [ebp-14h]
        int v6; // [esp+14h] [ebp-10h] BYREF
        _WORD *v7; // [esp+18h] [ebp-Ch] BYREF
        int v9; // [esp+20h] [ebp-4h]
    
        if ( !PyTuple_GetUnsignedLong(a2, 0, &v6) )
            return Py_BadArgument();
        v9 = CPythonCharacterManager;
        if ( !(*(int (__thiscall **)(int, int))(*(_DWORD *)(CPythonCharacterManager + 4) + 8))(
                  CPythonCharacterManager + 4,
                  v6) )
            return Py_BuildValue("i", 0);
        v3 = CInstanceBase::GetPart(6);
        if ( CItemManager::GetItemDataPointer(v3, &v7) )
        {
            for ( i = 0; i < 4; ++i )
            {
                if ( CItemData::GetApply(v7, i, (int)v4) )
                {
                    switch ( v4[0] )
                    {
                        case 99:
                            result = Py_BuildValue("i", 2048);
                            break;
                        case 100:
                            result = Py_BuildValue("i", 4096);
                            break;
                        case 101:
                            result = Py_BuildValue("i", 8192);
                            break;
                        case 102:
                            result = Py_BuildValue("i", 16384);
                            break;
                        case 103:
                            result = Py_BuildValue("i", 32768);
                            break;
                        case 104:
                            result = Py_BuildValue("i", 65536);
                            break;
                        default:
                            continue;
                    }
                    return result;
                }
            }
        }
        return Py_BuildValue("i", 0);
    }

     

     

    Btw this code has been completely removed after the renewal of the pendant system. They changed the way of the system, for monsters the values are inside the mob_proto, and for players: the second parameter of the CPythonNetworkStream::SendTargetPacket function requests the data which will be loaded from the server through packet (CPythonNetworkStreamPhaseGame.cpp[CPythonNetworkStream::RecvTargetPacket] --> game.py[ShowTargetElementEnchant] --> uitarget.py[ShowElementImg]).

    • Metin2 Dev 2
  2. announcement_metin2_de_73da7461d764aa572

    This is the hidden content, please
     or (
    This is the hidden content, please
    )
    Contains:

    • root-meta, dumped binary.
    • Every each files in a folder.

    Edit: Whole pack folder in a folder here:

    This is the hidden content, please
     or (
    This is the hidden content, please
    )

    Edit2:

    This is the hidden content, please
     or (
    This is the hidden content, please
    )

    • Metin2 Dev 215
    • kekw 1
    • Eyes 1
    • Dislove 5
    • Angry 3
    • Not Good 1
    • Sad 5
    • Cry 2
    • Think 2
    • Confused 3
    • Scream 2
    • Lmao 1
    • Good 65
    • Love 9
    • Love 119
  3. This is the hidden content, please
     (
    This is the hidden content, please
    )

    This is the hidden content, please
     (
    This is the hidden content, please
    )

    This is the hidden content, please
     (
    This is the hidden content, please
    )

    Contains:

    • root-meta, dumped binary, protos
    • Every each files are in a folder.
    • Metin2 Dev 186
    • kekw 1
    • Eyes 1
    • Dislove 4
    • Angry 4
    • Not Good 3
    • Sad 4
    • Cry 1
    • Think 2
    • Confused 6
    • Scream 5
    • Lmao 2
    • Good 80
    • Love 7
    • Love 103
  4. I would like to mention here a minor bugfix about the update packets which cause the lags on changing attributes (maybe with manual mouse drag only? dunno).
    I hope it is visible on the video, if not just test it by yourself.
     

    What you need to do with these microlags is easy, just open the interfaceModule.py and there inside the Interface class you will find a function which is the RefreshInventory.
    Every different window which has refreshable item grid, it runs down from there even if the windows isn't opened. This cause the fps drop which is visible even with human eyes.
    The solution is, you have to put an (IsShow) if statement before they run down like the way how it looks like on my side:

    	def RefreshInventory(self):
    		self.wndTaskBar.RefreshQuickSlot()
    		if self.wndInventory and self.wndInventory.IsShow():
    			self.wndInventory.RefreshItemSlot()
    		if app.ENABLE_DRAGON_SOUL_SYSTEM:
    			if self.wndDragonSoul and self.wndDragonSoul.IsShow():
    				self.wndDragonSoul.RefreshItemSlot()
    		if app.ENABLE_EXTEND_INVEN_SYSTEM and app.ENABLE_SEPARATED_EXTEND_INVEN_WINDOW:
    			if self.wndInventoryEx and self.wndInventoryEx.IsShow():
    				self.wndInventoryEx.RefreshItemSlot()
    		if app.ENABLE_MOVE_COSTUME_ATTR or app.ENABLE_MOVE_SASH_ATTR:
    			if app.GetMoveAttrWindowOpen():
    				if self.wndItemCombination and self.wndItemCombination.IsShow():
    					self.wndItemCombination.RefreshCombSlotWindow()
    		if app.ENABLE_SHOULDER_SASH_SYSTEM:
    			if player.GetAcceRefineWindowOpen():
    				if self.wndAcce and self.wndAcce.IsShow():
    					self.wndAcce.RefreshAcceWindow()
    		if app.ENABLE_CHANGE_LOOK_SYSTEM:
    			if player.GetChangeLookWindowOpen():
    				if self.wndChangeLook and self.wndChangeLook.IsShow():
    					self.wndChangeLook.RefreshChangeLookWindow()
    		if self.wndAttr67Add and self.wndAttr67Add.IsShow():
    			self.wndAttr67Add.RefreshAttr67Window()
    		if app.ENABLE_AURA_SYSTEM:
    			if player.IsAuraRefineWindowOpen():
    				if self.wndAura and self.wndAura.IsShow():
    					self.wndAura.RefreshAuraWindow()
    • Metin2 Dev 46
    • Dislove 1
    • Angry 1
    • Scream 1
    • Good 13
    • Love 1
    • Love 7
  5. It depends. Shall we need the functionality of the ALT in the game to change the quickslot page and show the names around our character when the window is opened or not? Due the fact the keydown process is not executing during the change, I think the best solution is to block the keyup function too when the board is opened. Ofc it need some checks too, although the keychange processed with the OnKeyDown function.

  6. I just discovered a small bug with the OnKeyDown function in python which is there even on the official servers too.
    It will never execute the binary side OnKeyDown with the ALT key when the KeySettingBoard is opened.
    Howover the OnKeyUp always executes. So the quickslot paging will be decreased all the time when you hit the ALT key.

  7. Nice 😉.

    If I know well (not sure, but) on the official it stores the attributes when the player get kicked or warped or whatever, on the next login the window will show up again like the luckybox.
    I've done it like that way, even when shutdown or reboot happens.

    Even if this isn't the official way, it's a player friendly feature.

    Spoiler

    YmlQZuN.png

     

    • Good 2
  8. Thanks for share, here are some missing ones.

    Ship Defense (Hydra)

    Spoiler

    login.jpg

    Spoiler

    2Fu1036.jpeg

    loading0.jpg

    Spoiler

    RDt1Srj.jpeg

    loading1.jpg

    Spoiler

    ah7jyUF.jpeg

    loading2.jpg

    Spoiler

    IfcBJGO.jpeg

     

    Chinese Zodiac Temple (12zi)

    Spoiler

    login.jpg

    Spoiler

    MveRQxV.jpeg

    loading0.jpg

    Spoiler

    DY2UdaG.jpeg

    loading1.jpg

    Spoiler

    856hO1t.jpeg

    loading2.jpg

    Spoiler

    zmKaGw5.jpeg

    loading3.jpg

    Spoiler

    i7suTOe.jpeg

    loading4.jpg

    Spoiler

    OwAod3a.jpeg

    loading5.jpg

    Spoiler

    Lhmbk9K.jpeg

    loading6.jpg

    Spoiler

    61bh87Y.jpeg

    loading7.jpg

    Spoiler

    HHeTWBK.jpeg

    loading8.jpg

    Spoiler

    uy5tOCk.jpeg

    loading9.jpg

    Spoiler

    3G5Hsti.jpeg

    loading10.jpg

    Spoiler

    CjnJl7O.jpeg

    loading11.jpg

    Spoiler

    J9oSLc9.jpeg

     

    Elemental Realm

    Spoiler

    login.jpg

    Spoiler

    o8iwiXR.jpeg

    loading0.jpg

    Spoiler

    274vUbi.jpeg

    loading1.jpg

    Spoiler

    nHIejtO.jpeg

    loading2.jpg

    Spoiler

    hQWfBn9.jpeg

     

    Plateau of Illusions

    Spoiler

    login.jpg

    Spoiler

    TAOLyBt.jpeg

    loading0.jpg

    Spoiler

    50teXuW.jpeg

    loading1.jpg

    Spoiler

    qLJASfj.jpeg

    loading2.jpg

    Spoiler

    HUbd0E7.jpeg

    loading3.jpg

    Spoiler

    0kgTnMF.jpeg

     

    Conquerors of Yohara

    Spoiler

    login.jpg

    Spoiler

    SIZIBaH.jpeg

    loading0.jpg

    Spoiler

    xMRaajR.jpeg

    loading1.jpg

    Spoiler

    i55eE0z.jpeg

    loading2.jpg

    Spoiler

    Gy7b0sJ.jpeg

    loading3.jpg

    Spoiler

    54BC3qk.jpeg

     

    Curse of the Serpent Queen

    Spoiler

    login.jpg

    Spoiler

    umTwiMx.jpeg

    loading0.jpg

    Spoiler

    QaVKmOe.jpeg

    loading1.jpg

    Spoiler

    XtQPiUS.jpeg

    loading2.jpg

    Spoiler

    wSUV3Sl.jpeg

    loading3.jpg

    Spoiler

    1SnW7Fe.jpeg

     

    Legend of the White Dragon

    Spoiler

    login.jpg

    Spoiler

    xWc8O6v.jpeg

    loading0.jpg

    Spoiler

    dMw4rKg.jpeg

    loading1.jpg

    Spoiler

    F8uPXYW.jpeg

    loading2.jpg

    Spoiler

    O1g6Ujy.jpeg

    loading3.jpg

    Spoiler

    WdVWURQ.jpeg

     

    Dawn of the Lycans

    Spoiler

    loading0.jpg

    Spoiler

    o6C77RL.jpeg

    loading1.jpg

    Spoiler

    CTOWiJB.jpeg

    loading2.jpg

    Spoiler

    6Gv9mYZ.jpeg

    loading3.jpg

    Spoiler

    bMHF4vB.jpeg

    loading4.jpg

    Spoiler

    xHOjUG4.jpeg

    loading5.jpg

    Spoiler

    ghGYchR.jpeg

     

     

    • Metin2 Dev 8
    • kekw 2
    • Think 1
    • Scream 1
    • Good 9
    • Love 3
    • Love 10
  9. FMU0O3q.jpeg

    This is the hidden content, please
     (
    This is the hidden content, please
    )

    Contents:

    • root-meta, dumped binary, protos(out of date, types/values will be checked later)
    • New map with dungeon and monsters, npcs, objects.
    • New weapons, pet(2x textures), new mount.
    • All files are unpacked in a folder.

    Demo.

    Spoiler

     

     

    • Metin2 Dev 177
    • Eyes 3
    • Dislove 8
    • Angry 3
    • Not Good 3
    • Sad 3
    • Smile Tear 2
    • Think 1
    • Scream 5
    • Lmao 1
    • Good 93
    • Love 20
    • Love 183
  10. M2 Download Center

    This is the hidden content, please
      ( Internal )

    Hello everyone.

    I've got this request long time ago to extend the OutLine coloring feature for the TextLines to make beautiful texts via Python.
    As you might know there is the ConquerorLevel text which also uses this feature just binary sided.
    With this small code you will be able to recolor the OutLine of the textlines from python scripts.

    Demo:

    Spoiler

    Images:

    Spoiler

    VI5ynXE.png  KcDVAdN.png   jeisAt5.png

    Video:

    Spoiler

     

     

     

    Guide:

    Spoiler

    1.) EterPythonLib/PythonWindowManagerModule.cpp >> Declare the following function and add to the method list:

    PyObject * wndTextSetOutLineColor(PyObject * poSelf, PyObject * poArgs)
    {
    	UI::CWindow * pWindow;
    	if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
    		return Py_BuildException();
    
    	if (2 == PyTuple_Size(poArgs))
    	{
    		DWORD dwColor;
    		// <!> PyTuple_GetUnsignedLong might cause some problems, change it if you need <!>
    		if (!PyTuple_GetUnsignedLong(poArgs, 1, &dwColor))
    			return Py_BuildException();
    		((UI::CTextLine*)pWindow)->SetOutLineColor(dwColor);
    	}
    	else if (5 == PyTuple_Size(poArgs))
    	{
    		float fr;
    		if (!PyTuple_GetFloat(poArgs, 1, &fr))
    			return Py_BuildException();
    		float fg;
    		if (!PyTuple_GetFloat(poArgs, 2, &fg))
    			return Py_BuildException();
    		float fb;
    		if (!PyTuple_GetFloat(poArgs, 3, &fb))
    			return Py_BuildException();
    		float fa;
    		if (!PyTuple_GetFloat(poArgs, 4, &fa))
    			return Py_BuildException();
    
    		((UI::CTextLine*)pWindow)->SetOutLineColor(fr, fg, fb, fa);
    	}
    	else
    	{
    		return Py_BuildException();
    	}
    
    	return Py_BuildNone();
    }
    
    //// 
    
    		{ "SetOutLineColor",			wndTextSetOutLineColor,				METH_VARARGS },

    2.) EterPythonLib/PythonWindow.h >> Add the following lines into the CTextLine class as 'public' (recommended below of the SetFontColor):

    			void SetOutLineColor(DWORD dwColor);
    			void SetOutLineColor(float fR, float fG, float fB, float fA);

    3.) EterPythonLib/PythonWindow.cpp >> Declare the new functions (recommended below of the CTextLine::SetFontColor):

    	void CTextLine::SetOutLineColor(DWORD dwColor)
    	{
    		m_TextInstance.SetOutLineColor(dwColor);
    	}
    	void CTextLine::SetOutLineColor(float fR, float fG, float fB, float fA)
    	{
    		m_TextInstance.SetOutLineColor(fR, fG, fB, fA);
    	}

    4.) root/ui.py >> Add these functions into the TextLine class (recommended below of the SetPackedFontColor):

    	def SetOutLineColor(self, red, green, blue, alpha):
    		wndMgr.SetOutLineColor(self.hWnd, red, green, blue, alpha)
    
    	def SetPackedOutLineColor(self, color):
    		wndMgr.SetOutLineColor(self.hWnd, color)

     

     

    Test Script:

    Spoiler

     

    Any problem --> Comment below 👇
    Greetz

    • Metin2 Dev 38
    • Confused 1
    • Lmao 1
    • Good 11
    • Love 5
    • Love 37
  11. Firts of all I think the section is wrong where you opened the topic.
    Secondly Pete's code for LocalPos is also wrong.

    Here is the right one:

    Spoiler
    // PythonWindowManagerModule.cpp
    PyObject * wndMgrGetSlotLocalPosition(PyObject * poSelf, PyObject * poArgs)
    {
    	UI::CWindow * pWin;
    	if (!PyTuple_GetWindow(poArgs, 0, &pWin))
    		return Py_BuildException();
    
    	int iSlotIndex;
    	if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
    		return Py_BuildException();
    
    	if (!pWin->IsType(UI::CSlotWindow::Type()))
    	{
    #ifdef _DEBUG
    		TraceError("wndMgr.GetSlotLocalPosition : not a slot window");
    #endif
    		return Py_BuildException();
    	}
    
    	int iX = 0, iY = 0;
    	UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
    	pSlotWin->GetSlotLocalPosition((DWORD)iSlotIndex, &iX, &iY);
    	return Py_BuildValue("ii", iX, iY);
    }
    
    PyObject * wndMgrGetSlotGlobalPosition(PyObject * poSelf, PyObject * poArgs)
    {
    	UI::CWindow * pWin;
    	if (!PyTuple_GetWindow(poArgs, 0, &pWin))
    		return Py_BuildException();
    
    	int iSlotIndex;
    	if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
    		return Py_BuildException();
    
    	if (!pWin->IsType(UI::CSlotWindow::Type()))
    	{
    #ifdef _DEBUG
    		TraceError("wndMgr.GetSlotGlobalPosition : not a slot window");
    #endif
    		return Py_BuildException();
    	}
    
    	int iX = 0, iY = 0;
    	UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
    	pSlotWin->GetSlotGlobalPosition((DWORD)iSlotIndex, &iX, &iY);
    	return Py_BuildValue("ii", iX, iY);
    }
    
    
    // PythonSlotWindow.h
    		public:
    			bool GetSlotLocalPosition(DWORD dwIndex, int * iX, int * iY);
    			bool GetSlotGlobalPosition(DWORD dwIndex, int * iX, int * iY);
    
    // PythonSlotWindow.cpp
    bool CSlotWindow::GetSlotLocalPosition(DWORD dwIndex, int * iX, int * iY)
    {
    	TSlot * pSlot;
    	if (!GetSlotPointer(dwIndex, &pSlot))
    		return false;
    
    	*iX = pSlot->ixPosition;
    	*iY = pSlot->iyPosition;
    	return true;
    }
    
    bool CSlotWindow::GetSlotGlobalPosition(DWORD dwIndex, int * iX, int * iY)
    {
    	TSlot * pSlot;
    	if (!GetSlotPointer(dwIndex, &pSlot))
    		return false;
    
    	*iX = m_rect.left + pSlot->ixPosition;
    	*iY = m_rect.top + pSlot->iyPosition;
    	return true;
    }

     

     

    • Metin2 Dev 1
    • Love 3
×
×
  • 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.