Scripts/DalaranLegion: Implement Quest: "Weapons of Legend" (Hunter) (#31099)

This commit is contained in:
Naddley
2025-07-05 16:13:58 +02:00
committed by GitHub
parent 21712f4753
commit 2a2e09e8f4
3 changed files with 131 additions and 3 deletions

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();
@@ -31,12 +34,14 @@ void AddSC_instance_black_rook_hold();
// 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();
@@ -49,6 +54,6 @@ void AddBrokenIslesScripts()
AddSC_boss_amalgam_of_souls();
AddSC_instance_black_rook_hold();
// Orderhalls
AddSC_orderhall_warrior();
AddSC_zone_mardum();
}

View File

@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "PlayerChoice.h"
#include "SpellAuras.h"
#include "SpellScript.h"
@@ -66,7 +67,7 @@ enum OrderCampaignDalaranIntro
// 224240 - 7.0 Order Campaign - Dalaran Aura
class spell_dalaran_order_campaign_intro_aura : public AuraScript
{
void HandlePeriodic(AuraEffect const* /*aurEff*/)
void HandlePeriodic(AuraEffect const* /*aurEff*/) const
{
Player* player = Object::ToPlayer(GetCaster());
if (!player)
@@ -157,8 +158,41 @@ class spell_dalaran_order_campaign_intro_aura : public AuraScript
}
};
enum WeaponsOfLegendHunter
{
// Spells
SPELL_FORCE_BEAST_MASTERY_SPEC = 198433,
SPELL_FORCE_SURVIVAL_SPEC = 198435,
SPELL_FORCE_MARKSMANSHIP_SPEC = 198436,
// Playerchoice
PLAYERCHOICE_RESPONSE_CHOOSE_BEAST_MASTERY_WEAPON = 504,
PLAYERCHOICE_RESPONSE_CHOOSE_SURVIVAL_WEAPON = 505,
PLAYERCHOICE_RESPONSE_CHOOSE_MARKSMANSHIP_WEAPON = 506,
};
// 240 - Playerchoice
class playerchoice_weapons_of_legend_hunter : public PlayerChoiceScript
{
public:
playerchoice_weapons_of_legend_hunter() : PlayerChoiceScript("playerchoice_weapons_of_legend_hunter") {}
void OnResponse(WorldObject* /*object*/, Player* player, PlayerChoice const* /*choice*/, PlayerChoiceResponse const* response, uint16 /*clientIdentifier*/) override
{
if (response->ResponseId == PLAYERCHOICE_RESPONSE_CHOOSE_BEAST_MASTERY_WEAPON)
player->CastSpell(player, SPELL_FORCE_BEAST_MASTERY_SPEC, CastSpellExtraArgsInit{ .TriggerFlags = TRIGGERED_FULL_MASK });
else if (response->ResponseId == PLAYERCHOICE_RESPONSE_CHOOSE_SURVIVAL_WEAPON)
player->CastSpell(player, SPELL_FORCE_SURVIVAL_SPEC, CastSpellExtraArgsInit{ .TriggerFlags = TRIGGERED_FULL_MASK });
else if (response->ResponseId == PLAYERCHOICE_RESPONSE_CHOOSE_MARKSMANSHIP_WEAPON)
player->CastSpell(player, SPELL_FORCE_MARKSMANSHIP_SPEC, CastSpellExtraArgsInit{ .TriggerFlags = TRIGGERED_FULL_MASK });
}
};
void AddSC_zone_dalaran_broken_isle()
{
// Playerchoice
new playerchoice_weapons_of_legend_hunter();
// Spellscripts
RegisterSpellScript(spell_dalaran_order_campaign_intro_aura);
}