fix(Core/Scripts): skip areatrigger scripts for gamemasters (#25196)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4f363ac4bf
commit
3da6e30196
6 changed files with 6 additions and 15 deletions
|
|
@ -732,7 +732,8 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
|
|||
if (player->isDebugAreaTriggers)
|
||||
ChatHandler(this).PSendSysMessage(LANG_DEBUG_AREATRIGGER_REACHED, triggerId);
|
||||
|
||||
if (sScriptMgr->OnAreaTrigger(player, atEntry))
|
||||
// Skip areatrigger scripts for GMs unless debug areatriggers is enabled
|
||||
if ((!player->IsGameMaster() || player->isDebugAreaTriggers) && sScriptMgr->OnAreaTrigger(player, atEntry))
|
||||
return;
|
||||
|
||||
if (player->IsAlive())
|
||||
|
|
|
|||
|
|
@ -246,9 +246,6 @@ public:
|
|||
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*at*/) override
|
||||
{
|
||||
if (player->IsGameMaster())
|
||||
return false;
|
||||
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
if (Creature* beast = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_THE_BEAST)))
|
||||
|
|
@ -268,9 +265,6 @@ public:
|
|||
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*at*/) override
|
||||
{
|
||||
if (player->IsGameMaster())
|
||||
return false;
|
||||
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
if (Creature* beast = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_THE_BEAST)))
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override
|
||||
{
|
||||
if (player->IsGameMaster() || !player->IsAlive())
|
||||
if (!player->IsAlive())
|
||||
return false;
|
||||
|
||||
// Handle Call Ancients event start - The area trigger summons 3 ancients
|
||||
|
|
|
|||
|
|
@ -1463,9 +1463,6 @@ public:
|
|||
|
||||
bool OnTrigger(Player* player, const AreaTrigger* /*at*/) override
|
||||
{
|
||||
if (player->IsGameMaster())
|
||||
return false;
|
||||
|
||||
InstanceScript* inst = player->GetInstanceScript();
|
||||
if (!inst)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1176,8 +1176,7 @@ public:
|
|||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_LADY_DEATHWHISPER) != DONE)
|
||||
if (!player->IsGameMaster())
|
||||
if (Creature* ladyDeathwhisper = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_LADY_DEATHWHISPER)))
|
||||
if (Creature* ladyDeathwhisper = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_LADY_DEATHWHISPER)))
|
||||
ladyDeathwhisper->AI()->DoAction(ACTION_START_INTRO);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3592,7 +3592,7 @@ public:
|
|||
bool OnTrigger(Player* player, AreaTrigger const* /*areaTrigger*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_SINDRAGOSA_GAUNTLET) == NOT_STARTED && !player->IsGameMaster())
|
||||
if (instance->GetBossState(DATA_SINDRAGOSA_GAUNTLET) == NOT_STARTED)
|
||||
if (Creature* gauntlet = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_SINDRAGOSA_GAUNTLET)))
|
||||
gauntlet->AI()->DoAction(ACTION_START_GAUNTLET);
|
||||
return true;
|
||||
|
|
@ -3607,7 +3607,7 @@ public:
|
|||
bool OnTrigger(Player* player, AreaTrigger const* /*areaTrigger*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetData(DATA_PUTRICIDE_TRAP_STATE) == NOT_STARTED && !player->IsGameMaster())
|
||||
if (instance->GetData(DATA_PUTRICIDE_TRAP_STATE) == NOT_STARTED)
|
||||
if (Creature* trap = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_PUTRICADES_TRAP)))
|
||||
trap->AI()->DoAction(ACTION_START_GAUNTLET);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue