diff --git a/sql/world/base/wotlk_archmage_timear.sql b/sql/world/base/wotlk_archmage_timear.sql new file mode 100644 index 0000000..a26551f --- /dev/null +++ b/sql/world/base/wotlk_archmage_timear.sql @@ -0,0 +1,78 @@ +UPDATE `creature_template` SET `ScriptName`='npc_archmage_timear' WHERE `entry`=31439; + +DELETE FROM `creature_questender` WHERE `id`=31439 AND `quest` IN (13245, 13246, 13247, 13248, 13249, 13250, 13251, 13252, 13253, 13254, 13255, 13256, 14199); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13245); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13246); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13247); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13248); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13249); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13250); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13251); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13252); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13253); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13254); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13255); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 13256); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES (31439, 14199); + +DELETE FROM `creature_queststarter` WHERE `id`=31439 AND `quest` IN (13245, 13246, 13247, 13248, 13249, 13250, 13251, 13252, 13253, 13254, 13255, 13256, 14199); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13245); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13246); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13247); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13248); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13249); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13250); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13251); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13252); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13253); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13254); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13255); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 13256); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (31439, 14199); + +UPDATE `quest_template` SET `Flags`=4232 WHERE `ID` IN (13245, 13246, 13247, 13248, 13249, 13250, 13251, 13252, 13253, 13254, 13255, 13256, 14199); + +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Axe of the Plunderer.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13245; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with Keristrasza\'s Broken Heart.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13246; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with a Ley Line Tuner.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13247; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Locket of the Deceased Queen.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13248; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Prophet\'s Enchanted Tiki.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13249; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Mojo Remnant of Akali.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13250; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Artifact from the Nathrezim Homeworld.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13251; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Curse of Flesh Disc.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13252; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Celestial Ruby Ring.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13253; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Idle Crown of Anub\'arak.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13254; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Faceless One\'s Withered Brain.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13255; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with the Head of Cyanigosa.$B$BThis quest may only be completed on Heroic difficulty.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=13256; +UPDATE `quest_template` SET `LogDescription`='Archmage Timear in Dalaran wants you to return with a Fragment of the Black Knight\'s Soul.$B$BThis quest may only be completed on Heroic difficulty.', `QuestDescription`='My counterpart, Archmage Lan\'dalock, has asked me to warn you of something dire. Soon, you will be participating in the Trial of the Champions at the Argent Coliseum in Icecrown. You must beware of interference from one known only as the Black Knight.$B$BBring me a fragment of his soul that the Kirin Tor will know he is dealt with. I am told that failing to do so will be your own undoing.', `QuestCompletionLog`='Return to Archmage Timear at Forlorn Woods in Crystalsong Forest.' WHERE `ID`=14199; + +UPDATE `quest_offer_reward` SET `RewardText`='$b$bTo be honest, I feared the worst had befallen you. It\'s difficult to stand idly by while others, such as yourself, deal with the matters of life and death which confront our world seemingly on a daily basis.$b$bNow what are we going to do with that gigantic ring?' WHERE `ID`=13253; +UPDATE `quest_offer_reward` SET `RewardText`='What horrors you must have faced while traversing the Upper City.$b$b$b$bPerhaps we should put that aside for their new king whenever the nerubians decide to coronate one?' WHERE `ID`=13254; + +UPDATE `quest_request_items` SET `CompletionText`='Did the Black Knight appear unexpectedly as Lan\'dalock foresaw?' WHERE `ID`=14199; + +UPDATE `quest_template_addon` SET `ExclusiveGroup`=13245 WHERE `ID`=14199; + +DELETE FROM `pool_template` WHERE `entry`=90000; +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES (90000, 1, 'Heroic Dungeon Dailies'); + +DELETE FROM `pool_quest` WHERE `pool_entry`=90000; +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13245, 90000, 'Proof of Demise: Ingvar the Plunderer'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13246, 90000, 'Proof of Demise: Keristrasza'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13247, 90000, 'Proof of Demise: Ley-Guardian Eregos'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13248, 90000, 'Proof of Demise: King Ymiron'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13249, 90000, 'Proof of Demise: The Prophet Tharon\'ja'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13250, 90000, 'Proof of Demise: Gal\'darah'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13251, 90000, 'Proof of Demise: Mal\'Ganis'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13252, 90000, 'Proof of Demise: Sjonnir The Ironshaper'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13253, 90000, 'Proof of Demise: Loken'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13254, 90000, 'Proof of Demise: Anub\'arak'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13255, 90000, 'Proof of Demise: Herald Volazj'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (13256, 90000, 'Proof of Demise: Cyanigosa'); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES (14199, 90000, 'Proof of Demise: The Black Knight'); + +DELETE FROM `creature_template_addon` WHERE `entry`=31618; +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES (31618, 0, 0, 50331648, 0, 0, 0, ''); + +DELETE FROM `creature_template_addon` WHERE `entry`=31629; +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES (31629, 0, 0, 50331648, 0, 0, 0, ''); diff --git a/src/IndividualProgression_loader.cpp b/src/IndividualProgression_loader.cpp index 0c66f2d..6cbd112 100644 --- a/src/IndividualProgression_loader.cpp +++ b/src/IndividualProgression_loader.cpp @@ -37,6 +37,7 @@ void AddSC_ipp_spell_scripts(); void AddSC_individualProgression_commandscript(); void AddSC_mod_individual_progression_awareness(); void AddSC_mod_individual_progression_player(); +void AddSC_npc_archmage_timear(); void Addmod_individual_progressionScripts() @@ -75,4 +76,5 @@ void Addmod_individual_progressionScripts() AddSC_individualProgression_commandscript(); AddSC_mod_individual_progression_awareness(); AddSC_mod_individual_progression_player(); + AddSC_npc_archmage_timear(); } diff --git a/src/wotlkScripts/npc_archmage_timear.cpp b/src/wotlkScripts/npc_archmage_timear.cpp new file mode 100644 index 0000000..abf3ae6 --- /dev/null +++ b/src/wotlkScripts/npc_archmage_timear.cpp @@ -0,0 +1,140 @@ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" + +enum ArchmageTimearQuests +{ + QUEST_PROOF_OF_DEMISE_INGVAR_THE_PLUNDERER = 13245, + QUEST_PROOF_OF_DEMISE_KERISTRASZA = 13246, + QUEST_PROOF_OF_DEMISE_LEY_GUARDIAN_EREGOS = 13247, + QUEST_PROOF_OF_DEMISE_KING_YMIRON = 13248, + QUEST_PROOF_OF_DEMISE_THE_PROPHET_THARON_JA = 13249, + QUEST_PROOF_OF_DEMISE_GAL_DARAH = 13250, + QUEST_PROOF_OF_DEMISE_MAL_GANIS = 13251, + QUEST_PROOF_OF_DEMISE_SJONNIR_THE_IRONSHAPER = 13252, + QUEST_PROOF_OF_DEMISE_LOKEN = 13253, + QUEST_PROOF_OF_DEMISE_ANUB_ARAK = 13254, + QUEST_PROOF_OF_DEMISE_HERALD_VOLAZJ = 13255, + QUEST_PROOF_OF_DEMISE_CYANIGOSA = 13256, + QUEST_PROOF_OF_DEMISE_THE_BLACK_KNIGHT = 14199 +}; + +enum ArchmageTimearImages +{ + NPC_INGVAR_THE_PLUNDERER_IMAGE = 31584, + NPC_KERISTRASZA_IMAGE = 31618, + NPC_LEY_GUARDIAN_EREGOS_IMAGE = 31619, + NPC_KING_YMIRON_IMAGE = 31620, + NPC_THE_PROPHET_THARON_JA_IMAGE = 31621, + NPC_GAL_DARAH_IMAGE = 31622, + NPC_MAL_GANIS_IMAGE = 31623, + NPC_SJONNIR_THE_IRONSHAPER_IMAGE = 31624, + NPC_LOKEN_IMAGE = 31625, + NPC_ANUB_ARAK_IMAGE = 31626, + NPC_HERALD_VOLAZJ_IMAGE = 31627, + NPC_CYANIGOSA_IMAGE = 31629, + NPC_THE_BLACK_KNIGHT_IMAGE = 35461 +}; + +class npc_archmage_timear : public CreatureScript +{ +public: + npc_archmage_timear() : CreatureScript("npc_archmage_timear") + { + } + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_archmage_timearAI(creature); + } + + struct npc_archmage_timearAI : public ScriptedAI + { + npc_archmage_timearAI(Creature* creature) : ScriptedAI(creature) + { + _switchImageTimer = MINUTE * IN_MILLISECONDS; + _summonGUID.Clear(); + } + + uint32 GetImageEntry(uint32 QuestId) + { + switch (QuestId) + { + case QUEST_PROOF_OF_DEMISE_INGVAR_THE_PLUNDERER: + return NPC_INGVAR_THE_PLUNDERER_IMAGE; + case QUEST_PROOF_OF_DEMISE_KERISTRASZA: + return NPC_KERISTRASZA_IMAGE; + case QUEST_PROOF_OF_DEMISE_LEY_GUARDIAN_EREGOS: + return NPC_LEY_GUARDIAN_EREGOS_IMAGE; + case QUEST_PROOF_OF_DEMISE_KING_YMIRON: + return NPC_KING_YMIRON_IMAGE; + case QUEST_PROOF_OF_DEMISE_THE_PROPHET_THARON_JA: + return NPC_THE_PROPHET_THARON_JA_IMAGE; + case QUEST_PROOF_OF_DEMISE_GAL_DARAH: + return NPC_GAL_DARAH_IMAGE; + case QUEST_PROOF_OF_DEMISE_MAL_GANIS: + return NPC_MAL_GANIS_IMAGE; + case QUEST_PROOF_OF_DEMISE_SJONNIR_THE_IRONSHAPER: + return NPC_SJONNIR_THE_IRONSHAPER_IMAGE; + case QUEST_PROOF_OF_DEMISE_LOKEN: + return NPC_LOKEN_IMAGE; + case QUEST_PROOF_OF_DEMISE_ANUB_ARAK: + return NPC_ANUB_ARAK_IMAGE; + case QUEST_PROOF_OF_DEMISE_HERALD_VOLAZJ: + return NPC_HERALD_VOLAZJ_IMAGE; + case QUEST_PROOF_OF_DEMISE_CYANIGOSA: + return NPC_CYANIGOSA_IMAGE; + default: //case QUEST_PROOF_OF_DEMISE_THE_BLACK_KNIGHT: + return NPC_THE_BLACK_KNIGHT_IMAGE; + } + } + + void JustSummoned(Creature* image) override + { + if (image->GetEntry() != NPC_ANUB_ARAK_IMAGE) + image->SetUnitMovementFlags(MOVEMENTFLAG_RIGHT); + _summonGUID = image->GetGUID(); + } + + void UpdateAI(uint32 diff) override + { + ScriptedAI::UpdateAI(diff); + + _switchImageTimer += diff; + if (_switchImageTimer > MINUTE * IN_MILLISECONDS) + { + _switchImageTimer = 0; + QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(me->GetEntry()); + for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i) + { + uint32 questId = i->second; + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (!quest || !quest->IsDaily()) + continue; + + uint32 newEntry = GetImageEntry(questId); + if (_summonGUID.GetEntry() != newEntry) + { + if (Creature* image = ObjectAccessor::GetCreature(*me, _summonGUID)) + image->DespawnOrUnsummon(); + + float z = 653.622f; + if (newEntry == NPC_KERISTRASZA_IMAGE || newEntry == NPC_CYANIGOSA_IMAGE) + z += 3.0f; + + me->SummonCreature(newEntry, 5770.970f, 529.512f, z, 3.985f); + } + } + } + } + private: + uint32 _switchImageTimer; + ObjectGuid _summonGUID; + }; +}; + +void AddSC_npc_archmage_timear() +{ + new npc_archmage_timear(); +}