aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortkrokli <tkrokli@hotmail.com>2016-03-04 23:15:47 +0100
committertkrokli <tkrokli@hotmail.com>2016-06-05 18:29:57 +0200
commitb6d43623a259f62ce0240a9e9f44f28e8c1ad5eb (patch)
tree86ae55292dfef7d96dc6a20142e3a6af6978d491 /src
parenta6e7c9873c7b3530e1c4ff28119dbec30abc6afb (diff)
Core/Scripts: boss_majordomo hardcoded text
2 more text lines removed in the ongoing series: "Remove hardcoded text from core scripts". Core script for boss Majordomo Executus: - add missing gossip_menu_option entries - link the options via the table gossip_menu - remove hardcoded text from the script - minor enum line order sorting cleanup - replace OnGossipSelect() with sGossipSelect() The scripted events are unchanged. If the script is inaccurate, make a new PR.
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
index 9b487f7b5f9..8cff67d9f28 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
@@ -44,16 +44,20 @@ enum Texts
enum Spells
{
- SPELL_MAGIC_REFLECTION = 20619,
- SPELL_DAMAGE_REFLECTION = 21075,
+ SPELL_SUMMON_RAGNAROS = 19774,
SPELL_BLAST_WAVE = 20229,
- SPELL_AEGIS_OF_RAGNAROS = 20620,
SPELL_TELEPORT = 20618,
- SPELL_SUMMON_RAGNAROS = 19774,
+ SPELL_MAGIC_REFLECTION = 20619,
+ SPELL_AEGIS_OF_RAGNAROS = 20620,
+ SPELL_DAMAGE_REFLECTION = 21075
};
-#define GOSSIP_HELLO 4995
-#define GOSSIP_SELECT "Tell me more."
+enum Extras
+{
+ OPTION_ID_YOU_CHALLENGED_US = 0,
+ FACTION_FRIENDLY = 35,
+ MENU_OPTION_YOU_CHALLENGED_US = 4108
+};
enum Events
{
@@ -64,7 +68,7 @@ enum Events
EVENT_OUTRO_1 = 5,
EVENT_OUTRO_2 = 6,
- EVENT_OUTRO_3 = 7,
+ EVENT_OUTRO_3 = 7
};
class boss_majordomo : public CreatureScript
@@ -106,7 +110,7 @@ class boss_majordomo : public CreatureScript
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
{
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
- me->setFaction(35);
+ me->setFaction(FACTION_FRIENDLY);
EnterEvadeMode();
Talk(SAY_DEFEAT);
_JustDied();
@@ -184,25 +188,20 @@ class boss_majordomo : public CreatureScript
}
else if (action == ACTION_START_RAGNAROS_ALT)
{
- me->setFaction(35);
+ me->setFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
}
- };
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(GOSSIP_HELLO, creature->GetGUID());
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
- {
- player->CLOSE_GOSSIP_MENU();
- creature->AI()->DoAction(ACTION_START_RAGNAROS);
- return true;
- }
+ void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
+ {
+ if (menuId == MENU_OPTION_YOU_CHALLENGED_US && gossipListId == OPTION_ID_YOU_CHALLENGED_US)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ DoAction(ACTION_START_RAGNAROS);
+ }
+ }
+ };
CreatureAI* GetAI(Creature* creature) const override
{