###Code:###
final ServerStorage<QuestTemplate> questTemplate = requestServerStorage("world", "quest_template");
final QuestTemplate riseOfTheSilithid = questTemplate.request(ServerStorageKeys.ofQuestTemplate(32)).get();
System.out.println("\n (Creature Template):\n");
questTemplate.getChangeTracker().setScope("q1", "Edit quest Rise of the Silithid\nonly mages allowed\nand set prev and next quest");
riseOfTheSilithid.prevQuestId().set(28);
riseOfTheSilithid.nextQuestId().set(32);
riseOfTheSilithid.requiredClasses().reset();
riseOfTheSilithid.requiredClasses().addFlag(Classes.CLASS_MAGE);
questTemplate.getChangeTracker().setScope("q2", "Add a new quest");
final QuestTemplate newQuest = questTemplate.create(ServerStorageKeys.ofQuestTemplate(3000000));
newQuest.title().set("hey im new here, complete me please!");
// Receive query
System.out.println(createSQLBuilder(questTemplate.getChangeTracker()).toString());
System.out.println("\n");
###Result:### Mode: LAZY
SET @CLASS_MAGE := 0x100;
SET @QUEST_TRIAL_OF_THE_LAKE := 28;
SET @QUEST_RISE_OF_THE_SILITHID := 32;
SET @QUEST_UNK_3000000 := 3000000;
/* *
* Edit quest Rise of the Silithid
* only mages allowed
* and set prev and next quest
*/
UPDATE `quest_template` SET `NextQuestId` = @QUEST_RISE_OF_THE_SILITHID, `PrevQuestId` = @QUEST_TRIAL_OF_THE_LAKE, `RequiredClasses` = @CLASS_MAGE WHERE `Id` = @QUEST_RISE_OF_THE_SILITHID;
-- Add a new quest
DELETE FROM `quest_template` WHERE `Id` = @QUEST_UNK_3000000;
INSERT INTO `quest_template` (`Id`, `Method`, `Level`, `MinLevel`, `MaxLevel`, `ZoneOrSort`, `Type`, `SuggestedPlayers`, `LimitTime`, `RequiredClasses`, `RequiredRaces`, `RequiredSkillId`, `RequiredSkillPoints`, `RequiredFactionId1`, `RequiredFactionId2`, `RequiredFactionValue1`, `RequiredFactionValue2`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `PrevQuestId`, `NextQuestId`, `ExclusiveGroup`, `NextQuestIdChain`, `RewardXPId`, `RewardOrRequiredMoney`, `RewardMoneyMaxLevel`, `RewardSpell`, `RewardSpellCast`, `RewardHonor`, `RewardHonorMultiplier`, `RewardMailTemplateId`, `RewardMailDelay`, `SourceItemId`, `SourceItemCount`, `SourceSpellId`, `Flags`, `SpecialFlags`, `MinimapTargetMark`, `RewardTitleId`, `RequiredPlayerKills`, `RewardTalents`, `RewardArenaPoints`, `RewardSkillId`, `RewardSkillPoints`, `RewardReputationMask`, `QuestGiverPortrait`, `QuestTurnInPortrait`, `RewardItemId1`, `RewardItemId2`, `RewardItemId3`, `RewardItemId4`, `RewardItemCount1`, `RewardItemCount2`, `RewardItemCount3`, `RewardItemCount4`, `RewardChoiceItemId1`, `RewardChoiceItemId2`, `RewardChoiceItemId3`, `RewardChoiceItemId4`, `RewardChoiceItemId5`, `RewardChoiceItemId6`, `RewardChoiceItemCount1`, `RewardChoiceItemCount2`, `RewardChoiceItemCount3`, `RewardChoiceItemCount4`, `RewardChoiceItemCount5`, `RewardChoiceItemCount6`, `RewardFactionId1`, `RewardFactionId2`, `RewardFactionId3`, `RewardFactionId4`, `RewardFactionId5`, `RewardFactionValueId1`, `RewardFactionValueId2`, `RewardFactionValueId3`, `RewardFactionValueId4`, `RewardFactionValueId5`, `RewardFactionValueIdOverride1`, `RewardFactionValueIdOverride2`, `RewardFactionValueIdOverride3`, `RewardFactionValueIdOverride4`, `RewardFactionValueIdOverride5`, `PointMapId`, `PointX`, `PointY`, `PointOption`, `Title`, `Objectives`, `Details`, `EndText`, `OfferRewardText`, `RequestItemsText`, `CompletedText`, `RequiredNpcOrGo1`, `RequiredNpcOrGo2`, `RequiredNpcOrGo3`, `RequiredNpcOrGo4`, `RequiredNpcOrGoCount1`, `RequiredNpcOrGoCount2`, `RequiredNpcOrGoCount3`, `RequiredNpcOrGoCount4`, `RequiredSourceItemId1`, `RequiredSourceItemId2`, `RequiredSourceItemId3`, `RequiredSourceItemId4`, `RequiredSourceItemCount1`, `RequiredSourceItemCount2`, `RequiredSourceItemCount3`, `RequiredSourceItemCount4`, `RequiredItemId1`, `RequiredItemId2`, `RequiredItemId3`, `RequiredItemId4`, `RequiredItemId5`, `RequiredItemId6`, `RequiredItemCount1`, `RequiredItemCount2`, `RequiredItemCount3`, `RequiredItemCount4`, `RequiredItemCount5`, `RequiredItemCount6`, `RequiredSpell`, `ObjectiveText1`, `ObjectiveText2`, `ObjectiveText3`, `ObjectiveText4`, `RewardCurrencyId1`, `RewardCurrencyId2`, `RewardCurrencyId3`, `RewardCurrencyId4`, `RewardCurrencyCount1`, `RewardCurrencyCount2`, `RewardCurrencyCount3`, `RewardCurrencyCount4`, `RequiredCurrencyId1`, `RequiredCurrencyId2`, `RequiredCurrencyId3`, `RequiredCurrencyId4`, `RequiredCurrencyCount1`, `RequiredCurrencyCount2`, `RequiredCurrencyCount3`, `RequiredCurrencyCount4`, `QuestGiverTextWindow`, `QuestGiverTargetName`, `QuestTurnTextWindow`, `QuestTurnTargetName`, `SoundAccept`, `SoundTurnIn`, `DetailsEmote1`, `DetailsEmote2`, `DetailsEmote3`, `DetailsEmote4`, `DetailsEmoteDelay1`, `DetailsEmoteDelay2`, `DetailsEmoteDelay3`, `DetailsEmoteDelay4`, `EmoteOnIncomplete`, `EmoteOnComplete`, `OfferRewardEmote1`, `OfferRewardEmote2`, `OfferRewardEmote3`, `OfferRewardEmote4`, `OfferRewardEmoteDelay1`, `OfferRewardEmoteDelay2`, `OfferRewardEmoteDelay3`, `OfferRewardEmoteDelay4`, `VerifiedBuild`) VALUES
(3000000, 2, 1, 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, 1.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, 0, 0.0, 0.0, 0, "hey im new here, complete me please!", "", "", "", "", "", "", 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, "", "", "", "", 890, 878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
Mode: COMPLETE
SET @CLASS_MAGE := 0x100;
SET @QUEST_TRIAL_OF_THE_LAKE := 28;
SET @QUEST_RISE_OF_THE_SILITHID := 32;
SET @QUEST_UNK_3000000 := 3000000;
/* *
* Edit quest Rise of the Silithid
* only mages allowed
* and set prev and next quest
*/
UPDATE `quest_template` SET `NextQuestId` = @QUEST_RISE_OF_THE_SILITHID, `PrevQuestId` = @QUEST_TRIAL_OF_THE_LAKE, `RequiredClasses` = @CLASS_MAGE WHERE `Id` = @QUEST_RISE_OF_THE_SILITHID;
-- Add a new quest
DELETE FROM `quest_template` WHERE `Id` = @QUEST_UNK_3000000;
INSERT INTO `quest_template` (`Id`, `RequiredClasses`, `PrevQuestId`, `NextQuestId`, `Title`) VALUES
(3000000, 0, 0, 0, "hey im new here, complete me please!");
Mode: STRICT
SET @CLASS_MAGE := 0x100;
SET @QUEST_TRIAL_OF_THE_LAKE := 28;
SET @QUEST_RISE_OF_THE_SILITHID := 32;
SET @QUEST_UNK_3000000 := 3000000;
/* *
* Edit quest Rise of the Silithid
* only mages allowed
* and set prev and next quest
*/
UPDATE `quest_template` SET `NextQuestId` = @QUEST_RISE_OF_THE_SILITHID, `PrevQuestId` = @QUEST_TRIAL_OF_THE_LAKE, `RequiredClasses` = @CLASS_MAGE WHERE `Id` = @QUEST_RISE_OF_THE_SILITHID;
-- Add a new quest
DELETE FROM `quest_template` WHERE `Id` = @QUEST_UNK_3000000;
INSERT INTO `quest_template` (`Id`, `RequiredClasses`, `Title`, `PrevQuestId`, `NextQuestId`) VALUES
(3000000, 0, "hey im new here, complete me please!", 0, 0);