Jump to content

Extend NPC Shop to 80 Items


Recommended Posts

M2 Download Center

Hidden Content

    Give reaction to this post to see the hidden content.
( 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:


Hidden Content

    Give reaction to this post to see the hidden content.

 
Now create "shopdialog2.py" and insert this content:

Hidden Content

    Give reaction to this post to see the hidden content.

 
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:

Hidden Content

    Give reaction to this post to see the hidden content.

 

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:

Hidden Content

    Give reaction to this post to see the hidden content.

 
Now open "privateshopbuilder.py" and replace all content with:

Hidden Content

    Give reaction to this post to see the hidden content.

 
Now you can compress your UiScript.
 
Screen Private Shop:
http://s11.postimg.org/7eqsq708j/Item_Shop_Ch1.png

Et Voilà, we ended.
http://s23.postimg.org/qj1d0e9u1/Item_Shop_Size80_Post.png
Good work,
Bye.

  • Love 15

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

Link to comment
  • VIP

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!!!!

If code.isTurkisch:
    self.suicide();
elif code.isPoland:
   self.giveHate()

 

Link to comment
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
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
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

In yout error case, the problem is Tab character. Check "shopdialog.py" file.

And Private Shop ? When I make a Private Shop have a Slots problem

Wow, thank you. I totally forgot it!

Today I'll post the fix.

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

Link to comment
  • VIP

Now I have returned the original treatment I had and still
Boot: shop table size error



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

If code.isTurkisch:
    self.suicide();
elif code.isPoland:
   self.giveHate()

 

Link to comment
  • VIP

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

Now I have returned the original treatment I had and still

Boot: shop table size error

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

I'll give you my Skype contact and I'll help you. I'm out now, when I come back home I'll fix your error.

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

Link to comment

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Read our Rules
  • Activity

    1. 2

      [Python] Code Translator 2 to 3

    2. 0

      bug gaya

    3. 5

      Fix Core Crash (unused serverside packet)

    4. 45

      Chest Drop View

    5. 0

      How to add Python 3.9 script?

    6. 15

      Metin2 Download Center - Specifications & Documentation

    7. 5

      Fix Core Crash (unused serverside packet)

    8. 45

      Chest Drop View

    9. 5

      Fix Core Crash (unused serverside packet)

  • Recently Browsing

    No registered users viewing this page.

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