Skip to content

Correctly apply nearby aggro on start opening "Treasure" gameobjects with the correct lockId #2997

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

Open
wants to merge 13 commits into
base: development
Choose a base branch
from

Conversation

FlagFlayer
Copy link
Contributor

@FlagFlayer FlagFlayer commented Apr 5, 2025

🍰 Pullrequest

Correctly applies aggro effect on opening spell start and only on gameobjects it's supposed to according to testing.

Corrects usage of factions 94, 101, 102, 114, and 1375 per sniffs.

Constructor overloading AnyUnfriendlyUnitInObjectRangeCheck so that it can take a WorldObject as a faction input.

Proof

From testing:

  • Opening an object will only cause the aggro effect if it uses lockId 57 (for open objects) or a lockId that requires lockpicking to open.

  • Further, the object must use a faction template that uses faction 77 ("Treasure"). Otherwise the aggro effect does not trigger. (These faction template IDs are 94, 100 (unused), 101, 102, 114, and 1375)

Results from testing on Classic 1.15 (can supply videos on request, forgot to film the objects that didn't cause aggro):

  • Opening an object with correct lockId but without a "Treasure" faction, e.g. Cat Figurine (Faction 0, lockId 57) or Venture Co. Engineering Plans (Faction 84 - Alliance Generic, lockId 57) does not aggro nearby mobs.

  • Opening an object with correct faction but incorrect lockId, e.g. Food Crate (Faction 94, lockId 43) does not aggro nearby mobs.

  • Opening any object with faction 94 and lockId 57 results in aggro:

https://i.imgur.com/wDSV9do.mp4

  • Opening an object with a lockpicking requirement (through any method) that has a "Treasure" faction results in aggro:

https://i.imgur.com/eLaEJCB.mp4

Issues

How2Test

  • Open a chest -> Aggros nearby mobs
  • Open an object that has a different lockId and/or faction -> Does not aggro nearby mobs

Todo / Checklist

  • None

@ratkosrb
Copy link
Contributor

ratkosrb commented Apr 6, 2025

The indentation looks totally whack.

@FlagFlayer
Copy link
Contributor Author

Looked fine on the file itself. I'll try and adjust it

adjust indentation
@FlagFlayer
Copy link
Contributor Author

Currently has an issue with handling factions 101 and 102 since the objects are openable by the object faction's friendly mask and should aggro based on the faction's hostile mask.

Updated AnyUnfriendlyUnitInObjectRangeCheck to take WorldObject faction input, used this to fix bug relating to specific faction aggro on gameobjects
@FlagFlayer
Copy link
Contributor Author

Currently has an issue with handling factions 101 and 102 since the objects are openable by the object faction's friendly mask and should aggro based on the faction's hostile mask.

Fixed now. Should be good to go.

Use ToUnit instead of static cast without crash handling
How I missed this is beyond me
@ShiyoKozuki
Copy link
Contributor

I've been waiting for this for like 2 years!
Any chance you can merge in the current core to this? It has tons of merge conflicts if I try to take it as a PR.

@FlagFlayer
Copy link
Contributor Author

I've been waiting for this for like 2 years! Any chance you can merge in the current core to this? It has tons of merge conflicts if I try to take it as a PR.

Done

@ShiyoKozuki
Copy link
Contributor

ShiyoKozuki commented May 15, 2025

Thank you! Works wonderfully.
However, this still has the bug where opening rogue lockers that require lock picking skill aggro everything. (i.e. lockers in wetlands, NOT locked TREASURE chests)

@FlagFlayer
Copy link
Contributor Author

However, this still has the bug where opening rogue lockers that require lock picking skill aggro everything.

Yes. That is intended and correct behaviour. See this video from Classic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants