fix(Scripts/VioletHold): Sinclari gossip order, crystals being spamma… (#22195)

This commit is contained in:
avarishd
2025-05-30 16:05:46 +03:00
committed by GitHub
parent d2be121930
commit 9ed8350b95
3 changed files with 28 additions and 10 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 58152) AND (`SourceId` = 0) AND (`ElseGroup` = 18) AND (`ConditionTypeOrReference` = 31);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 58152, 0, 18, 31, 0, 3, 29321, 0, 0, 0, 0, '', 'Defense System - Arcane Lightning - Ichor Globule');

View File

@@ -218,7 +218,11 @@ public:
{
EncounterStatus = IN_PROGRESS;
if (Creature* c = instance->GetCreature(NPC_SinclariGUID))
{
c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
c->AI()->Talk(SAY_SINCLARI_LEAVING);
/// @todo: Missing orientation for Sinclari's movement and "interaction" animation with the nearby crystal.
}
events.RescheduleEvent(EVENT_GUARDS_FALL_BACK, 4s);
}
break;
@@ -451,6 +455,7 @@ public:
{
if (Creature* c = instance->GetCreature(NPC_SinclariGUID))
{
c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
c->AI()->Talk(SAY_SINCLARI_DOOR_LOCK);
}
if (Creature* c = instance->GetCreature(NPC_DoorSealGUID))
@@ -568,7 +573,13 @@ public:
}
// reset positions of Sinclari and Guards
if (Creature* c = instance->GetCreature(NPC_SinclariGUID)) { c->DespawnOrUnsummon(); c->SetRespawnTime(3); }
if (Creature* c = instance->GetCreature(NPC_SinclariGUID))
{
c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
c->DespawnOrUnsummon();
c->SetRespawnTime(3);
}
for (uint8 i = 0; i < 4; ++i)
if (Creature* c = instance->GetCreature(NPC_GuardGUID[i]))
{

View File

@@ -27,16 +27,15 @@
#include "SpellScriptLoader.h"
/// @todo: Missing Sinclari Trigger announcements (32204) Look at its creature_text for more info.
/// @todo: Activation Crystals (go_vh_activation_crystal) (193611) are spammable, should be a 1 time use per crystal.
enum Texts
{
GOSSIP_MENU_START_EVENT = 9998,
GOSSIP_MENU_ITEM = 9997,
GOSSIP_MENU_START_1 = 9997,
GOSSIP_MENU_START_2 = 9998,
GOSSIP_MENU_LATE_JOIN = 10275,
NPC_TEXT_SINCLARI_IN = 13853,
NPC_TEXT_SINCLARI_ITEM = 13854,
NPC_TEXT_SINCLARI_START = 13854,
NPC_TEXT_SINCLARI_DONE = 13910,
NPC_TEXT_SINCLARI_LATE_JOIN = 14271,
};
@@ -53,7 +52,11 @@ public:
bool OnGossipHello(Player* /*player*/, GameObject* go) override
{
if (InstanceScript* pInstance = go->GetInstanceScript())
{
pInstance->SetData(DATA_ACTIVATE_DEFENSE_SYSTEM, 1);
go->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
}
return true;
}
};
@@ -73,8 +76,7 @@ public:
switch (pInstance->GetData(DATA_ENCOUNTER_STATUS))
{
case NOT_STARTED:
AddGossipItemFor(player, GOSSIP_MENU_ITEM, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
AddGossipItemFor(player, GOSSIP_MENU_START_EVENT, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
AddGossipItemFor(player, GOSSIP_MENU_START_1, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
SendGossipMenuFor(player, NPC_TEXT_SINCLARI_IN, creature->GetGUID());
break;
case IN_PROGRESS:
@@ -94,13 +96,14 @@ public:
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
AddGossipItemFor(player, GOSSIP_MENU_START_2, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
SendGossipMenuFor(player, NPC_TEXT_SINCLARI_START, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
CloseGossipMenuFor(player);
if (InstanceScript* pInstance = creature->GetInstanceScript())
pInstance->SetData(DATA_START_INSTANCE, 1);
break;
case GOSSIP_ACTION_INFO_DEF+2:
SendGossipMenuFor(player, NPC_TEXT_SINCLARI_ITEM, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->NearTeleportTo(playerTeleportPosition.GetPositionX(), playerTeleportPosition.GetPositionY(), playerTeleportPosition.GetPositionZ(), playerTeleportPosition.GetOrientation(), true);
CloseGossipMenuFor(player);