Scripts/DalaranLegion: Implement Quest "Call of the Uncrowned" (#31126)

This commit is contained in:
Naddley
2025-07-12 22:14:56 +02:00
committed by GitHub
parent 52add56a7f
commit cd3dd59b53
4 changed files with 393 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "AreaTrigger.h"
#include "AreaTriggerAI.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "Player.h"
enum CallOfTheUncrownedATData
{
QUEST_CALL_OF_THE_UNCROWNED = 40832,
NPC_MILTON_BEATS_ORDERHALL = 105908
};
// XXX - Areatrigger
struct at_hall_of_shadows_call_of_the_uncrowned_clone_milton : AreaTriggerAI
{
at_hall_of_shadows_call_of_the_uncrowned_clone_milton(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) {}
void OnUnitEnter(Unit* unit) override
{
Player* player = unit->ToPlayer();
if (!player || player->GetQuestStatus(QUEST_CALL_OF_THE_UNCROWNED) != QUEST_STATUS_INCOMPLETE)
return;
Creature* miltonObject = GetClosestCreatureWithOptions(player, 30.0f, { .CreatureId = NPC_MILTON_BEATS_ORDERHALL, .IgnorePhases = true });
if (!miltonObject)
return;
TempSummon* miltonClone = miltonObject->SummonPersonalClone(miltonObject->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
if (!miltonClone)
return;
}
};
void AddSC_orderhall_rogue()
{
// Areatrigger
RegisterAreaTriggerAI(at_hall_of_shadows_call_of_the_uncrowned_clone_milton);
}

View File

@@ -34,6 +34,7 @@ void AddSC_instance_black_rook_hold();
// Orderhalls
void AddSC_orderhall_warrior();
void AddSC_orderhall_rogue();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
@@ -56,4 +57,5 @@ void AddBrokenIslesScripts()
// Orderhalls
AddSC_orderhall_warrior();
AddSC_orderhall_rogue();
}

View File

@@ -16,9 +16,12 @@
*/
#include "ScriptMgr.h"
#include "Conversation.h"
#include "ConversationAI.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "PlayerChoice.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
#include "SpellScript.h"
@@ -188,11 +191,58 @@ public:
}
};
enum CallOfTheUncrownedData
{
NPC_SUMMON_RAVENHOLD_COURIER = 102018,
CONVO_ACTOR_SUMMON_COURIER = 51066,
SPELL_SEALED_LETTER_CREDIT = 201264
};
// 1100 - Conversation
class conversation_on_summon_call_of_the_uncrowned : public ConversationAI
{
public:
using ConversationAI::ConversationAI;
void OnCreate(Unit* creator) override
{
Creature* ravenholdCurier = creator->FindNearestCreatureWithOptions(20.0f, { .CreatureId = NPC_SUMMON_RAVENHOLD_COURIER, .IgnorePhases = true, .OwnerGuid = creator->GetGUID() });
if (!ravenholdCurier)
return;
conversation->AddActor(CONVO_ACTOR_SUMMON_COURIER, 0, ravenholdCurier->GetGUID());
conversation->Start();
}
};
// 201253 - Sealed Letter
class spell_dalaran_sealed_letter : public AuraScript
{
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;
GetCaster()->CastSpell(GetCaster(), SPELL_SEALED_LETTER_CREDIT, CastSpellExtraArgsInit{ .TriggerFlags = TRIGGERED_FULL_MASK });
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_dalaran_sealed_letter::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_zone_dalaran_broken_isle()
{
// Conversation
RegisterConversationAI(conversation_on_summon_call_of_the_uncrowned);
// Playerchoice
new playerchoice_weapons_of_legend_hunter();
// Spellscripts
RegisterSpellScript(spell_dalaran_order_campaign_intro_aura);
RegisterSpellScript(spell_dalaran_sealed_letter);
}