Skip to content

Commit

Permalink
Merge branch 'opentibiabr:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 authored May 25, 2024
2 parents 26f6fb9 + dabbead commit 6edfcef
Show file tree
Hide file tree
Showing 154 changed files with 2,167 additions and 1,192 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-ubuntu-dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-22.04]
buildtype: [linux-release, linux-debug]
include:
- os: ubuntu-20.04
triplet: x64-linux
- os: ubuntu-22.04
triplet: x64-linux

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-22.04]
buildtype: [linux-release, linux-debug]
include:
- os: ubuntu-20.04
triplet: x64-linux
- os: ubuntu-22.04
triplet: x64-linux

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ endif()


# === IPO ===
option(OPTIONS_ENABLE_IPO "Check and Enable interprocedural optimization (IPO/LTO)" ON)
if(OPTIONS_ENABLE_IPO)
log_option_enabled("IPO/LTO")
if(MSVC)
log_option_enabled("IPO/LTO")
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")
log_option_enabled("IPO/LTO")
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output)
if(result)
Expand Down
4 changes: 3 additions & 1 deletion cmake/modules/BaseConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ if (MSVC)
endforeach(type)

add_compile_options(/MP /FS /Zf /EHsc)
endif (MSVC)
else()
add_compile_options(-Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-implicit-fallthrough -Wno-extra)
endif()

## Link compilation files to build/bin folder, else link to the main dir
function(set_output_directory target_name)
Expand Down
3 changes: 3 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@ partyListMaxDistance = 30
toggleMapCustom = true

-- Market
-- NOTE: marketRefreshPricesInterval (in minutes, minimum is 1 minute)
-- NOTE: set it to 0 for disable, is the time in which the task will run updating the prices of the items that will be sent to the client
marketOfferDuration = 30 * 24 * 60 * 60
marketRefreshPricesInterval = 30
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100
Expand Down
6 changes: 2 additions & 4 deletions data-otservbr-global/lib/quests/the_primal_ordeal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ function RegisterPrimalPackBeast(template)
primalMonster.loot = {}
primalMonster.name = "Primal Pack Beast"
primalMonster.description = "a primal pack beast"

primalMonster.health = primalMonster.health
primalMonster.maxHealth = primalMonster.maxHealth
primalMonster.maxHealth = primalMonster.maxHealth * 0.7
primalMonster.health = primalMonster.maxHealth
primalMonster.raceId = nil
primalMonster.Bestiary = nil
primalMonster.corpse = 0

primal:register(primalMonster)
end
55 changes: 54 additions & 1 deletion data-otservbr-global/migrations/45.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
logger.info("Updating database to version 46 (feat: vip groups)")

db.query([[
CREATE TABLE IF NOT EXISTS `account_vipgroups` (
`id` tinyint(3) UNSIGNED NOT NULL,
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose vip group entry it is',
`name` varchar(128) NOT NULL,
`customizable` BOOLEAN NOT NULL DEFAULT '1',
CONSTRAINT `account_vipgroups_pk` PRIMARY KEY (`id`, `account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])

db.query([[
CREATE TRIGGER `oncreate_accounts` AFTER INSERT ON `accounts` FOR EACH ROW BEGIN
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (1, NEW.`id`, 'Enemies', 0);
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (2, NEW.`id`, 'Friends', 0);
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (3, NEW.`id`, 'Trading Partner', 0);
END;
]])

db.query([[
CREATE TABLE IF NOT EXISTS `account_vipgrouplist` (
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose viplist entry it is',
`player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry',
`vipgroup_id` tinyint(3) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs',
INDEX `account_id` (`account_id`),
INDEX `player_id` (`player_id`),
INDEX `vipgroup_id` (`vipgroup_id`),
CONSTRAINT `account_vipgrouplist_unique` UNIQUE (`account_id`, `player_id`, `vipgroup_id`),
CONSTRAINT `account_vipgrouplist_player_fk`
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`)
ON DELETE CASCADE,
CONSTRAINT `account_vipgrouplist_vipgroup_fk`
FOREIGN KEY (`vipgroup_id`, `account_id`) REFERENCES `account_vipgroups` (`id`, `account_id`)
ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])

db.query([[
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`)
SELECT 1, id, 'Friends', 0 FROM `accounts`;
]])

db.query([[
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`)
SELECT 2, id, 'Enemies', 0 FROM `accounts`;
]])

db.query([[
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`)
SELECT 3, id, 'Trading Partners', 0 FROM `accounts`;
]])

return true
end
3 changes: 3 additions & 0 deletions data-otservbr-global/migrations/46.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ local thePrimalMenaceConfig = {
CountGrowthPerHazard = 1.05,
CountMax = 6,

HpRateOnSpawn = 0.7,
MonsterPool = {
"Emerald Tortoise (Primal)",
"Gore Horn (Primal)",
Expand Down Expand Up @@ -291,8 +290,6 @@ local function spawnMonster(monsterId, spawnPosition)
MonsterId = primalMonster:getId(),
Created = os.time(),
}
local monsterMaxHealth = primalMonster:getMaxHealth()
primalMonster:setHealth(monsterMaxHealth * thePrimalMenaceConfig.MonsterConfig.HpRateOnSpawn)

local primalBeasts = monster:getStorageValue(thePrimalMenaceConfig.Storage.PrimalBeasts)
table.insert(primalBeasts, primalBeastEntry)
Expand Down
5 changes: 3 additions & 2 deletions data-otservbr-global/npc/alaistar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ local itemsTable = {
{ itemName = "strong health potion", clientId = 236, buy = 115 },
{ itemName = "strong mana potion", clientId = 237, buy = 93 },
{ itemName = "supreme health potion", clientId = 23375, buy = 625 },
{ itemName = "ultimate health potion", clientId = 7643, buy = 438 },
{ itemName = "ultimate mana potion", clientId = 23373, buy = 379 },
{ itemName = "ultimate health potion", clientId = 7643, buy = 379 },
{ itemName = "ultimate mana potion", clientId = 23373, buy = 438 },
{ itemName = "ultimate spirit potion", clientId = 23374, buy = 438 },
{ itemName = "vial", clientId = 2874, sell = 5 },
},
["creature products"] = {
{ itemName = "cowbell", clientId = 21204, sell = 210 },
{ itemName = "execowtioner mask", clientId = 21201, sell = 240 },
{ itemName = "giant pacifier", clientId = 21199, sell = 170 },
{ itemName = "glob of glooth", clientId = 21182, sell = 125 },
{ itemName = "glooth injection tube", clientId = 21103, sell = 350 },
Expand Down
22 changes: 22 additions & 0 deletions data-otservbr-global/npc/alexander.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ npcConfig.voices = {
}

local itemsTable = {
["exercise weapons"] = {
{ itemName = "durable exercise rod", clientId = 35283, buy = 945000, count = 1800 },
{ itemName = "durable exercise wand", clientId = 35284, buy = 945000, count = 1800 },
{ itemName = "exercise rod", clientId = 28556, buy = 262500, count = 500 },
{ itemName = "exercise wand", clientId = 28557, buy = 262500, count = 500 },
{ itemName = "lasting exercise rod", clientId = 35289, buy = 7560000, count = 14400 },
{ itemName = "lasting exercise wand", clientId = 35290, buy = 7560000, count = 14400 },
},
["creature products"] = {
{ itemName = "crystal ball", clientId = 3076, buy = 530, sell = 190 },
{ itemName = "life crystal", clientId = 3061, sell = 83 },
{ itemName = "mind stone", clientId = 3062, sell = 170 },
},
["shields"] = {
{ itemName = "spellbook of enlightenment", clientId = 8072, sell = 4000 },
{ itemName = "spellbook of warding", clientId = 8073, sell = 8000 },
{ itemName = "spellbook of mind control", clientId = 8074, sell = 13000 },
{ itemName = "spellbook of lost souls", clientId = 8075, sell = 19000 },
},
["others"] = {
{ itemName = "spellwand", clientId = 651, sell = 299 },
},
["runes"] = {
{ itemName = "animate dead rune", clientId = 3203, buy = 375 },
{ itemName = "blank rune", clientId = 3147, buy = 10 },
Expand Down
68 changes: 68 additions & 0 deletions data-otservbr-global/npc/an_idol.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
local internalNpcName = "An Idol"
local npcType = Game.createNpcType(internalNpcName)
local npcConfig = {}

npcConfig.name = internalNpcName
npcConfig.description = internalNpcName

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

npcConfig.outfit = {
lookTypeEx = 15894,
}

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

local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)

if not npcHandler:checkInteraction(npc, creature) then
return false
end

if MsgContains(message, "VBOX") then
npcHandler:say("J-T B^C J^BXT°", npc, creature)
player:teleportTo(Position(32366, 32531, 8), false)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, false)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
33 changes: 33 additions & 0 deletions data-otservbr-global/npc/asima.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ npcConfig.flags = {
}

local itemsTable = {
["exercise weapons"] = {
{ itemName = "durable exercise rod", clientId = 35283, buy = 945000, count = 1800 },
{ itemName = "durable exercise wand", clientId = 35284, buy = 945000, count = 1800 },
{ itemName = "exercise rod", clientId = 28556, buy = 262500, count = 500 },
{ itemName = "exercise wand", clientId = 28557, buy = 262500, count = 500 },
{ itemName = "lasting exercise rod", clientId = 35289, buy = 7560000, count = 14400 },
{ itemName = "lasting exercise wand", clientId = 35290, buy = 7560000, count = 14400 },
},
["potions"] = {
{ itemName = "empty potion flask", clientId = 283, sell = 5 },
{ itemName = "empty potion flask", clientId = 284, sell = 5 },
Expand All @@ -41,6 +49,12 @@ local itemsTable = {
{ itemName = "ultimate spirit potion", clientId = 23374, buy = 438 },
{ itemName = "vial", clientId = 2874, sell = 5 },
},
["others"] = {
{ itemName = "spellwand", clientId = 651, sell = 299 },
},
["shields"] = {
{ itemName = "spellbook", clientId = 3059, buy = 150 },
},
["runes"] = {
{ itemName = "avalanche rune", clientId = 3161, buy = 57 },
{ itemName = "blank rune", clientId = 3147, buy = 10 },
Expand All @@ -61,8 +75,27 @@ local itemsTable = {
{ itemName = "poison field rune", clientId = 3172, buy = 21 },
{ itemName = "poison wall rune", clientId = 3176, buy = 52 },
{ itemName = "sudden death rune", clientId = 3155, buy = 135 },
{ itemName = "stalagmite rune", clientId = 3179, buy = 12 },
{ itemName = "ultimate healing rune", clientId = 3160, buy = 175 },
},
["wands"] = {
{ itemName = "hailstorm rod", clientId = 3067, buy = 15000 },
{ itemName = "moonlight rod", clientId = 3070, buy = 1000 },
{ itemName = "necrotic rod", clientId = 3069, buy = 5000 },
{ itemName = "northwind rod", clientId = 8083, buy = 7500 },
{ itemName = "snakebite rod", clientId = 3066, buy = 500 },
{ itemName = "springsprout rod", clientId = 8084, buy = 18000 },
{ itemName = "terra rod", clientId = 3065, buy = 10000 },
{ itemName = "underworld rod", clientId = 8082, buy = 22000 },
{ itemName = "wand of cosmic energy", clientId = 3073, buy = 10000 },
{ itemName = "wand of decay", clientId = 3072, buy = 5000 },
{ itemName = "wand of draconia", clientId = 8093, buy = 7500 },
{ itemName = "wand of dragonbreath", clientId = 3075, buy = 1000 },
{ itemName = "wand of inferno", clientId = 3071, buy = 15000 },
{ itemName = "wand of starstorm", clientId = 8092, buy = 18000 },
{ itemName = "wand of voodoo", clientId = 8094, buy = 22000 },
{ itemName = "wand of vortex", clientId = 3074, buy = 500 },
},
}

npcConfig.shop = {}
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/briasol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ npcConfig.shop = {
{ itemName = "cyan crystal fragment", clientId = 16125, sell = 800 },
{ itemName = "dragon figurine", clientId = 30053, sell = 45000 },
{ itemName = "gemmed figurine", clientId = 24392, sell = 3500 },
{ itemName = "giant amethyst", clientId = 30061, sell = 60000 },
{ itemName = "giant amethyst", clientId = 32622, sell = 60000 },
{ itemName = "giant emerald", clientId = 30060, sell = 90000 },
{ itemName = "giant ruby", clientId = 30059, sell = 70000 },
{ itemName = "giant sapphire", clientId = 30061, sell = 50000 },
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/chantalle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ npcConfig.shop = {
{ itemName = "diamond", clientId = 32770, sell = 15000 },
{ itemName = "dragon figurine", clientId = 30053, sell = 45000 },
{ itemName = "gemmed figurine", clientId = 24392, sell = 3500 },
{ itemName = "giant amethyst", clientId = 30061, sell = 60000 },
{ itemName = "giant amethyst", clientId = 32622, sell = 60000 },
{ itemName = "giant emerald", clientId = 30060, sell = 90000 },
{ itemName = "giant ruby", clientId = 30059, sell = 70000 },
{ itemName = "giant sapphire", clientId = 30061, sell = 50000 },
Expand Down
32 changes: 32 additions & 0 deletions data-otservbr-global/npc/chuckles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,38 @@ local itemsTable = {
{ itemName = "sudden death rune", clientId = 3155, buy = 135 },
{ itemName = "ultimate healing rune", clientId = 3160, buy = 175 },
},
["wands"] = {
{ itemName = "hailstorm rod", clientId = 3067, buy = 15000 },
{ itemName = "moonlight rod", clientId = 3070, buy = 1000 },
{ itemName = "necrotic rod", clientId = 3069, buy = 5000 },
{ itemName = "northwind rod", clientId = 8083, buy = 7500 },
{ itemName = "snakebite rod", clientId = 3066, buy = 500 },
{ itemName = "springsprout rod", clientId = 8084, buy = 18000 },
{ itemName = "terra rod", clientId = 3065, buy = 10000 },
{ itemName = "underworld rod", clientId = 8082, buy = 22000 },
{ itemName = "wand of cosmic energy", clientId = 3073, buy = 10000 },
{ itemName = "wand of decay", clientId = 3072, buy = 5000 },
{ itemName = "wand of draconia", clientId = 8093, buy = 7500 },
{ itemName = "wand of dragonbreath", clientId = 3075, buy = 1000 },
{ itemName = "wand of inferno", clientId = 3071, buy = 15000 },
{ itemName = "wand of starstorm", clientId = 8092, buy = 18000 },
{ itemName = "wand of voodoo", clientId = 8094, buy = 22000 },
{ itemName = "wand of vortex", clientId = 3074, buy = 500 },
},
["exercise weapons"] = {
{ itemName = "durable exercise rod", clientId = 35283, buy = 945000, count = 1800 },
{ itemName = "durable exercise wand", clientId = 35284, buy = 945000, count = 1800 },
{ itemName = "exercise rod", clientId = 28556, buy = 262500, count = 500 },
{ itemName = "exercise wand", clientId = 28557, buy = 262500, count = 500 },
{ itemName = "lasting exercise rod", clientId = 35289, buy = 7560000, count = 14400 },
{ itemName = "lasting exercise wand", clientId = 35290, buy = 7560000, count = 14400 },
},
["others"] = {
{ itemName = "spellwand", clientId = 651, sell = 299 },
},
["shields"] = {
{ itemName = "spellbook", clientId = 3059, buy = 150 },
},
}

npcConfig.shop = {}
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/edmund.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ npcConfig.shop = {
{ itemName = "cyan crystal fragment", clientId = 16125, sell = 800 },
{ itemName = "dragon figurine", clientId = 30053, sell = 45000 },
{ itemName = "gemmed figurine", clientId = 24392, sell = 3500 },
{ itemName = "giant amethyst", clientId = 30061, sell = 60000 },
{ itemName = "giant amethyst", clientId = 32622, sell = 60000 },
{ itemName = "giant emerald", clientId = 30060, sell = 90000 },
{ itemName = "giant ruby", clientId = 30059, sell = 70000 },
{ itemName = "giant sapphire", clientId = 30061, sell = 50000 },
Expand Down
Loading

0 comments on commit 6edfcef

Please sign in to comment.