The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vendor Gold
Author Message
Lightsource
Apprentice
*

Posts: 9
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: Dec 2013
Reputation: 0



Post: #1
Vendor Gold
Hey, im trying to make my vendors buy houses from players that cost 30k gp, but they keep saying that they can't afford it. I have given GPs through @NPCRestock, put gold in their banks, bought stuff to see if their purchase limit would rise, but no success in any case.
After a little debugging I came across this at CContain.cpp (which is the limit I'm facing right now):

Code:
case LAYER_BANKBOX:
                    // Restock petty cash.
                    if ( !m_itEqBankBox.m_Check_Restock )
                        m_itEqBankBox.m_Check_Restock = 10000;
                    if ( m_itEqBankBox.m_Check_Amount < m_itEqBankBox.m_Check_Restock )
                        m_itEqBankBox.m_Check_Amount = m_itEqBankBox.m_Check_Restock;
                    return;

Is there anyway I can override this line m_itEqBankBox.m_Check_Restock by scripts? or should I change my source code?

Thanks in advance

edit:

also when I change this in source code and it starts buying houses, it shows the wrong price at the Vendor Gump than what he actually pays. At the gump it shows 36.928gps, but he pays when I click accept 168.000gps
(This post was last modified: 02-14-2017 03:06 AM by Lightsource.)
02-14-2017 02:31 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Vendor Gold
m_itEqBankBox.m_Check_Restock is an alias for MORE2, so maybe you can use "RESTOCK + MORE2 = 123456789" on scripts

on source code you also must take care with variable types like char/short/int/long/etc. Each type have its signal or max limits, so if you use 'unsigned short' to store signed values this will return wrong value, or storing values like 160.000 on unsigned short (max value = 65.535) will also make it return wrong value, etc
02-14-2017 05:05 AM
Find all posts by this user Like Post Quote this message in a reply
Lightsource
Apprentice
*

Posts: 9
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: Dec 2013
Reputation: 0



Post: #3
RE: Vendor Gold
(02-14-2017 05:05 AM)Coruja Wrote:  m_itEqBankBox.m_Check_Restock is an alias for MORE2, so maybe you can use "RESTOCK + MORE2 = 123456789" on scripts

on source code you also must take care with variable types like char/short/int/long/etc. Each type have its signal or max limits, so if you use 'unsigned short' to store signed values this will return wrong value, or storing values like 160.000 on unsigned short (max value = 65.535) will also make it return wrong value, etc

Thanks for your reply! I have just found out that info about MORE2.

Now, about that gump price, at grayproto.h it says at ln 2754:
Code:
NWORD m_price;    // Hmm what if price is > 65K?

So this basically means that it is really a short and I can't by any means send prices over 65.535gp to the client at a Sell Operation?
02-14-2017 05:51 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)