Skip to content

Commit

Permalink
Merge branch 'main' into luan/compact-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
luan authored Dec 29, 2023
2 parents 129ac26 + 458eb99 commit 4e20364
Show file tree
Hide file tree
Showing 216 changed files with 4,600 additions and 749 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build-docker-dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Build - Docker (dummy)

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "src/**"

jobs:
build_docker_x86:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- run: echo "This is a dummy job to satisfy branch protection checks"

build_docker_arm:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- run: echo "This is a dummy job to satisfy branch protection checks"
9 changes: 1 addition & 8 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -90,13 +90,6 @@ jobs:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
if: github.ref != 'refs/heads/main'
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content"
cancel_others: true

- name: Checkout
uses: actions/checkout@main
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/build-ubuntu-dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Build - Ubuntu (dummy)

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "src/**"

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
buildtype: [linux-release, linux-debug]
include:
- os: ubuntu-20.04
triplet: x64-linux
- os: ubuntu-22.04
triplet: x64-linux

steps:
- run: echo "This is a dummy job to satisfy branch protection checks"
- name: Checkout repository
uses: actions/checkout@main
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build-windows-cmake-dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Build - Windows - CMake (dummy)
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "src/**"

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
buildtype: [windows-release]
include:
- os: windows-2022
triplet: x64-windows-static
packages: >
sccache
steps:
- run: echo "This is a dummy job to satisfy branch protection checks"
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
MAKEFLAGS: "-j 2"
jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/build-windows-solution-dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Build - Windows - Solution (dummy)

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "src/**"

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
buildtype: [Debug]
include:
- os: windows-2022
triplet: x64-windows
packages: >
sccache
steps:
- run: echo "This is a dummy job to satisfy branch protection checks"
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/clang-lint-dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Clang-format (dummy)
on:
pull_request:
paths-ignore:
- "src/**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "This is a dummy job to satisfy branch protection checks"
2 changes: 1 addition & 1 deletion .github/workflows/clang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "src/**"
jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
cancel-runs:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/lua-format-dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Lua-format (dumy)

on:
pull_request:
paths-ignore:
- "data*/**"

jobs:
lua-formatter:
runs-on: ubuntu-latest
steps:
- run: echo "This is a dummy job to satisfy branch protection checks"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ client_assertions.txt
*-house.xml
*-monster.xml
*-npc.xml
monster_count.txt

# SFTP for Sublime
sftp-config.json
Expand Down
33 changes: 23 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,30 @@ endif()
# === IPO ===
option(OPTIONS_ENABLE_IPO "Check and Enable interprocedural optimization (IPO/LTO)" ON)
if(OPTIONS_ENABLE_IPO)
log_option_enabled("ipo")

include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
log_war("IPO is not supported: ${output}")
endif()
log_option_enabled("IPO/LTO")
if(MSVC)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
else()
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "Release")
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output)
if(result)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=auto")
message(STATUS "IPO/LTO enabled with -flto=auto for non-MSVC compiler.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
log_war("IPO/LTO not supported: ${output}")
endif()
else()
log_option_disabled("IPO/LTO")
endif ()
endif()
else()
log_option_disabled("ipo")
log_option_disabled("IPO/LTO")
endif()

option(BUILD_TESTS "Build tests" OFF) # By default, tests will not be built
Expand Down
20 changes: 16 additions & 4 deletions cmake/modules/CanaryLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,23 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif()

# === IPO ===
check_ipo_supported(RESULT result OUTPUT output)
if(result)
set_property(TARGET ${PROJECT_NAME}_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
if(MSVC)
target_compile_options(${PROJECT_NAME}_lib PRIVATE "/GL")
set_target_properties(${PROJECT_NAME}_lib PROPERTIES
STATIC_LINKER_FLAGS "/LTCG"
SHARED_LINKER_FLAGS "/LTCG"
MODULE_LINKER_FLAGS "/LTCG"
EXE_LINKER_FLAGS "/LTCG")
else()
message(WARNING "IPO is not supported: ${output}")
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=auto")
message(STATUS "IPO/LTO enabled with -flto=auto for non-MSVC compiler.")
set_property(TARGET ${PROJECT_NAME}_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "IPO/LTO is not supported: ${output}")
endif()
endif()

# === UNITY BUILD (compile time reducer) ===
Expand Down
8 changes: 8 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ hazardCriticalInterval = 2000
hazardCriticalChance = 750
hazardCriticalMultiplier = 25
hazardDamageMultiplier = 200
hazardDefenseMultiplier = 0
hazardDodgeMultiplier = 85
hazardPodsDropMultiplier = 87
hazardPodsTimeToDamage = 2000
Expand Down Expand Up @@ -373,13 +374,20 @@ showScriptsLogInConsole = false
criticalChance = 10
inventoryGlowOnFiveBless = false
adventurersBlessingLevel = 21
skulledDeathLoseStoreItem = false
experienceDisplayRates = true
-- configure attack base on Fist Fighting skill/experience
-- multiplierSpeedOnFist * 5 (multiplies the value obtained from the player fist skill and multiplies it * 5) max 25 is recommended due minTicks limits else player stop attack
-- maxSpeedOnFist 500 miliseconds (The maximum attack speed that can be obtained no matter how high the player has the Fist Fighting skill.)
toggleAttackSpeedOnFist = false
multiplierSpeedOnFist = 5
maxSpeedOnFist = 500
disableLegacyRaids = false -- disable legacy XML raids
disableMonsterArmor = false
combatChainDelay = 50 -- minimum: 50 miliseconds
minElementalResistance = -200
maxElementalResistance = 200
maxDamageReflection = 200

-- Global server Save
-- NOTE: globalServerSaveNotifyDuration in minutes
Expand Down
15 changes: 8 additions & 7 deletions data-otservbr-global/monster/amphibics/makara.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ monster.flags = {
canPushCreatures = true,
staticAttackChance = 90,
targetDistance = 1,
runHealth = 10,
runHealth = 0,
healthHidden = false,
isBlockable = false,
canWalkOnEnergy = false,
Expand All @@ -71,12 +71,13 @@ monster.voices = {
interval = 5000,
chance = 10,
{ text = "waddle waddle", yell = false },
{ text = "Nihahaha!", yell = false },
}

monster.loot = {
{ name = "platinum coin", chance = 100000, maxCount = 13 },
{ name = "platinum coin", chance = 100000, maxCount = 18 },
{ name = "makara tongue", chance = 10160 },
{ name = "makara fin", chance = 7420 },
{ name = "makara fin", chance = 7420, maxCount = 2 },
{ name = "meat", chance = 7030, maxCount = 2 },
{ name = "cyan crystal fragment", chance = 4300 },
{ name = "yellow gem", chance = 4100 },
Expand All @@ -90,10 +91,10 @@ monster.loot = {

monster.attacks = {
{ name = "combat", interval = 2000, chance = 100, type = COMBAT_PHYSICALDAMAGE, minDamage = -145, maxDamage = -390, target = true }, -- basic_attack
{ name = "combat", interval = 2000, chance = 25, type = COMBAT_EARTHDAMAGE, minDamage = -305, maxDamage = -390, radius = 3, effect = CONST_ME_STONES, shootEffect = CONST_ANI_EARTH, target = true }, -- stone_shower_ball
{ name = "combat", interval = 2000, chance = 25, type = COMBAT_EARTHDAMAGE, minDamage = -305, maxDamage = -390, radius = 5, effect = CONST_ME_STONES, shootEffect = CONST_ANI_EARTH, target = true }, -- great_stone_shower_ball
{ name = "combat", interval = 2000, chance = 25, type = COMBAT_ICEDAMAGE, minDamage = -360, maxDamage = -390, range = 7, shootEffect = CONST_ANI_SMALLICE, effect = CONST_ME_ICEATTACK, target = true }, -- ice_strike
{ name = "makarawatersplash", interval = 2000, chance = 25, minDamage = -380, maxDamage = -455, target = false }, -- short_water_cone-wave
{ name = "combat", interval = 2500, chance = 25, type = COMBAT_EARTHDAMAGE, minDamage = -305, maxDamage = -390, radius = 3, effect = CONST_ME_STONES, shootEffect = CONST_ANI_EARTH, target = true }, -- stone_shower_ball
{ name = "combat", interval = 3000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -305, maxDamage = -390, radius = 5, effect = CONST_ME_STONES, shootEffect = CONST_ANI_EARTH, target = true }, -- great_stone_shower_ball
{ name = "combat", interval = 3500, chance = 20, type = COMBAT_ICEDAMAGE, minDamage = -360, maxDamage = -390, range = 7, shootEffect = CONST_ANI_SMALLICE, effect = CONST_ME_ICEATTACK, target = true }, -- ice_strike
{ name = "makarawatersplash", interval = 4000, chance = 25, minDamage = -380, maxDamage = -455, target = false }, -- short_water_cone-wave
}

monster.defenses = {
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/deathling_scout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ monster.speed = 155
monster.manaCost = 0

monster.faction = FACTION_DEATHLING
monster.enemyFactions = { FACTION_DEEPLING, FACTION_PLAYER }
monster.enemyFactions = { FACTION_PLAYER, FACTION_DEEPLING }

monster.changeTarget = {
interval = 4000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ monster.speed = 155
monster.manaCost = 0

monster.faction = FACTION_DEATHLING
monster.enemyFactions = { FACTION_DEEPLING, FACTION_PLAYER }
monster.enemyFactions = { FACTION_PLAYER, FACTION_DEEPLING }

monster.changeTarget = {
interval = 4000,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/deepling_brawler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ monster.speed = 85
monster.manaCost = 0

monster.faction = FACTION_DEEPLING
monster.enemyFactions = { FACTION_DEATHLING, FACTION_PLAYER }
monster.enemyFactions = { FACTION_PLAYER, FACTION_DEATHLING }

monster.changeTarget = {
interval = 4000,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/deepling_elite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ monster.speed = 165
monster.manaCost = 0

monster.faction = FACTION_DEEPLING
monster.enemyFactions = { FACTION_DEATHLING, FACTION_PLAYER }
monster.enemyFactions = { FACTION_PLAYER, FACTION_DEATHLING }

monster.changeTarget = {
interval = 4000,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/deepling_guard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ monster.speed = 135
monster.manaCost = 0

monster.faction = FACTION_DEEPLING
monster.enemyFactions = { FACTION_DEATHLING, FACTION_PLAYER }
monster.enemyFactions = { FACTION_PLAYER, FACTION_DEATHLING }

monster.changeTarget = {
interval = 4000,
Expand Down
Loading

0 comments on commit 4e20364

Please sign in to comment.