|
You last visited: Today at 15:47
Advertisement
[C++ & PY]Non-Tradeable-Items-Effect
Discussion on [C++ & PY]Non-Tradeable-Items-Effect within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
06/30/2016, 02:48
|
#1
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 336
|
[C++ & PY]Non-Tradeable-Items-Effect
Hallo all
system : http://imgur.com/npIy2b4
c++ :
open EterPythonLib/PythonSlotWindow.cpp
PHP Code:
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 [COLOR="Red"]xP3NG3Rx [/COLOR]):
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
PHP Code:
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
PHP Code:
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
PHP Code:
( thx to [COLOR="red"]martysama0134 [/COLOR])
find : PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "StartExchange", Py_BuildValue("()"));
add after it :
__RefreshInventoryWindow();
now python part
open :root/ui.py
PHP Code:
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
PHP Code:
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 
|
|
|
06/30/2016, 04:16
|
#2
|
elite*gold: 0
Join Date: Sep 2012
Posts: 184
Received Thanks: 19
|
its with red effect?
ty for this
|
|
|
06/30/2016, 04:56
|
#3
|
elite*gold: 0
Join Date: Feb 2012
Posts: 95
Received Thanks: 29
|
Quote:
Originally Posted by Chris9090909090
its with red effect?
ty for this
|
change the color from here:
PHP Code:
CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f, 0.3f);
the last arg (0.3) is for the alpha channel (aka opacity it will look a bit gray)
|
|
|
06/30/2016, 06:23
|
#4
|
elite*gold: 0
Join Date: Jan 2013
Posts: 12
Received Thanks: 0
|
seems only work in 1st page of inventory
|
|
|
06/30/2016, 06:53
|
#5
|
elite*gold: 0
Join Date: Nov 2012
Posts: 29
Received Thanks: 7
|
Better is LockSlot, only change color
|
|
|
06/30/2016, 11:35
|
#6
|
elite*gold: 0
Join Date: Jun 2012
Posts: 58
Received Thanks: 13
|
Not only in exchange is shown this effect man.
|
|
|
06/30/2016, 12:09
|
#7
|
elite*gold: 0
Join Date: May 2015
Posts: 15
Received Thanks: 8
|
Quote:
Originally Posted by Finaltorment
seems only work in 1st page of inventory
|
Change:
for i in xrange(player.INVENTORY_PAGE_SIZE*2):
for:
for i in xrange(player.INVENTORY_PAGE_SIZE*4): #4 pages
It will be fine.
|
|
|
06/30/2016, 15:05
|
#8
|
elite*gold: 0
Join Date: Jan 2013
Posts: 12
Received Thanks: 0
|
Quote:
Originally Posted by filipw1
Change:
for i in xrange(player.INVENTORY_PAGE_SIZE*2):
for:
for i in xrange(player.INVENTORY_PAGE_SIZE*4): #4 pages
It will be fine.
|
i try it but don't work, i only see the effect on 1st page.
|
|
|
06/30/2016, 15:42
|
#9
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 336
|
ok thx for the notice
thix fix will make the system work on all pages
change:
<b>
PHP Code:
self.wndItem.SetUnusableSlot(slotNumber) self.listUnusableSlot.append(slotNumber)
for :
self.wndItem.SetUnusableSlot(i) self.listUnusableSlot.append(i)
and :
PHP Code:
self.wndItem.SetUsableSlot(slotNumber) self.listUnusableSlot.remove(slotNumber)
for :
self.wndItem.SetUsableSlot(i) self.listUnusableSlot.remove(i)
|
|
|
07/01/2016, 00:54
|
#10
|
elite*gold: 0
Join Date: Oct 2015
Posts: 106
Received Thanks: 0
|
More guys testet? Its working fine?
|
|
|
07/01/2016, 02:07
|
#11
|
elite*gold: 0
Join Date: Jan 2013
Posts: 12
Received Thanks: 0
|
yes is work fine
|
|
|
07/01/2016, 10:46
|
#12
|
elite*gold: 0
Join Date: Mar 2013
Posts: 57
Received Thanks: 10
|
Thanks !
Effect only at Inventory page 1
Quote:
Originally Posted by MrLibya
ok thx for the notice
thix fix will make the system work on all pages
change:
<b>
PHP Code:
self.wndItem.SetUnusableSlot(slotNumber)
self.listUnusableSlot.append(slotNumber)
for :
self.wndItem.SetUnusableSlot(i)
self.listUnusableSlot.append(i)
and :
PHP Code:
self.wndItem.SetUsableSlot(slotNumber)
self.listUnusableSlot.remove(slotNumber)
for :
self.wndItem.SetUsableSlot(i)
self.listUnusableSlot.remove(i)
|
Without this fix, it works fine
|
|
|
07/01/2016, 11:33
|
#13
|
elite*gold: 0
Join Date: Apr 2016
Posts: 60
Received Thanks: 21
|
Vielen dank dafür.
|
|
|
07/07/2016, 09:57
|
#14
|
elite*gold: 0
Join Date: Sep 2013
Posts: 56
Received Thanks: 15
|
I only see the effects of Page 1
|
|
|
07/07/2016, 11:11
|
#15
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 336
|
Quote:
Originally Posted by AmerigoMendosa
I only see the effects of Page 1

|
've put the fix up there ( while I think the topic is updated with the fix )
|
|
|
 |
|
Similar Threads
|
[HELP] Start items tradeable a non tradeable item!
11/02/2015 - SRO Private Server - 4 Replies
Anyone help me to make started item tradeable to non tradeable ? :confused:
|
[Tuturial]Trading non-tradeable items tradeable without Item.SDATA
02/16/2015 - Shaiya Hacks, Bots, Cheats & Exploits - 13 Replies
Hello :p
I'm making this release
We can trade non-tradeable items tradeable.
Steps
1] Open Shaiya Packet Editor
|
Tradeable items / Pshop
12/19/2012 - Dekaron Private Server - 10 Replies
got a question ive searched columns in csvs but cudnt find any of them for making an item Trable able or selling in personal shops.
any 1 who knows the columns for it ? thanks for ur time!
EDIT: found it , edit column "Weight" 0 = No trade 1 = Tradeable!
if u edit this u can trade or put items in personal shop like costumes etc!
for the ppl who also wanna know
|
Tradeable Items
03/09/2010 - Dekaron - 10 Replies
I remember back in the good old days of winhex when I first started hacking, I came across the item section that determined whether or not items were tradeable. I have a new idea for something that I would like to try, and it involves making non-tradeable items tradeable.
So I've been looking through the CSV's and can't seem to find the correct one. Anybody mind helping me out? (I feel dumb asking this, but I am seriously at a loss here...)
|
non tradeable items
04/26/2009 - Dekaron - 3 Replies
hi guys i recall reading some day a post about how to trade untreadable items.
It included hex editing(if i remember well) changing something from 0 to 1 or opositte.. ( or not??):confused:
If any1 remembers link of post, got an idea, know how that can be done, tips, i would be happy to transfer the vc's from old farmer to main..
If u dont want be leeched pm's accepted..
|
All times are GMT +2. The time now is 15:47.
|
|