Skip to content

fix(Scripts/ScarletEnclave): City guards should throw stuff at new DKs #22317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 21, 2025

Conversation

avarishd
Copy link
Contributor

@avarishd avarishd commented Jun 15, 2025

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

Currently, only the guards throw/say stuff, civilians cower

Issues Addressed:

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found

in the issue

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

TESTED ONLY ON HORDE

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.

(H) .q add 13189
(A) .q add 13188

Known Issues and TODO List:

  • Mobs sometimes don't reset their orientation
  • Citizen npcs are missing creature_texts
  • non civilian and non guard npcs should also throw stuff
  • Cower emote seems too short

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

@github-actions github-actions bot added DB related to the SQL database Script file-cpp Used to trigger the matrix build labels Jun 15, 2025
}
else /// @todo: Needs to be checked for other creatures
if (creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN)
creature->HandleEmoteCommand(EMOTE_ONESHOT_COWER);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you use a one-shot emote it is normal that the animation seems too short. Maybe you could use the state_cower with a reset command after a few seconds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe they cast a spell...? @heyitsbench

@Rorschach91
Copy link
Member

Rorschach91 commented Jun 16, 2025

I could be wrong, but I remember reading somewhere that on trinity core this mechanic is on smartai and not on c++ scripts.

This is an example that I just created for Orgrimmar Grunts, but it can also be applied for Stormwind Guards (if you change the IDs).

Note: I think only civilians react to spell hit with a scream and fear emote (I am not entirely sure).

-- Set Actionlists for Orgrimmar Grunts
DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 329600);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(329600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 58513, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Cast \'Rotten Banana Toss\''),
(329600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Say Line 3'),
(329600, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Set Orientation Home Position');

DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 329601);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(329601, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 58509, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Cast \'Rotten Apple Toss\''),
(329601, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Say Line 2'),
(329601, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Set Orientation Home Position');


DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 329602);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(329602, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 58520, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Cast \'Spit\''),
(329602, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Say Line 4'),
(329602, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Set Orientation Home Position');

DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 329603);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(329603, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Set Orientation Invoker'),
(329603, 9, 1, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 10, 14, 25, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Play Random Emote (14, 25)'),
(329603, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Say Line 5'),
(329603, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Actionlist - Set Orientation Home Position');

-- Orgrimmar Grunt (updated comments and added Call Random ActionList
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 3296;

DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 3296);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(3296, 0, 0, 0, 8, 0, 100, 256, 58552, 0, 20000, 35000, 0, 0, 87, 329600, 329601, 329602, 329603, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - On Spellhit \'Return to Orgrimmar\' - Run Random Script'),
(3296, 0, 1, 0, 22, 0, 100, 512, 101, 5000, 5000, 0, 0, 0, 80, 6800, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Received Emote 101 - Run Script'),
(3296, 0, 2, 0, 22, 0, 100, 512, 78, 5000, 5000, 0, 0, 0, 80, 6801, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Received Emote 78 - Run Script'),
(3296, 0, 3, 0, 22, 0, 100, 512, 58, 5000, 5000, 0, 0, 0, 80, 6802, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Received Emote 58 - Run Script'),
(3296, 0, 4, 0, 22, 0, 100, 512, 84, 5000, 5000, 0, 0, 0, 80, 6803, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Received Emote 84 - Run Script'),
(3296, 0, 5, 0, 22, 0, 100, 512, 77, 5000, 5000, 0, 0, 0, 80, 6804, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Received Emote 77 - Run Script'),
(3296, 0, 7, 0, 22, 0, 100, 512, 17, 5000, 5000, 0, 0, 0, 80, 6802, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Received Emote 17 - Run Script');

@Rorschach91
Copy link
Member

However, I don't think they should have an interaction every time they are hit by the spell.
Also, when they speak they should use one of two different emotes (14 or 25).

RtO.mp4

@avarishd
Copy link
Contributor Author

avarishd commented Jun 16, 2025

I think some things may need to be checked on recycled, idk the correct behavior.

as for the emotes, they should be in the creature_text

@Rorschach91
Copy link
Member

I think some things may need to be checked on recycled, idk the correct behavior.

As far as I know the single npc cannot repeat the interaction for 30 seconds (even if it is hit again by the trigger spell).
In my query I added a cooldown and DONT_RESET flag on Spell Hit row. I don't know if you can get the same result in c++.

as for the emotes, they should be in the creature_text

Creature_text does not allow a single emote linked to the single text? In this case the emotes are two and they are randomic.

For example when a grunt says GET A ROPE! it can use rude or point emote (source from sniffs).

@Rorschach91
Copy link
Member

Rorschach91 commented Jun 17, 2025

Tested. I think you should remove the fear emote for now. The guards use it sometimes.
Other than that, the only remaining problem is the orientation reset.
And maybe all these interactions should have a probability other than 100%, otherwise this interaction happens too often in places with many guards.

@avarishd
Copy link
Contributor Author

From the videos it seems that every npc has a reaction.

@Rorschach91
Copy link
Member

Rorschach91 commented Jun 17, 2025

From the videos it seems that every npc has a reaction.

What are their reactions? From what I know the guards can throw apples, bananas, spit and utter dialogues, but they do not use the emote fear.

Only civilians seem to use the massive scream sound effect and emote fear.

Edit: I would like to know what type of sound effect is that.

@avarishd
Copy link
Contributor Author

Was referring to "And maybe all these interactions should have a probability other than 100%". And the "guards" that fear atm is due to them being "fake" (lol?) and having civilian flag :D

@Rorschach91
Copy link
Member

Was referring to "And maybe all these interactions should have a probability other than 100%". And the "guards" that fear atm is due to them being "fake" (lol?) and having civilian flag :D

I just sent you a PM on discord.
I hope it can help you.

@avarishd
Copy link
Contributor Author

Can you give it another try, please?

@github-actions github-actions bot added the CORE Related to the core label Jun 18, 2025
@Rorschach91
Copy link
Member

Can you give it another try, please?

The orientation reset problem now seems to be solved. GJ @avarishd.
Do you want to continue with this PR or I can add tested label?

@avarishd
Copy link
Contributor Author

I think I'm done with this, for now.

@Rorschach91 Rorschach91 added the Tested This PR has been tested and is working. label Jun 19, 2025
@Rorschach91 Rorschach91 requested a review from Nyeriah June 19, 2025 11:18
@Rorschach91 Rorschach91 merged commit 7c171ae into azerothcore:master Jun 21, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core DB related to the SQL database file-cpp Used to trigger the matrix build Ready to be Reviewed Script Tested This PR has been tested and is working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants