Skip to content

Conversation

@libergod
Copy link

@libergod libergod commented Oct 8, 2025

Description

Currently, Party Hunt loot values (specifically for market data) don't behave like Global values.

### OBSERVATION

Small differences still occur due to missing NPCs in the canary folders. For example, Meat has the highest price value from an NPC called 'Fral the Butcher' (15GP), but due to its being missing, the canary server will send NPC Arito/Jezzara (10GP). Creating differences between Supply Analyzer and Party Hunt Analyzer.

imageimage

Behaviour

Actual

When selecting Market from Party Hunt analyzer, the values never use market historical data to generate an average of value.

Expected

Expects to get the item's average historical data from the market (Buy Average + Sell Average) / 2. If no historical data in the server, then fall back to buy data value (NPCs).

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested Party Hunt x Loot Analyser x Hunting Analyser
    CIP Client
image

OTC Redemption + Party Member
image

  • Confirms data with the Cyclopedia information
image image image
  • CIPSoft Tibia 1412
image

Test Configuration:

  • Server Version: 1412
  • Client: OTC and CipSoft 1412
  • Operating System: W11, SERVER UBUNTU 2204

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@libergod
Copy link
Author

libergod commented Oct 9, 2025

Ready to test.

@libergod libergod marked this pull request as ready for review October 9, 2025 18:25
Copilot AI review requested due to automatic review settings October 9, 2025 18:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the party hunt loot value calculation to use market historical data instead of NPC prices when "Market Data" is selected. The change ensures party hunt analyzer behavior matches the global market value system by using average historical market prices as the primary source, with NPC prices as fallback.

  • Implements new getItemMarketAveragePrice function that calculates average from historical purchase and sale data
  • Updates party hunt loot and supply price calculations to use market averages when market price type is selected
  • Cleans up garbage item definitions in shop configuration

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
src/game/game.hpp Adds declaration for new market average price calculation function
src/game/game.cpp Implements market average price calculation and adds debug logging to existing price function
src/creatures/players/grouping/party.cpp Updates party loot/supply tracking to use market averages instead of NPC prices when market mode is selected
data/scripts/lib/shops.lua Removes most garbage items from the list and adds conditional check to prevent empty iterations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@majestyotbr majestyotbr changed the title Fix: party hunt loot values (Market Data) fix: party hunt loot values (market data) Oct 13, 2025
@majestyotbr majestyotbr requested a review from dudantas October 13, 2025 12:56
@libergod libergod closed this Oct 18, 2025
@libergod libergod deleted the new-partyhunt-values branch October 18, 2025 02:53
@libergod libergod restored the new-partyhunt-values branch October 18, 2025 02:59
@libergod libergod reopened this Oct 18, 2025
@libergod libergod force-pushed the new-partyhunt-values branch from db15b07 to 1c8c416 Compare October 18, 2025 04:48
@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant