Jump to content

Extend NPC Shop to 80 Items


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Hello,
 
To extend NPC Shop to 80 Items follow these steps.
 
ServerSide
 
Open "common/length.h" and search:

SHOP_HOST_ITEM_MAX_NUM = 40

 
Replace with:

SHOP_HOST_ITEM_MAX_NUM = 80

 
In the same file search:

SHOP_PRICELIST_MAX_NUM = 40

 
Replace with:

SHOP_PRICELIST_MAX_NUM = 80

 
Now open "game/shop.cpp" and search:

m_pGrid = M2_NEW CGrid(5, 9)

 
Replace with:

m_pGrid = M2_NEW CGrid(10, 9)

 
Now open "game/shop_manager.cpp" and search:

CGrid grid = CGrid(5, 9)

 
Replace with:

CGrid grid = CGrid(10, 9)

 
 
Now compile Db File & Game File and ServerSide's steps complete.
 
 
 
ClientSide
 

NOTE: If you want Only NPC Shop's with 80 Items follow this guide, else if you want NPC Shop & Private Shop follow the Update Istruction.

Extract "pack/uiscript" from your Client and open "shopdialog.py".
 
Now reaplace all content with:


Shopdialog.py ~ 80 Items
 
Now create "shopdialog2.py" and insert this content:

ShopDialog2 ~ 80 Items for Shop
 
Ok, at this point you can compress your UiScript with the new file "shopdialog2.py".
 
Extract "pack/root" from your Client and open "interfacemodule.py"
 
Search this: 

self.dlgShop = uiShop.ShopDialog()
self.dlgShop.LoadDialog()
self.dlgShop.Hide()

 
After add:

self.dlgShop2 = uiShop.ShopDialog2()
self.dlgShop2.LoadDialog()
self.dlgShop2.Hide()

 
Same file, search this:

def OpenShopDialog(self, vid):
  self.wndInventory.Show()
  self.wndInventory.SetTop()
  self.dlgShop.Open(vid)
  self.dlgShop.SetTop()

 
After add:

def OpenShopDialog2(self, vid):
  self.wndInventory.Show()
  self.wndInventory.SetTop()
  self.dlgShop2.Open(vid)
  self.dlgShop2.SetTop()

 
Now open "game.py" and Search:

def StartShop(self, vid):
  self.interface.OpenShopDialog(vid)

Replace with:

def StartShop(self, vid):
if chr.IsNPC(vid):
  self.interface.OpenShopDialog(vid)
else:
  self.interface.OpenShopDialog2(vid)

Now open "uishop.py" and Search:

def Close(self):
 self.OnCloseQuestionDialog()
 shop.Close()
 net.SendShopEndPacket()
 self.CancelShopping()
 self.tooltipItem.HideToolTip()
 self.Hide()

 
Replace with:

def Close(self):
 self.OnCloseQuestionDialog()
 shop.Close()
 net.SendShopEndPacket()
 self.CancelShopping()
 self.Hide()

 
Same file, search:

def OnUpdate(self):

USE_SHOP_LIMIT_RANGE = 1000

(x, y, z) = player.GetMainCharacterPosition()
if abs(x - self.xShopStart) > USE_SHOP_LIMIT_RANGE or abs(y - self.yShopStart) > USE_SHOP_LIMIT_RANGE:
self.Close()

 
After add:
UiShop.py ~ ShopDialog2
 

Now you can compress "root" file.
 
 
#Update [24-02-15]

  • Fixed Client Bug.
  • Changes in "shop_manager.cpp" added.

#Update [26-02-15]

  • Added PrivateShop with 80 Items.

NPC & PrivateShop with 80 Items ClientSide:
  
Open "UserInterface/Packet.h" in you Binary Client Source and Search:

SHOP_HOST_ITEM_MAX_NUM = 40

 
Replace with:

SHOP_HOST_ITEM_MAX_NUM = 80

 
Now you can compile your Binary Source.
 
Open your Client File and extract "pack/uiscript". Open "shopdialog.py" and replace all contentwith:
Shopdialog.py ~ 80 Items
 
Now open "privateshopbuilder.py" and replace all content with:
PrivateShopBuilder ~ 80 Items
 
Now you can compress your UiScript.
 
Screen Private Shop:

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

Et Voilà, we ended.
https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif
Good work,
Bye.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 54
  • kekw 2
  • Angry 1
  • Sad 1
  • Confused 1
  • Lmao 2
  • Good 25
  • muscle 1
  • Love 3
  • Love 59

- To know how to hide one's ability is great skill. -

Link to comment
Share on other sites

  • Premium

Ehm, error
 

0224 07:52:22605 :: Failed to load script file : UIScript/shopdialog.py
0224 07:52:22669 :: 
ui.py(line:2773) LoadScriptFile
system.py(line:192) execfile
system.py(line:161) Run
system.py(line:177) __LoadTextFile__

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.SyntaxError'>:invalid syntax (UIScript/shopdialog.py, line 43)

0224 07:52:22669 :: ============================================================================================================
0224 07:52:22669 :: Abort!!!!

  • Good 1


 

Link to comment
Share on other sites

0224 11:07:20062 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
0224 11:07:25831 :: Failed to load script file : UIScript/shopdialog.py
0224 11:07:25834 :: 
ui.py(line:2767) LoadScriptFile
system.py(line:192) execfile
system.py(line:161) Run
system.py(line:177) __LoadTextFile__
 
LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.SyntaxError'>:invalid syntax (UIScript/shopdialog.py, line 43)
 
0224 11:07:25834 :: ============================================================================================================
0224 11:07:25834 :: Abort!!!!
 
 
0224 11:07:25836 :: 
uiShop.py(line:55) LoadDialog
ui.py(line:2784) LoadScriptFile
exception.py(line:36) Abort
 
ShopDialog.LoadDialog.LoadObject - <type 'exceptions.SystemExit'>:
 
0224 11:07:25836 :: ============================================================================================================
0224 11:07:25836 :: Abort!!!!
 
 
 
Error ,
Link to comment
Share on other sites

0224 11:07:20062 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
0224 11:07:25831 :: Failed to load script file : UIScript/shopdialog.py
0224 11:07:25834 :: 
ui.py(line:2767) LoadScriptFile
system.py(line:192) execfile
system.py(line:161) Run
system.py(line:177) __LoadTextFile__
 
LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.SyntaxError'>:invalid syntax (UIScript/shopdialog.py, line 43)
 
0224 11:07:25834 :: ============================================================================================================
0224 11:07:25834 :: Abort!!!!
 
 
0224 11:07:25836 :: 
uiShop.py(line:55) LoadDialog
ui.py(line:2784) LoadScriptFile
exception.py(line:36) Abort
 
ShopDialog.LoadDialog.LoadObject - <type 'exceptions.SystemExit'>:
 
0224 11:07:25836 :: ============================================================================================================
0224 11:07:25836 :: Abort!!!!
 
 
 
Error ,
Link to comment
Share on other sites

0224 11:07:20062 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
0224 11:07:25831 :: Failed to load script file : UIScript/shopdialog.py
0224 11:07:25834 :: 
ui.py(line:2767) LoadScriptFile
system.py(line:192) execfile
system.py(line:161) Run
system.py(line:177) __LoadTextFile__
 
LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.SyntaxError'>:invalid syntax (UIScript/shopdialog.py, line 43)
 
0224 11:07:25834 :: ============================================================================================================
0224 11:07:25834 :: Abort!!!!
 
 
0224 11:07:25836 :: 
uiShop.py(line:55) LoadDialog
ui.py(line:2784) LoadScriptFile
exception.py(line:36) Abort
 
ShopDialog.LoadDialog.LoadObject - <type 'exceptions.SystemExit'>:
 
0224 11:07:25836 :: ============================================================================================================
0224 11:07:25836 :: Abort!!!!
 
 
 
Error ,
Link to comment
Share on other sites

  • Premium

Now I have returned the original treatment I had and still

Boot: shop table size error

@SamuR f***k you. For bug core.

 

He release something and you insult him... His tutorial is correct, I'm pretty sure. If you doing something wrong, it's your fault.

 

And you still can reverse the tutorial (use original files).

  • Love 1
Link to comment
Share on other sites

Now I have returned the original treatment I had and still

Boot: shop table size error

@SamuR f***k you. For bug core.

He release something and you insult him... His tutorial is correct, I'm pretty sure. If you doing something wrong, it's your fault.

And you still can reverse the tutorial (use original files).

Thank you man

  • Love 1

- To know how to hide one's ability is great skill. -

Link to comment
Share on other sites

Announcements



×
×
  • 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.