@rpg-engine/long-bow 0.6.74 → 0.6.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32107,31 +32107,42 @@ var QuestList = function QuestList(_ref) {
32107
32107
  };
32108
32108
  // Updated helper function to format objectives
32109
32109
  var formatObjectives = function formatObjectives(objectives) {
32110
- return objectives.map(function (objective) {
32111
- if ('killCountTarget' in objective) {
32112
- // This is an IQuestObjectiveKill
32113
- var killObjective = objective;
32114
- return "Kill " + formatText(killObjective.creatureKeys.join(', ')) + ": " + killObjective.killCount + "/" + killObjective.killCountTarget;
32115
- } else if ('targetNPCkey' in objective) {
32116
- var _interactionObjective;
32117
- // This is an IQuestObjectiveInteraction
32118
- var interactionObjective = objective;
32119
- return "Interact with NPC: " + formatText((_interactionObjective = interactionObjective.targetNPCkey) != null ? _interactionObjective : 'Unknown');
32120
- } else {
32121
- return 'Unknown objective';
32122
- }
32123
- }).join('; ');
32110
+ try {
32111
+ if (!objectives || !Array.isArray(objectives)) return 'No objectives';
32112
+ return objectives.map(function (objective) {
32113
+ if ('killCountTarget' in objective) {
32114
+ var _killObjective$creatu, _killObjective$creatu2, _killObjective$killCo, _killObjective$killCo2;
32115
+ var killObjective = objective;
32116
+ return "Kill " + formatText((_killObjective$creatu = (_killObjective$creatu2 = killObjective.creatureKeys) == null ? void 0 : _killObjective$creatu2.join(', ')) != null ? _killObjective$creatu : 'Unknown') + ": " + ((_killObjective$killCo = killObjective.killCount) != null ? _killObjective$killCo : 0) + "/" + ((_killObjective$killCo2 = killObjective.killCountTarget) != null ? _killObjective$killCo2 : 0);
32117
+ } else if ('targetNPCkey' in objective) {
32118
+ var _interactionObjective;
32119
+ var interactionObjective = objective;
32120
+ return "Interact with NPC: " + formatText((_interactionObjective = interactionObjective.targetNPCkey) != null ? _interactionObjective : 'Unknown');
32121
+ } else {
32122
+ return 'Unknown objective';
32123
+ }
32124
+ }).join('; ');
32125
+ } catch (error) {
32126
+ console.error('Error formatting objectives:', error);
32127
+ return 'Error formatting objectives';
32128
+ }
32124
32129
  };
32125
32130
  // Updated helper function to format rewards
32126
32131
  var formatRewards = function formatRewards(rewards) {
32127
32132
  try {
32128
32133
  if (!rewards || !Array.isArray(rewards)) return 'No rewards';
32129
32134
  return rewards.map(function (reward) {
32130
- var _reward$itemKeys;
32131
- return "" + formatText(reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32132
- return itemKey + ' x' + (reward == null ? void 0 : reward.qty);
32133
- }).join(', ')) + (reward != null && reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32134
- }).join('; ');
32135
+ var _reward$itemKeys, _reward$spellKeys;
32136
+ var itemKeysFormatted = reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32137
+ return itemKey && (reward == null ? void 0 : reward.qty) !== undefined ? itemKey + " x" + reward.qty : '';
32138
+ }).filter(Boolean).join(', ');
32139
+ var spellKeysFormatted = reward == null ? void 0 : (_reward$spellKeys = reward.spellKeys) == null ? void 0 : _reward$spellKeys.filter(Boolean).join(', ');
32140
+ var formattedReward = itemKeysFormatted ? "" + formatText(itemKeysFormatted) : '';
32141
+ if (spellKeysFormatted) {
32142
+ return formattedReward ? formattedReward + ", Spells: " + formatText(spellKeysFormatted) : "Spells: " + formatText(spellKeysFormatted);
32143
+ }
32144
+ return formattedReward || 'No rewards';
32145
+ }).filter(Boolean).join('; ');
32135
32146
  } catch (error) {
32136
32147
  console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32137
32148
  return 'Error on rewards';