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.
(cherry picked from commit b6d43623a2)
This commit is contained in:
tkrokli
2016-03-04 23:15:47 +01:00
committed by joschiwald
parent 2b5d7eef3a
commit 4e00321970
2 changed files with 37 additions and 24 deletions

View File

@@ -44,16 +44,20 @@ enum Texts
enum Spells
{
SPELL_MAGIC_REFLECTION = 20619,
SPELL_DAMAGE_REFLECTION = 21075,
SPELL_BLAST_WAVE = 20229,
SPELL_AEGIS_OF_RAGNAROS = 20620,
SPELL_TELEPORT = 20618,
SPELL_SUMMON_RAGNAROS = 19774,
SPELL_BLAST_WAVE = 20229,
SPELL_TELEPORT = 20618,
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,26 +188,21 @@ 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);
}
}
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);
}
}
};
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;
}
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_majordomoAI>(creature);