Skip to content

Commit

Permalink
feat: augment system & optimisations
Browse files Browse the repository at this point in the history
* Add bootstrap script to ease installation on linux platforms.

Co-Authored By: Martin Nylind <[email protected]>

* Added Augmented Players and Items. (#29)

* Augments (WIP)

* Fixed issue with imbuements serialization on items with augments

* Added Augment & Imbuement Smart Protections

Blocking augment of stackables, charged items, non moveables ect.
Checking that item is in the slot its assigned to for the augments to count if the config is set to true (default), only a problem for classic slots.
Preventing items from decaying and/or transforming if they are imbued or augmented.
Imbuement stackables still lack necessary support and protection for unwanted behavior.

* Various patches for overlooked things.

Added resist with rest of defensive modifiers.
Configured stamina to be by seconds.
Removed the check to ensure missing health, mana, soul, and stamina which prevented getting the effect.
Created more complete leech/steal combat.
Enabled crits on condition damage.
Strict typing of int32_t for no inconsistencies in damage calculations.
Fixed piercing damage healing instead of piercing.
Added other enhancements for augment combat code.

* Removed dead code, and fixed problems with "steal/leech" combats.

* Fix broken flat factor option & soul/stamina not working with numbers bigger than their numeric limit.

* Keep from adding pz tiles to list of possible ricochet positions

* Huge update with fixes from other systems included.

* Fix small issue with percents introduced recently

* Add config options, fixed some quirks, numeric conversion issue and others.

* Added additional considerations for classic slots users

* added some prints for debuggin and fixed some things

* Major update to deflect, and some other optimizations and such

* more minor updates. deflect had 2 areas that were fixed

* many optimizations

* latest fixes

* switch to recursive iterator to support loading sub folders

* Expanded parser some, did some optimizations, applied solution for classic slots problem

* Commit to attempt to fix builds on linux, includes classic slots fix

* Added missing lua methods

* Implement workflow build fix for dependencies.

Co-Authored-By: jordanhoare <[email protected]>

* Added missing modifier enums.

* Pass count for reward container stackables

* Adjustments to Monster::death for Reward System

-Switched to using game::internalAddItem
-Reduced code duplication
-Improved Readability
-Added error reporting to output stream for failure to add items.

* Fix stackables not stacking with themselves for reward container

* Fix Syntax Error with queries for Augments Migrations

Co-Authored-By: Silba <[email protected]>

* Fix for issue #27

- The rearrangement of order of logic execution resulted in an early return for all creatures under the circumstances of stepping on a square with a creature who is not a gm or ghosted, this ensures proper checks all around.

- Some logic with player::canWalkThrough needed adjustment as well, it seems the config check was only grouped with pz and level protection previously.

* Fixes issue #17 Removed access check

* Remove overlooked print

* Fixes issue #16

- Code imported on this commit is take from TFS and is therefore under the same license as TFS, GPL. It's an exclusion from other code added by myself for being under the new license, MIT.

* Code Cleanup

- Removed debug prints from augment testing.

* Remove undefined function from default onGainExperience

* Implemented Hash Cache for spectators. (#31)

Co-authored-by: Sarah Wesker <[email protected]>

* Fix syntactical error that allowed walking on occupied depot tiles.

* Fix issue #20

- resolves problem of monsters' ownership transferring to a non existent spawn point

* Apply changes meant for e7fd326

- Finally completely resolves #16

* Reworked Boss Reward logic a bit, fixes #30

- Added in support for reward items having augments.
- Added missing support for config multipliers.
- Updated logic for determining loot.
- Send "no loot" message under right circumstances.

* Cleanup of old debug prints still around.

* Fix: Unable to set spell group to 'NONE' (#32)

Using the spellgroup("none"), didn't work as below in the code, after it was already loaded, the code: if (group == SPELLGROUP_NONE) {, would have overriden it and set none to either attack or healing group.

This successfully fixes it.

* Spell Groups: Adapt revscript loading to spell groups (Black-Tek#33)

* Adapt revscript loading to spell groups

Previous PR should've fixed XML loading, this should fix Revscript loading.

* Resolve compilation warnings about truncation

* Lua Compatibility Fix for #18

- This changes many cases of lua_pushnumber to lua_pushinteger
- This implements new overloads for "setField" method for the lua interface
- There were a couple un-needed static_casts cleaned up from imbuement lua api

* Cleanup warnings from the console (Black-Tek#34)

Had to remove a couple old commits from Evil Hero, that caused the console to fill up with errors, but the underlying problem wasn't resolved anyways. Also cleaned up a leftover debug print.

* Changed player:getMaxMana() to use lua_pushinteger for #18

* Resolve Display error in item description for percent based stats.

* Resolve error thrown for doing math with a boolean after lua change for #18

* Closes Black-Tek#35 Fix for attribute serialization and reward container saving.

- Attributes can't use same stream as Augments because attributes use uint8_t's as indicators, and augments writes a uint32_t directly where an indicator should be, so we give augments their own stream.

- Normalized the saving for reward items so they are handled the same way other item saving is done.

- Removed 7 day limit as it was causing problems (only items with the attributes for date were showing up in container, but stackables can't have custom attributes like date).

* Changed some checks for healing combat during bockhit (imbuements)

- Had a private reported bug about healing combat triggering imbuements, this should resolve that.

* Implement Windows Edge Builds

* Add Bootstrap.bat to ease installation

- Also updated readme

* Update premake5.lua

- Support arm architecture
- Add ability to use system libraries
- Add options to use custom paths for edge cases
- Remove redundant --std=c++20 buildoption

* Fix Black-Tek#37

* Remove redundant "names" std::unordered_map from Player::getCorpse() (Black-Tek#38)

I've noticed redundant allocation of std::unordered_map together with its unneeded loop.

The edited fragment of method, which is about creating corpse's description (Item* Player::getCorpse(Creature* lastHitCreature, Creature* mostDamageCreature)),
does not need to check names[lastHitCreature->getName()] == 1 , which is the only place where the names map is actually used.

It just serves no visible purpose, maybe it was meant to check if lastHitCreature is in getKillers(), which is a check if the lastHitCreature has hit the dead person in last minute... which is not needed, because lastHitCreature by its definition means that it is true.

* Update Server Version (and console information)

* Linux Edge Builds

* No .exe on linux

* Permissions for linux builds

* Update windows_build_runner.yml

- Changed edge builds to be only 1 at a time
- Changed windows edge builds to use same tag
- Added a version.info to compressed artifacts to keep record of semantic version by sha.
- Added sha to name of compressed artifact as another record of semantic version

* Resolve Windows Build Error (workflows)

* Properly name linux artifact

* Properly name windows artifact (workflows)

* Use Buildtype for evaluation in windows workflow

* Update bootstrap.sh

- Fix some small mistakes
- Lower min gcc version to 10
- Some armv7 support by using system libraries
- Find premake when .local/bin is not in PATH

* Augment events (Black-Tek#39)

* Augment Events

- Added Player Events (callbacks) onPlayerAugment, onRemovePlayerAugment
- Added Item Events (callbacks) onItemAugment, onRemoveItemAugment

* Change Event Names

* More Responsive Monsters

Co-Authored-By: SaiyansKing <[email protected]>

* Add Doors lib

* Update Licensing

* Add Discord to readme

* Update Community Link with discord server invite

* Fix Black-Tek#42

* Fix Ubuntu builds for bootstrap.sh

* Moved Imbuement Combat logic to Combat::doTargetCombat() (Black-Tek#43) Fixes Black-Tek#41

- Rewrote some of the math and logic involving the math
- Used more consts and refs
- Added defaults, and unlikely attribute, for switches
- Checking for only melee and ranged attacks
- Excluded all healing and manadrain combat types

* Update Discord Link in Readme

* Added Server Save Talkaction (Black-Tek#46)

* Create storages.lua (Black-Tek#48)

Create talkaction /storage for in-game storage management.

* Add isRewardBoss to lua. (Black-Tek#49)

Add isRewardBoss to lua

* Merge remote-tracking branch 'upstream/master' into chore/upstream

* Merge remote-tracking branch 'upstream/master' into chore/upstream

* chore: remove migrations

---------

Co-authored-by: codinablack <[email protected]>
Co-authored-by: Codinablack <[email protected]>
Co-authored-by: Silba <[email protected]>
Co-authored-by: Sarah Wesker <[email protected]>
Co-authored-by: Tofame <[email protected]>
Co-authored-by: Martin Nylind <[email protected]>
Co-authored-by: SaiyansKing <[email protected]>
Co-authored-by: LuanGP <[email protected]>
  • Loading branch information
9 people authored Jan 18, 2025
1 parent 25d1218 commit abc2223
Show file tree
Hide file tree
Showing 85 changed files with 6,766 additions and 2,532 deletions.
339 changes: 0 additions & 339 deletions LICENSE

This file was deleted.

178 changes: 178 additions & 0 deletions bootstrap.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
@echo off
setlocal enabledelayedexpansion

set projectDir=%CD%

echo ::::::::::::::::::::::::::::::::::::::
echo ::::::::::::::::::::::::::::::::::::::
echo ::::: Black Tek Server Bootstrap :::::
echo ::::: (for windows) :::::
echo ::::::::::::::::::::::::::::::::::::::
echo ::::::::::::::::::::::::::::::::::::::


:: Check if vcpkg is installed first.
where vcpkg >nul 2>&1
if %ERRORLEVEL%==0 (
echo Vcpkg installation has been found!
echo skipping vcpkg installation..
goto premake_input
) else (
echo Vcpkg installation has not been detected!
echo moving forward with vpckg installation...
)

:vcpkg_input
echo Please provide the path to the directory you wish to store your vcpgk installation!
echo Warning!! This folder MUST ALREADY EXIST, or it won't be accepted.
echo Example input: C:\Packages\vcpkg
set /p VCPKG_INSTALL_PATH=Path:

:: Remove quotes if user included them
set VCPKG_INSTALL_PATH=!VCPKG_INSTALL_PATH:"=!

:: Check if path exists
if not exist "!VCPKG_INSTALL_PATH!" (
echo Error: The specified path does not exist.
echo Please enter a valid path.
goto vcpkg_input
)

cd "!VCPKG_INSTALL_PATH!"

:: Download and extract vcpkg
echo Downloading vcpkg...
curl -L "https://github.com/microsoft/vcpkg/archive/refs/heads/master.zip" -o vcpkg.zip || (
echo Failed to download vcpkg.
exit /b
)
tar -xf vcpkg.zip
del vcpkg.zip
ren "vcpkg-master" "vcpkg"

:: Setup vcpkg
echo Setting up vcpkg...
cd "!VCPKG_INSTALL_PATH!\vcpkg"
call bootstrap-vcpkg.bat || (
echo Failed to bootstrap vcpkg.
exit /b
)
vcpkg integrate install || (
echo Failed to integrate vcpkg.
exit /b
)
cd "!projectDir!"

:premake_input
echo Please enter a path to a folder for storing premake
echo Warning: This folder must already exist, or it won't be accepted.
echo Example: C:\premake
set /p PREMAKE_PATH=Path:

set PREMAKE_PATH=!PREMAKE_PATH:"=!

:: Check if path exists
if not exist "!PREMAKE_PATH!" (
echo Error: The specified path does not exist.
echo Please enter a valid path.
goto premake_input
)

cd "!PREMAKE_PATH!"

:: Download and extract premake.
:: We are currently locked into a version of premake
:: which does not fail to build using its bootstrap.bat
:: but also supports our needed features.
echo Downloading premake...
curl -L "https://github.com/premake/premake-core/archive/490686ceb24b29f16c1ec817ed05c07c5cce89c6.zip" -o premake.zip || (
echo Failed to download premake.
exit /b
)
tar -xf premake.zip
del premake.zip
ren "premake-core-490686ceb24b29f16c1ec817ed05c07c5cce89c6" "premake-core"
set premakeBin=!PREMAKE_PATH!\premake-core\bin\release\premake5.exe

:: Build premake
echo Building premake...
cd premake-core
cmd /c Bootstrap.bat || (
echo Premake build failed.
exit /b
)
cls

:: Copy premake5.exe to BlackTek-Server
echo Copying premake5.exe...
if not exist "!premakeBin!" (
echo Source file does not exist: "!premakeBin!"
exit /b
)
if not exist "!projectDir!" (
echo Destination directory does not exist: "!projectDir!"
exit /b
)
copy "!premakeBin!" "!projectDir!"
if errorlevel 1 (
echo Failed to copy premake5.exe.
echo Error level: %errorlevel%
echo From: "!premakeBin!"
echo To: "!projectDir!"
exit /b
)

:select_vs_version
cls
echo Select Visual Studio version:
echo [1] Visual Studio 2022
echo [2] Visual Studio 2019
echo [3] Visual Studio 2015
echo [4] Visual Studio 2013
echo [5] Visual Studio 2012
echo.

set /p choice="Enter number (1-5): "

:: Set the vs_version variable based on user choice
if "%choice%"=="1" (
set "vs_version=vs2022"
) else if "%choice%"=="2" (
set "vs_version=vs2019"
) else if "%choice%"=="3" (
set "vs_version=vs2015"
) else if "%choice%"=="4" (
set "vs_version=vs2013"
) else if "%choice%"=="5" (
set "vs_version=vs2012"
) else (
echo Invalid selection. Please try again.
timeout /t 2 >nul
goto select_vs_version
)

:: Confirm selection
echo.
echo You selected Visual Studio %vs_version%
echo.
set /p confirm="Is this correct? (Y/N): "
if /i not "%confirm%"=="Y" goto select_vs_version

:: Run premake with selected version
echo.
echo Generating solution files for %vs_version%...
cd !projectDir!
cmd /c premake5.exe %vs_version%

if errorlevel 1 (
echo Failed to generate solution files.
echo Error level: %errorlevel%
pause
exit /b 1
)

echo Solution files generated successfully!
echo Setup complete. BlackTek has been successfully installed!
pause
exit
endlocal
Loading

0 comments on commit abc2223

Please sign in to comment.