Sets a property of looted to some random choice from choices list

Choices can be a simple array, or a map of anything => weight.

setToRandomChoice({rng, looted, {
property: 'item.color',
choices: ['red', 'green', 'blue']
}}); // looted.item.color will be one of red, green or blue.
  • Parameters

    • args: {
          args: {
              choices?: any[] | Record<any, number> | Map<any, number>;
              property?: string;
          };
          looted: LootTableEntryResult;
          rng: RngInterface;
      }
      • args: {
            choices?: any[] | Record<any, number> | Map<any, number>;
            property?: string;
        }
        • Optionalchoices?: any[] | Record<any, number> | Map<any, number>
        • Optionalproperty?: string
      • looted: LootTableEntryResult
      • rng: RngInterface

    Returns void