Questie

Questie

116M Downloads

Add distance check to DebugOffer for whilelisted items

BreakBB opened this issue ยท 1 comments

commented

Description

Currently we show debug offers every time the player encounters a whitelisted item. This needs to become more clever.

A good example is Glade Flower, for which we already have the most visited spawns. The reports differ to the spawns of the DB, but only very little.

Suggestion is to add a distance check when the item was looted from an object and only show the debug offer when the distance to the DB spawn exceeds a certain threshold.

function calculate_distance(x1, y1, x2, y2)
    -- Adjust the x-coordinate to account the map scale
    adjusted_x2 = x2 * 1.5

    return math.sqrt((adjusted_x2 - x1)^2 + (y2 - y1)^2)
end

-- Example usage:
x1, y1 = 1, 2
x2, y2 = 4, 6

distance = calculate_distance(x1, y1, x2, y2)
print(string.format("Distance between points: %.2f", distance)) -- prints 6.40
commented

QuestieLib.GetSpawnDistance will be added with #5362