Jump to content

Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

Hallo all

 
.gif
 
c++ :
 
open EterPythonLib/PythonSlotWindow.cpp
 
Spoiler

 

 
find
 
void CSlotWindow::DisableSlot(DWORD dwIndex)
 
after this function add :
 
void CSlotWindow::SetUnusableSlot(DWORD dwIndex)
{
 TSlot * pSlot;
 if (!GetSlotPointer(dwIndex, &pSlot))
  return;
 
 
 
 SET_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE);
 //pSlot->dwState |= SLOT_STATE_UNUSABLE;
}
 
 
 
void CSlotWindow::SetUsableSlot(DWORD dwIndex)
{
 TSlot * pSlot;
 if (!GetSlotPointer(dwIndex, &pSlot))
  return;
 REMOVE_BIT(pSlot->dwState, SLOT_STATE_UNUSABLE);
 //pSlot->dwState ^= SLOT_STATE_UNUSABLE;
}
 
now find :
 
if (rSlot.pFinishCoolTimeEffect)
 
after this block add  ( this part by xP3NG3Rx ?
 
if (IS_SET(rSlot.dwState, SLOT_STATE_UNUSABLE))
  {
   CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f, 0.3f);
   CPythonGraphic::Instance().RenderBar2d(m_rect.left + rSlot.ixPosition,
    m_rect.top + rSlot.iyPosition,
    m_rect.left + rSlot.ixPosition + rSlot.byxPlacedItemSize * ITEM_WIDTH,
    m_rect.top + rSlot.iyPosition + rSlot.byyPlacedItemSize * ITEM_HEIGHT);
  }
 

 

 
 
 
 
now open
 
EterPythonLib/PythonSlotWindow.h
 
Spoiler

 

 
find : SLOT_STATE_ALWAYS_RENDER_COVER = (1 << 3)
 
add after it :
 
SLOT_STATE_UNUSABLE = (1 << 4),
 
now find : BOOL IsEnableSlot(DWORD dwIndex);
 
add after it :
 
   void SetUnusableSlot(DWORD dwIndex);
   void SetUsableSlot(DWORD dwIndex);
 

 

 

 
now open :
 
/EterPythonLib/PythonWindowManagerModule.cpp
 
Spoiler

 

 

 
find :
 
PyObject * wndMgrDisableSlot(PyObject * poSelf, PyObject * poArgs)
 
after this function add :
 
PyObject * wndMgrSetUnusableSlot(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()))
  return Py_BuildException();
 
 
 
 UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
 pSlotWin->SetUnusableSlot(iSlotIndex);
 return Py_BuildNone();
}
 
 
 
PyObject * wndMgrSetUsableSlot(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()))
  return Py_BuildException();
 
 
 
 UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
 pSlotWin->SetUsableSlot(iSlotIndex);
 return Py_BuildNone();
}
 

now find :
 
{ "DisableSlot",    wndMgrDisableSlot,     METH_VARARGS },
 
add :
 
  { "SetUnusableSlot",   wndMgrSetUnusableSlot,    METH_VARARGS },
  { "SetUsableSlot",    wndMgrSetUsableSlot,    METH_VARARGS },
 

 

 
 
now open:
 
/UserInterface/PythonNetworkStreamPhaseGame.cpp
 
 
Spoiler

 

 
( thx to martysama0134 )
 
find : PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "StartExchange", Py_BuildValue("()"));
 
add after it :
 
__RefreshInventoryWindow();
 
 
 

 

now python part
 
Spoiler

 


open :root/ui.py
 
 
find : def EnableSlot(self, slotIndex):
 
after this def add :
 
def SetUnusableSlot(self, slotIndex):
  wndMgr.SetUnusableSlot(self.hWnd, slotIndex)
 
 def SetUsableSlot(self, slotIndex):
  wndMgr.SetUsableSlot(self.hWnd, slotIndex)
 

 

 
 
 
open : root/uiinventory.py
 
 
Spoiler

 

 

 

 

add
 
import exchange
 
find : self.wndCostume = None
 
add : self.listUnusableSlot = []
 

find : setItemVNum(i, itemVnum, itemCount)
 
add :
 
   if exchange.isTrading() and item.IsAntiFlag(item.ANTIFLAG_GIVE):
    self.wndItem.SetUnusableSlot(i)
    self.listUnusableSlot.append(i)
   elif not exchange.isTrading() and item.IsAntiFlag(item.ANTIFLAG_GIVE) and slotNumber in self.listUnusableSlot:
    self.wndItem.SetUsableSlot(i)
    self.listUnusableSlot.remove(i)
 
 

 

 

 


ok that's it , have a nice day :)
 
 
 
 
 
 

 

  • Metin2 Dev 24
  • Good 7
  • Love 1
  • Love 27

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/
Share on other sites

Just now, xP3NG3Rx said:

Watafak are you talking about, txt-sql? xD

Anyway this system is a part of the full system.

  Hide contents

Coming soon... :)

 

i belive this will work with txt. Cuz there u can mark itens with  ANTIFLAG_GIVE but its complicate do set this in mysql, right?

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71534
Share on other sites

36 minutes ago, OceanusPT said:

 

i belive this will work with txt. Cuz there u can mark itens with  ANTIFLAG_GIVE but its complicate do set this in mysql, right?

Man, when server loads the txt it converts string to numbers (like mysql) ANTIFLAG_GIVE is an antiflag number.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71538
Share on other sites

1 hour ago, OceanusPT said:

 

i belive this will work with txt. Cuz there u can mark itens with  ANTIFLAG_GIVE but its complicate do set this in mysql, right?

I wrote this for you: http://sandbox.onlinephpfunctions.com/code/9194d1bac0985bcc9a35834ba6dd95e20651ef8d (it's easy to understand, find "$current_antiflag" and set your item's antiflag, after use the set_bit function to set a new flag).

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71541
Share on other sites

2 hours ago, Shang said:

Man, when server loads the txt it converts string to numbers (like mysql) ANTIFLAG_GIVE is an antiflag number.

hum... i dont know that! Ty for the info

 

2 hours ago, .Devil. said:

I wrote this for you: http://sandbox.onlinephpfunctions.com/code/9194d1bac0985bcc9a35834ba6dd95e20651ef8d (it's easy to understand, find "$current_antiflag" and set your item's antiflag, after use the set_bit function to set a new flag).

taks Devil. I get it yes. Ty for this tutorial.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71547
Share on other sites

  • Premium

ok thx for the notice

thix fix will make the system work on all pages

change:

Spoiler

    self.wndItem.SetUnusableSlot(slotNumber)
    self.listUnusableSlot.append(slotNumber)

for :
 

Spoiler

 

    self.wndItem.SetUnusableSlot(i)
    self.listUnusableSlot.append(i)

 

and :

Spoiler

    self.wndItem.SetUsableSlot(slotNumber)
    self.listUnusableSlot.remove(slotNumber)

for :

Spoiler

    self.wndItem.SetUsableSlot(i)
    self.listUnusableSlot.remove(i)

 

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71557
Share on other sites

  • Premium
20 minutes ago, finaltorment said:

another problem now, seems he don't refresh well the pages now.

Explain more

ok edit this

self.listUnusableSlot.remove(I)
self.listUnusableSlot.append(I)

to

self.listUnusableSlot.remove(i)
self.listUnusableSlot.append(i)

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71560
Share on other sites

  • Premium

EDIT 
sorry my fault all work fine, the problem was you write:
self.listUnusableSlot.remove(I)

but it must be:
self.listUnusableSlot.remove(i)

9 minutes ago, Chris90909090909090 said:

@ penger what do you mean with is not this complet system?

he mean that shop and safebox part is missed.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71563
Share on other sites

  • Premium
3 hours ago, veilles said:

Can someone help how to add this for safebox ? I can't find function which checking is that safebox is opened. I need something like this: "exchange.isTrading()"

try to make one , it's not hard

1 hour ago, Shang said:

Why are you appending the slots in a list if you don't use the list?

open your eyes

and slotNumber in self.listUnusableSlot:

1 hour ago, ImTweet said:

Same for shops ? 

player.IsOpenPrivateShop() and item.IsAntiFlag(item.ANTIFLAG_MYSHOP

 

  • Love 1

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/12423-non-tradeable-items-effect/#findComment-71669
Share on other sites

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.