查看: 3404|回复: 7

[有事请教] 关于强行改数据库中的物品价格

[复制链接]
梦石
0
星屑
779
在线时间
107 小时
注册时间
2018-1-7
回帖
4
发表于 2020-11-29 22:16:57 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
请教一下大佬有什么插件或者脚本可以强制修改数据库中定好的某个物品价格(不是全部加减)
这种方式会不会造成存档报错或者储存读取后失效
或者有没有用变量修改物品的售出 购买价格的  求教!
梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2020-11-29 22:41:14 | 显示全部楼层
yep商店插件
回复

使用道具 举报

梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2020-11-29 22:42:13 | 显示全部楼层
yep商店插件
回复

使用道具 举报

梦石
0
星屑
779
在线时间
107 小时
注册时间
2018-1-7
回帖
4
 楼主| 发表于 2020-11-30 09:18:11 | 显示全部楼层

yep商店插件 试过了,他的售出价格改不了,还是数据库里设定的一半,不能变量变动
回复

使用道具 举报

梦石
0
星屑
16261
在线时间
4014 小时
注册时间
2015-9-14
回帖
1322

开拓者

发表于 2020-11-30 20:34:24 | 显示全部楼层
簡單物品售價,作者MrTS網址:https://mrtrivelrpg.wordpress.com/2016/03/15/simple-item-sell-price/
  1. //=============================================================================
  2. // MrTS_SimpleItemPrice.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc Allows to set default sell price in note tags.
  6. * @author Mr. Trivel
  7. *
  8. * @help
  9. * --------------------------------------------------------------------------------
  10. * Terms of Use
  11. * --------------------------------------------------------------------------------
  12. * Don't remove the header or claim that you wrote this plugin.
  13. * Credit Mr. Trivel if using this plugin in your project.
  14. * Free for commercial and non-commercial projects.
  15. * --------------------------------------------------------------------------------
  16. * Version 1.0
  17. * --------------------------------------------------------------------------------
  18. *
  19. * --------------------------------------------------------------------------------
  20. * Item/Weapon/Armor Tags
  21. * --------------------------------------------------------------------------------
  22. * <SellPrice: [PRICE]>
  23. * [PRICE] - default sell price.
  24. *
  25. * E.g.:
  26. * <SellPrice: 9999>
  27. * <SellPrice: 2000>
  28. * --------------------------------------------------------------------------------
  29. *
  30. * --------------------------------------------------------------------------------
  31. * Version History
  32. * --------------------------------------------------------------------------------
  33. * 1.0 - Release
  34. */

  35. (function() {
  36.         var _SceneShop_sellingPrice = Scene_Shop.prototype.sellingPrice;
  37.         Scene_Shop.prototype.sellingPrice = function() {
  38.                 if (this._item.meta.SellPrice)
  39.                         return Number(this._item.meta.SellPrice)
  40.                 else
  41.                         return _SceneShop_sellingPrice.call(this);
  42.         };
  43. })();
复制代码
https://rpg.blue/data/attachment/album/202003/28/021323lltgrsvfytfwuya5.gif
回复

使用道具 举报

梦石
0
星屑
779
在线时间
107 小时
注册时间
2018-1-7
回帖
4
 楼主| 发表于 2020-12-13 10:32:33 | 显示全部楼层
wabcmcc 发表于 2020-11-30 20:34
簡單物品售價,作者MrTS網址:https://mrtrivelrpg.wordpress.com/2016/03/15/simple-item-sell-price/
...

大佬,这个和YEP的功能差不多,可以自行定义售价,但是不能游戏中按变量实时定义售价
回复

使用道具 举报

梦石
0
星屑
16261
在线时间
4014 小时
注册时间
2015-9-14
回帖
1322

开拓者

发表于 2020-12-13 13:02:39 | 显示全部楼层
本帖最后由 wabcmcc 于 2020-12-13 13:06 编辑

同作者MrTS插件,稅金
利用稅金特性增加或減少價格.

MrTS_SimpleShopTax.js//=============================================================================
// MrTS_SimpleShopTax.js
//=============================================================================

/*:
* @plugindesc Allows easy way to change prices for whole shop items at once.
* @author Mr. Trivel
*
* @help
* --------------------------------------------------------------------------------
* Terms of Use
* --------------------------------------------------------------------------------
* Don't remove the header or claim that you wrote this plugin.
* Credit Mr. Trivel if using this plugin in your project.
* Free for commercial and non-commercial projects.
* --------------------------------------------------------------------------------
* Version 1.1
* --------------------------------------------------------------------------------
**
* --------------------------------------------------------------------------------
* Plugin Commands
* --------------------------------------------------------------------------------
* SetTaxTo Buy [TAX]
* SetTaxTo Sell [TAX]
*
* Examples:
* SetTaxTo Buy 50
* SetTaxTo Buy -75
* SetTaxTo Sell 25
* SeTtAxTo Sell -50
* --------------------------------------------------------------------------------
* Version History
* --------------------------------------------------------------------------------
* 1.1 - Added sell tax.
* 1.0 - Release
*/

(function() {

        //--------------------------------------------------------------------------
        // Game_Interpreter
        //

        var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
        Game_Interpreter.prototype.pluginCommand = function(command, args) {
                _Game_Interpreter_pluginCommand.call(this, command, args);
                if (command.toLowerCase() === 'settaxto') {
                        switch(args[0].toUpperCase())
                        {
                                case 'BUY':
                                {
                                        $gameSystem.setBuyTaxTo(Number(args[1]));
                                } break;
                                case 'SELL':
                                {
                                        $gameSystem.setSellTaxTo(Number(args[1]));
                                }       
                        }
                }
        };

        //--------------------------------------------------------------------------
        // Window_ShopBuy
        //
       
        var _WindowShopBuy_price = Window_ShopBuy.prototype.price;
        Window_ShopBuy.prototype.price = function(item) {
                var price = _WindowShopBuy_price.call(this, item);
                price += Math.floor(price * $gameSystem.getBuyTax());
            return price;
        };

        //--------------------------------------------------------------------------
        // Scene_Shop
        //

        var _Scene_Shop_sellingPrice = Scene_Shop.prototype.sellingPrice;
        Scene_Shop.prototype.sellingPrice = function() {
                var sellingPrice = _Scene_Shop_sellingPrice.call(this);
            return Math.max(0, sellingPrice - Math.floor(sellingPrice * $gameSystem.getSellTax()));
        };

        //--------------------------------------------------------------------------
        // Game_System
        //

        Game_System.prototype.setBuyTaxTo = function(tax) {
                this._shopBuyTax = tax;
        };

        Game_System.prototype.setSellTaxTo = function(tax) {
                this._shopSellTax = tax;
        };

        Game_System.prototype.getBuyTax = function() {
                return this._shopBuyTax/100 || 0;
        };

        Game_System.prototype.getSellTax = function() {
                return this._shopSellTax/100 || 0;
        };
})();
https://rpg.blue/data/attachment/album/202003/28/021323lltgrsvfytfwuya5.gif
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部