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) Add null check, reduce load on map creation, fix incorrect max health on some creatures #171

Merged
merged 63 commits into from
Nov 9, 2023

Conversation

kjack9
Copy link
Collaborator

@kjack9 kjack9 commented Nov 8, 2023

Changes Proposed:

Resolves some issues with a null that shouldn't ever get hit but doesn't hurt to check).

I removed the "feature" where an empty map would be disabled - was causing issues on Map creation. Maps will now be adjusted for 1 player on creation, and won't re-calculate when that first player enters. Reduces load on map creation.

Several users reported issues with creatures that were not being health adjusted like they should be. I have fixed all the cases that I know of and have built in some safeties to handle any situation where AC changes the max health after I set it. Bad AC, BAD!

Finally, resolved an issue where creatures that are supposed to start with less than full health were being restored to full health by AutoBalance.

Issues Addressed:

SOURCE:

Tests Performed:

  • It Just Works™

How to Test the Changes:

Linked issues have good descriptions of problematic creatures and how to trigger their various issues.

- Add worldHealthMultiplier, intended to be used to scale the health of attackable game objects in the instance
- tear out and re-implement all the damage handling to ensure more cases are handled
- use the map's damage modifier when damage happens where the source isn't a creature
- better handle when the source of damage no longer exists (logged out or despawned)
- extensive (optional) logging under the `module.AutoBalance.Damage` logging prefix
- WIP implementattion of game object damage handling (destructible buildings)
- fix a long-standing error in the class name for some logging
- need to apply statmodifiers still
- improved logging
- fix a bug with the enable check case statements (stupid case breaks)
- remove antiquated battleground checks - should never scale in battlegrounds
- better handle "special" creatures (totems, triggers, critters)
- allow combat critters to scale correctly
- allow intentionally-low-level triggers and critters to remain low level
- workaround an issue with summons showing the wrong level client-side (level change ramp up)
- further improve GM and user commands
- erase map AB info from maps when they are created, preventing issues with instance ID re-use
- better handle instances with no non-GM characters (disable scaling temporarily)
- removed unnecessary `std::string`s
- majory re-wrote the multiplicer calculations to increase accuracy and clarity
- take advantage of new `OnBeforeCreatureSelectLevel` hook to set the initial level of creatures before they are added to the world
- separated level-scaled and non-level-scaled multipliers for tracking and display
- move creature relevancy check to new function `isCreatureRelevant`
- rename many variables to standardize and clarify
- add option to force a map stats update, to be used when a player enters the map
- players leaving the map are no longer included in the map's stats
- sweeping improvements in logging of the multiplier calculation process (`AutoBalance.StatGeneration`)
- update `.ab creaturestat` to show new scaled modifiers in an understandable way
- replace kludgy player count detection with an internal player list (more features coming Soon)
- skip scaling on player-owned summons, totems, etc
- skip scaling on flavor critters but not on combat critters
- separate map and global config times, reducing the work to refresh if only a map config changes
- centralize detection of "non-relevant" creatures, use a `skipMe` tag to speed up processing
- correctly handle a GM leaving the instance who was previously a non-GM when they entered
- temporarily disable in-combat checking
- improve logging format to produce the ID needed for `.go creature <UUID>`
- standardize logging format
- moved enums to top the file, added `Relevance` enum
- improve performance of `isCreatureRelevant` but saving the decision from previous runs
- fix issues with summon detection to (hopefully) cover all edge cases
- consolidate and fix StatModifier case selection, add debugs
- more logging improvements all around
- boss summons now also count as a "boss"
- percent-based damage auras will now ignore level scaling (per-player scaling only)
- map multipliers (damage/healing and health) will now honor the level scaling setting
- use a custom struct to store and move around world multipliers
- properly remove LevelScalingEndGameBoost until it can be fixed (azerothcore#156)
- creatures summoned by a boss will now be scaled like bosses
- further refinement of trigger handling logic
- fix active creature not being decremented on creature removal
- fix incorrect announcing of GMs entering/exiting the instance
- improvements for in-game commands
- continued log improvements
- fix display issue with active creatures
- that'll teach me to commit before I build
- track summoner as a part of AutoBalanceCreatureInfo
- detect when a summon is a clone and use the correct current health instead of scaling again
- add summon information to `.ab creaturestat`
- as always, logging improvements
- spells with SPELL_AURA_SHARE_DAMAGE_PCT effects will now correctly be unmodified
- added `spellIdsToNeverModify` and correctly skip modification of them
- add "Twin Empathy" (1177) to the `spellIdsToNeverModify` list
- convert `_IsAuraPercentDamage` to `_isAuraWithEffectType` since this probably isn't the last I'll need it
- logging changes, naturally
…alth/SetMaxHealth just before adding creatures to the world.

- Fixes azerothcore#168
- Fixes azerothcore#169
@kjack9
Copy link
Collaborator Author

kjack9 commented Nov 8, 2023

The commit log here is a disaster and I'm not sure why. I'll make sure I clean that up before next PR, sorry. Changed files are correct though.

@Helias
Copy link
Member

Helias commented Nov 9, 2023

I did a quick review and it looks good to me

@Helias Helias merged commit 02225b4 into azerothcore:master Nov 9, 2023
1 check passed
@kjack9 kjack9 deleted the kjack9/issue169 branch November 14, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants