mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
Refactor(Core/Gossip): Replacing old macros with new (#1338)
* Correct support new macro
This commit is contained in:
@@ -515,14 +515,14 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
_instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void Reset() override
|
||||
{
|
||||
_events.Reset();
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
@@ -551,7 +551,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_INTRO_HORDE_2, 5000, 0, PHASE_INTRO_H);
|
||||
_events.ScheduleEvent(EVENT_INTRO_HORDE_3, 18500, 0, PHASE_INTRO_H);
|
||||
_instance->HandleGameObject(_instance->GetData64(GO_SAURFANG_S_DOOR), true);
|
||||
|
||||
|
||||
if (GameObject* teleporter = ObjectAccessor::GetGameObject(*me, _instance->GetData64(GO_SCOURGE_TRANSPORTER_SAURFANG)))
|
||||
{
|
||||
_instance->HandleGameObject(0, false, teleporter);
|
||||
@@ -575,7 +575,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_OUTRO_HORDE_1, 10000);
|
||||
_events.ScheduleEvent(EVENT_OUTRO_HORDE_2, 18000);
|
||||
_events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 24000);*/
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case ACTION_EVADE:
|
||||
@@ -603,7 +603,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_GRIP_OF_AGONY)
|
||||
{
|
||||
@@ -612,7 +612,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
{
|
||||
@@ -650,7 +650,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
switch (_events.ExecuteEvent())
|
||||
@@ -733,25 +733,25 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
std::list<Creature*> _guardList;
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != IN_PROGRESS)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "We are ready to go, High Overlord. The Lich King must fall!", 631, -ACTION_START_EVENT);
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "We are ready to go, High Overlord. The Lich King must fall!", 631, -ACTION_START_EVENT);
|
||||
SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != IN_PROGRESS)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
ClearGossipMenuFor(player);
|
||||
CloseGossipMenuFor(player);
|
||||
if (action == -ACTION_START_EVENT)
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
@@ -759,7 +759,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetIcecrownCitadelAI<npc_high_overlord_saurfangAI>(creature);
|
||||
}
|
||||
@@ -777,14 +777,14 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
_instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void Reset() override
|
||||
{
|
||||
_events.Reset();
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
@@ -862,7 +862,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_GRIP_OF_AGONY)
|
||||
{
|
||||
@@ -871,7 +871,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
{
|
||||
@@ -891,7 +891,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
switch (_events.ExecuteEvent())
|
||||
@@ -947,25 +947,25 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
std::list<Creature*> _guardList;
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != IN_PROGRESS)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(0, "Let it begin...", 631, -ACTION_START_EVENT + 1);
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
AddGossipItemFor(player, 0, "Let it begin...", 631, -ACTION_START_EVENT + 1);
|
||||
SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != IN_PROGRESS)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
ClearGossipMenuFor(player);
|
||||
CloseGossipMenuFor(player);
|
||||
if (action == -ACTION_START_EVENT + 1)
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
@@ -973,7 +973,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetIcecrownCitadelAI<npc_muradin_bronzebeard_iccAI>(creature);
|
||||
}
|
||||
|
||||
@@ -1826,7 +1826,7 @@ class npc_alchemist_adrianna : public CreatureScript
|
||||
public:
|
||||
npc_alchemist_adrianna() : CreatureScript("npc_alchemist_adrianna") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_ROTFACE) == DONE && instance->GetBossState(DATA_FESTERGUT) == DONE && !creature->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN) && !creature->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN25))
|
||||
@@ -2569,7 +2569,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -2634,7 +2634,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -2689,7 +2689,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -2751,7 +2751,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -2870,7 +2870,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -2916,7 +2916,7 @@ public:
|
||||
SeveredEssenceSpellInfo sesi_spells[] =
|
||||
{
|
||||
{CLASS_SHAMAN, 71938, 5000, 1, 0.0f},
|
||||
{CLASS_PALADIN, 57767, 8000, 2, 30.0f},
|
||||
{CLASS_PALADIN, 57767, 8000, 2, 30.0f},
|
||||
{CLASS_WARLOCK, 71937, 10000, 1, 0.0f},
|
||||
{CLASS_DEATH_KNIGHT, 49576, 15000, 1, 30.0f},
|
||||
{CLASS_ROGUE, 71933, 8000, 1, 0.0f},
|
||||
@@ -2993,7 +2993,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -3092,7 +3092,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -3241,7 +3241,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -3273,13 +3273,13 @@ class npc_icc_buff_switcher : public CreatureScript
|
||||
public:
|
||||
npc_icc_buff_switcher() : CreatureScript("npc_icc_buff_switcher") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
if ((creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206) || (creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204))
|
||||
{
|
||||
if (!player->GetGroup() || !player->GetGroup()->isRaidGroup() || !player->GetGroup()->IsLeader(player->GetGUID()))
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
CloseGossipMenuFor(player);
|
||||
ChatHandler(player->GetSession()).PSendSysMessage("Only the raid leader can turn off the buff.");
|
||||
return true;
|
||||
}
|
||||
@@ -3288,7 +3288,7 @@ public:
|
||||
inst->SetData(DATA_BUFF_AVAILABLE, 0);
|
||||
if (creature->GetEntry() == NPC_GARROSH_HELLSCREAM)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
CloseGossipMenuFor(player);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3382,7 +3382,7 @@ public:
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -3571,7 +3571,7 @@ class npc_icc_gauntlet_controller : public CreatureScript
|
||||
{
|
||||
if (me->GetDistance(itr->GetSource()) > 100.0f || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
|
||||
continue;
|
||||
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_FIGHT, 1000);
|
||||
return;
|
||||
}
|
||||
@@ -3673,7 +3673,7 @@ class npc_icc_putricades_trap : public CreatureScript
|
||||
{
|
||||
if (me->GetDistance(itr->GetSource()) > 100.0f || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
|
||||
continue;
|
||||
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_FIGHT, 1000);
|
||||
return;
|
||||
}
|
||||
@@ -3726,7 +3726,7 @@ class at_icc_putricide_trap : public AreaTriggerScript
|
||||
at_icc_putricide_trap() : AreaTriggerScript("at_icc_putricide_trap") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*areaTrigger*/)
|
||||
{
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetData(DATA_PUTRICIDE_TRAP_STATE) == NOT_STARTED && !player->IsGameMaster())
|
||||
if (Creature* trap = ObjectAccessor::GetCreature(*player, instance->GetData64(NPC_PUTRICADES_TRAP)))
|
||||
|
||||
@@ -16,32 +16,33 @@ class icecrown_citadel_teleport : public GameObjectScript
|
||||
public:
|
||||
icecrown_citadel_teleport() : GameObjectScript("icecrown_citadel_teleport") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if (go->GetEntry() != GO_SCOURGE_TRANSPORTER_FIRST)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to Light's Hammer.", GOSSIP_SENDER_ICC_PORT, LIGHT_S_HAMMER_TELEPORT); // M_PI + M_PI/6
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Teleport to Light's Hammer.", GOSSIP_SENDER_ICC_PORT, LIGHT_S_HAMMER_TELEPORT); // M_PI + M_PI/6
|
||||
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetBossState(DATA_LORD_MARROWGAR) == DONE && go->GetEntry() != 202245)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Oratory of the Damned.", GOSSIP_SENDER_ICC_PORT, ORATORY_OF_THE_DAMNED_TELEPORT); // M_PI + M_PI/6
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Teleport to the Oratory of the Damned.", GOSSIP_SENDER_ICC_PORT, ORATORY_OF_THE_DAMNED_TELEPORT); // M_PI + M_PI/6
|
||||
if (instance->GetBossState(DATA_LADY_DEATHWHISPER) == DONE && go->GetEntry() != 202243)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Rampart of Skulls.", GOSSIP_SENDER_ICC_PORT, RAMPART_OF_SKULLS_TELEPORT); // M_PI/6
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Teleport to the Rampart of Skulls.", GOSSIP_SENDER_ICC_PORT, RAMPART_OF_SKULLS_TELEPORT); // M_PI/6
|
||||
if (instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == DONE && go->GetEntry() != 202244)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Deathbringer's Rise.", GOSSIP_SENDER_ICC_PORT, DEATHBRINGER_S_RISE_TELEPORT); // M_PI/6
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Teleport to the Deathbringer's Rise.", GOSSIP_SENDER_ICC_PORT, DEATHBRINGER_S_RISE_TELEPORT); // M_PI/6
|
||||
if (instance->GetData(DATA_COLDFLAME_JETS) == DONE && go->GetEntry() != 202235)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Upper Spire.", GOSSIP_SENDER_ICC_PORT, UPPER_SPIRE_TELEPORT); // M_PI/6
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Teleport to the Upper Spire.", GOSSIP_SENDER_ICC_PORT, UPPER_SPIRE_TELEPORT); // M_PI/6
|
||||
if (instance->GetBossState(DATA_VALITHRIA_DREAMWALKER) == DONE && instance->GetBossState(DATA_SINDRAGOSA_GAUNTLET) == DONE && go->GetEntry() != 202246)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to Sindragosa's Lair", GOSSIP_SENDER_ICC_PORT, SINDRAGOSA_S_LAIR_TELEPORT); // M_PI*3/2 + M_PI/6
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Teleport to Sindragosa's Lair", GOSSIP_SENDER_ICC_PORT, SINDRAGOSA_S_LAIR_TELEPORT); // M_PI*3/2 + M_PI/6
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(go), go->GetGUID());
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(go), go->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, GameObject* /*go*/, uint32 sender, uint32 action)
|
||||
bool OnGossipSelect(Player* player, GameObject* /*go*/, uint32 sender, uint32 action) override
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
ClearGossipMenuFor(player);
|
||||
CloseGossipMenuFor(player);
|
||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(action);
|
||||
if (!spell)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user