Skip to content

Commit

Permalink
Merge branch 'main' into fixTraceable
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Oct 21, 2023
2 parents 8fee5b0 + 4f09a64 commit 514e4db
Show file tree
Hide file tree
Showing 144 changed files with 2,493 additions and 856 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/analysis-sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ env:
VCPKG_BINARY_SOURCES: clear;default,readwrite

jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

sonarcloud:
name: SonarCloud
runs-on: ubuntu-22.04

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

- uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
with:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ on:
- main

jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

build_docker_x86:
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
16 changes: 9 additions & 7 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ env:
MAKEFLAGS: '-j 2'

jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
Expand All @@ -35,13 +44,6 @@ jobs:
triplet: x64-linux

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 repository
uses: actions/checkout@main

Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build-windows-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: '-j 2'
jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
Expand All @@ -29,13 +38,6 @@ jobs:
packages: >
sccache
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 repository
uses: actions/checkout@main

Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build-windows-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ env:
MAKEFLAGS: '-j 2'

jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
Expand All @@ -32,13 +41,6 @@ jobs:
packages: >
sccache
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: Setup MSBuild.exe
uses: microsoft/[email protected]

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/clang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ on:
paths:
- 'src/**'
jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

build:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cron-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ on:
- cron: '30 1 * * *'

jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

stale:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ on:
- pull_request_target

jobs:
cancel-runs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

triage:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 6 additions & 3 deletions data-otservbr-global/migrations/40.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
function onUpdateDatabase()
logger.info("Updating database to version 41 (optimize house_lists)")
db.query([[
ALTER TABLE `house_lists` DROP COLUMN `id`;
]])

db.query([[
ALTER TABLE `house_lists`
ADD COLUMN `version` bigint NOT NULL DEFAULT 0 AFTER `listid`,
ADD INDEX `version` (`version`),
ADD PRIMARY KEY (`house_id`, `listid`);
]])

db.query([[
ALTER TABLE `house_lists`
MODIFY `version` bigint(20) NOT NULL DEFAULT '0';
]])

return true
end
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ mType.onDisappear = function(monster, creature) end
mType.onMove = function(monster, creature, fromPosition, toPosition) end

mType.onSay = function(monster, creature, type, message)
if type ~= TALKTYPE_SAY then
return false
end
local exhaust = GrandMasterOberonConfig.Storage.Exhaust
if creature:isPlayer() and monster:getStorageValue(exhaust) <= os.time() then
message = message:lower()
Expand Down
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/....lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ npcConfig.outfit = {
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0
lookAddons = 0,
}

npcConfig.flags = {
floorchange = false
floorchange = false,
}

local keywordHandler = KeywordHandler:new()
Expand Down
3 changes: 3 additions & 0 deletions data-otservbr-global/npc/battlemart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ npcConfig.shop = {
{ itemName = "enhanced exercise bow", clientId = 35282, buy = 2340000 },
{ itemName = "enhanced exercise club", clientId = 35281, buy = 2340000 },
{ itemName = "enhanced exercise rod", clientId = 35283, buy = 2340000 },
{ itemName = "enhanced exercise shield", clientId = 44066, buy = 2340000 },
{ itemName = "enhanced exercise sword", clientId = 35279, buy = 2340000 },
{ itemName = "enhanced exercise wand", clientId = 35284, buy = 2340000 },
{ itemName = "envenomed arrow", clientId = 16143, buy = 12 },
Expand Down Expand Up @@ -124,10 +125,12 @@ npcConfig.shop = {
{ itemName = "magic wall rune", clientId = 3180, buy = 116 },
{ itemName = "magma amulet", clientId = 817, buy = 15000 },
{ itemName = "mana potion", clientId = 268, buy = 56 },
{ itemName = "mana shield potion", clientId = 35563, buy = 200000 },
{ itemName = "masterful exercise axe", clientId = 35286, buy = 2700000 },
{ itemName = "masterful exercise bow", clientId = 35288, buy = 2700000 },
{ itemName = "masterful exercise club", clientId = 35287, buy = 2700000 },
{ itemName = "masterful exercise rod", clientId = 35289, buy = 2700000 },
{ itemName = "masterful exercise shield", clientId = 44067, buy = 2700000 },
{ itemName = "masterful exercise sword", clientId = 35285, buy = 2700000 },
{ itemName = "masterful exercise wand", clientId = 35290, buy = 2700000 },
{ itemName = "might ring", clientId = 3048, buy = 5000 },
Expand Down
74 changes: 74 additions & 0 deletions data-otservbr-global/npc/john_bounac.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
local npcName = "John"
local npcType = Game.createNpcType("John (Bounac)")
local npcConfig = {}

npcConfig.name = npcName
npcConfig.description = npcName

npcConfig.health = 100
npcConfig.maxHealth = npcConfig.health
npcConfig.walkInterval = 2000
npcConfig.walkRadius = 2

npcConfig.outfit = {
lookType = 1245,
lookHead = 40,
lookBody = 0,
lookLegs = 99,
lookFeet = 28,
lookAddons = 3,
}

npcConfig.flags = {
floorchange = false,
}

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)

npcType.onThink = function(npc, interval)
npcHandler:onThink(npc, interval)
end

npcType.onAppear = function(npc, creature)
npcHandler:onAppear(npc, creature)
end

npcType.onDisappear = function(npc, creature)
npcHandler:onDisappear(npc, creature)
end

npcType.onMove = function(npc, creature, fromPosition, toPosition)
npcHandler:onMove(npc, creature, fromPosition, toPosition)
end

npcType.onSay = function(npc, creature, type, message)
npcHandler:onSay(npc, creature, type, message)
end

npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

npcConfig.shop = {
{ clientId = 36951, buy = 10000 },
{ clientId = 36952, buy = 10000 },
{ clientId = 36953, buy = 10000 },
{ clientId = 36954, buy = 10000 },
{ clientId = 36955, buy = 10000 },
{ clientId = 36956, buy = 10000 },
}
-- On buy npc shop message
npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
npc:sellItem(player, itemId, amount, subType, 0, ignore, inBackpacks)
end
-- On sell npc shop message
npcType.onSellItem = function(npc, player, itemId, subtype, amount, ignore, name, totalCost)
player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("Sold %ix %s for %i gold.", amount, name, totalCost))
end
-- On check npc shop message (look item)
npcType.onCheckItem = function(npc, player, clientId, subType) end

npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/the_bone_master.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 1)
end
elseif MsgContains(message, "advancement") then
elseif MsgContains(message, "advancement") or MsgContains(message, "demonic") or MsgContains(message, "essence") then
if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) == 1 then
npcHandler:say("So you want to advance to a {Hyaena} rank? Did you bring 500 demonic essences with you?", npc, creature)
npcHandler:setTopic(playerId, 3)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/the_dream_master.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 1)
end
elseif MsgContains(message, "advancement") then
elseif MsgContains(message, "advancement") or MsgContains(message, "demonic") or MsgContains(message, "essence") then
if player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) == 1 then
npcHandler:say("So you want to advance to a {Initiate} rank? Did you bring 500 demonic essences with you?", npc, creature)
npcHandler:setTopic(playerId, 3)
Expand Down
2 changes: 0 additions & 2 deletions data-otservbr-global/raids/raids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
<!-- Thais -->
<raid name="Cyclops" file="thais/cyclops.xml" interval2="500" margin="30" />
<raid name="OrcsThais" file="thais/orcs.xml" interval2="500" margin="70" />
<raid name="RatsThais" file="thais/rats.xml" interval2="500" margin="80" />
<raid name="Wild Horses" file="thais/wild_horses.xml" interval2="500" margin="80" />
<!-- Venore -->
<raid name="Dharalion" file="venore/dharalion.xml" interval2="500" margin="70" />
<raid name="Elves" file="venore/elves.xml" interval2="500" margin="80" />
Expand Down
3 changes: 3 additions & 0 deletions data-otservbr-global/scripts/actions/addons/addons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ local config = {
-- poltergeist
[32630] = { female = 1271, male = 1270, addon = 1, effect = CONST_ME_BLUE_GHOST, achievement = "Mainstreet Nightmare" },
[32631] = { female = 1271, male = 1270, addon = 2, effect = CONST_ME_BLUE_GHOST, achievement = "Mainstreet Nightmare" },
-- rascoohan
[35595] = { female = 1372, male = 1371, addon = 1, achievement = "Honorary Rascoohan" },
[35695] = { female = 1372, male = 1371, addon = 2, achievement = "Honorary Rascoohan" },
}

local addons = Action()
Expand Down
Loading

0 comments on commit 514e4db

Please sign in to comment.