Skip to content

Commit

Permalink
Merge branch 'main' into feature/checks-and-improves
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel authored Feb 22, 2024
2 parents 841a38a + 4a86b3f commit 2ed878c
Show file tree
Hide file tree
Showing 412 changed files with 655 additions and 583 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-windows-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ jobs:

- name: Install vcpkg
run: |
$vcpkgJson = Get-Content .\vcpkg.json -Raw | ConvertFrom-Json
$vcpkgCommitId = $vcpkgJson.'builtin-baseline'.Trim()
Write-Host "vcpkg commit ID: $vcpkgCommitId"
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg integrate install
git checkout $vcpkgCommitId
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
- name: Print useful paths
run: |
Expand Down
2 changes: 2 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ maxAllowedOnADummy = 1

-- Save interval per time
-- NOTE: toggleSaveInterval: true = enable the save interval, false = disable the save interval
-- NOTE: toggleSaveAsync = true, will enable save async (experimental), not recommended for use in production
-- NOTE: saveIntervalType: "minute", "second" or "hour"
-- NOTE: toggleSaveIntervalCleanMap: true = enable the clean map, false = disable the clean map
-- NOTE: saveIntervalTime: time based on what was set in "saveIntervalType"
toggleSaveAsync = false
toggleSaveInterval = true
saveIntervalType = "hour"
toggleSaveIntervalCleanMap = true
Expand Down
40 changes: 0 additions & 40 deletions data-canary/scripts/globalevents/save_interval.lua

This file was deleted.

87 changes: 0 additions & 87 deletions data-otservbr-global/scripts/actions/other/hireling_food.lua

This file was deleted.

6 changes: 0 additions & 6 deletions data-otservbr-global/scripts/creaturescripts/monster/wyda.lua

This file was deleted.

4 changes: 2 additions & 2 deletions data/XML/events.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event name="Otservbr example 1" startdate="11/03/2020" enddate="12/30/2023" script="example.lua" >
<ingame exprate="100" lootrate="100" spawnrate="100" skillrate="100" />
<ingame exprate="100" lootrate="100" bosslootrate="100" spawnrate="100" skillrate="100" />
<description description="Otserver br example 1 description double exp and a half, double loot !chance!, regular spawn and double skill" />
<colors colordark="#235c00" colorlight="#2d7400" />
<details displaypriority="6" isseasonal="0" specialevent="0" />
</event>
<event name="Otservbr example 2" startdate="2/2/2022" enddate="12/31/2023" script="" >
<ingame exprate="100" lootrate="100" spawnrate="100" skillrate="100" />
<ingame exprate="100" lootrate="100" bosslootrate="100" spawnrate="100" skillrate="100" />
<description description="Otserver br example 2 description 50% less exp, triple loot !chance!, 50% faster spawn and regular skill" />
<colors colordark="#735D10" colorlight="#8B6D05" />
<details displaypriority="6" isseasonal="0" specialevent="0" />
Expand Down
1 change: 1 addition & 0 deletions data/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ GLOBAL_CHARM_SCAVENGE = 125 -- 25% more chance to get creature products from ski
-- Event Schedule
SCHEDULE_LOOT_RATE = 100
SCHEDULE_EXP_RATE = 100
SCHEDULE_BOSS_LOOT_RATE = 100
SCHEDULE_SKILL_RATE = 100
SCHEDULE_SPAWN_RATE = 100

Expand Down
4 changes: 4 additions & 0 deletions data/libs/functions/monstertype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ function MonsterType:generateLootRoll(config, resultTable)
local factor = config.factor or 1.0
local uniqueItems = {}

if self:isRewardBoss() then
factor = factor * SCHEDULE_BOSS_LOOT_RATE / 100
end

local result = resultTable or {}
for _, item in ipairs(monsterLoot) do
local iType = ItemType(item.itemId)
Expand Down
69 changes: 69 additions & 0 deletions data/scripts/actions/items/hireling_foods.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
local hasteCondition = Condition(CONDITION_HASTE)
hasteCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
hasteCondition:setParameter(CONDITION_PARAM_SPEED, 80)

local fishingCondition = Condition(CONDITION_ATTRIBUTES)
fishingCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
fishingCondition:setParameter(CONDITION_PARAM_SKILL_FISHING, 30)

local magicPointsCondition = Condition(CONDITION_ATTRIBUTES)
magicPointsCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
magicPointsCondition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3)

local meleeCondition = Condition(CONDITION_ATTRIBUTES)
meleeCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
meleeCondition:setParameter(CONDITION_PARAM_SKILL_MELEE, 3)

local shieldCondition = Condition(CONDITION_ATTRIBUTES)
shieldCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
shieldCondition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 7)

local distanceCondition = Condition(CONDITION_ATTRIBUTES)
distanceCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
distanceCondition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 7)

local gourmetDishes = {
[29408] = { condition = shieldCondition, message = "Chomp." },
[29409] = { condition = distanceCondition, message = "Yummm." },
[29410] = { condition = magicPointsCondition, message = "Munch." },
[29411] = { condition = meleeCondition, message = "Munch." },
[29412] = { condition = hasteCondition, message = "Yummm." },
[29413] = { condition = fishingCondition, message = "Mmmmm." },
[29414] = { healing = true, message = "Munch." },
[29415] = { manaRestore = true, message = "Chomp." },
[29416] = { message = "Blurg." },
}

local hirelingFoods = Action()

function hirelingFoods.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local dish = gourmetDishes[item.itemid]
if not dish then
return true
end

if player:hasExhaustion("hireling-foods-cooldown") then
player:sendCancelMessage("You're still too full to eat any gourmet dishes for a while.")
return true
end

if dish.condition then
player:addCondition(dish.condition)
elseif dish.healing then
player:addHealth(player:getMaxHealth() * 0.3)
elseif dish.manaRestore then
player:addMana(player:getMaxMana() * 0.3)
end

player:say(dish.message, TALKTYPE_MONSTER_SAY)
player:setExhaustion("hireling-foods-cooldown", 10 * 60)

item:remove(1)
return true
end

for index, value in pairs(gourmetDishes) do
hirelingFoods:id(index)
end

hirelingFoods:register()
10 changes: 5 additions & 5 deletions data/scripts/actions/objects/wall_mirror.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ local setting = {
local wallMirror = Action()

function wallMirror.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local hasExhaustion = player:kv():get("delay-wall-mirror") or 0
if hasExhaustion > os.time() then
if player:hasExhaustion("delay-wall-mirror") then
player:say("Don't be so vain about your appearance.", TALKTYPE_MONSTER_SAY)
else
player:kv():set("delay-wall-mirror", os.time() + 20 * 60 * 60)
player:say(setting[math.random(1, #setting)], TALKTYPE_MONSTER_SAY)
return true
end

player:say(setting[math.random(1, #setting)], TALKTYPE_MONSTER_SAY)
player:setExhaustion("delay-wall-mirror", 20 * 60 * 60)
return true
end

Expand Down
12 changes: 12 additions & 0 deletions data/scripts/creaturescripts/monster/giant_spider_wyda_death.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local creatureevent = CreatureEvent("GiantSpiderWyda")

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
creature:say("It seems this was just an illusion.", TALKTYPE_MONSTER_SAY)

if mostDamageKiller:isPlayer() then
mostDamageKiller:addAchievement("Someone's Bored")
end
return true
end

creatureevent:register()
4 changes: 4 additions & 0 deletions data/scripts/creaturescripts/player/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ function playerLoginGlobal.onLogin(player)
sendBoostMessage(player, "Loot Rate", SCHEDULE_LOOT_RATE > 100)
end

if SCHEDULE_BOSS_LOOT_RATE ~= 100 then
sendBoostMessage(player, "Boss Loot Rate", SCHEDULE_BOSS_LOOT_RATE > 100)
end

if SCHEDULE_SKILL_RATE ~= 100 then
sendBoostMessage(player, "Skill Rate", SCHEDULE_SKILL_RATE > 100)
end
Expand Down
File renamed without changes.
9 changes: 7 additions & 2 deletions data/scripts/globalevents/server_initialization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ local function updateEventRates()
SCHEDULE_LOOT_RATE = lootRate
end

local bossLootRate = EventsScheduler.getEventSBossLoot()
if bossLootRate ~= 100 then
SCHEDULE_BOSS_LOOT_RATE = bossLootRate
end

local expRate = EventsScheduler.getEventSExp()
if expRate ~= 100 then
SCHEDULE_EXP_RATE = expRate
Expand All @@ -121,8 +126,8 @@ local function updateEventRates()
end

-- Log information if any of the rates are not 100%
if expRate ~= 100 or lootRate ~= 100 or spawnRate ~= 100 or skillRate ~= 100 then
logger.info("[Events] Exp: {}%, loot: {}%, Spawn: {}%, Skill: {}%", expRate, lootRate, spawnRate, skillRate)
if expRate ~= 100 or lootRate ~= 100 or spawnRate ~= 100 or skillRate ~= 100 or bossLootRate ~= 100 then
logger.info("[Events] Exp: {}%, Loot: {}%, Spawn: {}%, Skill: {}%, Boss loot: {}%", expRate, lootRate, spawnRate, skillRate, bossLootRate)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/account/account.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_info.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository_db.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository_db.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/canary_server.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <[email protected]>
* Copyright (©) 2019-2024 OpenTibiaBR <[email protected]>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
Loading

0 comments on commit 2ed878c

Please sign in to comment.