Skip to content
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

fix(Script/Instance): Rework Scarlet Monastery Ashbringer event partially #15218

Conversation

feltwitch
Copy link

@feltwitch feltwitch commented Feb 27, 2023

Hi! This ended up being a pretty big PR. If you are gonna take a look at the code, I recommend reviewing the commits individually. These changes make the Scarlet Monastery Ashbringer event very blizzlike, but there are still some differences in eg. the exact timings. However, the differences are small enough that I am satisfied with how the event plays out now.

Changes Proposed:

  • A partial rework of the Ashbringer event in Scarlet Monastery, with the aim of making it as true to how the event played out around 2010.
    • Use an area trigger to start the event instead of triggering it upon entering the instance.
    • Make Renault yell an intro text when the area trigger is triggered. Yell is missing in the previous implementation.
    • Open chapel doors when the area trigger is triggered. Previous implementation did not open the chapel doors.
    • Upon being approached by a player with Corrupted Ashbringer, the NPCs should only say one of the Ashbringer event lines part of the time.
    • The NPC reaction is now: 1) turn to face player, 2) kneel, 3) maybe say greeting text - with small, random delays between these actions, measured from the videos linked in sources. In the previous implementation, these actions happened with no delays in between them.
    • Use sniffed (broadcast_text) data for NPC texts. There were typos, mistakes and missing texts for NPCs.
    • Chapel NPCs can no longer snap out of being friendly to the player and attack them. Not sure what caused this or how I fixed it (if it was even me), but it doesn't happen anymore. 🥲
    • Scarlet Wizards no longer say their combat lines during the event.
    • Commander Mograine no longer yells an empty message when dying at the end of the event.
    • Added various missing emotes to the NPCs in the event.
    • Adjusted weapon sheathing timings.
  • Moved a bunch of data related to the event from the codebase to the database, eg. emotes, gossip menu options.
  • Some changes to the actual Scarlet Monastery dungeon behavior outside of the event:
    • Various things messed up with the texts. Centurion (I think?) was saying Ashbringer event lines in combat. Most NPCs were not saying anything in combat, even though old videos of SM clearly show them all saying stuff on aggro. I used the Centurion's SmartAI script as a basis for restoring the on aggro talking behavior (mostly I am worried about what the chance for an NPC saying something on aggro is).
    • Commander Mograine's "Unworthy." yell upon killing a player was showing up as an empty yell in-game. This PR fixes that.

Issues Addressed:

SOURCE:

Ashbringer event

  • https://www.youtube.com/watch?v=xnBQde8DW5U
    • This video has served as my primary source for the implementation of the event. Meaning that where other videos and this one differ, I have followed the implementation observed in this video.
    • This is a video uploaded in late 2009. It was the best quality video that was closest to patch 3.3.5 that I could find.
    • The YouTube account's about section links to a now-defunct guild website, but the website is still available via the wayback machine: https://web.archive.org/web/20100803194020/http://impervious-guild.com/
    • The archived website gives no indication that the video was not captured on retail WoW.
  • https://www.youtube.com/watch?v=DXC0nRs767Q
    • This seems to be captured during TBC era WoW.
  • https://www.youtube.com/watch?v=gbWyAMyhDGg
    • A recent video captured during WoW classic. Has a bunch of differences to the 3.3 implementation seen in the first video. Most confusingly some NPC texts are different. I opted to not care about this and just trust broadcast_text.
  • https://www.youtube.com/watch?v=9ZISZ8BH4KQ
    • Another recent WoW classic video.
  • There are a lot more videos you can find with the query ashbringer event on YouTube - sort the results by Upload date and scroll to the bottom to find vanilla-tbc-wotlk videos.

NPC on aggro say

Tests Performed:

  • OS & environment: Arch linux, using docker to run azerothcore.
  • Builds without errors.
  • I tested all of my changes in the instance with and without Corrupted Ashbringer equipped. I have seen the event way too many times now 😖

How to Test the Changes:

These instructions have been more or less how I have tested these changes. They can provide a starting point for how to test this.

Ashbringer event

  1. .additem 22691
  2. .instance unbind all
  3. .tele smcath
  4. Equip Corrupted Ashbringer
  5. Trigger the area trigger by walking forward a bit. Observe it works (all NPCs should turn friendly and Mograine should yell).
  6. Approach NPCs and observe that they kneel and sometimes greet you.
  7. Make your way to Renault, observing on the way that the chapel doors
  8. Approach Renault to trigger the event, observe that everything goes as in the primary source video.
  9. Go have a chat with Fairbanks, observe everything works as intended.

NPC on aggro say and Mograine's yell

  1. .instance unbind all
  2. .tele smcath
  3. Don't equip Corrupted Ashbringer.
  4. Fight the NPCs, observe that on aggro they say the apprioriate things sometimes.
  5. Test that there are no regressions in the behavior of the NPCs.
  6. Go fight Renault, let him kill you, observe that now he yells "Unworthy." whereas before the yell was "".
  7. Fight Renault and Whitemane and observe that there are no regressions in the fight.

Known Issues and TODO List:

  • Highlord Mograine's name is Highlord Mograine Transform when targeted. Remove Transform?
    • Fix timings to match new NPC move speed,
  • Fairbanks's gossip should only be available to a player who has Corrupted Ashbringer equipped.
  • Most of the NPCs should turn to face the player as a group, not individually.
    • Probably won't fix - if so, I will open an issue about it when this is merged.
    • Fixed by contribution from @fangshun2004, thank you ️☺
  • Add Fairbanks's missing emotes: for most of his gossip, he does 3 emotes per "page" of text displayed to player.
    • ^ Won't fix, I think this is fixed in another PR anyway.
  • Check the SQL code, again - eg. Scarlet Abbot's emote disappears when my SQL is applied.

Credits & contributions

Contributed by @fangshun2004:

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.

@yehonal-bot yehonal-bot added CORE Related to the core DB related to the SQL database file-cpp Used to trigger the matrix build Script labels Feb 27, 2023
@feltwitch
Copy link
Author

I have some questions, if anybody can help with these I'd be grateful and could still make some more changes based on the answers.

  1. How to resolve the name issue? SetName("Highlord Mograine") is called on Darion, and his name shows up correctly in emotes and says, but when you target him, Transform is still in his name.
  2. How to make the NPCs kneel & greet the player together as a group, like when multiple mobs get pulled as a result of one "grouped" being pulled?
  3. There has to be a better way of having Fairbanks do his emotes when talking to the player than setting them up with m_Events.AddEventAtOffset, right? Maybe in the database? I see broadcast_text has columns for emotes related to the text, but I've also understood that broadcast_text is not to be modified 🤔

@heyitsbench
Copy link
Contributor

I have some questions, if anybody can help with these I'd be grateful and could still make some more changes based on the answers.

I would recommend you take a look at the implementation for vmangos (Here's one commit cleaning it up a bit). It might not answer all of your questions, but hopefully it'll help at least a little bit. Anything you do cherry-pick, make sure to credit properly to the author(s).

@fangshun2004
Copy link
Contributor

fangshun2004 commented Mar 8, 2023

I tested it overall, and it was better than the previous script, but point 8 is a slight difference from the video
1.https://www.youtube.com/watch?v=xnBQde8DW5U the position of 3:18--3:20 seconds in the video and there is a gesture of standing up facing "Highlord Mograine" - holding a weapon - lowering the weapon - talking - holding the weapon again (Talk(4, 2s); Previously missing me->SetSheath(SHEATH_STATE_MELEE); )
2.mograine->AI()->Talk(1); The text display should be retained for a longer period of about 10 seconds until mograine->AI()->Talk(2); Before ending(perhaps modifying creature_text Duration in the data table to control?)

@laowoji
Copy link

laowoji commented Apr 27, 2023

The test conforms to the description
Before merging:
WoWScrnShot_042623_191244
After the merger:
WoWScrnShot_042623_193811
Before merging:
There was no yelling triggered after entering the door
WoWScrnShot_042623_191837
After the merger:
Trigger a yell
WoWScrnShot_042723_220730
At the same time said my name
WoWScrnShot_042723_220407

@fangshun2004
Copy link
Contributor

fangshun2004 commented May 8, 2023

Is this fix still pulling requests still not complete? How many tasks do I have in the fix solution plan.

@Kitzunu
Copy link
Member

Kitzunu commented Jun 27, 2023

PR abandoned by author. if you want to conitnue, reopen or make a new pr

@Kitzunu Kitzunu closed this Jun 27, 2023
@Kitzunu Kitzunu added the PR Abandoned Original author stopped working on this PR. Feel free to take over. label Jun 27, 2023
@feltwitch
Copy link
Author

Hey! Thanks for the response. I understand that the PR has been marked as abandoned due to my inactivity and absence over the past months. My apologies for the lack of communication during this period.

The pull request contains numerous updates and improvements to the Ashbringer event, and I believe it's still of value to AC. There might still be minor improvements to be made, that could be made in the scope of this PR - however, I feel it's important that the work put into this so far doesn't get lost or left behind. With that in mind, I'd like to continue contributing to the project and see this pull request through to completion. It already had the "Ready to be Reviewed" and "Waiting to be Tested" labels for a while, but I'm unsure how to proceed from here. Could you please advise? What would be required on my part to get this PR reviewed, tested, and hopefully, merged?

@feltwitch
Copy link
Author

Also, how would I actually go about reopening this PR? Do I have to create a completely new PR? I don't see any obvious way to do so in the GitHub UI - I guess I don't have the necessary access rights to reopen it? @Kitzunu

@Nyeriah Nyeriah reopened this Jul 1, 2023
@Nyeriah
Copy link
Member

Nyeriah commented Jul 1, 2023

Reopen as requested, thanks for your contributions

@Nyeriah Nyeriah removed the PR Abandoned Original author stopped working on this PR. Feel free to take over. label Jul 1, 2023
@GastonCK
Copy link
Contributor

GastonCK commented Jul 1, 2023

Wow this is a big one. I would be willing to test this but it's not passing the checks.
Please review it and whenever is ready feel free to tag me and I'll proceed with the test.

@fangshun2004
Copy link
Contributor

The SQL script does not modify the 'broadcast_text' data table, which copies text from the 'broadcast_text' data table to a variable and then from the variable to the creature_text data table. There is a problem with the SQL Inspector's misjudgment

@fangshun2004
Copy link
Contributor

fangshun2004 commented Aug 21, 2023

I realized that the reason Highlord Mograine's name was wrong was that the ID of a wrong NPC was used. I pushed a fix to this - changing the scripts to use the correct NPC id, but now the timings for the event are a bit off. I had observed these awkward timing issues between the video and AC, but didn't realize what was causing it. As a workaround, I had changed the Highlord's movement so that he pauses for 5 seconds before moving when he spawns. I suspect this is maybe that the correct NPC has a different move speed. Will fix it later.

I also noticed that there may be something off with the SQL now - at least one emote of Scarlet Abbot's gets lost somewhere when my SQL is applied. I'll check that as well.

                

I realized that the reason Highlord Mograine's name was wrong was that the ID of a wrong NPC was used. I pushed a fix to this - changing the scripts to use the correct NPC id, but now the timings for the event are a bit off. I had observed these awkward timing issues between the video and AC, but didn't realize what was causing it. As a workaround, I had changed the Highlord's movement so that he pauses for 5 seconds before moving when he spawns. I suspect this is maybe that the correct NPC has a different move speed. Will fix it later.

I also noticed that there may be something off with the SQL now - at least one emote of Scarlet Abbot's gets lost somewhere when my SQL is applied. I'll check that as well.

The previous biological velocity was 1.2. The new bioid is from the old Naxxramas. The speed of movement is not the same

if (Creature* h_mograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000))
                 { 
                     h_mograine->SetFaction(FACTION_FRIENDLY); 
                     h_mograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE);
                     h_mograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP);//No weapons are used
                     h_mograine->SetSpeed(MOVE_WALK, 1.2f);//Modify the movement speed
                 }

@fangshun2004
Copy link
Contributor

fangshun2004 commented Aug 21, 2023

The creature action of 1:18 seconds in the first video. It can be determined that the event should be triggered by the passive aura of the Ashbrant every 5 seconds (ABEffect000 = 28441). At the same time, this aura effect will also cause some neutral creatures to attack the player. I think the trigger event should be using

void SpellHit(Unit* who, SpellInfo const* spell) override 
{ 
             if (who && spell->Id == ABEffect000 && ! SayAshbringer) 
             {
//code
            }
}

I believe in known issues. It seems that the effect of group control is also the effect produced by this passive AOE every 5 seconds

This reverts commit 5822fc7.

The behavior of these Scarlet Monastery NPCs seems to be controlled by both the
SAI scripts and the C++ script `npc_scarlet_guard`. Using the new scriptmodel
makes the behavior of the NPCs only be controlled by `npc_scarlet_guard`,
breaking their combat behavior, as that is implemented in the SAI scripts of the
NPC.
I had earlier added a 5 second wait to get the event timings to work nicely, but
I believe this was needed in the first place because the wrong NPC was used for
the event (fixed in an earlier commit). Now that the correct NPC is used, if the
5 second wait is removed, the event timings work out nicely again.
@feltwitch
Copy link
Author

Okay, pushed some changes again. Here's the short of it:

  • Reverted the scriptmodel change, now the Scarlet NPCs behave again as expected both in combat and in the Ashbringer event.
  • I went through the SQL code more or less line by line and tried to track the changes made to the database, and everything seems fine; I'm not sure what exactly I was seeing when I thought that one of the Abbot's emotes gets lost, but well, it's not happening now. 🤷🏻‍♀️
  • Highlord Mograine no longer waits 5 seconds at the Chapel doors before starting to walk to Renault.

I concur with @fangshun2004 and reverted the changes to npc_scarlet_guard. I don't have the time or understanding of this codebase to figure out how the old approach works and why and whether it's supposed to work 😕 Perhaps time to open a new issue?

The previous biological velocity was 1.2. The new bioid is from the old Naxxramas. The speed of movement is not the same

Yeah, the move speed is not the same, but I think this might be what the move speed is supposed to be. I now removed the 5 second wait from Highlord Mograine (I was the one to add the wait in an earlier commit, as a bandaid, because the timings I saw in the videos vs AzerothCore didn't match up) and the event timings more or less work out. Have you measured the time it takes for Highlord Mograine to reach Renault after spawning at the doors? I could do it from the video, and check if now, with the correct NPC and the wait time removed, the event timings match the timings in the video.

BTW @fangshun2004 if you don't mind, I could use your "no weapons" code in this PR, and credit you via the commit author field?

The creature action of 1:18 seconds in the first video. It can be determined that the event should be triggered by the passive aura of the Ashbrant every 5 seconds
...
I believe in known issues. It seems that the effect of group control is also the effect produced by this passive AOE every 5 seconds

Oh cool, thank you. I will apply this change next time I am working on the code and I will credit you :)

@feltwitch
Copy link
Author

@fangshun2004 I added the contributions as I mentioned in my previous comment, and credited you in the PR description and in the commit "author" field. Please let me know if this is OK by you - if not, I will remove the contributions from this PR.

@feltwitch
Copy link
Author

Okay, the TODO list is emptied and, for now, I can't think of any other actions for me to take regrading this PR. As far as I can tell, it's ready for review and testing. I will keep an eye on it and try to react/respond in a timely manner.

@feltwitch feltwitch requested a review from Kitzunu August 28, 2023 08:55
@Kitzunu
Copy link
Member

Kitzunu commented Aug 28, 2023

Question: Is any of this sniffed?

@feltwitch
Copy link
Author

feltwitch commented Aug 28, 2023 via email

@heyitsbench
Copy link
Contributor

Could I get my hands on some sniffed data of the event?

Feel free to contact me on Discord: @heyitsbench. Unfortunately all I have is a second-hand perspective of the event taking place, but it should at least be a bit of help to you.

@Kitzunu
Copy link
Member

Kitzunu commented Aug 29, 2023

I will not block the this PR if the outcome is greatly improved from how it was before.

But check with Bench first to see what he got, and then come back to me 👍

@fangshun2004
Copy link
Contributor

@feltwitch @Kitzunu I used @heyitsbench to provide sniffing data and modified the timer, the creature coordinates, and the sequence of actions. Now I don't know if I should keep the full time or delete the last two digits of the time.
feltwitch#3

@Kitzunu
Copy link
Member

Kitzunu commented Sep 17, 2023

@feltwitch Status?

@feltwitch
Copy link
Author

@feltwitch Status?

  • I got the sniff data.
  • I started writing some tools to help with analyzing/filtering the data and I got a proof of concept working.
  • A second round of covid took me out for a bit over a week, I'm now mostly recovered, but...
  • A bunch of work is needed on the analysis/filter tool to extract NPC positions from the parsed sniff.

I'm not sure how long it will take for me to get that functionality implemented in the tool. I also still have yet to take a look at fangshun2004's recent contribution (which is based on the sniff data, I believe). The job is pretty busy this week and I finally upgraded my PC and I can play Armored Core 6 -> I'll probably have time to work on this again this weekend 🥲

Taking all this into consideration, I'm not sure exactly how long the process of utilizing the sniff data is 🤔 It makes me wonder if it would be a good idea to work toward getting this merged, perhaps with incorporating fangshun2004's contribution to this, and treat the utilization of the sniff data as a separate task. Thoughts? If you have any, please share; either way, I'll be returning to this during the weekend and we'll see how far I get.

@Kitzunu
Copy link
Member

Kitzunu commented Oct 22, 2023

Merge Conflicts

@Kitzunu
Copy link
Member

Kitzunu commented Oct 22, 2023

@fangshun2004 Do you want to continue work on this? Seems like the author has abandoned it

player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 4000.0f);
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 4000.0f);
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 4000.0f);
player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f);
Copy link
Member

@Nyeriah Nyeriah Oct 22, 2023

Choose a reason for hiding this comment

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

Oh boy this is a monster
Grid searches are very expensive
4k yards is pretty much the entire map, do we need to search the entire map?

Copy link
Contributor

Choose a reason for hiding this comment

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

My guess is that some of the monks and mages in the library will also be affected, and I don't know if that's the case in Blizzard servers

@fangshun2004
Copy link
Contributor

@fangshun2004 Do you want to continue work on this? Seems like the author has abandoned it

I can continue, but I don't know how to merge the modified code into this project, do I open another pull request and then add this pull request and @feltwitch name?

@Kitzunu
Copy link
Member

Kitzunu commented Oct 22, 2023

Yea your best bet is to cherrypick into a new PR

@Nyeriah
Copy link
Member

Nyeriah commented Oct 22, 2023

Try to slice the PR into parts so we can merge it faster, makes everything overall much easier

@Kitzunu
Copy link
Member

Kitzunu commented Nov 12, 2023

Closed in favor of #17558

@Kitzunu Kitzunu closed this Nov 12, 2023
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 Waiting to be Tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Corrupted Ashbringer effect seems inconsistent.
9 participants