Skip to content

Commit

Permalink
Add new race sounds for Cataclysm
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed May 2, 2024
1 parent ccdabf4 commit 0251fa7
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 30 deletions.
6 changes: 6 additions & 0 deletions Comm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ LootReserve.Comm.Handlers[Opcodes.SendWinner] = function(sender, item, winners,
if LootReserve.Client.Settings.RollRequestWinnerReaction then
item:OnCache(function()
local race, sex = select(3, LootReserve:UnitRace(LootReserve:Me())), LootReserve:UnitSex(LootReserve:Me());
if LootReserve:UnitIsGilneanForm(LootReserve:Me()) then
race = LootReserve.Constants.Races.Gilnean;
end
local soundTable = custom and LootReserve.Constants.Sounds.Congratulate or LootReserve.Constants.Sounds.Cheer;
if race and sex and soundTable[race] and soundTable[race][sex] then
PlaySound(soundTable[race][sex]);
Expand All @@ -838,6 +841,9 @@ LootReserve.Comm.Handlers[Opcodes.SendWinner] = function(sender, item, winners,
if LootReserve.Client.Settings.RollRequestLoserReaction and LootReserve:Contains(losers, LootReserve:Me()) then
item:OnCache(function()
local race, sex = select(3, LootReserve:UnitRace(LootReserve:Me())), LootReserve:UnitSex(LootReserve:Me());
if LootReserve:UnitIsGilneanForm(LootReserve:Me()) then
race = LootReserve.Constants.Races.Gilnean;
end
local soundTable = LootReserve.Constants.Sounds.Cry;
if race and sex and soundTable[race] and soundTable[race][sex] then
PlaySound(soundTable[race][sex]);
Expand Down
74 changes: 44 additions & 30 deletions Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,14 @@ LootReserve.Constants.Races = {
Scourge = 5,
Draenei = 11,
BloodElf = 10,
Gilnean = 23,
Worgen = 22,
Goblin = 9,
};
LootReserve.Constants.GilneanModels = {
[119940] = "Male",
[119563] = "Female",
};
LootReserve.Constants.ItemLevelInvTypeWhitelist = setmetatable({
[""] = false,
INVTYPE_BAG = false,
Expand Down Expand Up @@ -344,40 +349,49 @@ LootReserve.Constants.LocomotionPhrases = {
{
LevelUp = 1440,
Cheer = {
[Races.Human] = {[Genders.Male] = 2677, [Genders.Female] = 2689},
[Races.Dwarf] = {[Genders.Male] = 2725, [Genders.Female] = 2737},
[Races.Gnome] = {[Genders.Male] = 2835, [Genders.Female] = 2847},
[Races.NightElf] = {[Genders.Male] = 2749, [Genders.Female] = 2761},
[Races.Orc] = {[Genders.Male] = 2701, [Genders.Female] = 2713},
[Races.Troll] = {[Genders.Male] = 2859, [Genders.Female] = 2871},
[Races.Tauren] = {[Genders.Male] = 2797, [Genders.Female] = 2810},
[Races.Scourge] = {[Genders.Male] = 2773, [Genders.Female] = 2785},
[Races.Draenei] = {[Genders.Male] = 9706, [Genders.Female] = 9681},
[Races.BloodElf] = {[Genders.Male] = 9656, [Genders.Female] = 9632},
[Races.Human] = {[Genders.Male] = 2677, [Genders.Female] = 2689},
[Races.Dwarf] = {[Genders.Male] = 2725, [Genders.Female] = 2737},
[Races.Gnome] = {[Genders.Male] = 2835, [Genders.Female] = 2847},
[Races.NightElf] = {[Genders.Male] = 2749, [Genders.Female] = 2761},
[Races.Orc] = {[Genders.Male] = 2701, [Genders.Female] = 2713},
[Races.Troll] = {[Genders.Male] = 2859, [Genders.Female] = 2871},
[Races.Tauren] = {[Genders.Male] = 2797, [Genders.Female] = 2810},
[Races.Scourge] = {[Genders.Male] = 2773, [Genders.Female] = 2785},
[Races.Draenei] = {[Genders.Male] = 9706, [Genders.Female] = 9681},
[Races.BloodElf] = {[Genders.Male] = 9656, [Genders.Female] = 9632},
[Races.Gilnean] = {[Genders.Male] = 18972, [Genders.Female] = 18643},
[Races.Worgen] = {[Genders.Male] = 19297, [Genders.Female] = 19517},
[Races.Goblin] = {[Genders.Male] = 19089, [Genders.Female] = 19202},
},
Congratulate = {
[Races.Human] = {[Genders.Male] = 6168, [Genders.Female] = 6141},
[Races.Dwarf] = {[Genders.Male] = 6113, [Genders.Female] = 6104},
[Races.Gnome] = {[Genders.Male] = 6131, [Genders.Female] = 6122},
[Races.NightElf] = {[Genders.Male] = 6186, [Genders.Female] = 6177},
[Races.Orc] = {[Genders.Male] = 6366, [Genders.Female] = 6357},
[Races.Troll] = {[Genders.Male] = 6402, [Genders.Female] = 6393},
[Races.Tauren] = {[Genders.Male] = 6384, [Genders.Female] = 6375},
[Races.Scourge] = {[Genders.Male] = 6420, [Genders.Female] = 6411},
[Races.Draenei] = {[Genders.Male] = 9707, [Genders.Female] = 9682},
[Races.BloodElf] = {[Genders.Male] = 9657, [Genders.Female] = 9641},
[Races.Human] = {[Genders.Male] = 6168, [Genders.Female] = 6141},
[Races.Dwarf] = {[Genders.Male] = 6113, [Genders.Female] = 6104},
[Races.Gnome] = {[Genders.Male] = 6131, [Genders.Female] = 6122},
[Races.NightElf] = {[Genders.Male] = 6186, [Genders.Female] = 6177},
[Races.Orc] = {[Genders.Male] = 6366, [Genders.Female] = 6357},
[Races.Troll] = {[Genders.Male] = 6402, [Genders.Female] = 6393},
[Races.Tauren] = {[Genders.Male] = 6384, [Genders.Female] = 6375},
[Races.Scourge] = {[Genders.Male] = 6420, [Genders.Female] = 6411},
[Races.Draenei] = {[Genders.Male] = 9707, [Genders.Female] = 9682},
[Races.BloodElf] = {[Genders.Male] = 9657, [Genders.Female] = 9641},
[Races.Gilnean] = {[Genders.Male] = 18974, [Genders.Female] = 18647},
[Races.Worgen] = {[Genders.Male] = 19299, [Genders.Female] = 19378},
[Races.Goblin] = {[Genders.Male] = 19091, [Genders.Female] = 19199},
},
Cry = {
[Races.Human] = {[Genders.Male] = 6921, [Genders.Female] = 6916},
[Races.Dwarf] = {[Genders.Male] = 6901, [Genders.Female] = 6895},
[Races.Gnome] = {[Genders.Male] = 6911, [Genders.Female] = 6906},
[Races.NightElf] = {[Genders.Male] = 6931, [Genders.Female] = 6926},
[Races.Orc] = {[Genders.Male] = 6941, [Genders.Female] = 6936},
[Races.Troll] = {[Genders.Male] = 6961, [Genders.Female] = 6956},
[Races.Tauren] = {[Genders.Male] = 6951, [Genders.Female] = 6946},
[Races.Scourge] = {[Genders.Male] = 6972, [Genders.Female] = 6967},
[Races.Draenei] = {[Genders.Male] = 9701, [Genders.Female] = 9676},
[Races.BloodElf] = {[Genders.Male] = 9651, [Genders.Female] = 9647},
[Races.Human] = {[Genders.Male] = 6921, [Genders.Female] = 6916},
[Races.Dwarf] = {[Genders.Male] = 6901, [Genders.Female] = 6895},
[Races.Gnome] = {[Genders.Male] = 6911, [Genders.Female] = 6906},
[Races.NightElf] = {[Genders.Male] = 6931, [Genders.Female] = 6926},
[Races.Orc] = {[Genders.Male] = 6941, [Genders.Female] = 6936},
[Races.Troll] = {[Genders.Male] = 6961, [Genders.Female] = 6956},
[Races.Tauren] = {[Genders.Male] = 6951, [Genders.Female] = 6946},
[Races.Scourge] = {[Genders.Male] = 6972, [Genders.Female] = 6967},
[Races.Draenei] = {[Genders.Male] = 9701, [Genders.Female] = 9676},
[Races.BloodElf] = {[Genders.Male] = 9651, [Genders.Female] = 9647},
[Races.Gilnean] = {[Genders.Male] = 18975, [Genders.Female] = 18648},
[Races.Worgen] = {[Genders.Male] = 19300, [Genders.Female] = 23321},
[Races.Goblin] = {[Genders.Male] = 19092, [Genders.Female] = 19200},
},
};
end)();
Expand Down
12 changes: 12 additions & 0 deletions LootReserve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,18 @@ function LootReserve:UnitRace(player)
end);
end

function LootReserve:UnitIsGilneanForm(player)
if select(3, self:UnitRace(player)) == self.Constants.Races.Worgen then
self.PlayerModel = self.PlayerModel or CreateFrame("PlayerModel");
self.PlayerModel:SetUnit(player);
local model = self.PlayerModel:GetModelFileID();
if model then
return self.Constants.GilneanModels[model] and true or false;
end
end
return false;
end

function LootReserve:UnitSex(player)
if not self:IsCrossRealm() then
return UnitSex(player);
Expand Down

0 comments on commit 0251fa7

Please sign in to comment.