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

Core/Conditions: Added CONDITION_SOURCE_TYPE_PLAYER_CONDITION #29832

Merged
merged 3 commits into from Mar 27, 2024

Conversation

meji46
Copy link
Member

@meji46 meji46 commented Mar 25, 2024

Changes proposed:

  • Added CONDITION_SOURCE_TYPE_PLAYER_CONDITION (can be used for serverside playerconditions referenced by vendors or gameobjects)
  • Update GO dynamic flags according to player conditions (serverside playercondition always returns true if it isn't conditioned)
  • Fixed dynamic flags logic for GAMEOBJECT_TYPE_GOOBER
  • Implemented dynamic flags logic for GAMEOBJECT_TYPE_BUTTON

Issues addressed:
Maybe closes #27374

Tests performed:
Builds, tested in-game.
Examples:

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=34 AND `SourceEntry` IN (9766, 10282, 10355);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(34, 0, 10355, 0, 0, 47, 0, 26955, 8, 0, '', 0, 0, 0, '', 'Satisfy player condition if quest 26955 is taken'),
(34, 0, 10282, 0, 0, 47, 0, 5581, 8, 0, '', 0, 0, 0, '', 'Satisfy player condition if quest 5581 is taken'),
(34, 0, 10282, 0, 1, 47, 0, 14374, 8, 0, '', 0, 0, 0, '', 'Satisfy player condition if quest 14374 is taken'),
(34, 0, 9766, 0, 0, 47, 0, 25731, 8, 0, '', 0, 0, 0, '', 'Satisfy player condition if quest 25731 is taken');

Known issues and TODO list: (add/remove lines as needed)

  • We need to prevent a player condition from being conditioned by itself (CONDITION_PLAYER_CONDITION) or prevent circular references (player condition A conditioned by player condition B - player condition B conditioned by player condition A).
    • Make source type CONDITION_SOURCE_TYPE_PLAYER_CONDITION incompatible with CONDITION_PLAYER_CONDITION or
    • Restrict CONDITION_SOURCE_TYPE_PLAYER_CONDITION to serverside player conditions (CONDITION_PLAYER_CONDITION can only reference db2 data)

@Shauren Shauren merged commit 4913d02 into TrinityCore:master Mar 27, 2024
5 of 6 checks passed
@meji46 meji46 deleted the condition/player-condition branch March 27, 2024 21:11
funjoker pushed a commit that referenced this pull request Mar 28, 2024
Razinao added a commit to Razinao/TrinityCore that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[master] GO_DYNFLAG_LO_HIGHLIGHT is wrongly set
2 participants