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

Implement MAKE_ITEM_GROUP handling. #267

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Implement MAKE_ITEM_GROUP handling. #267

wants to merge 5 commits into from

Conversation

xGuTeK
Copy link
Contributor

@xGuTeK xGuTeK commented Nov 17, 2024

#247

Description

This PR introduces support for MAKE_ITEM_GROUP, enhancing the existing drop system. Previously, only up to 5 items could be directly assigned as drops. With this PR, you can now assign a group of up to 30 items. When the group is selected as a drop, the system will randomly choose one item from within that group. Item groups are managed in the MAKE_ITEM_GROUP table.

Instructions for Use:

Creating an Item Group:

  • Open the MAKE_ITEM_GROUP table.
  • Create a new row with a group index. Ensure the group ID is greater than 100.
  • Add the desired items to the group and set their individual drop rates.

Assigning an Item Group to a Monster:

  • Open the K_MONSTER_ITEM table.
  • Assign the group ID to the iItem01 column of the desired monster.

⚠️ ### Important: Item groups will only be recognized in the iItem01 column. This means you can assign only one item group to a monster in a drop table.

💔 Thank you!

stevewgr and others added 5 commits November 12, 2024 23:26
Refactored N3Utils.h to introduce various platform-agnostic string
utilities, improving code consistency and cross-platform compatibility.

Changes include:
- Added concepts for CharType, StringType, StringViewType, and PathType.
- Introduced case-insensitive comparison functions (iequals, istarts_with,
  iends_with) for strings and filesystem paths, using a custom ToLower
  functor to handle case transformations across char types.
- Defined platform-specific mappings for string functions, improving
  portability across Windows, macOS, and Linux.
- Updated comments and instructions for verifying compatibility with
  C++20 compilers (GCC, Clang, MSVC) on godbolt.org.

These improvements enhance code reuse and ensure compatibility across
multiple platforms, supporting the goal of a more robust, standardized
codebase.
This commit introduces `fs::pathx`, a custom wrapper around
`std::filesystem::path`, to address limitations in the standard
implementation. This extended class provides additional functionality
and optimizations while maintaining compatibility with existing code.

Key features include:
- **Automatic Path Normalization**: FS_AUTO_NORMALIZE automatically
  standardizes path separators during concatenation with `operator/`
  or `operator/=`, simplifying path handling, especially on Windows.
- **Extended Path Manipulation**: Added functions for case-insensitive
  path comparisons (`icontains`), relative path construction, and
  converting paths to lowercase, improving flexibility in handling paths.
- **Operator Overloading**: Implemented `operator/` and `operator+=`
  to streamline path concatenation, along with other convenient
  overloads.
- **Temporary File Creation**: Added `mktemp_file`, a function for
  creating temporary files with customizable prefixes, suffixes, and
  directory locations.
- **Namespace Redirection**: The new class uses namespace redirection
  and aliasing to remain unobtrusive in the codebase, making it behave
  like a native `std::filesystem::path` object.

These enhancements offer a more versatile and efficient approach to
path management, particularly on Windows, and allow for a cleaner,
more maintainable codebase. This approach should remain effective
until future standard updates to `std::filesystem` address current
limitations.
Added a console log output in CLogWriter::Write to display log
messages directly in the console in addition to file output. This
enhancement helps improve real-time debugging by making logs
immediately visible.
This commit replaces numerous platform-specific WinAPI functions and
custom implementations with C++17’s std::filesystem, streamlining
and modernizing path and file management across the codebase.
The refactor enhances code readability, reduces platform-specific
dependencies, and improves cross-platform compatibility.

Summary of changes:
- **Path Handling**: Replaced custom and WinAPI-based path handling
  across files, standardizing operations like path concatenation,
  normalization, and extraction using std::filesystem methods.
- **File I/O Operations**: Migrated file reading, writing, and
  existence checks to use std::filesystem, ensuring cleaner and
  more uniform file operations across platforms.
- **Legacy Code Removal**: Removed obsolete components such as
  `CAVIPlayer` and other WinAPI-based implementations no longer
  required with std::filesystem support.
- **Bug Fixes**: Addressed existing path-related bugs and inconsistencies
  that stemmed from the manual path handling methods previously used.
- **Code Cleanup**: Deleted unnecessary code comments and unused
  functions, including those related to deprecated path handling,
  for a cleaner, more maintainable codebase.

This update provides a solid foundation for improved cross-platform
support and prepares the codebase for future C++ standard upgrades.
@xGuTeK xGuTeK requested a review from stevewgr November 17, 2024 11:35
@xGuTeK xGuTeK self-assigned this Nov 17, 2024
@xGuTeK xGuTeK requested review from a team and SeniourMarquies November 17, 2024 11:36
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.

2 participants