Skip to content

Commit

Permalink
Merge branch 'main' into improve-save-stash
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 authored Jul 21, 2024
2 parents 302701b + 165a908 commit 2ca889f
Show file tree
Hide file tree
Showing 46 changed files with 408 additions and 280 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/Cjaker)
* [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
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
@@ -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 @@ -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
1 change: 1 addition & 0 deletions data/scripts/creaturescripts/familiar/on_login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function familiarOnLogin.onLogin(player)
return false
end

player:registerEvent("FamiliarAdvance")
local vocation = FAMILIAR_ID[player:getVocation():getBaseId()]

local familiarName
Expand Down
9 changes: 9 additions & 0 deletions data/scripts/creaturescripts/player/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,19 @@ function playerLoginGlobal.onLogin(player)
onMovementRemoveProtection(playerId, player:getPosition(), 10)
end

-- Change support outfit to a normal outfit to open customize character without crashes
local playerOutfit = player:getOutfit()
if table.contains({ 75, 266, 302 }, playerOutfit.lookType) then
playerOutfit.lookType = 136
playerOutfit.lookAddons = 0
player:setOutfit(playerOutfit)
end

player:initializeLoyaltySystem()
player:registerEvent("PlayerDeath")
player:registerEvent("DropLoot")
player:registerEvent("BossParticipation")
player:registerEvent("UpdatePlayerOnAdvancedLevel")
return true
end

Expand Down
7 changes: 1 addition & 6 deletions src/config/config_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum ConfigKey_t : uint16_t {
ACTIONS_DELAY_INTERVAL,
ADVENTURERSBLESSING_LEVEL,
AIMBOT_HOTKEY_ENABLED,
ALLOW_BLOCK_SPAWN,
ALLOW_CHANGEOUTFIT,
ALLOW_RELOAD,
AUGMENT_INCREASED_DAMAGE_PERCENT,
Expand Down Expand Up @@ -63,11 +62,11 @@ enum ConfigKey_t : uint16_t {
DISCORD_WEBHOOK_URL,
EMOTE_SPELLS,
ENABLE_PLAYER_PUT_ITEM_IN_AMMO_SLOT,
ENABLE_SUPPORT_OUTFIT,
EX_ACTIONS_DELAY_INTERVAL,
EXP_FROM_PLAYERS_LEVEL_RANGE,
EXPERIENCE_FROM_PLAYERS,
FAMILIAR_TIME,
FORCE_MONSTERTYPE_LOAD,
FORGE_AMOUNT_MULTIPLIER,
FORGE_BASE_SUCCESS_RATE,
FORGE_BONUS_SUCCESS_RATE,
Expand Down Expand Up @@ -135,8 +134,6 @@ enum ConfigKey_t : uint16_t {
M_CONST,
MAINTAIN_MODE_MESSAGE,
MAP_AUTHOR,
MAP_CUSTOM_AUTHOR,
MAP_CUSTOM_NAME,
MAP_DOWNLOAD_URL,
MAP_NAME,
MARKET_OFFER_DURATION,
Expand Down Expand Up @@ -221,8 +218,6 @@ enum ConfigKey_t : uint16_t {
RATE_MONSTER_ATTACK,
RATE_MONSTER_DEFENSE,
RATE_MONSTER_HEALTH,
RATE_NPC_ATTACK,
RATE_NPC_DEFENSE,
RATE_NPC_HEALTH,
RATE_OFFLINE_TRAINING_SPEED,
RATE_SKILL,
Expand Down
Loading

0 comments on commit 2ca889f

Please sign in to comment.