Update TOC for 12.1. Handle secret values in one of the places they might exist.
This commit is contained in:
parent
4b1a1af6b3
commit
9c0705f2d3
133
TurnIn.lua
133
TurnIn.lua
@ -495,84 +495,87 @@ function TI_HandleGossipWindow(gorq)
|
||||
|
||||
|
||||
local npcname = UnitName("npc");
|
||||
TI_AddNPCToTempList(npcname, ListEntry);
|
||||
|
||||
if(TI_status.autoadd and (not TI_NPCDB[npcname])) then
|
||||
TI_debug("autoadd on, adding this NPC", TI_status.autoadd, TI_NPCDB[npcname]);
|
||||
TI_AddNPCToList(ListEntry, npcname);
|
||||
end
|
||||
|
||||
-- If a NPC is in the Database but a new dialog option has appeared (new daily/completed quest) then add it to the DB
|
||||
if (TI_NPCDB[npcname]) then
|
||||
for k1, v1 in ipairs(ListEntry) do
|
||||
local found = false;
|
||||
for k2, v2 in ipairs(TI_NPCDB[npcname]) do
|
||||
if (v2.type == v1.type and v2.name == v1.name) then
|
||||
found = true;
|
||||
if not issecretvalue(npcname) then
|
||||
TI_AddNPCToTempList(npcname, ListEntry);
|
||||
|
||||
if(TI_status.autoadd and (not TI_NPCDB[npcname])) then
|
||||
TI_debug("autoadd on, adding this NPC", TI_status.autoadd, TI_NPCDB[npcname]);
|
||||
TI_AddNPCToList(ListEntry, npcname);
|
||||
end
|
||||
|
||||
-- If a NPC is in the Database but a new dialog option has appeared (new daily/completed quest) then add it to the DB
|
||||
if (TI_NPCDB[npcname]) then
|
||||
for k1, v1 in ipairs(ListEntry) do
|
||||
local found = false;
|
||||
for k2, v2 in ipairs(TI_NPCDB[npcname]) do
|
||||
if (v2.type == v1.type and v2.name == v1.name) then
|
||||
found = true;
|
||||
end
|
||||
end
|
||||
if (not found) then
|
||||
table.insert(TI_NPCDB[npcname], v1)
|
||||
TI_PopulateOptions("npclist updated");
|
||||
end
|
||||
end
|
||||
if (not found) then
|
||||
table.insert(TI_NPCDB[npcname], v1)
|
||||
TI_PopulateOptions("npclist updated");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
||||
TI_debug("Out of available/active quests, giving up ");
|
||||
TI_ResetPointers();
|
||||
return;
|
||||
end
|
||||
|
||||
TI_debug(npcname);
|
||||
if(TI_NPCDB[npcname]) then
|
||||
local thisnpc = TI_NPCDB[npcname];
|
||||
if(thisnpc.state) then
|
||||
TI_debug("npc is active, using his options");
|
||||
for i1,current in ipairs(thisnpc) do
|
||||
if (current.state == true) then
|
||||
TI_debug("Current Quest: "..current.name);
|
||||
if (TI_specnum == 0 or i1 > TI_specnum) then
|
||||
TI_specnum = i1;
|
||||
if (current.type == "availquest") then
|
||||
for i2,v2 in ipairs(AvailableQuests) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Available Match Found: "..current.name);
|
||||
SAvQ(v2.questID);
|
||||
return;
|
||||
end
|
||||
end
|
||||
elseif (current.type == "activequest") then
|
||||
for i2,v2 in ipairs(ActiveQuests) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Active Match Found: "..current.name..", "..current.type);
|
||||
SAcQ(v2.questID);
|
||||
return;
|
||||
end
|
||||
end
|
||||
else
|
||||
for i2,v2 in ipairs(GossipOptions) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type);
|
||||
if(v2.args) then
|
||||
TI_FunctionList.g.gossip(v2.args);
|
||||
else
|
||||
TI_FunctionList.g.gossip(i2);
|
||||
|
||||
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
||||
TI_debug("Out of available/active quests, giving up ");
|
||||
TI_ResetPointers();
|
||||
return;
|
||||
end
|
||||
|
||||
TI_debug(npcname);
|
||||
if(TI_NPCDB[npcname]) then
|
||||
local thisnpc = TI_NPCDB[npcname];
|
||||
if(thisnpc.state) then
|
||||
TI_debug("npc is active, using his options");
|
||||
for i1,current in ipairs(thisnpc) do
|
||||
if (current.state == true) then
|
||||
TI_debug("Current Quest: "..current.name);
|
||||
if (TI_specnum == 0 or i1 > TI_specnum) then
|
||||
TI_specnum = i1;
|
||||
if (current.type == "availquest") then
|
||||
for i2,v2 in ipairs(AvailableQuests) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Available Match Found: "..current.name);
|
||||
SAvQ(v2.questID);
|
||||
return;
|
||||
end
|
||||
end
|
||||
elseif (current.type == "activequest") then
|
||||
for i2,v2 in ipairs(ActiveQuests) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Active Match Found: "..current.name..", "..current.type);
|
||||
SAcQ(v2.questID);
|
||||
return;
|
||||
end
|
||||
end
|
||||
else
|
||||
for i2,v2 in ipairs(GossipOptions) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type);
|
||||
if(v2.args) then
|
||||
TI_FunctionList.g.gossip(v2.args);
|
||||
else
|
||||
TI_FunctionList.g.gossip(i2);
|
||||
end
|
||||
return;
|
||||
end
|
||||
return;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return;
|
||||
else
|
||||
TI_debug("npc in list, but not active");
|
||||
end
|
||||
return;
|
||||
else
|
||||
TI_debug("npc in list, but not active");
|
||||
TI_debug("npc not in list");
|
||||
end
|
||||
else
|
||||
TI_debug("npc not in list");
|
||||
end
|
||||
|
||||
if(TI_status.usedefault == false) then
|
||||
TI_debug("npc not in list, default set to off, returning.");
|
||||
return;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
## Interface: 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||
## X-Compatible-With: 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||
## Interface: 120100, 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||
## X-Compatible-With: 120100, 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||
## Title: Turn In
|
||||
## Notes: Automates the selection of quest and gossip options.
|
||||
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
|
||||
|
||||
Loading…
Reference in New Issue
Block a user