fix issues with milestone announcements
This commit is contained in:
parent
e5ccf5cfb5
commit
154f49c1e9
46
main.lua
46
main.lua
@ -174,7 +174,7 @@ local function AutoAnnounceMilestone_INT_STEADY_IINCR(value, kindkey, prettyName
|
|||||||
local totalHours = math.floor((lastConfirmedTime + internalTimeOffset + Trackster_timeOffset) / 3600);
|
local totalHours = math.floor((lastConfirmedTime + internalTimeOffset + Trackster_timeOffset) / 3600);
|
||||||
message = "Congratulations! You have played for " .. totalHours .. " hours!";
|
message = "Congratulations! You have played for " .. totalHours .. " hours!";
|
||||||
else
|
else
|
||||||
message = "Congratulations! You have reached " .. value .. " " .. kindkey .. "!";
|
message = "Congratulations! You have reached " .. CommafyNumber(value) .. " " .. prettyName .. "!";
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -407,13 +407,13 @@ function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate)
|
|||||||
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__all, "distAll", " meters 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__swam, "distSwam", "meters 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__walked, "distWalked", "meters 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__groundmount, "distGroundmount", "meters 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__flight, "distFlight", "meters 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__taxi, "distTaxi", "meters rode (on taxi)", 500*000, 100); --> Each 500 km
|
||||||
AutoAnnounceMilestone_DEC_STEADY(val__ghost, "distGhost", "kilometers haunted", 10*000, 100); --> Each 10 km
|
AutoAnnounceMilestone_DEC_STEADY(val__ghost, "distGhost", "meters 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;
|
||||||
@ -569,24 +569,19 @@ function UpdateDeaths()
|
|||||||
|
|
||||||
if (val == "--") then
|
if (val == "--") then
|
||||||
fsDeaths:SetText("Death count: " .. textCol_value .. CommafyNumber(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 .. CommafyNumber(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);
|
||||||
|
|
||||||
fsKills:SetText("Kill count: " .. textCol_value .. CommafyNumber(Trackster_killCounter + Trackster_killsOffset));
|
fsKills:SetText("Kill count: " .. textCol_value .. CommafyNumber(Trackster_killCounter + Trackster_killsOffset));
|
||||||
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_deathOffset, "kills", "creatures slain", 1000);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateQuests()
|
local function UpdateQuests()
|
||||||
Trackster_questsOffset = round(Trackster_questsOffset);
|
Trackster_questsOffset = round(Trackster_questsOffset);
|
||||||
fsQuests:SetText("Quest count: " .. textCol_value .. CommafyNumber(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()
|
||||||
@ -626,8 +621,6 @@ end
|
|||||||
local function UpdateJump()
|
local function UpdateJump()
|
||||||
Trackster_jumpOffset = round(Trackster_jumpOffset);
|
Trackster_jumpOffset = round(Trackster_jumpOffset);
|
||||||
fsJump:SetText("Jump count: " .. textCol_value .. CommafyNumber(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()
|
||||||
@ -643,15 +636,11 @@ local function UpdateCasts()
|
|||||||
end
|
end
|
||||||
|
|
||||||
fsCasts:SetText("Cast count: " .. textCol_value .. CommafyNumber(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 .. CommafyNumber(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()
|
||||||
@ -663,8 +652,6 @@ end
|
|||||||
local function UpdateBoss()
|
local function UpdateBoss()
|
||||||
Trackster_bossOffset = round(Trackster_bossOffset);
|
Trackster_bossOffset = round(Trackster_bossOffset);
|
||||||
fsBoss:SetText("Boss count: " .. textCol_value .. CommafyNumber(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
|
||||||
|
|
||||||
|
|
||||||
@ -672,7 +659,6 @@ local function UpdateIlvl()
|
|||||||
local overall, equipped = GetAverageItemLevel();
|
local overall, equipped = GetAverageItemLevel();
|
||||||
local val = math.floor(equipped + Trackster_IlvlOffset);
|
local val = math.floor(equipped + Trackster_IlvlOffset);
|
||||||
|
|
||||||
|
|
||||||
fsIlvl:SetText("ItemLvl: " .. textCol_value .. val);
|
fsIlvl:SetText("ItemLvl: " .. textCol_value .. val);
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -688,8 +674,6 @@ end
|
|||||||
local function UpdateChat()
|
local function UpdateChat()
|
||||||
Trackster_chatOffset = round(Trackster_chatOffset);
|
Trackster_chatOffset = round(Trackster_chatOffset);
|
||||||
fsChat:SetText("Chat msgs sent: " .. textCol_value .. CommafyNumber(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()
|
||||||
@ -707,14 +691,13 @@ 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
|
||||||
|
|
||||||
|
|
||||||
hooksecurefunc( "JumpOrAscendStart", function()
|
hooksecurefunc( "JumpOrAscendStart", function()
|
||||||
if (IsFlying() == false and UnitOnTaxi("PLAYER") == false and IsSwimming() == false) then
|
if (IsFlying() == false and UnitOnTaxi("PLAYER") == false and IsSwimming() == false) then
|
||||||
Trackster_jumpCounter = Trackster_jumpCounter + 1;
|
Trackster_jumpCounter = Trackster_jumpCounter + 1;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_jumpCounter + Trackster_jumpOffset, "jumps", "times jumped", 10000);
|
||||||
UpdateJump();
|
UpdateJump();
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -895,6 +878,7 @@ local function ProcessChatMsg(...)
|
|||||||
|
|
||||||
if(author == GetUnitName("player") .. "-" .. GetRealmName()) then
|
if(author == GetUnitName("player") .. "-" .. GetRealmName()) then
|
||||||
Trackster_chatCounter = Trackster_chatCounter + 1;
|
Trackster_chatCounter = Trackster_chatCounter + 1;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_chatCounter + Trackster_chatOffset, "chatMessagesSent", "chat messages sent", 1000);
|
||||||
UpdateChat();
|
UpdateChat();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -915,6 +899,7 @@ function UpdateHandler(self, deltaTime)
|
|||||||
updateOneSecondTimer = 0;
|
updateOneSecondTimer = 0;
|
||||||
|
|
||||||
internalTimeOffset = internalTimeOffset + 1;
|
internalTimeOffset = internalTimeOffset + 1;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(lastConfirmedTime + internalTimeOffset + Trackster_timeOffset, "timePlayed", "time played", 3600*100);
|
||||||
FormatTime(lastConfirmedTime + internalTimeOffset + Trackster_timeOffset);
|
FormatTime(lastConfirmedTime + internalTimeOffset + Trackster_timeOffset);
|
||||||
UpdateTime();
|
UpdateTime();
|
||||||
end
|
end
|
||||||
@ -949,6 +934,8 @@ local function eventHandler(self, event, ...)
|
|||||||
UpdatePlvl();
|
UpdatePlvl();
|
||||||
|
|
||||||
elseif (event == "PLAYER_DEAD") then
|
elseif (event == "PLAYER_DEAD") then
|
||||||
|
local val = select(1, GetStatistic(60));
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(val + Trackster_deathOffset, "deaths", "deaths", 100);
|
||||||
UpdateDeaths();
|
UpdateDeaths();
|
||||||
|
|
||||||
elseif (event == "COMBAT_LOG_EVENT_UNFILTERED") then
|
elseif (event == "COMBAT_LOG_EVENT_UNFILTERED") then
|
||||||
@ -960,6 +947,7 @@ local function eventHandler(self, event, ...)
|
|||||||
Trackster_killCounter = Trackster_killCounter + 1;
|
Trackster_killCounter = Trackster_killCounter + 1;
|
||||||
PlaySoundFile("Interface\\AddOns\\Trackster\\hurt.wav", "MASTER");
|
PlaySoundFile("Interface\\AddOns\\Trackster\\hurt.wav", "MASTER");
|
||||||
print(type .. ', ' .. source .. ', ' .. dest);
|
print(type .. ', ' .. source .. ', ' .. dest);
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_killCounter + Trackster_killsOffset, "kills", "creatures slain", 1000);
|
||||||
UpdateKills();
|
UpdateKills();
|
||||||
|
|
||||||
elseif (type == "SPELL_DAMAGE") then
|
elseif (type == "SPELL_DAMAGE") then
|
||||||
@ -967,6 +955,7 @@ local function eventHandler(self, event, ...)
|
|||||||
isCrit = select(21, CombatLogGetCurrentEventInfo());
|
isCrit = select(21, CombatLogGetCurrentEventInfo());
|
||||||
if (isCrit) then
|
if (isCrit) then
|
||||||
Trackster_critCounter = Trackster_critCounter + 1;
|
Trackster_critCounter = Trackster_critCounter + 1;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_critCounter + Trackster_critOffset, "crits", "critical hits", 10000);
|
||||||
UpdateCrits();
|
UpdateCrits();
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -977,6 +966,7 @@ local function eventHandler(self, event, ...)
|
|||||||
|
|
||||||
elseif (type == "SPELL_CAST_SUCCESS") then
|
elseif (type == "SPELL_CAST_SUCCESS") then
|
||||||
Trackster_castCounter = Trackster_castCounter + 1;
|
Trackster_castCounter = Trackster_castCounter + 1;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_castCounter + Trackster_castOffset, "casts" , "spells casted", 10000);
|
||||||
UpdateCasts();
|
UpdateCasts();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -990,6 +980,7 @@ local function eventHandler(self, event, ...)
|
|||||||
if (timeNow - timeLastQuestCompleted > 1) 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;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_questCounter + Trackster_questsOffset, "quests", "quests completed", 100);
|
||||||
UpdateQuests();
|
UpdateQuests();
|
||||||
else
|
else
|
||||||
print("Quest turned in, fired, but it was ignored as a duplicate!");
|
print("Quest turned in, fired, but it was ignored as a duplicate!");
|
||||||
@ -1013,6 +1004,7 @@ local function eventHandler(self, event, ...)
|
|||||||
|
|
||||||
elseif (event == "BOSS_KILL") then
|
elseif (event == "BOSS_KILL") then
|
||||||
Trackster_bossCounter = Trackster_bossCounter + 1;
|
Trackster_bossCounter = Trackster_bossCounter + 1;
|
||||||
|
AutoAnnounceMilestone_INT_STEADY_IINCR(Trackster_bossCounter + Trackster_bossOffset, "bosses", "bosses slain", 100);
|
||||||
UpdateBoss();
|
UpdateBoss();
|
||||||
|
|
||||||
elseif (event == "CHAT_MSG_LOOT") then
|
elseif (event == "CHAT_MSG_LOOT") then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user