Hey y'all, so I'm using Yanfly's Skill Cost Item plugin to create gun weapons that use bullets for ammo. Now the problem comes when making the skills for these guns and not wanting to make 4 or 5 versions of the same skill that use different item costs. The plugin allows you to change the item cost by using javascript, but I couldn't find protaining to checking the skill user's currently equipped weapon type. Anyone have any ideas how to achieve this idea?
How to change item cost depending on weapon type equipped?
Javascript/Plugin SupportI think you could do something like this:
JavaScript:
var w = user.weapons()[0]; // Get first equipped weapon
var wtype = w ? w.wtypeId : 0; // Get weapon type ID (or 0 if no weapon equipped)
if (wtype === 1) cost = 1;
if (wtype === 2) cost = 4;
// etc
@caethyril It works perfectly! The icons for the other items still show up when 0, but I'll deal with that later. Thank you so much for the help!
Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-item-cost-depending-on-weapon-type-equipped.118075/