Description:
https://www.wowhead.com/npc=18261/lantresor-of-the-blade
https://www.wowhead.com/quest=10108/diplomatic-measures
https://www.wowhead.com/quest=9928/armaments-for-deception
https://www.wowhead.com/quest=9927/ruthless-cunning

Current behaviour:
Completing Diplomatic Measures does not cause Lantresor of the Blade to give Armaments for Deception and Ruthless Cunning.
Expected behaviour:
When completing the quest Diplomatic Measures, Lantresor of the Blade should then provide Armaments for Deception and Ruthless Cunning.
Branch(es):
3.3.5
TC rev. hash/commit:
TrinityCore rev. c5fa08afc1d1 2018-09-11 18:51:00 +0200 (3.3.5 branch) (Win64, RelWithDebInfo, Static)
Using SSL version: OpenSSL 1.1.0h 27 Mar 2018 (library: OpenSSL 1.1.0h 27 Mar 2018)
Using Boost version: 1.66.0
Using MySQL version: 5.5.38
Using CMake version: 3.12.0
Compiled on: Windows 10.0.17134
Automatic database updates are enabled for the following databases: Auth, Characters, World
Worldserver listening connections on port 8085
Realmlist (Realm Id: 1) configured in port 8085
VMAPs status: Enabled. LineOfSight: 1, getHeight: 1, indoorCheck: 1
MMAPs status: Enabled
maps directory located in ./maps. Total size: 252191207 bytes
vmaps directory located in ./vmaps. Total size: 588247501 bytes
mmaps directory located in ./mmaps. Total size: 2152621724 bytes
Using enUS DBC Locale as default. All available DBC locales: enUS
Using World DB: TDB 335.64
Operating system: Windows 10 Pro
PrevQuestID is set to 10107 (horde version)
ExclusiveGroup value for both Armaments of Deception and Ruthless Cunning are set to -9927 (Ruthless Cunning) - this sounds wrong because Lantresor should provide both quests to both sides, and neither is a prereq for the other. Both quests require either 10107 or 10108 to be completed (but obviously not both).
I just don't know how to express that in the database.

Hmm, OK. Let us look at what is in TDB 335.64 now for those quests:
SELECT * FROM `quest_template_addon` WHERE `ID` IN (9927,9928,10107,10108);
ID MaxLevel AllowableClasses SourceSpellID PrevQuestID NextQuestID ExclusiveGroup RewardMailTemplateID RewardMailDelay RequiredSkillID RequiredSkillPoints RequiredMinRepFaction RequiredMaxRepFaction RequiredMinRepValue RequiredMaxRepValue ProvidedItemCount SpecialFlags
----- -------- ---------------- ------------- ----------- ----------- -------------- -------------------- --------------- --------------- ------------------- --------------------- --------------------- ------------------- ------------------- ----------------- ------------
9927 0 0 0 10108 0 -9927 0 0 0 0 0 0 0 0 1 0
9928 0 0 0 10107 0 -9927 0 0 0 0 0 0 0 0 0 0
10107 0 0 0 9907 9927 0 0 0 0 0 0 0 0 0 0 2
10108 0 0 0 9922 9928 0 0 0 0 0 0 0 0 0 0 2
md5-565e9580702b3935f693d0096236ab35
ID QuestType QuestLevel MinLevel QuestSortID QuestInfoID SuggestedGroupNum RequiredFactionId1 RequiredFactionId2 RequiredFactionValue1 RequiredFactionValue2 RewardNextQuest RewardXPDifficulty RewardMoney RewardBonusMoney RewardDisplaySpell RewardSpell RewardHonor RewardKillHonor StartItem Flags RequiredPlayerKills RewardItem1 RewardAmount1 RewardItem2 RewardAmount2 RewardItem3 RewardAmount3 RewardItem4 RewardAmount4 ItemDrop1 ItemDropQuantity1 ItemDrop2 ItemDropQuantity2 ItemDrop3 ItemDropQuantity3 ItemDrop4 ItemDropQuantity4 RewardChoiceItemID1 RewardChoiceItemQuantity1 RewardChoiceItemID2 RewardChoiceItemQuantity2 RewardChoiceItemID3 RewardChoiceItemQuantity3 RewardChoiceItemID4 RewardChoiceItemQuantity4 RewardChoiceItemID5 RewardChoiceItemQuantity5 RewardChoiceItemID6 RewardChoiceItemQuantity6 POIContinent POIx POIy POIPriority RewardTitle RewardTalents RewardArenaPoints RewardFactionID1 RewardFactionValue1 RewardFactionOverride1 RewardFactionID2 RewardFactionValue2 RewardFactionOverride2 RewardFactionID3 RewardFactionValue3 RewardFactionOverride3 RewardFactionID4 RewardFactionValue4 RewardFactionOverride4 RewardFactionID5 RewardFactionValue5 RewardFactionOverride5 TimeAllowed AllowableRaces LogTitle LogDescription QuestDescription AreaDescription QuestCompletionLog RequiredNpcOrGo1 RequiredNpcOrGo2 RequiredNpcOrGo3 RequiredNpcOrGo4 RequiredNpcOrGoCount1 RequiredNpcOrGoCount2 RequiredNpcOrGoCount3 RequiredNpcOrGoCount4 RequiredItemId1 RequiredItemId2 RequiredItemId3 RequiredItemId4 RequiredItemId5 RequiredItemId6 RequiredItemCount1 RequiredItemCount2 RequiredItemCount3 RequiredItemCount4 RequiredItemCount5 RequiredItemCount6 Unknown0 ObjectiveText1 ObjectiveText2 ObjectiveText3 ObjectiveText4 VerifiedBuild
9927 2 66 64 3518 0 0 0 0 0 0 0 5 35000 67800 0 0 0 0 25552 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Ruthless Cunning Lantresor of the Blade at the Burning Blade Ruins in Nagrand wants you to drive 10 Warmaul Ogre Banners through the bodies of Kil'sorrow members at Kil'sorrow Fortress.$B$BReturn any unused Warmaul Ogre Banners.
10107 2 66 64 3518 0 0 0 0 0 0 0 4 0 51300 0 0 0 0 0 138 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 941 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 690 Diplomatic Measures Jorin Deadeye at Garadar in Nagrand has asked that you find and speak with Lantresor of the Blade in the Burning Blade Ruins. Kilrath sends news of the Boulderfist leader: He is an orc! An ancient orc that passed through the Dark Portal in the time of our fathers and has since returned to his homeland. I wish for you to track down this orc and try to convince him to pull back the Boulderfist ogres. He resides on an upper platform in the Burning Blade Ruins to the southeast near the border of Terokkar. Good Hear the Tale of the BlademasterblReturn to Lantresor of the Blade at the Burning Blade Ruins in Nagrand. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12340
10108 2 66 64 3518 0 0 0 0 0 0 0 4 0 5100 0 0 0 0 0 138 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 978 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1101 Diplomatic Measures Mo'mor the Breaker at Telaar in Nagrand has asked that you find and speak with Lantresor of the Blade in the Burning Blade Ruins. The huntress's agents send news of the Boulderfist leader: He is an orc! An ancient orc that passed through the Dark Portal in the time of our fathers and has since returned to his homeland. I wish for you to track down this orc and try to convince him to pull back the Boulderfist ogres. He resides on an upper platform in the Burning Blade Ruins to the east. Good luck, $N!$B$BBe warnHear the Tale of the Blademaster Return to Lantresor of the Blade at the Burning Blade Ruins in Nagrand. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12340
```
The problem with assigning a PrevQuestID is that there are two possible quests that lead up to it (alliance or horde). And the problem with assigning a NextQuestID is that there are two quests that become available upon completing your factions quest (9927 & 9928). I am really stumped and really quite agitated that I can't figure this out with the materials provided in the wikia.
Could someone please help explain how this is fixed, I'm sure it's something simple and I really want to learn.
This is as far as I can get to at least make Lantresor of the Blade offer quest 9928. I don't know why I can't get both 9928 and 9927 to appear.
ID PrevQuestID NextQuestID ExclusiveGroup
----- ----------- ----------- --------------
10107 9907 9927 -10107
10108 9922 9927 -10107
9927 0 0 -9927
9928 0 0 -9927
Very well. We will have to figure out which values are incorrect and then solve the issue by correcting the incorrect values.
As far as I know, this chain has to be fixed via conditions.
This is how the quest flow should be:
I don't know if/how this can be done with quest_template_addon fields, as it's a very uncommon case for quest chains.
Plus, Message to Garadar is a requirement for yet another quest chain (A Visit With the Greatmother), so its ExclusiveGroup shouldn't be changed.
UPDATE `quest_template_addon` SET `PrevQuestID`=0, `ExclusiveGroup`=0 WHERE `ID` IN (9927, 9928, 9931, 9932);
UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID`=9934;
UPDATE `quest_template_addon` SET `NextQuestID`=0 WHERE `ID` IN (10107, 10108);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry` IN (9927, 9928, 9931, 9932, 9933, 9934);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(19, 0, 9927, 0, 0, 8, 0, 10107, 0, 0, 0, 0, 0, "", "Quest Ruthless Cunning requires quest Diplomatic Measures (Horde) rewarded OR"),
(19, 0, 9927, 0, 1, 8, 0, 10108, 0, 0, 0, 0, 0, "", "Quest Ruthless Cunning requires quest Diplomatic Measures (Alliance) rewarded"),
(19, 0, 9928, 0, 0, 8, 0, 10107, 0, 0, 0, 0, 0, "", "Quest Armaments for Deception requires quest Diplomatic Measures (Horde) rewarded OR"),
(19, 0, 9928, 0, 1, 8, 0, 10108, 0, 0, 0, 0, 0, "", "Quest Armaments for Deception requires quest Diplomatic Measures (Alliance) rewarded"),
(19, 0, 9931, 0, 0, 8, 0, 9927, 0, 0, 0, 0, 0, "", "Quest Returning the Favor requires quest Ruthless Cunning rewarded AND"),
(19, 0, 9931, 0, 0, 8, 0, 9928, 0, 0, 0, 0, 0, "", "Quest Returning the Favor requires quest Armaments for Deception rewarded"),
(19, 0, 9932, 0, 0, 8, 0, 9927, 0, 0, 0, 0, 0, "", "Quest Body of Evidence requires quest Ruthless Cunning rewarded AND"),
(19, 0, 9932, 0, 0, 8, 0, 9928, 0, 0, 0, 0, 0, "", "Quest Body of Evidence requires quest Armaments for Deception rewarded"),
(19, 0, 9933, 0, 0, 8, 0, 9931, 0, 0, 0, 0, 0, "", "Quest Message to Telaar requires quest Returning the Favor rewarded AND"),
(19, 0, 9933, 0, 0, 8, 0, 9932, 0, 0, 0, 0, 0, "", "Quest Message to Telaar requires quest Body of Evidence rewarded"),
(19, 0, 9934, 0, 0, 8, 0, 9931, 0, 0, 0, 0, 0, "", "Quest Message to Garadar requires quest Returning the Favor rewarded AND"),
(19, 0, 9934, 0, 0, 8, 0, 9932, 0, 0, 0, 0, 0, "", "Quest Message to Garadar requires quest Body of Evidence rewarded");
@Rynem Worked out great for Alliance.
I'm trying to convert Rynem's fix to not use conditions but as far as I can tell PrevQuestId and NextQuestId don't allow to do a "unlock two quests after turning in two quests" behavior. Can't find anything useful in the wiki either.
Closest I can find is "one quest unlocks two quests" which is not applicable to this case, unless one wants to use a mix of conditions and quest_template_addon (I strongly advise against that - using either one or the other makes any potential issue easier to spot).
Aren't conditions allowed to be used in very uncommon cases like this chain?
This must fix the chaining
``sql
UPDATEquest_template_addonSETPrevQuestID=0,NextQuestID=0,ExclusiveGroup=0 WHEREID=9927;
UPDATEquest_template_addonSETPrevQuestID=9927,NextQuestID=0,ExclusiveGroup=0 WHEREID=9928;
UPDATEquest_template_addonSETPrevQuestID=9928,NextQuestID=0,ExclusiveGroup=-9931 WHEREID=9931;
UPDATEquest_template_addonSETPrevQuestID=9931,NextQuestID=10044,ExclusiveGroup=-9868 WHEREID=9934;
UPDATEquest_template_addonSETPrevQuestID=10009,NextQuestID=0,ExclusiveGroup=0 WHEREID=10010;
UPDATEquest_template_addonSETPrevQuestID=10010,NextQuestID=0,ExclusiveGroup=0 WHEREID=10011;
UPDATEquest_template_addonSETPrevQuestID=10011,NextQuestID=0,ExclusiveGroup=0 WHEREID=10044;
UPDATEquest_template_addonSETPrevQuestID=9907,NextQuestID=9927,ExclusiveGroup=0 WHEREID=10107;
UPDATEquest_template_addonSETPrevQuestID=9922,NextQuestID=9927,ExclusiveGroup=0 WHEREID`=10108;
I've tested both fixes and tried everything I could to make it work without conditions - turns out that the two-quests-unlock-two-quests is impossible to replicate using quest_template_addon.
This is probably the only case where we have this kind of quest relation, so it's fine to use conditions :P
Most helpful comment
As far as I know, this chain has to be fixed via conditions.
This is how the quest flow should be:
I don't know if/how this can be done with quest_template_addon fields, as it's a very uncommon case for quest chains.
Plus, Message to Garadar is a requirement for yet another quest chain (A Visit With the Greatmother), so its ExclusiveGroup shouldn't be changed.