Change Selling price

gotnovicks

Veteran
Veteran
Joined
Feb 15, 2015
Messages
76
Reaction score
9
First Language
Portuguese
Primarily Uses
N/A
Hey guys!


I'm making a plugin that changes the price of an weapon/armor according it's basis params (HP, MP, ATK, DEF, etc). I already made the buying price, now I'm struggling to make the selling price. I'm still getting the price on database, not the new price altered by my plugin. can anyone help me? :(


The buying price code:

Code:
var _WindowShopBuy_price = Window_ShopBuy.prototype.price;
        Window_ShopBuy.prototype.price = function(item) {
        var _priceMod = newMod[8];
        for (i = 0; i < 7; i++) {
          _priceMod += item.params[i] * newMod[i];
        }
            var price = _WindowShopBuy_price.call(this, item);
            price += _priceMod;
            return price;
        };
 

Jragyn

idk wat this is
Member
Joined
Aug 14, 2012
Messages
21
Reaction score
4
First Language
English
Primarily Uses
Selling is handled elsewhere in the code.


I found it over under Scene_Shop.

Scene_Shop.prototype.sellingPrice = function() {
return Math.floor(this._item.price / 2);
};



Your method is called within the Window part of the shop.


If I had to guess, this is calling directly to the item's price, which is a property(?) of the item itself.


You will likely need to modify this code to accommodate your price-change-code if you want selling to be affected.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Person: "Taxes are bs and money is, too! Anarchy!!" *Literally anything goes wrong* Same Person: "Why hasn't the government fixed this???"
Stream will be live shortly with a session of Haunting Ground! Feel free to drop by!
As for the Coronavirus? Well: "People that spend their life avoiding death are already dead (they're also rich, and I like to spend my life with their money.)"
- R. Sanchez, "Edge of Tomorty: Rick, Die, Repeat"
making pierogi and corrupting my game files wbu

Forum statistics

Threads
94,345
Messages
920,111
Members
124,105
Latest member
acelaces
Top