edited August 2019 in ORK Scripting
Could you do me a favor, please?

private static ItemGain outCome = new ItemGain();
outCome.type = ItemDropType.Weapon;
outCome.id = 4;
outCome.level = 1;
outCome.quantity = 1;
outCome.chance = 100;

EquipShortcut equipShortcut = new EquipShortcut();
equipShortcut = (EquipShortcut)outCome.CreateShortcut();

Equipment equipment = equipShortcut.Setting;
equipment.level[0].bonus.custom.statusBonus[0].statusID = 1;
equipment.level[0].bonus.custom.statusBonus[0].bonus = 999;
//didn't work
//equipment.level[0].bonus.custom.statusBonus[1].statusID = 4;
//equipment.level[0].bonus.custom.statusBonus[1].bonus = 9999;

I don't know how to add a new statusBonus , and this code didn't work. Because it's an array , I can't use function "Add".
Post edited by IronFromIce on
  • I thought I have solved it. I might need to add a few status value to the weapon in the frame first.
  • edited August 2019
    What exactly are you trying to do - add a bonus to an instance of the equipment, or add a bonus to the settings?

    The actual bonuses of an in-game equipment are stored in the EquipShortcut instance representing it, i.e. changing the settings will only change future equipments that are instantiated. The status value bonuses of an EquipShortcut are not accessible from the outside, though ... but you can change them via the ChangeStatusValueBonus function :)

    equipShortcut.ChangeStatusValueBonus(statusID, value, SimpleOperator.Add);
    This will add value to the status value bonus for the status value with ID/index statusID.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.