Skip to content

Commit

Permalink
Added support for Classic WoW
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed Apr 28, 2020
1 parent de4e60f commit e59fde9
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 27 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Release new AddOn version
name: Release AddOn

on:
push:
tags:
- '**'

env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}

jobs:
release:
runs-on: ubuntu-latest
steps:
# pull the repository (required)
- uses: actions/checkout@v1

# run release.sh without any arguments (default)
- uses: BigWigsMods/packager@master
with:
args: release.sh -g 1.13.4

# run release.sh with arguments
- uses: BigWigsMods/packager@master
with:
args: release.sh

# use a specific version of release.sh (short-SHA)
- uses: BigWigsMods/packager@a80cac9
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.luacheckrc
.release
.vscode
25 changes: 14 additions & 11 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ function KIT:OnInitialize()
--- Dungeon Names ---
---------------------

-- grab the localized names from the dungeon finder
for i = 1, GetNumRFDungeons() do
local id, name = GetRFDungeonInfo(i)
S.DungeonName[id] = name
end

for k, v in pairs(S.SpecialDungeon) do
S.DungeonName[k] = GetLFGDungeonInfo(k)
if not S.isClassic then
-- grab the localized names from the dungeon finder
for i = 1, GetNumRFDungeons() do
local id, name = GetRFDungeonInfo(i)
S.DungeonName[id] = name
end

for k, v in pairs(S.SpecialDungeon) do
S.DungeonName[k] = GetLFGDungeonInfo(k)
end
end

S.RemapDungeon()
Expand All @@ -72,7 +74,7 @@ function KIT:OnInitialize()
end

function KIT:OnEnable()
for _, v in ipairs(S.events) do
for _, v in ipairs(S.isClassic and S.ClassicEvents or S.Events ) do
self:RegisterEvent(v)
end

Expand Down Expand Up @@ -157,7 +159,7 @@ function KIT:PLAYER_ENTERING_WORLD(event)

if S.pve[S.instance] and not S.IsGarrison() then
-- zoned from an instance to a different instance
local changedInstances = (prevInstance and prevInstance ~= S.mapinstance)
local changedInstances = prevInstance and prevInstance ~= S.mapinstance
-- entered instance
if char.timeInstance == 0 or changedInstances then
self:StartData()
Expand Down Expand Up @@ -191,9 +193,10 @@ function KIT:COMBAT_LOG_EVENT_UNFILTERED(event)
local unitType, _, _, _, _, npcId = strsplit("-", destGUID)
npcId = tonumber(npcId)

local hasBossID = S.isClassic and S.ClassicBossIDs[npcId] or S.BossIDs[npcId]
-- dont report raid finder in normal/heroic/mythic raids
-- note that we still want to report in dungeons like maraudon and seasonal
local name = not S.IsNormalRaid() and S.DungeonIDs[npcId] or S.BossIDs[npcId]
local name = not S.IsNormalRaid() and S.DungeonIDs[npcId] or hasBossID

if S.npc[unitType] and name and char.timeInstance > 0 then

Expand Down
37 changes: 35 additions & 2 deletions KethoInstanceTimer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ KethoInstanceTimer = LibStub("AceAddon-3.0"):NewAddon(NAME, "AceEvent-3.0", "Ace
local KIT = KethoInstanceTimer
KIT.S = S -- debug purpose

S.isClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC)

local L = S.L
local profile, char

Expand Down Expand Up @@ -36,6 +38,12 @@ S.events = {
"SCENARIO_COMPLETED",
}

S.ClassicEvents = {
"PLAYER_ENTERING_WORLD",
"COMBAT_LOG_EVENT_UNFILTERED",
"CHAT_MSG_SYSTEM",
}

----------------------
--- Instance Types ---
----------------------
Expand Down Expand Up @@ -75,8 +83,10 @@ S.garrison = {
-- GetDifficultyInfo(difficultyID)
S.difficulty = {}

for i = 1, 30 do
S.difficulty[i] = GetDifficultyInfo(i)
if not S.isClassic then
for i = 1, 30 do
S.difficulty[i] = GetDifficultyInfo(i)
end
end

local normalRaid = {
Expand Down Expand Up @@ -159,6 +169,29 @@ S.BossIDs = { -- untested
[155126] = true, -- Queen Azshara; The Eternal Palace
}

S.ClassicBossIDs = {
[639] = true, -- Edwin VanCleef; Deadmines
[1716] = true, -- Bazil Thredd; Stormwind Stockade
[1853] = true, -- Darkmaster Gandling; Scholomance
[2748] = true, -- Archaedas; Uldaman
[3654] = true, -- Mutanus the Devourer; Wailing Caverns
[3977] = true, -- High Inquisitor Whitemane; Scarlet Monastery
[4275] = true, -- Archmage Arugal; Shadowfang Keep
[4421] = true, -- Charlga Razorflank; Razorfen Kraul
[4829] = true, -- Aku'mai; Blackfathom Deeps
[5709] = true, -- Shade of Eranikus; Sunken Temple
[7267] = true, -- Chief Ukorz Sandscalp; Zul'Farrak
[7358] = true, -- Amnennar the Coldbringer; Razorfen Downs
[7800] = true, -- Mekgineer Thermaplugg; Gnomeregan
[9019] = true, -- Emperor Dagran Thaurissan
[9568] = L["Lower Blackrock Spire"], -- Overlord Wyrmthalak
[10363] = L["Upper Blackrock Spire"], -- General Drakkisath
[10440] = true, -- Lord Aurius Rivendare; Stratholme
[11501] = true, -- King Gordok; Dire Maul
[11520] = true, -- Taragaman the Hungerer; Ragefire Chasm
[12201] = true, -- Princess Theradras; Maraudon
}

-- /run for i = 1, GetNumRFDungeons() do print(GetRFDungeonInfo(i)) end
-- GetLFGDungeonInfo(i)
S.DungeonName = {}
Expand Down
7 changes: 6 additions & 1 deletion KethoInstanceTimer.toc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#@retail@
## Interface: 80300
#@end-retail@
#@non-retail@
# ## Interface: 11304
#@end-non-retail@
## Version: @project-version@
## Title: KethoInstanceTimer
## Notes: Ketho's Instance Timer
## Author: Ketho @ EU-Boulderfist
## SavedVariables: KethoInstanceTimerDB
## OptionalDeps: Ace3
## OptionalDeps: Ace3, LibSink-2.0
## X-Embeds: Ace3
## X-Curse-Project-ID: 30054
## X-WoWI-ID: 19910
Expand Down
2 changes: 1 addition & 1 deletion Locales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local _, S = ...

local L = {
enUS = {
INSTANCE_TIMER = INSTANCE.." Timer",
INSTANCE_TIMER = "Instance Timer",
INSTANCE_TIMER_MSG = "[<INSTANCE>] cleared in <TIME> [<START>]-[<END>]",
MANUAL_RESET = TRACKER_SORT_MANUAL.." "..RESET,
MANUAL_START = TRACKER_SORT_MANUAL.." "..START,
Expand Down
3 changes: 2 additions & 1 deletion Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ S.options = {
Stopwatch = {
type = "toggle", order = 5,
width = "full", descStyle = "",
name = "|TInterface\\Icons\\Spell_Holy_BorrowedTime:16:16:1:0"..S.crop.."|t "..STOPWATCH_TITLE.."|r",
name = S.isClassic and "|TInterface\\Icons\\spell_nature_timestop:16:16:1:0"..S.crop.."|t "..STOPWATCH_TITLE.."|r"
or "|TInterface\\Icons\\Spell_Holy_BorrowedTime:16:16:1:0"..S.crop.."|t "..STOPWATCH_TITLE.."|r",
set = function(i, v)
profile.Stopwatch = v
if v then
Expand Down

0 comments on commit e59fde9

Please sign in to comment.