Skip to content

Commit

Permalink
Merge branch 'main' into fix/map-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel authored Jul 19, 2024
2 parents 79d8dbd + 165a908 commit 5c2ac03
Show file tree
Hide file tree
Showing 74 changed files with 1,157 additions and 511 deletions.
90 changes: 20 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,43 @@
# OpenTibiaBR - Canary

[![Discord Channel](https://img.shields.io/discord/528117503952551936.svg?style=flat-square&logo=discord)](https://discord.gg/gvTj5sh9Mp)
[![GitHub issues](https://img.shields.io/github/issues/opentibiabr/canary)](https://github.com/opentibiabr/canary/issues)
[![GitHub pull request](https://img.shields.io/github/issues-pr/opentibiabr/canary)](https://github.com/opentibiabr/canary/pulls)
[![Contributors](https://img.shields.io/github/contributors/opentibiabr/canary.svg?style=flat-square)](https://github.com/opentibiabr/canary/graphs/contributors)
[![GitHub](https://img.shields.io/github/license/opentibiabr/canary)](https://github.com/opentibiabr/canary/blob/master/LICENSE)

![GitHub repo size](https://img.shields.io/github/repo-size/opentibiabr/canary)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=opentibiabr_canary&metric=alert_status)](https://sonarcloud.io/dashboard?id=opentibiabr_canary)

## Builds

[![Build - Ubuntu](https://github.com/opentibiabr/canary/actions/workflows/build-ubuntu.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/build-ubuntu.yml)
[![Build - Windows - CMake](https://github.com/opentibiabr/canary/actions/workflows/build-windows-cmake.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/build-windows-cmake.yml)
[![Build - Windows - Solution](https://github.com/opentibiabr/canary/actions/workflows/build-windows-solution.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/build-windows-solution.yml)
[![Build - Docker](https://github.com/opentibiabr/canary/actions/workflows/build-docker.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/build-docker.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=opentibiabr_canary&metric=alert_status)](https://sonarcloud.io/dashboard?id=opentibiabr_canary)
![GitHub repo size](https://img.shields.io/github/repo-size/opentibiabr/canary)
[![GitHub](https://img.shields.io/github/license/opentibiabr/canary)](https://github.com/opentibiabr/canary/blob/main/LICENSE)

## Docker

`docker pull opentibiabr/canary:latest`<br><br>
[![Automation](https://img.shields.io/docker/cloud/automated/opentibiabr/canary)](https://hub.docker.com/r/opentibiabr/canary)
[![Image Size](https://img.shields.io/docker/image-size/opentibiabr/canary)](https://hub.docker.com/r/opentibiabr/canary/tags?page=1&ordering=last_updated)
![Pulls](https://img.shields.io/docker/pulls/opentibiabr/canary)
[![Build](https://img.shields.io/docker/cloud/build/opentibiabr/canary)](https://hub.docker.com/r/opentibiabr/canary/builds)

## Project

OpenTibiaBR - Canary is a free and open-source MMORPG server emulator written in C++.

It is a fork of the [OTServBR-Global](https://github.com/opentibiabr/otservbr-global) project. You can see the
repository history in the [releases](https://github.com/opentibiabr/otservbr-global/releases/).

This project was created with the intention of being a base as clean as possible, to work as an MMORPG engine and not
necessarily linked to Tibia Global, although it will also work. The OpenTibiaBR - Global was adapted to work with the
source of the Canary, so that it will be the first repository to use this engine.

To connect to the server and to take a stable experience, you can
use [mehah's otclient](https://github.com/mehah/otclient)
OpenTibiaBR - Canary is a free and open-source MMORPG server emulator written in C++. It is a fork of the [OTServBR-Global](https://github.com/opentibiabr/otservbr-global) project. To connect to the server and to take a stable experience, you can use [mehah's otclient](https://github.com/mehah/otclient)
or [tibia client](https://github.com/dudantas/tibia-client/releases/latest) and if you want to edit something, check
our [customized tools](https://docs.opentibiabr.com/opentibiabr/downloads/tools).

If you want edit the map, use the [own remere's map editor](https://github.com/opentibiabr/remeres-map-editor/).
our [customized tools](https://docs.opentibiabr.com/opentibiabr/downloads/tools). If you want to edit the map, use our own [remere's map editor](https://github.com/opentibiabr/remeres-map-editor/).

You are subject to our code of conduct, read
at [this link](https://github.com/opentibiabr/canary/blob/master/CODE_OF_CONDUCT.md).

### Getting **Started**
## Getting Started

* [Gitbook](https://docs.opentibiabr.com/opentibiabr/projects/canary).
* [Wiki](https://github.com/opentibiabr/canary/wiki).

### Issues
## Support

If you need help, please visit our [discord](https://discord.gg/gvTj5sh9Mp). Our issue tracker is not a support forum, and using it as one will result in your issue being closed.

We use the [issue tracker on GitHub](https://github.com/opentibiabr/canary/issues). Keep in mind that everyone who is
watching the repository gets notified by e-mail when there is an activity, so be thoughtful and avoid writing comments
that aren't meant for an issue (e.g. "+1"). If you'd like for an issue to be fixed faster, you should either fix it
yourself and submit a pull request, or place a bounty on the issue.
## Contributing

### Pull requests
Here are some ways you can contribute:

Before [creating a pull request](https://github.com/opentibiabr/canary/pulls) please keep in mind:
* [Issue Tracker](https://github.com/opentibiabr/canary/issues/new/choose).
* [Pull Request](https://github.com/opentibiabr/canary/pulls).

* Do not send Pull Request changing the map, as we can't review the changes it's better to use
our [Discord](https://discord.gg/gvTj5sh9Mp) to talk about or send the map changes to the responsible for updating it.
* Focus on fixing only one thing, mixing too much things on the same Pull Request make it harder to review, harder to
test and if we need to revert the change it will remove other things together.
* Follow the project indentation, if your editor support you can use the [editorconfig](https://editorconfig.org/) to
automatic configure the indentation.
* There are people that doesn't play the game on the official server, so explain your changes to help understand what
are you changing and why.
* Avoid opening a Pull Request to just update one line of an xml file.
You are subject to our code of conduct, read at [this link](https://github.com/opentibiabr/canary/blob/main/CODE_OF_CONDUCT.md).

### Special Thanks
## Special Thanks

* our partners
* our crew (majesty, gpedro, eduardo dantas, foot)
* [our contributors](https://github.com/opentibiabr/canary/graphs/contributors)
* [fear lucien](https://github.com/FearLucien)
* [cjaker](https://github.com/Eternal-Scripts)
* [slavidodo](https://github.com/slavidodo)
* [mignari and our awesome tools](https://github.com/ottools)
* [mattyx14/otxserver](https://github.com/mattyx14/otxserver) and contributors
* [otland/forgottenserver](https://github.com/otland/forgottenserver) and contributors
* [saiyansking/optimized_forgottenserver](https://github.com/SaiyansKing/optimized_forgottenserver) and contributors
* if we forget someone, we apologize by forgot you. but you know, **forgot**tenserver.
- Our contributors ([Canary](https://github.com/opentibiabr/canary/graphs/contributors) | [OTServBR-Global](https://github.com/opentibiabr/otservbr-global/graphs/contributors)).

### **Sponsors**
## Sponsors

See our [donate page](https://docs.opentibiabr.com/home/donate)
See our [donate page](https://docs.opentibiabr.com/home/donate).

## Project supported by JetBrains

Expand All @@ -98,6 +48,6 @@ other open-source initiatives.
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="JetBrains" width="150" />
</a>

### Partners
## Partners

[![Supported by OTServ Brasil](https://raw.githubusercontent.com/otbr/otserv-brasil/main/otbr.png)](https://forums.otserv.com.br)
8 changes: 8 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ onlyPremiumAccount = false

-- Customs
-- NOTE: stashMoving = true, stow an container inside your stash
-- NOTE: stashItemCount, the maximum items quantity in stash
-- NOTE: depotChest, the non-stackable items will be moved to the selected depot chest(I - XVIII).
-- NOTE: autoBank = true, the dropped coins from monsters will be automatically deposited to your bank account.
-- NOTE: toggleGoldPouchAllowAnything will allow players to move items or gold to gold pouch
Expand All @@ -254,7 +255,9 @@ onlyPremiumAccount = false
-- NOTE: startStreakLevel will make a reward streak level for new players who never logged in
-- NOTE: if showLootsInBestiary is true, will cause all loots to be shown in the bestiary even if the player has not reached the required number of kills
-- NOTE: minTownIdToBankTransfer blocks towns less than defined from receiving money transfers
-- NOTE: enableSupportOutfit enable GODS and GMS to select support outfit (gamemaster, customer support or community manager)
stashMoving = false
stashItemCount = 5000
depotChest = 4
autoLoot = false
autoBank = false
Expand All @@ -273,6 +276,7 @@ enablePlayerPutItemInAmmoSlot = false
startStreakLevel = 0
showLootsInBestiary = false
minTownIdToBankTransfer = 3
enableSupportOutfit = true

-- Teleport summon
-- Set to true will never remove the summon
Expand Down Expand Up @@ -502,6 +506,9 @@ rateMonsterHealth = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0

-- Npc rates
rateNpcHealth = 1.0

-- Boss rates
rateBossHealth = 1.0
rateBossAttack = 1.0
Expand Down Expand Up @@ -539,6 +546,7 @@ location = "South America"
-- Leave empty if you wish to disable.
discordWebhookURL = ""
discordSendFooter = true
discordWebhookDelayMs = 1000

-- Vip System (Get more info in: https://github.com/opentibiabr/canary/pull/1063)
-- NOTE: set vipSystemEnabled to true to enable the vip system functionalities (this overrides premium checks)
Expand Down
7 changes: 7 additions & 0 deletions data-canary/scripts/creaturescripts/player_death.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ function playerDeath.onDeath(player, corpse, killer, mostDamageKiller, unjustifi
mostDamageName = "field item"
end

player:takeScreenshot(byPlayer and SCREENSHOT_TYPE_DEATHPVP or SCREENSHOT_TYPE_DEATHPVE)

if mostDamageKiller and mostDamageKiller:isPlayer() and killer ~= mostDamageKiller then
mostDamageKiller:takeScreenshot(SCREENSHOT_TYPE_PLAYERKILL)
end

local playerGuid = player:getGuid()
db.query(
"INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES ("
Expand Down Expand Up @@ -83,6 +89,7 @@ function playerDeath.onDeath(player, corpse, killer, mostDamageKiller, unjustifi
end

if byPlayer == 1 then
killer:takeScreenshot(SCREENSHOT_TYPE_PLAYERKILL)
local targetGuild = player:getGuild()
targetGuild = targetGuild and targetGuild:getId() or 0
if targetGuild ~= 0 then
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/undeads/iks_ahpututu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ monster.outfit = {

monster.raceId = 2349
monster.Bestiary = {
class = "Iks",
class = "Undead",
race = BESTY_RACE_UNDEAD,
toKill = 5,
FirstUnlock = 1,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/undeads/iks_aucar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ monster.outfit = {

monster.raceId = 2344
monster.Bestiary = {
class = "Iks",
class = "Undead",
race = BESTY_RACE_UNDEAD,
toKill = 1000,
FirstUnlock = 50,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/undeads/iks_chuka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ monster.outfit = {

monster.raceId = 2345
monster.Bestiary = {
class = "Iks",
class = "Undead",
race = BESTY_RACE_UNDEAD,
toKill = 1000,
FirstUnlock = 50,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/undeads/iks_churrascan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ monster.outfit = {

monster.raceId = 2350
monster.Bestiary = {
class = "Iks",
class = "Undead",
race = BESTY_RACE_UNDEAD,
toKill = 1000,
FirstUnlock = 50,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/undeads/iks_pututu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ monster.outfit = {

monster.raceId = 2343
monster.Bestiary = {
class = "Iks",
class = "Undead",
race = BESTY_RACE_UNDEAD,
toKill = 1000,
FirstUnlock = 50,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/obi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ npcConfig.shop = {
{ itemName = "hatchet", clientId = 3276, sell = 25 },
{ itemName = "katana", clientId = 3300, sell = 35 },
{ itemName = "mace", clientId = 3286, sell = 30 },
{ itemName = "machete", clientId = 3308, sell = 30 },
{ itemName = "machete", clientId = 3308, sell = 6 },
{ itemName = "rapier", clientId = 3272, buy = 15, sell = 5 },
{ itemName = "sabre", clientId = 3273, buy = 25, sell = 12 },
{ itemName = "scythe", clientId = 3453, buy = 12, sell = 3 },
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/ramina.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ npcConfig.shop = {
{ itemName = "orange", clientId = 3586, buy = 12 },
{ itemName = "peas", clientId = 11683, buy = 5 },
{ itemName = "vial of fruit juice", clientId = 2874, buy = 10, count = 14 },
{ itemName = "vial of water", clientId = 2874, buy = 2, count = 1 },
{ itemName = "vial of water", clientId = 2874, buy = 6, count = 1 },
}
-- On buy npc shop message
npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
Expand Down
8 changes: 4 additions & 4 deletions data-otservbr-global/npc/sessek.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ npcConfig.shop = {
{ itemName = "peas", clientId = 11683, buy = 3 },
{ itemName = "pineapple", clientId = 11459, buy = 14 },
{ itemName = "roll", clientId = 3601, buy = 2 },
{ itemName = "vial of coconut milk", clientId = 2874, buy = 2, count = 15 },
{ itemName = "vial of coconut milk", clientId = 2874, buy = 6, count = 15 },
{ itemName = "vial of fruit juice", clientId = 2874, buy = 6, count = 14 },
{ itemName = "vial of tea", clientId = 2874, buy = 3, count = 17 },
{ itemName = "vial of water", clientId = 2874, buy = 2, count = 1 },
{ itemName = "vial of wine", clientId = 2874, buy = 3, count = 2 },
{ itemName = "vial of tea", clientId = 2874, buy = 6, count = 17 },
{ itemName = "vial of water", clientId = 2874, buy = 6, count = 1 },
{ itemName = "vial of wine", clientId = 2874, buy = 6, count = 2 },
}
-- On buy npc shop message
npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function rapierQuest.onUse(player, item, fromPosition, target, toPosition, isHot
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a rapier.")
player:addItem(rewardId, 1)
player:questKV("rapier"):set("completed", true)
player:takeScreenshot(SCREENSHOT_TYPE_TREASUREFOUND)
return true
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
local loginEvents = CreatureEvent("LoginEvents")
function loginEvents.onLogin(player)
local events = {
"AdvanceSave",
"RookgaardAdvance",
"FamiliarLogin",
"FamiliarAdvance",
--Quests
--Cults Of Tibia Quest
"HealthPillar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ function playerDeath.onDeath(player, corpse, killer, mostDamageKiller, unjustifi
mostDamageName = "field item"
end

player:takeScreenshot(byPlayer and SCREENSHOT_TYPE_DEATHPVP or SCREENSHOT_TYPE_DEATHPVE)

if mostDamageKiller and mostDamageKiller:isPlayer() then
mostDamageKiller:takeScreenshot(SCREENSHOT_TYPE_PLAYERKILL)
end

local playerGuid = player:getGuid()
db.query(
"INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES ("
Expand Down Expand Up @@ -83,6 +89,7 @@ function playerDeath.onDeath(player, corpse, killer, mostDamageKiller, unjustifi
end

if byPlayer == 1 then
killer:takeScreenshot(SCREENSHOT_TYPE_PLAYERKILL)
local targetGuild = player:getGuild()
local targetGuildId = targetGuild and targetGuild:getId() or 0
if targetGuildId ~= 0 then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ function symbol.onStepIn(creature, item, position, fromPosition)
end

symbol:type("stepin")
symbol:position({ x = 33349, y = 31123, z = 5 })
symbol:position({ x = 33357, y = 31123, z = 5 })
symbol:register()
4 changes: 4 additions & 0 deletions data/libs/functions/revscriptsys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ do
self:type("periodchange")
self:onPeriodChange(value)
return
elseif key == "onSave" then
self:type("save")
self:onSave(value)
return
end
rawset(self, key, value)
end
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/blessings/blessings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Blessings.Credits = {

Blessings.Config = {
AdventurerBlessingLevel = configManager.getNumber(configKeys.ADVENTURERSBLESSING_LEVEL), -- Free full bless until level
HasToF = false, -- Enables/disables twist of fate
HasToF = not configManager.getBoolean(configKeys.TOGGLE_SERVER_IS_RETRO), -- Enables/disables twist of fate
InquisitonBlessPriceMultiplier = 1.1, -- Bless price multiplied by henricus
SkulledDeathLoseStoreItem = configManager.getBoolean(configKeys.SKULLED_DEATH_LOSE_STORE_ITEM), -- Destroy all items on store when dying with red/blackskull
InventoryGlowOnFiveBless = configManager.getBoolean(configKeys.INVENTORY_GLOW), -- Glow in yellow inventory items when the player has 5 or more bless,
Expand Down Expand Up @@ -142,7 +142,7 @@ Blessings.sendBlessDialog = function(player)
msg:addU16(Blessings.BitWiseTable[v.id])
msg:addByte(player:getBlessingCount(v.id))
if player:getClient().version > 1200 then
msg:addByte(0) -- Store Blessings Count
msg:addByte(player:getBlessingCount(v.id, true)) -- Store Blessings Count
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions data/modules/scripts/gamestore/gamestore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ GameStore.Categories = {
icons = { "Blood_of_the_Mountain.png" },
name = "Blood of the Mountain",
price = 25,
blessid = 8,
blessid = 7,
count = 1,
id = GameStore.SubActions.BLESSING_BLOOD,
description = "<i>Reduces your character's chance to lose any items as well as the amount of your character's experience and skill loss upon death:</i>\n\n&#8226; 1 blessing = 8.00% less Skill / XP loss, 30% equipment protection\n&#8226; 2 blessing = 16.00% less Skill / XP loss, 55% equipment protection\n&#8226; 3 blessing = 24.00% less Skill / XP loss, 75% equipment protection\n&#8226; 4 blessing = 32.00% less Skill / XP loss, 90% equipment protection\n&#8226; 5 blessing = 40.00% less Skill / XP loss, 100% equipment protection\n&#8226; 6 blessing = 48.00% less Skill / XP loss, 100% equipment protection\n&#8226; 7 blessing = 56.00% less Skill / XP loss, 100% equipment protection\n\n{character} \n{limit|5} \n{info} added directly to the Record of Blessings \n{info} characters with a red or black skull will always lose all equipment upon death",
Expand All @@ -154,7 +154,7 @@ GameStore.Categories = {
icons = { "Heart_of_the_Mountain.png" },
name = "Heart of the Mountain",
price = 25,
blessid = 7,
blessid = 8,
count = 1,
id = GameStore.SubActions.BLESSING_HEART,
description = "<i>Reduces your character's chance to lose any items as well as the amount of your character's experience and skill loss upon death:</i>\n\n&#8226; 1 blessing = 8.00% less Skill / XP loss, 30% equipment protection\n&#8226; 2 blessing = 16.00% less Skill / XP loss, 55% equipment protection\n&#8226; 3 blessing = 24.00% less Skill / XP loss, 75% equipment protection\n&#8226; 4 blessing = 32.00% less Skill / XP loss, 90% equipment protection\n&#8226; 5 blessing = 40.00% less Skill / XP loss, 100% equipment protection\n&#8226; 6 blessing = 48.00% less Skill / XP loss, 100% equipment protection\n&#8226; 7 blessing = 56.00% less Skill / XP loss, 100% equipment protection\n\n{character} \n{limit|5} \n{info} added directly to the Record of Blessings \n{info} characters with a red or black skull will always lose all equipment upon death",
Expand Down
Loading

0 comments on commit 5c2ac03

Please sign in to comment.