feat: add funny hurt sound, improved tracking, and added milestone announcements
This commit is contained in:
parent
cdde346457
commit
e5ccf5cfb5
@ -5,7 +5,7 @@
|
|||||||
## Version: 1.2
|
## Version: 1.2
|
||||||
|
|
||||||
# Stats stated here are saved per character.
|
# Stats stated here are saved per character.
|
||||||
## SavedVariablesPerCharacter: Trackster_jumpCounter, Trackster_critCounter, Trackster_questCounter, Trackster_castCounter, Trackster_loginCounter, Trackster_bossCounter, Trackster_chatCounter, Trackster_itemCounter, Trackster_goldCounter, Trackster_distanceTravelledCounter, Trackster_distanceTravelledCounter__swam, Trackster_distanceTravelledCounter__walked, Trackster_distanceTravelledCounter__groundmount, Trackster_distanceTravelledCounter__flight, Trackster_distanceTravelledCounter__taxi, Trackster_distanceTravelledCounter__ghost
|
## SavedVariablesPerCharacter: Trackster_jumpCounter, Trackster_critCounter, Trackster_questCounter, Trackster_killCounter, Trackster_castCounter, Trackster_loginCounter, Trackster_bossCounter, Trackster_chatCounter, Trackster_itemCounter, Trackster_goldCounter, Trackster_distanceTravelledCounter, Trackster_distanceTravelledCounter__swam, Trackster_distanceTravelledCounter__walked, Trackster_distanceTravelledCounter__groundmount, Trackster_distanceTravelledCounter__flight, Trackster_distanceTravelledCounter__taxi, Trackster_distanceTravelledCounter__ghost
|
||||||
|
|
||||||
|
|
||||||
# Stats stated here are saved for the whole wow client.
|
# Stats stated here are saved for the whole wow client.
|
||||||
@ -18,5 +18,6 @@
|
|||||||
# These are internal values. Just don't touch those.
|
# These are internal values. Just don't touch those.
|
||||||
## SavedVariablesPerCharacter: Trackster_showMainframe, Trackster_frameScale
|
## SavedVariablesPerCharacter: Trackster_showMainframe, Trackster_frameScale
|
||||||
|
|
||||||
|
av-texts.lua
|
||||||
main.lua
|
main.lua
|
||||||
options.lua
|
options.lua
|
||||||
|
114
av-texts.lua
Normal file
114
av-texts.lua
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
local hour = 3600;
|
||||||
|
local day = 24*hour;
|
||||||
|
local week = 7*day;
|
||||||
|
local month = 30*day;
|
||||||
|
local year = 360*day;
|
||||||
|
local km = 1000;
|
||||||
|
|
||||||
|
Trackster_avMessages = {
|
||||||
|
quests = {
|
||||||
|
[1] = "First quest completed!",
|
||||||
|
[10] = "Completed ten quests",
|
||||||
|
[69] = "69 quests. Nice!",
|
||||||
|
[100] = "Completed 100 quests",
|
||||||
|
[420] = "Completed 420 quests! Smoke them Druid TIER-1 set pieces!",
|
||||||
|
[1000] = "Completed 1000 quests, that's a lot of quests!",
|
||||||
|
[9999] = "9,999 Quests! Go get the Champagne! Just one more to go!",
|
||||||
|
[10000] = "10,000 quests! POP! CLING CLING! CONGRATULATIONS!",
|
||||||
|
},
|
||||||
|
kills = {
|
||||||
|
[1] = "First blood",
|
||||||
|
[10] = "Serial killer",
|
||||||
|
[69] = "69 kills. Nice!",
|
||||||
|
[100] = "Tenfold serial killer",
|
||||||
|
[420] = "420 kills! Smoke 'em",
|
||||||
|
[1000] = "Thousand kills!",
|
||||||
|
[2000] = "Thousands of kills!",
|
||||||
|
[10000] = "Tenfold thousandkiller! 10k kills!",
|
||||||
|
[25000] = "25k kills! Quarter of a Kilohectakill",
|
||||||
|
[50000] = "Fiftyfold thousandkiller! Half of a Kilohectakill!",
|
||||||
|
[75000] = "75k kills! Three quarters to a Kilohectakill!",
|
||||||
|
[100000] = "100k kills! Kilohectakiller!",
|
||||||
|
[110000] = "110k kills! Kilohectakill + Kilodecakill!",
|
||||||
|
[120000] = "120k kills! Kilohectakill + 2 Kilodecakills!",
|
||||||
|
[130000] = "130k kills! Kilohectakill + 3 Kilodecakills!",
|
||||||
|
[140000] = "140k kills! Kilohectakill + 4 Kilodecakills!",
|
||||||
|
[150000] = "150k kills! Kilohectakill + 5 Kilodecakills!",
|
||||||
|
[250000] = "500k kills! That's a quarter Megakill! Wtf!",
|
||||||
|
[500000] = "500k kills! That's half a Megakill! Wtf!",
|
||||||
|
[750000] = "750k kills! That's a three-quarter Megakill! Wtf!",
|
||||||
|
[1000000] = "ONE MILLION KILLS! THAT'S A MEGAKILL!",
|
||||||
|
[1000000000] = "GIGAKILLER!!!!",
|
||||||
|
},
|
||||||
|
deaths = {
|
||||||
|
[1] = "You died!",
|
||||||
|
[10] = "Died ten times",
|
||||||
|
[69] = "69 Deaths! Death by snu-snu!",
|
||||||
|
[100] = "Died a hundred deaths!",
|
||||||
|
[200] = "Died two-hundred deaths!",
|
||||||
|
[300] = "Died three-hundred deaths!",
|
||||||
|
[400] = "Died four-hundred deaths!",
|
||||||
|
[420] = "420 deaths! Overdosed? Is that even possible?",
|
||||||
|
[500] = "Died five-hundred deaths!",
|
||||||
|
[600] = "Died six-hundred deaths!",
|
||||||
|
[700] = "Died seven-hundred deaths!",
|
||||||
|
[800] = "Died eight-hundred deaths!",
|
||||||
|
[900] = "Died nine-hundred deaths!",
|
||||||
|
[1000] = "Died a thousand deaths!",
|
||||||
|
},
|
||||||
|
timePlayed = {
|
||||||
|
[hour] = "Played for an hour!",
|
||||||
|
[10 * hour] = "Played for ten hours!",
|
||||||
|
[100 * hour] = "Played a hundred hours!",
|
||||||
|
[200 * hour] = "Played for two-hundred hours!",
|
||||||
|
[300 * hour] = "Played for three-hundred hours!",
|
||||||
|
[400 * hour] = "Played for four-hundred hours!",
|
||||||
|
[500 * hour] = "Played for five-hundred hours!",
|
||||||
|
[600 * hour] = "Played for six-hundred hours!",
|
||||||
|
[700 * hour] = "Played for seven-hundred hours!",
|
||||||
|
[800 * hour] = "Played for eight-hundred hours!",
|
||||||
|
[900 * hour] = "Played for nine-hundred hours!",
|
||||||
|
[1000 * hour] = "Played for a thousand hours!!!",
|
||||||
|
[8 * hour] = "Played for a workday!",
|
||||||
|
[day] = "Played for an entire day!",
|
||||||
|
[week] = "Played for an entire week!",
|
||||||
|
[2 * week] = "Played for two weeks!",
|
||||||
|
[3 * week] = "Played for three weeks!",
|
||||||
|
[4 * week] = "Played for four weeks!",
|
||||||
|
[5 * week] = "Played for five weeks!",
|
||||||
|
[6 * week] = "Played for six weeks!",
|
||||||
|
[7 * week] = "Played for seven weeks!",
|
||||||
|
[9 * week] = "Played for nine weeks!",
|
||||||
|
[10 * week] = "Played for ten weeks!",
|
||||||
|
[month] = "Played for an entire month!",
|
||||||
|
[2 * month] = "Played for two months!",
|
||||||
|
[3 * month] = "Played a quarter year!",
|
||||||
|
[4 * month] = "Played for four months!",
|
||||||
|
[5 * month] = "Played for five months!",
|
||||||
|
[6 * month] = "Played half a year!",
|
||||||
|
[7 * month] = "Played for seven months!",
|
||||||
|
[9 * month] = "Played for three quartals of a year!",
|
||||||
|
[10 * month] = "Played for ten months!",
|
||||||
|
[11 * month] = "Played for eleven months!",
|
||||||
|
[year] = "Played for an entire year! This should not even be possible!",
|
||||||
|
},
|
||||||
|
distAll = {
|
||||||
|
[2440 * 2 * km] = "Travelled the equivalent of the diameter of Mercury (" .. 2440 * 2 .. "km)",
|
||||||
|
[6052 * 2 * km] = "Travelled the equivalent of the diameter of Venus (" .. 6052 * 2 .. "km)",
|
||||||
|
[6371 * 2 * km] = "Travelled the equivalent of the diameter of the Earth (" .. 6371 * 2 .. "km)",
|
||||||
|
[3390 * 2 * km] = "Travelled the equivalent of the diameter of Mars (" .. 3390 * 2 .. "km)",
|
||||||
|
[69911 * 2 * km] = "Travelled the equivalent of the diameter of Jupiter (" .. 69911 * 2 .. "km)",
|
||||||
|
[58232 * 2 * km] = "Travelled the equivalent of the diameter of Saturn (" .. 58232 * 2 .. "km)",
|
||||||
|
[25362 * 2 * km] = "Travelled the equivalent of the diameter of Uranus (" .. 25362 * 2 .. "km)",
|
||||||
|
[24622 * 2 * km] = "Travelled the equivalent of the diameter of Neptune (" .. 24622 * 2 .. "km)",
|
||||||
|
[40075 * km] = "Travelled the equivalent of the the Earths circumference (" .. 40075 .. "km)",
|
||||||
|
[20032 * km] = "Travelled the equivalent of HALF the the Earths circumference (" .. 20032 .. "km)",
|
||||||
|
[22860 * km] = "Travelled the equivalent 250,000 football fields (" .. 22860 .. "km)",
|
||||||
|
[45720 * km] = "Travelled the equivalent 500,000 football fields (" .. 45720 .. "km)",
|
||||||
|
[29412765] = "Travelled 50,000 smoots (" .. 29412.765 .. "km)",
|
||||||
|
},
|
||||||
|
distWalked = {
|
||||||
|
[804 * km] = "And I would walk five hundred miles...",
|
||||||
|
[804 * 2 * km] = "... And I would walk five hundred more",
|
||||||
|
},
|
||||||
|
}
|
215
main.lua
215
main.lua
@ -15,6 +15,7 @@ Trackster_chatCounter = 0;
|
|||||||
Trackster_itemCounter = 0;
|
Trackster_itemCounter = 0;
|
||||||
Trackster_goldCounter = 0;
|
Trackster_goldCounter = 0;
|
||||||
Trackster_questCounter = 0;
|
Trackster_questCounter = 0;
|
||||||
|
Trackster_killCounter = 0;
|
||||||
Trackster_distanceTravelledCounter = 0;
|
Trackster_distanceTravelledCounter = 0;
|
||||||
Trackster_distanceTravelledCounter__swam = 0;
|
Trackster_distanceTravelledCounter__swam = 0;
|
||||||
Trackster_distanceTravelledCounter__walked = 0;
|
Trackster_distanceTravelledCounter__walked = 0;
|
||||||
@ -145,6 +146,130 @@ local function PrintMsg(s)
|
|||||||
print("|cFFFFD044Trackster:|r " .. s);
|
print("|cFFFFD044Trackster:|r " .. s);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--> Will play a sound and display a string on screen
|
||||||
|
local function AnnounceMilestone(message)
|
||||||
|
--> Play a nice sound --> https://www.wowhead.com/sound=63971/ui-legendaryloot-toast
|
||||||
|
PlaySound(63971);
|
||||||
|
--> Announce the message on screen
|
||||||
|
UIErrorsFrame:AddMessage(message, 1.0, 1.0, 0.0, 1.0, UIERRORS_HOLD_TIME)
|
||||||
|
--> Announce in chat
|
||||||
|
PrintMsg(message);
|
||||||
|
end
|
||||||
|
|
||||||
|
--> Will call AnnounceMilestone automatically, each time value is a multiple of interval, or explicitly defined in avMessages
|
||||||
|
--> Only use for integer, steady, individually incremented values!
|
||||||
|
--> Meaning, they are integers, never decrease in value, and call this method for every single increment, and every increment must be by 1!
|
||||||
|
local function AutoAnnounceMilestone_INT_STEADY_IINCR(value, kindkey, prettyName, interval)
|
||||||
|
if (value > 0) then
|
||||||
|
--> If a multiple of interval, or if we have a special message for that count
|
||||||
|
if (value % interval == 0) or (Trackster_avMessages[kindkey] and Trackster_avMessages[kindkey][value]) then
|
||||||
|
|
||||||
|
--> Fetch a special message if we have one, else come up with one
|
||||||
|
local message;
|
||||||
|
if Trackster_avMessages[kindkey] and Trackster_avMessages[kindkey][value] then
|
||||||
|
message = Trackster_avMessages[kindkey][value];
|
||||||
|
else
|
||||||
|
--> Little special case for time played
|
||||||
|
if (kindkey == "timePlayed") then
|
||||||
|
local totalHours = math.floor((lastConfirmedTime + internalTimeOffset + Trackster_timeOffset) / 3600);
|
||||||
|
message = "Congratulations! You have played for " .. totalHours .. " hours!";
|
||||||
|
else
|
||||||
|
message = "Congratulations! You have reached " .. value .. " " .. kindkey .. "!";
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
AnnounceMilestone(message);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--> Will call AnnounceMilestone automatically, each time value is close to a multiple of interval, or explicitly defined in avMessages
|
||||||
|
--> Only use for decimal, steady values!
|
||||||
|
--> Meaning, they are decimal numbers and must never decrease in value!
|
||||||
|
--> Y is the leeway to trigger. Let's say, if you set a trigger for 1,000,000, and have a Y of 2, it would still trigger for 1,000,002.
|
||||||
|
local aamds_triggersUsed = {}
|
||||||
|
local function AutoAnnounceMilestone_DEC_STEADY(value, kindkey, prettyName, interval, Y)
|
||||||
|
if (Y == nil) then Y = 1 end;
|
||||||
|
|
||||||
|
local intval = math.floor(value);
|
||||||
|
|
||||||
|
--> Special trigger points
|
||||||
|
if (Trackster_avMessages[kindkey]) then
|
||||||
|
--> Find closest trigger point
|
||||||
|
local closestKey = nil;
|
||||||
|
local minDifference = math.huge;
|
||||||
|
for key, _ in pairs(Trackster_avMessages[kindkey]) do
|
||||||
|
if key <= intval then
|
||||||
|
local difference = intval - key
|
||||||
|
if difference < minDifference then
|
||||||
|
minDifference = difference
|
||||||
|
closestKey = key
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--> If we have found a closest key (may be 0 because were only looking at <= value keys
|
||||||
|
if (closestKey) then
|
||||||
|
--> If value is near closest defined trigger value AND trigger value is not blacklisted
|
||||||
|
local intsOverNearestTrigger = intval - closestKey;
|
||||||
|
if ((intsOverNearestTrigger <= Y) and (aamds_triggersUsed[kindkey][closestKey] == nil)) then
|
||||||
|
--> Announce the milestone
|
||||||
|
local message = Trackster_avMessages[kindkey][closestKey];
|
||||||
|
AnnounceMilestone(message);
|
||||||
|
|
||||||
|
--> Blacklist this trigger value
|
||||||
|
if (aamds_triggersUsed[kindkey] == nil) then
|
||||||
|
aamds_triggersUsed[kindkey] = {};
|
||||||
|
end
|
||||||
|
aamds_triggersUsed[kindkey][closestKey] = true;
|
||||||
|
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--> Procedural trigger points
|
||||||
|
local mod = intval % interval;
|
||||||
|
local intsOverNearestTrigger = intval % interval;
|
||||||
|
local nearestTrigger = intval - intsOverNearestTrigger;
|
||||||
|
|
||||||
|
--> If value is near procedural trigger AND trigger value is not blacklisted
|
||||||
|
if ((intsOverNearestTrigger <= Y) and (aamds_triggersUsed[kindkey] == nil or aamds_triggersUsed[kindkey][nearestTrigger] == nil)) then
|
||||||
|
--> Announce the milestone
|
||||||
|
local message = "Congratulations! You have reached " .. value .. " " .. prettyName .. "!";
|
||||||
|
AnnounceMilestone(message);
|
||||||
|
|
||||||
|
--> Blacklist this trigger value
|
||||||
|
if (aamds_triggersUsed[kindkey] == nil) then
|
||||||
|
aamds_triggersUsed[kindkey] = {};
|
||||||
|
end
|
||||||
|
aamds_triggersUsed[kindkey][nearestTrigger] = true;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function CommafyNumber(number)
|
||||||
|
-- Convert the number to a string
|
||||||
|
local strNumber = tostring(number)
|
||||||
|
|
||||||
|
-- Reverse the string
|
||||||
|
local reversedStr = string.reverse(strNumber)
|
||||||
|
|
||||||
|
-- Add commas every three characters
|
||||||
|
local formattedStr = reversedStr:gsub("(%d%d%d)", "%1,")
|
||||||
|
|
||||||
|
-- Reverse the formatted string back to its original order
|
||||||
|
local finalStr = string.reverse(formattedStr)
|
||||||
|
|
||||||
|
-- Remove any leading comma if present
|
||||||
|
if string.sub(finalStr, 1, 1) == "," then
|
||||||
|
finalStr = string.sub(finalStr, 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Return the formatted number
|
||||||
|
return finalStr
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
mainFrame:SetBackdrop({
|
mainFrame:SetBackdrop({
|
||||||
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background",
|
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background",
|
||||||
edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border",
|
edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border",
|
||||||
@ -255,7 +380,7 @@ local timer__taxi = 0;
|
|||||||
local timer__ghost = 0;
|
local timer__ghost = 0;
|
||||||
function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
||||||
--> Update value in background in every frame
|
--> Update value in background in every frame
|
||||||
local deltaDistance = GetUnitSpeed("PLAYER") * 0.9144 * deltaTime;
|
local deltaDistance = GetUnitSpeed("PLAYER") * 0.9144 * deltaTime; --> Distance gets saved in meters, GetUnitSpeed returns yards per second
|
||||||
Trackster_distanceTravelledCounter = Trackster_distanceTravelledCounter + deltaDistance;
|
Trackster_distanceTravelledCounter = Trackster_distanceTravelledCounter + deltaDistance;
|
||||||
|
|
||||||
--> Increment specialized distance counters, if the state fits (like, swimming only if IsSwimming() == true)
|
--> Increment specialized distance counters, if the state fits (like, swimming only if IsSwimming() == true)
|
||||||
@ -281,6 +406,14 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
local val__flight = round(Trackster_distanceTravelledCounter__flight + Trackster_distanceTravelledOffset__flight);
|
local val__flight = round(Trackster_distanceTravelledCounter__flight + Trackster_distanceTravelledOffset__flight);
|
||||||
local val__taxi = round(Trackster_distanceTravelledCounter__taxi + Trackster_distanceTravelledOffset__taxi);
|
local val__taxi = round(Trackster_distanceTravelledCounter__taxi + Trackster_distanceTravelledOffset__taxi);
|
||||||
local val__ghost = round(Trackster_distanceTravelledCounter__ghost + Trackster_distanceTravelledOffset__ghost);
|
local val__ghost = round(Trackster_distanceTravelledCounter__ghost + Trackster_distanceTravelledOffset__ghost);
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__all, "distAll", "kilometers travelled", 1000*1000, 100); --> Each 1,000 km
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__swam, "distSwam", "kilometers swam", 50*1000, 100); --> Each 50 km
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__walked, "distWalked", "kilometers travelled by foot", 500*1000, 100); --> Each 500 km
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__groundmount, "distGroundmount", "kilometers rode (on ground)", 1000*1000, 100); --> Each 1,000 km
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__flight, "distFlight", "kilometers flown", 1000*000, 100); --> Each 1,000 km
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__taxi, "distTaxi", "kilometers rode (on taxi)", 500*000, 100); --> Each 500 km
|
||||||
|
AutoAnnounceMilestone_DEC_STEADY(val__ghost, "distGhost", "kilometers haunted", 10*000, 100); --> Each 10 km
|
||||||
|
|
||||||
timer__all = timer__all + deltaTime;
|
timer__all = timer__all + deltaTime;
|
||||||
timer__swam = timer__swam + deltaTime;
|
timer__swam = timer__swam + deltaTime;
|
||||||
@ -356,9 +489,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__all >= updateDelayS__all or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__all >= updateDelayS__all or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__all < 10000) then
|
if (val__all < 10000) then
|
||||||
fsDist:SetText("Distance travelled: " .. textCol_value .. val__all .. "m");
|
fsDist:SetText("Distance travelled: " .. textCol_value .. CommafyNumber(val__all) .. "m");
|
||||||
else
|
else
|
||||||
fsDist:SetText("Distance travelled: " .. textCol_value .. round(val__all/1000) .. "km");
|
fsDist:SetText("Distance travelled: " .. textCol_value .. CommafyNumber(round(val__all/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__all = 0;
|
timer__all = 0;
|
||||||
@ -366,9 +499,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__swam >= updateDelayS__swam or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__swam >= updateDelayS__swam or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__swam < 10000) then
|
if (val__swam < 10000) then
|
||||||
fsDist__swam:SetText("Distance swam: " .. textCol_value .. val__swam .. "m");
|
fsDist__swam:SetText("Distance swam: " .. textCol_value .. CommafyNumber(val__swam) .. "m");
|
||||||
else
|
else
|
||||||
fsDist__swam:SetText("Distance swam: " .. textCol_value .. round(val__swam/1000) .. "km");
|
fsDist__swam:SetText("Distance swam: " .. textCol_value .. CommafyNumber(round(val__swam/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__swam = 0;
|
timer__swam = 0;
|
||||||
@ -376,9 +509,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__walked >= updateDelayS__walked or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__walked >= updateDelayS__walked or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__walked < 10000) then
|
if (val__walked < 10000) then
|
||||||
fsDist__walked:SetText("Distance by foot: " .. textCol_value .. val__walked .. "m");
|
fsDist__walked:SetText("Distance by foot: " .. textCol_value .. CommafyNumber(val__walked) .. "m");
|
||||||
else
|
else
|
||||||
fsDist__walked:SetText("Distance by foot: " .. textCol_value .. round(val__walked/1000) .. "km");
|
fsDist__walked:SetText("Distance by foot: " .. textCol_value .. CommafyNumber(round(val__walked/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__walked = 0;
|
timer__walked = 0;
|
||||||
@ -386,9 +519,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__groundmount >= updateDelayS__groundmount or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__groundmount >= updateDelayS__groundmount or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__groundmount < 10000) then
|
if (val__groundmount < 10000) then
|
||||||
fsDist__groundmount:SetText("Distance rode: " .. textCol_value .. val__groundmount .. "m");
|
fsDist__groundmount:SetText("Distance rode: " .. textCol_value .. CommafyNumber(val__groundmount) .. "m");
|
||||||
else
|
else
|
||||||
fsDist__groundmount:SetText("Distance rode: " .. textCol_value .. round(val__groundmount/1000) .. "km");
|
fsDist__groundmount:SetText("Distance rode: " .. textCol_value .. CommafyNumber(round(val__groundmount/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__groundmount = 0;
|
timer__groundmount = 0;
|
||||||
@ -396,9 +529,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__flight >= updateDelayS__flight or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__flight >= updateDelayS__flight or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__flight < 10000) then
|
if (val__flight < 10000) then
|
||||||
fsDist__flight:SetText("Distance flown: " .. textCol_value .. val__flight .. "m");
|
fsDist__flight:SetText("Distance flown: " .. textCol_value .. CommafyNumber(val__flight) .. "m");
|
||||||
else
|
else
|
||||||
fsDist__flight:SetText("Distance flown: " .. textCol_value .. round(val__flight/1000) .. "km");
|
fsDist__flight:SetText("Distance flown: " .. textCol_value .. CommafyNumber(round(val__flight/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__flight = 0;
|
timer__flight = 0;
|
||||||
@ -406,9 +539,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__taxi >= updateDelayS__taxi or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__taxi >= updateDelayS__taxi or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__taxi < 10000) then
|
if (val__taxi < 10000) then
|
||||||
fsDist__taxi:SetText("Distance on taxi: " .. textCol_value .. val__taxi .. "m");
|
fsDist__taxi:SetText("Distance on taxi: " .. textCol_value .. CommafyNumber(val__taxi) .. "m");
|
||||||
else
|
else
|
||||||
fsDist__taxi:SetText("Distance on taxi: " .. textCol_value .. round(val__taxi/1000) .. "km");
|
fsDist__taxi:SetText("Distance on taxi: " .. textCol_value .. CommafyNumber(round(val__taxi/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__taxi = 0;
|
timer__taxi = 0;
|
||||||
@ -416,9 +549,9 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
|
|
||||||
if (timer__ghost >= updateDelayS__ghost or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
if (timer__ghost >= updateDelayS__ghost or forceTextUpdate) then --> Update UI text every deltaTime seconds
|
||||||
if (val__ghost < 10000) then
|
if (val__ghost < 10000) then
|
||||||
fsDist__ghost:SetText("Distance haunted: " .. textCol_value .. val__ghost .. "m");
|
fsDist__ghost:SetText("Distance haunted: " .. textCol_value .. CommafyNumber(val__ghost) .. "m");
|
||||||
else
|
else
|
||||||
fsDist__ghost:SetText("Distance haunted: " .. textCol_value .. round(val__ghost/1000) .. "km");
|
fsDist__ghost:SetText("Distance haunted: " .. textCol_value .. CommafyNumber(round(val__ghost/1000)) .. "km");
|
||||||
end
|
end
|
||||||
|
|
||||||
timer__ghost = 0;
|
timer__ghost = 0;
|
||||||
@ -435,27 +568,25 @@ function UpdateDeaths()
|
|||||||
local val = select(1, GetStatistic(60));
|
local val = select(1, GetStatistic(60));
|
||||||
|
|
||||||
if (val == "--") then
|
if (val == "--") then
|
||||||
fsDeaths:SetText("Death count: " .. textCol_value .. (Trackster_deathOffset));
|
fsDeaths:SetText("Death count: " .. textCol_value .. CommafyNumber(Trackster_deathOffset));
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_deathOffset, "deaths", "deaths", 100);
|
||||||
else
|
else
|
||||||
fsDeaths:SetText("Death count: " .. textCol_value .. (val + Trackster_deathOffset));
|
fsDeaths:SetText("Death count: " .. textCol_value .. CommafyNumber(val + Trackster_deathOffset));
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateKills()
|
local function UpdateKills()
|
||||||
Trackster_killsOffset = round(Trackster_killsOffset);
|
Trackster_killsOffset = round(Trackster_killsOffset);
|
||||||
|
|
||||||
local val = select(1, GetStatistic(1197));
|
fsKills:SetText("Kill count: " .. textCol_value .. CommafyNumber(Trackster_killCounter + Trackster_killsOffset));
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_deathOffset, "kills", "creatures slain", 1000);
|
||||||
if (val == "--") then
|
|
||||||
fsKills:SetText("Kill count: " .. textCol_value .. (Trackster_killsOffset));
|
|
||||||
else
|
|
||||||
fsKills:SetText("Kill count: " .. textCol_value .. (val + Trackster_killsOffset));
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateQuests()
|
local function UpdateQuests()
|
||||||
Trackster_questsOffset = round(Trackster_questsOffset);
|
Trackster_questsOffset = round(Trackster_questsOffset);
|
||||||
fsQuests:SetText("Quest count: " .. textCol_value .. (Trackster_questCounter + Trackster_questsOffset));
|
fsQuests:SetText("Quest count: " .. textCol_value .. CommafyNumber(Trackster_questCounter + Trackster_questsOffset));
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_questCounter + Trackster_questsOffset, "quests", "quests completed", 100);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateHearthstones()
|
local function UpdateHearthstones()
|
||||||
@ -494,8 +625,9 @@ end
|
|||||||
|
|
||||||
local function UpdateJump()
|
local function UpdateJump()
|
||||||
Trackster_jumpOffset = round(Trackster_jumpOffset);
|
Trackster_jumpOffset = round(Trackster_jumpOffset);
|
||||||
fsJump:SetText("Jump count: " .. textCol_value .. (Trackster_jumpCounter + Trackster_jumpOffset));
|
fsJump:SetText("Jump count: " .. textCol_value .. CommafyNumber(Trackster_jumpCounter + Trackster_jumpOffset));
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_jumpCounter + Trackster_jumpOffset, "jumps", "times jumped", 10000);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateCasts()
|
local function UpdateCasts()
|
||||||
@ -510,26 +642,29 @@ local function UpdateCasts()
|
|||||||
elseif(val >= 100000) then val = tostring(round(val / 1000), 0) .. "K";
|
elseif(val >= 100000) then val = tostring(round(val / 1000), 0) .. "K";
|
||||||
end
|
end
|
||||||
|
|
||||||
fsCasts:SetText("Cast count: " .. textCol_value .. val);
|
fsCasts:SetText("Cast count: " .. textCol_value .. CommafyNumber(val));
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_castCounter + Trackster_castOffset, "casts" , "spells casted", 10000);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateCrits()
|
local function UpdateCrits()
|
||||||
Trackster_critOffset = round(Trackster_critOffset);
|
Trackster_critOffset = round(Trackster_critOffset);
|
||||||
fsCrits:SetText("Crit count: " .. textCol_value .. (Trackster_critCounter + Trackster_critOffset));
|
fsCrits:SetText("Crit count: " .. textCol_value .. CommafyNumber(Trackster_critCounter + Trackster_critOffset));
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_critCounter + Trackster_critOffset, "crits", "critical hits", 10000);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateLogins()
|
local function UpdateLogins()
|
||||||
Trackster_loginOffset = round(Trackster_loginOffset);
|
Trackster_loginOffset = round(Trackster_loginOffset);
|
||||||
fsLogins:SetText("Login count: " .. textCol_value .. (Trackster_loginCounter + Trackster_loginOffset));
|
fsLogins:SetText("Login/Reload count: " .. textCol_value .. CommafyNumber(Trackster_loginCounter + Trackster_loginOffset));
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateBoss()
|
local function UpdateBoss()
|
||||||
Trackster_bossOffset = round(Trackster_bossOffset);
|
Trackster_bossOffset = round(Trackster_bossOffset);
|
||||||
fsBoss:SetText("Boss count: " .. textCol_value .. (Trackster_bossCounter + Trackster_bossOffset));
|
fsBoss:SetText("Boss count: " .. textCol_value .. CommafyNumber(Trackster_bossCounter + Trackster_bossOffset));
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_bossCounter + Trackster_bossOffset, "bosses", "bosses slain", 100);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -552,7 +687,9 @@ end
|
|||||||
|
|
||||||
local function UpdateChat()
|
local function UpdateChat()
|
||||||
Trackster_chatOffset = round(Trackster_chatOffset);
|
Trackster_chatOffset = round(Trackster_chatOffset);
|
||||||
fsChat:SetText("Chat msgs sent: " .. textCol_value .. (Trackster_chatCounter + Trackster_chatOffset));
|
fsChat:SetText("Chat msgs sent: " .. textCol_value .. CommafyNumber(Trackster_chatCounter + Trackster_chatOffset));
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_chatCounter + Trackster_chatOffset, "chatMessagesSent", "chat messages sent", 1000);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateItem()
|
local function UpdateItem()
|
||||||
@ -570,6 +707,8 @@ local function UpdateTime()
|
|||||||
|
|
||||||
local d, h, m, s = select(1, FormatTime(time() - Trackster_timestampRunBegin));
|
local d, h, m, s = select(1, FormatTime(time() - Trackster_timestampRunBegin));
|
||||||
fsAbsTime:SetText("Time real: " .. textCol_value .. d .. "d, " .. h .. ":" .. m .. ":" .. s);
|
fsAbsTime:SetText("Time real: " .. textCol_value .. d .. "d, " .. h .. ":" .. m .. ":" .. s);
|
||||||
|
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(lastConfirmedTime + internalTimeOffset + Trackster_timeOffset, "timePlayed", "time played", 3600*100);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -813,11 +952,15 @@ local function eventHandler(self, event, ...)
|
|||||||
UpdateDeaths();
|
UpdateDeaths();
|
||||||
|
|
||||||
elseif (event == "COMBAT_LOG_EVENT_UNFILTERED") then
|
elseif (event == "COMBAT_LOG_EVENT_UNFILTERED") then
|
||||||
local type, fo, foo, source = select(2, CombatLogGetCurrentEventInfo());
|
local type, _, _, source, _, _, dest = select(2, CombatLogGetCurrentEventInfo());
|
||||||
|
|
||||||
if(source == GetUnitName("player")) then
|
if(source == GetUnitName("player")) then
|
||||||
|
|
||||||
if (type == "UNIT_DIED") then UpdateKills();
|
if (type == "PARTY_KILL") then
|
||||||
|
Trackster_killCounter = Trackster_killCounter + 1;
|
||||||
|
PlaySoundFile("Interface\\AddOns\\Trackster\\hurt.wav", "MASTER");
|
||||||
|
print(type .. ', ' .. source .. ', ' .. dest);
|
||||||
|
UpdateKills();
|
||||||
|
|
||||||
elseif (type == "SPELL_DAMAGE") then
|
elseif (type == "SPELL_DAMAGE") then
|
||||||
|
|
||||||
@ -844,7 +987,7 @@ local function eventHandler(self, event, ...)
|
|||||||
elseif (event == "QUEST_TURNED_IN") then
|
elseif (event == "QUEST_TURNED_IN") then
|
||||||
--> This event may fire multiple times per quest turnin -.- so we'll just add a cooldown to it...
|
--> This event may fire multiple times per quest turnin -.- so we'll just add a cooldown to it...
|
||||||
local timeNow = time();
|
local timeNow = time();
|
||||||
if (timeNow - timeLastQuestCompleted > 3) then
|
if (timeNow - timeLastQuestCompleted > 1) then
|
||||||
print("Quest turned in, fired, and counted!");
|
print("Quest turned in, fired, and counted!");
|
||||||
Trackster_questCounter = Trackster_questCounter + 1;
|
Trackster_questCounter = Trackster_questCounter + 1;
|
||||||
UpdateQuests();
|
UpdateQuests();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user