Initial pass at some fixes to try to get aldor/scryer stable

This commit is contained in:
2023-12-05 13:21:51 -05:00
parent 512cc4bc97
commit d64dbd59a6

View File

@@ -1,5 +1,7 @@
local PLAYER_EVENT_ON_LOGIN = 3
local FACTION_ALDOR = 932
local FACTION_SKRYER = 934
local racesHorde = "(2, 5, 6, 8, 10)"
local racesAlliance = "(1, 3, 4, 7, 11)"
@@ -45,17 +47,45 @@ local function OnPlayerLogin(event, player)
}
))
-- storage for the stattrat standings, see below the loop for how these are handled
local standingAldor = 0
local standingScryer = 0
if results then
repeat
local repGuid = results:GetUInt32(0)
local faction = results:GetUInt32(1)
local standing = results:GetUInt32(2)
player:Say("GUID " .. repGuid .. " Faction ".. tostring(faction) .. " standing ".. tostring(standing), 0)
player:Say(
"GUID " .. repGuid ..
" Faction ".. tostring(faction) ..
" standing ".. tostring(standing)
, 0)
if repGuid ~= guid then
if faction == FACTION_ALDOR then
standingAldor = standing
goto continue
end
if faction == FACTION_SKRYER then
standingScryer = standing
goto continue
end
player:SetReputation(faction, standing)
::continue::
end
until not results:NextRow()
-- deal with the shattrat factions by just setting the highest standing
if standingAldor > standingScryer then
player:SetReputation(FACTION_ALDOR, standingAldor)
elseif standingAldor < standingScryer then
player:SetReputation(FACTION_SKRYER, standingScryer)
end
end
end