mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(DB/Scripts): CoS agitated citizens now talk and emote near Patricia O'Reilly (#24042)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: Ludwig <sudlud@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
--
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` = 31028 AND `GroupID` IN (0, 1);
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` = 31126 AND `GroupID` = 2;
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` = 31127 AND `GroupID` = 0;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
-- Patricia O'Reilly (31028) - Ambient lines (GroupID 0)
|
||||
(31028, 0, 0, 'The magistrate is very busy.', 12, 0, 100, 1, 0, 0, 32068, 0, 'Patricia O\'Reilly - Ambient'),
|
||||
(31028, 0, 1, 'Please, return to your homes.', 12, 0, 100, 1, 0, 0, 32069, 0, 'Patricia O\'Reilly - Ambient'),
|
||||
(31028, 0, 2, 'Everyone, please remain calm...', 12, 0, 100, 1, 0, 0, 32070, 0, 'Patricia O\'Reilly - Ambient'),
|
||||
(31028, 0, 3, 'Magistrate Barthilas is unavailable at the moment...', 12, 0, 100, 1, 0, 0, 32071, 0, 'Patricia O\'Reilly - Ambient'),
|
||||
-- Patricia O'Reilly (31028) - Player enters building (GroupID 1)
|
||||
(31028, 1, 0, 'Please don\'t go back there!', 12, 0, 100, 274, 0, 0, 32073, 0, 'Patricia O\'Reilly - Player Enters'),
|
||||
(31028, 1, 1, 'Don\'t disturb the magistrate, please!', 12, 0, 100, 274, 0, 0, 32074, 0, 'Patricia O\'Reilly - Player Enters'),
|
||||
-- Agitated Stratholme Citizen (31126) - Ambient crowd (GroupID 2)
|
||||
(31126, 2, 0, 'Where\'s Barthilas?!', 12, 0, 100, 6, 0, 0, 32057, 0, 'Agitated Stratholme Citizen - Ambient'),
|
||||
(31126, 2, 1, 'What are we supposed to do?!', 12, 0, 100, 6, 0, 0, 32059, 0, 'Agitated Stratholme Citizen - Ambient'),
|
||||
(31126, 2, 2, 'We need leadership!', 12, 0, 100, 5, 0, 0, 32060, 0, 'Agitated Stratholme Citizen - Ambient'),
|
||||
(31126, 2, 3, 'Stop hiding, Barthilas!', 12, 0, 100, 5, 0, 0, 32061, 0, 'Agitated Stratholme Citizen - Ambient'),
|
||||
(31126, 2, 4, 'Let us through!', 12, 0, 100, 25, 0, 0, 32062, 0, 'Agitated Stratholme Citizen - Ambient'),
|
||||
(31126, 2, 5, 'We\'ll drag you out here if we have to!', 12, 0, 100, 5, 0, 0, 32063, 0, 'Agitated Stratholme Citizen - Ambient'),
|
||||
-- Agitated Stratholme Resident (31127) - Ambient crowd (GroupID 0)
|
||||
(31127, 0, 0, 'Where\'s Barthilas?!', 12, 0, 100, 6, 0, 0, 32057, 0, 'Agitated Stratholme Resident - Ambient'),
|
||||
(31127, 0, 1, 'We want to speak to the magistrate!', 12, 0, 100, 5, 0, 0, 32058, 0, 'Agitated Stratholme Resident - Ambient'),
|
||||
(31127, 0, 2, 'What are we supposed to do?!', 12, 0, 100, 6, 0, 0, 32059, 0, 'Agitated Stratholme Resident - Ambient'),
|
||||
(31127, 0, 3, 'We need leadership!', 12, 0, 100, 5, 0, 0, 32060, 0, 'Agitated Stratholme Resident - Ambient'),
|
||||
(31127, 0, 4, 'Let us through!', 12, 0, 100, 25, 0, 0, 32062, 0, 'Agitated Stratholme Resident - Ambient');
|
||||
@@ -187,6 +187,10 @@ enum Misc
|
||||
// Brandon Eiredeck crowd
|
||||
NPC_BRANDON_EIREDECK = 31023,
|
||||
SAY_BRANDON_CROWD_AMBIENT = 3,
|
||||
|
||||
// Patricia O'Reilly crowd
|
||||
SAY_AGITATED_CITIZEN_AMBIENT = 2,
|
||||
SAY_AGITATED_RESIDENT_AMBIENT = 0,
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -1541,6 +1545,10 @@ public:
|
||||
|
||||
isBrandonCrowd = me->GetDistance(2267.86f, 1144.93f, 138.403f) < 10.0f;
|
||||
ambientTalkTimer = isBrandonCrowd ? urand(5000, 15000) : 0;
|
||||
|
||||
isPatriciaCrowd = (me->GetEntry() == NPC_CITY_MAN3 || me->GetEntry() == NPC_CITY_MAN4) && me->GetDistance(2372.0f, 1199.0f, 135.0f) < 20.0f;
|
||||
talkTimer = isPatriciaCrowd ? urand(5000, 10000) : 0;
|
||||
emoteTimer = isPatriciaCrowd ? urand(1000, 3000) : 0;
|
||||
}
|
||||
|
||||
bool locked;
|
||||
@@ -1552,6 +1560,9 @@ public:
|
||||
uint8 stephanieDialoguePhase;
|
||||
bool isBrandonCrowd;
|
||||
uint32 ambientTalkTimer;
|
||||
bool isPatriciaCrowd;
|
||||
uint32 talkTimer;
|
||||
uint32 emoteTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -1667,6 +1678,27 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
// Agitated crowd near Patricia - active as soon as instance is loaded
|
||||
if (isPatriciaCrowd)
|
||||
{
|
||||
if (talkTimer <= diff)
|
||||
{
|
||||
Talk(me->GetEntry() == NPC_CITY_MAN3 ? SAY_AGITATED_CITIZEN_AMBIENT : SAY_AGITATED_RESIDENT_AMBIENT);
|
||||
talkTimer = urand(8000, 15000);
|
||||
}
|
||||
else
|
||||
talkTimer -= diff;
|
||||
|
||||
if (emoteTimer <= diff)
|
||||
{
|
||||
static uint32 const agitatedEmotes[] = { 1, 5, 6, 14, 15, 25, 273, 274, 396 };
|
||||
me->HandleEmoteCommand(agitatedEmotes[urand(0, 8)]);
|
||||
emoteTimer = urand(1500, 2500);
|
||||
}
|
||||
else
|
||||
emoteTimer -= diff;
|
||||
}
|
||||
|
||||
if (allowTimer)
|
||||
{
|
||||
allowTimer += diff;
|
||||
|
||||
Reference in New Issue
Block a user