Scripts/DalaranLegion: Implement aura to handle Orderhall Campaign Intro (#31063)

This commit is contained in:
Naddley
2025-06-14 18:07:11 +02:00
committed by GitHub
parent 597bd40fd1
commit 5054c9487e
3 changed files with 186 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
-- SpellArea
DELETE FROM `spell_area` WHERE `area` = 7502 AND `spell` = 224240;
INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `flags`, `quest_start_status`, `quest_end_status`) VALUES
(224240, 7502, 44184, 0, 0, 0, 2, 0x03, 64, 11);
-- ScriptName
DELETE FROM `spell_script_names` WHERE `spell_id` = 224240;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(224240, 'spell_dalaran_order_campaign_intro_aura');
-- Quest
DELETE FROM `quest_template` WHERE `ID` IN (40375,40374);
INSERT INTO `quest_template` (`ID`, `QuestType`, `QuestPackageID`, `ContentTuningID`, `QuestSortID`, `QuestInfoID`, `SuggestedGroupNum`, `RewardNextQuest`, `RewardXPDifficulty`, `RewardXPMultiplier`, `RewardMoneyDifficulty`, `RewardMoneyMultiplier`, `RewardBonusMoney`, `RewardDisplaySpell1`, `RewardDisplaySpell2`, `RewardDisplaySpell3`, `RewardSpell`, `RewardHonor`, `RewardKillHonor`, `StartItem`, `RewardArtifactXPDifficulty`, `RewardArtifactXPMultiplier`, `RewardArtifactCategoryID`, `Flags`, `FlagsEx`, `FlagsEx2`, `FlagsEx3`, `RewardItem1`, `RewardAmount1`, `RewardItem2`, `RewardAmount2`, `RewardItem3`, `RewardAmount3`, `RewardItem4`, `RewardAmount4`, `ItemDrop1`, `ItemDropQuantity1`, `ItemDrop2`, `ItemDropQuantity2`, `ItemDrop3`, `ItemDropQuantity3`, `ItemDrop4`, `ItemDropQuantity4`, `RewardChoiceItemID1`, `RewardChoiceItemQuantity1`, `RewardChoiceItemDisplayID1`, `RewardChoiceItemID2`, `RewardChoiceItemQuantity2`, `RewardChoiceItemDisplayID2`, `RewardChoiceItemID3`, `RewardChoiceItemQuantity3`, `RewardChoiceItemDisplayID3`, `RewardChoiceItemID4`, `RewardChoiceItemQuantity4`, `RewardChoiceItemDisplayID4`, `RewardChoiceItemID5`, `RewardChoiceItemQuantity5`, `RewardChoiceItemDisplayID5`, `RewardChoiceItemID6`, `RewardChoiceItemQuantity6`, `RewardChoiceItemDisplayID6`, `POIContinent`, `POIx`, `POIy`, `POIPriority`, `RewardTitle`, `RewardArenaPoints`, `RewardSkillLineID`, `RewardNumSkillUps`, `PortraitGiver`, `PortraitGiverMount`, `PortraitGiverModelSceneID`, `PortraitTurnIn`, `RewardFactionID1`, `RewardFactionValue1`, `RewardFactionOverride1`, `RewardFactionCapIn1`, `RewardFactionID2`, `RewardFactionValue2`, `RewardFactionOverride2`, `RewardFactionCapIn2`, `RewardFactionID3`, `RewardFactionValue3`, `RewardFactionOverride3`, `RewardFactionCapIn3`, `RewardFactionID4`, `RewardFactionValue4`, `RewardFactionOverride4`, `RewardFactionCapIn4`, `RewardFactionID5`, `RewardFactionValue5`, `RewardFactionOverride5`, `RewardFactionCapIn5`, `RewardFactionFlags`, `RewardCurrencyID1`, `RewardCurrencyQty1`, `RewardCurrencyID2`, `RewardCurrencyQty2`, `RewardCurrencyID3`, `RewardCurrencyQty3`, `RewardCurrencyID4`, `RewardCurrencyQty4`, `AcceptedSoundKitID`, `CompleteSoundKitID`, `AreaGroupID`, `TimeAllowed`, `AllowableRaces`, `Expansion`, `ManagedWorldStateID`, `QuestSessionBonus`, `LogTitle`, `LogDescription`, `QuestDescription`, `AreaDescription`, `PortraitGiverText`, `PortraitGiverName`, `PortraitTurnInText`, `PortraitTurnInName`, `QuestCompletionLog`, `ResetByScheduler`, `VerifiedBuild`) VALUES
(40375, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1024, 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, 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, 'A New Direction: Obtained Altruis', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0),
(40374, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1024, 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, 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, 'A New Direction: Obtained Kayn', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0);

View File

@@ -17,6 +17,9 @@
// This is where scripts' loading functions should be declared:
void AddSC_zone_dalaran_broken_isle();
void AddSC_zone_mardum();
// Maw of Souls
void AddSC_boss_ymiron_the_fallen_king();
void AddSC_instance_maw_of_souls();
@@ -27,12 +30,14 @@ void AddSC_instance_trial_of_valor();
// Orderhalls
void AddSC_orderhall_warrior();
void AddSC_zone_mardum();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddBrokenIslesScripts()
{
AddSC_zone_dalaran_broken_isle();
AddSC_zone_mardum();
// Maw of Souls
AddSC_boss_ymiron_the_fallen_king();
AddSC_instance_maw_of_souls();
@@ -41,6 +46,6 @@ void AddBrokenIslesScripts()
AddSC_boss_guarm();
AddSC_instance_trial_of_valor();
// Orderhalls
AddSC_orderhall_warrior();
AddSC_zone_mardum();
}

View File

@@ -0,0 +1,164 @@
/*
* 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 "ObjectAccessor.h"
#include "Player.h"
#include "SpellAuras.h"
#include "SpellScript.h"
enum OrderCampaignDalaranIntro
{
// Quest
QUEST_AN_IMPORTANT_MISSION = 42814,
QUEST_A_DESPERATE_PLEA = 41052,
QUEST_FELSTORMS_PLEA = 41035,
QUEST_NEEDS_OF_THE_HUNTER = 40384,
QUEST_CALL_OF_THE_UNCROWNED = 40832,
QUEST_PRIESTLY_MATTERS = 40705,
QUEST_THE_SIXTH = 40716,
QUEST_AN_URGENT_GATHERING = 38710,
QUEST_A_SUMMONS_FROM_MOONGLADE = 40643,
QUEST_BEFORE_THE_STORM = 12103,
QUEST_CALL_OF_THE_ILLIDARI_ALTRUIS = 39047,
QUEST_CALL_OF_THE_ILLIDARI_JAYCE = 39261,
QUEST_THE_CALL_TO_WAR = 40714,
// Tracking Quests DH
QUEST_A_NEW_DIRECTION_ALTRUIS = 40375,
QUEST_A_NEW_DIRECTION_JAYCE = 40374,
// Mage
SPELL_MAGE_ORDER_FORMATION = 195356,
// Death Knight
SPELL_AN_AUDIENCE_WITH_THE_KING = 200023,
// Summon Spells
SPELL_SUMMON_DALTON_WARRIOR = 216497,
SPELL_SUMMON_EITRIGG_WARRIOR = 216443,
SPELL_SUMMON_SNOWFEATHER_HUNTER = 196908,
SPELL_SUMMON_RAVENHOLDT_COURIER_ROGUE = 201208,
SPELL_A_SUMMON_MESSENGER_PRIEST = 202051,
SPELL_H_SUMMON_MESSENGER_PRIEST = 226409,
SPELL_SUMMON_RYSSTINS_PORTAL_WARLOCK = 204858,
SPELL_SUMMON_RYSSTINS_WARLOCK = 204860,
SPELL_SUMMON_MAXWELL_TYROSUS_PALADIN = 190886,
SPELL_SUMMON_DA_NEL_MONK = 193978,
SPELL_SUMMON_KORVAS_DH = 195286,
SPELL_SUMMON_RUNETOTEM_DRUID = 199277
};
// 224240 - 7.0 Order Campaign - Dalaran Aura
class spell_dalaran_order_campaign_intro_aura : public AuraScript
{
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
Player* player = Object::ToPlayer(GetCaster());
if (!player)
return;
switch (player->GetClass())
{
case CLASS_WARRIOR:
{
if (player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_AN_IMPORTANT_MISSION) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_DALTON_WARRIOR, true);
else if (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_A_DESPERATE_PLEA) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_EITRIGG_WARRIOR, true);
break;
}
case CLASS_HUNTER:
{
if (player->GetQuestStatus(QUEST_NEEDS_OF_THE_HUNTER) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_SNOWFEATHER_HUNTER, true);
break;
}
case CLASS_MAGE:
{
if (player->GetQuestStatus(QUEST_FELSTORMS_PLEA) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_MAGE_ORDER_FORMATION, true);
break;
}
case CLASS_ROGUE:
{
if (player->GetQuestStatus(QUEST_CALL_OF_THE_UNCROWNED) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_RAVENHOLDT_COURIER_ROGUE, true);
break;
}
case CLASS_PRIEST:
{
if (player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_PRIESTLY_MATTERS) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_A_SUMMON_MESSENGER_PRIEST, true);
else if (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_PRIESTLY_MATTERS) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_H_SUMMON_MESSENGER_PRIEST, true);
break;
}
case CLASS_WARLOCK:
{
if (player->GetQuestStatus(QUEST_THE_SIXTH) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_RYSSTINS_PORTAL_WARLOCK, true);
break;
}
case CLASS_PALADIN:
{
if (player->GetQuestStatus(QUEST_AN_URGENT_GATHERING) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_MAXWELL_TYROSUS_PALADIN, true);
break;
}
case CLASS_DRUID:
{
if (player->GetQuestStatus(QUEST_A_SUMMONS_FROM_MOONGLADE) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_RUNETOTEM_DRUID, true);
break;
}
case CLASS_MONK:
{
if (player->GetQuestStatus(QUEST_BEFORE_THE_STORM) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_SUMMON_DA_NEL_MONK, true);
break;
}
case CLASS_DEMON_HUNTER:
{
if (player->GetQuestStatus(QUEST_CALL_OF_THE_ILLIDARI_ALTRUIS) == QUEST_STATUS_NONE && player->GetQuestStatus(QUEST_A_NEW_DIRECTION_ALTRUIS) == QUEST_STATUS_REWARDED)
player->CastSpell(nullptr, SPELL_SUMMON_KORVAS_DH, true);
else if (player->GetQuestStatus(QUEST_CALL_OF_THE_ILLIDARI_JAYCE) == QUEST_STATUS_NONE && player->GetQuestStatus(QUEST_A_NEW_DIRECTION_JAYCE) == QUEST_STATUS_REWARDED)
player->CastSpell(nullptr, SPELL_SUMMON_KORVAS_DH, true);
break;
}
case CLASS_DEATH_KNIGHT:
{
if (player->GetQuestStatus(QUEST_THE_CALL_TO_WAR) == QUEST_STATUS_NONE)
player->CastSpell(nullptr, SPELL_AN_AUDIENCE_WITH_THE_KING, true);
break;
}
default:
break;
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dalaran_order_campaign_intro_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
void AddSC_zone_dalaran_broken_isle()
{
// Spellscripts
RegisterSpellScript(spell_dalaran_order_campaign_intro_aura);
}