Add Expert PvP world type and combat rules
This commit adds Expert Open PvP support to Canary as an explicit world type through worldType = expert-pvp.
The implementation introduces a dedicated ExpertPvp component for Expert specific combat, relation, field, movement, collision, and marking rules. Existing combat, spell, tile, player, game, and protocol code remain as thin integration points, while the Expert PvP decisions live under src creatures players components pvp.
This keeps the new behavior isolated from the existing world types and avoids spreading Expert PvP specific rules across unrelated systems.
The existing PvP world type handling was also clarified. retro-pvp is now the explicit Retro Open PvP value, while pvp remains supported as a compatibility alias for retro-pvp. no-pvp and pvp-enforced remain outside the Expert PvP decision path.
Main world type changes
• Adds worldType expert-pvp
• Makes retro-pvp the explicit Retro Open PvP config value
• Keeps pvp as a compatibility alias for retro-pvp
• Changes the default config value from pvp to retro-pvp
• Removes the old toggleServerIsRetroPVP config option
• Updates Lua helpers so IsRetroPVP reads the world type string
• Adds IsExpertPVP for Lua scripts
• Keeps no-pvp and pvp-enforced behavior outside the Expert PvP component
The ExpertPvp component centralizes relation classification and decision making for the new world type. It evaluates PvP mode, actor and target relation, combat action type, field ownership, side effects, player collision, and viewer specific situation marks.
The component covers relations such as self, access players, party allies, guild allies, war enemies, direct attackers, protected ally attackers, direct targets, skulled targets, neutral players, monsters, player summons, and NPCs.
Main Expert PvP rules included
• Dove mode behavior
• White Hand behavior
• Yellow Hand behavior
• Red Fist behavior
• Direct combat decisions
• Rune target decisions
• Area spell decisions
• Summon combat decisions
• Field step decisions
• Field damage decisions
• Player walkthrough decisions
• Pathfinding probe decisions
• Viewer specific field visual decisions
• Viewer relative creature situation marks
Combat integration now asks ExpertPvp before allowing Expert PvP relevant actions. This applies to direct attacks, runes, aggressive area spells, mana and health combat, conditions, dispels, default combat actions, and field damage.
When Expert PvP handles an action, it can allow or block the action and apply the correct side effects. These side effects include fight state, PZ lock behavior, skull actions, square feedback, and unjustified kill tracking where applicable.
Secure mode behavior is handled through the Expert PvP relation rules instead of the older broad secure mode check. This allows secure mode retaliation without applying unjustified protection zone locks in cases where the Expert PvP relation allows the response.
Magic Wall and Wild Growth now carry Expert PvP cast time context. When Expert PvP is enabled, these fields are created as safe field variants and receive owner context so the server can evaluate relation dependent behavior later.
Magic Wall and Wild Growth changes
• Stores the field owner context when the rune is cast
• Stores the owner PvP mode at cast time
• Tracks owner targets and attackers at cast time
• Uses safe visual field items as the base item in Expert PvP
• Resolves viewer specific appearance through protocol serialization
• Evaluates collision and pathfinding from the field context
• Evaluates field stepping side effects through ExpertPvp
• Prevents Expert PvP owned safe fields from being removed like regular no-pvp safe fields
• Keeps normal no-pvp behavior for non Expert PvP worlds
Tile and pathfinding logic now consult ExpertPvp for Expert owned fields. This allows Magic Wall and Wild Growth to appear or behave differently depending on the viewer and the PvP relation, while still using the existing movement and tile query paths as the final authority.
Player walkthrough and body blocking were updated so Expert PvP can decide whether a player can walk through another player outside legacy safe zones. Party, guild, war, attacker, protected ally, and target relations are used to keep collision behavior aligned with Expert PvP hand modes.
PvP situation tracking was added so player relations can affect persistent creature marks. The server can now send viewer relative creature marks for the current client profile and refresh visible marks when relevant state changes.
Situation mark updates happen when needed for events such as party changes, guild changes, attacked player tracking, player removal, and visible relation changes.
Protocol changes
• Adds ExpertPvpModeByte as a protocol feature flag
• Enables Expert PvP mode byte support for the Tibia 11.00 profile
• Keeps Tibia 11.00 on the verified four byte Set Tactics layout
• Keeps current 15.25 on its verified three byte tactics layout
• Defaults unsupported profiles safely to Dove mode
• Avoids appending speculative PvP mode bytes to the current 15.25 profile
• Sends Expert PvP controls only when the protocol profile supports them
• Sends viewer relative creature marks only through supported packet layouts
The current 15.25 profile keeps its verified tactics payload layout and does not receive a speculative extra PvP byte. This prevents client desync or crash risk. Unsupported profiles are forced safely to Dove when Expert PvP is enabled but the protocol cannot represent the mode.
Player state now includes a dedicated PvP component. The selected Expert PvP mode is stored on the player and persisted to the database.
Persistence and database changes
• Adds PlayerPvp component
• Adds player getPvpMode and setPvpMode support
• Saves expert_pvp_mode during player save
• Loads expert_pvp_mode during player load
• Adds players.expert_pvp_mode to schema.sql
• Bumps database version to 59
• Adds migration 59 for the players.expert_pvp_mode column
• Skips the migration safely if the column already exists
Lua API support was expanded so scripts can inspect PvP state and attach field context where needed.
Lua API changes
• Adds Player getPvpMode
• Adds Player hasAttacked
• Adds Item setExpertPvpFieldContext
• Updates generated Lua API documentation
• Updates Magic Wall and Wild Growth scripts to attach Expert PvP field context
The PR also updates blessing and death loss behavior to use the new Retro PvP world type detection instead of the removed toggleServerIsRetroPVP config. This keeps existing Retro PvP behavior while moving the decision to the explicit world type model.
Additional behavior covered
• Party relation handling
• Guild relation handling
• War enemy relation handling
• Skull relation handling
• Aggressor relation handling
• Protected ally relation handling
• Field ownership behavior
• Viewer specific field visuals
• Body blocking and player collision
• Situation marks and persistent creature marks
• Defensive PZ lock behavior
• Secure mode retaliation behavior
• Blessing cost and Twist of Fate behavior under Retro PvP detection
Out of scope
• Frag sharing
• player_kills.weight schema changes
• Debug commands
• Unrelated PvP features
• Broad behavior changes to existing world types
Documentation and tests
• Adds Expert PvP implementation roadmap documentation
• Adds Expert PvP porting plan documentation
• Links the new documentation from the systems overview
• Documents the behavioral contract
• Documents the implementation roadmap
• Documents the in game regression matrix
• Adds Expert PvP unit coverage
• Adds protocol profile coverage for Expert PvP mode support
• Adds regression scenarios for all world types
Validation performed
• Built canary target
• Built canary_ut target
• Built canary_it target
• Expert PvP and protocol profile tests passed with 49 of 49 tests
• Full unit binary passed with 311 of 311 tests
• Integration binary passed with 40 of 40 tests
• Manual scenarios were exercised during implementation
• Tested secure mode retaliation
• Tested defensive PZ lock behavior
• Tested Magic Wall and Wild Growth cast time relations
• Tested viewer specific visuals and collision
• Tested situation marks
Test configuration
• Platform Windows x64
• Compiler Microsoft Visual C plus plus 19.44
• Protocol coverage Tibia 11.00 and current 15.25 profiles
Known validation note
Two isolated CTest invocations terminated during global teardown after their test bodies passed. The same behavior reproduces on the main baseline. Running the unit suite in one process passes all 311 tests.
Overall this commit adds Expert Open PvP as a gated world type with dedicated relation based combat and field rules. It keeps existing world types protected from Expert PvP behavior, persists the selected PvP mode, supports protocol safe PvP mode handling, updates Lua APIs and documentation, and adds regression coverage for the new rules.
feat: add Way of the Monk quest, monster updates, and core data improvements
This commit introduces the complete implementation of the Way of the Monk quest, along with multiple updates to monsters, bosses, items, and core gameplay data.
Quest:
• Added full quest definition for Way of the Monk, including mission flow, shrine tracking, and storage handling.
• Registered the new quest module in the quest catalog.
• Introduced new storage keys related to monk quest progression and items.
• Added a sample monk player migration (DB version 55) for testing purposes.
• Added Blue Valley to the towns list to support quest locations.
Monsters and Bosses:
• Added new monster Tame Terror Bird with complete stats, behaviors, and loot.
• Reworked Mitmah Vanguard boss with updated events, attributes, attacks, defenses, elemental modifiers, loot, and lifecycle hooks.
• Expanded loot tables for bosses such as The Brainstealer and The Monster, including monk-related items and potions.
Items and Loot:
• Updated frazzlemaw and guzzlemaw loot to drop traditional sai instead of sai.
• Added monk-related item IDs to destruction scripts and Dawnport cleanup logic.
Gameplay:
• Added Monk’s Apparition to the Soul War quest apparition list.
• Introduced a new combat formula for fist fighting skill.
• Removed legacy fist fighting attack speed configuration from server settings.
Workflow:
• Improved GitHub Actions workflow to ensure reusable checks run on the correct branch.
feat: add client and server features for gameplay and UI improvements
- Renamed Supply Stash to Stash and removed depot slot limit count
- Added advanced filters for Stash item categories
- Reworked Cyclopedia Combat Stats into Offense, Defense, and Misc Stats
- Added detailed tooltips and integrated stats into Skills widget
- Introduced Magical Archive interface for spells and runes with filters
- Overhauled Quest Log and Tracker with pinning, search, sort, compact display, and notifications
- Enhanced Exaltation Forge with boots tier bonus and Dust management
- Redesigned Charms System with new Major and Minor charms and balance changes
- Added new mounts and outfits for customization
- Improved server and client behavior with advanced stash, spell archive, detailed stats, and enhanced tier systems
- Verified features through manual and in-game testing
Allows you to setup boss loot event similar to experience, spawnrate and
loot.
See updated examples in events.xml
---------
Co-authored-by: Sebastian Nobbelin <sebastiannobbelin@gmail.com>
Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com>
Client to test: https://github.com/dudantas/tibia-client/pull/10
New features:
• Wheel Gems
• New forge convergence fusion and transfer
• New forge transcendence (tier for legs)
• New window "Obtain" for manage containers
• Moved forge skills formula to config.lua
Fixes:
• House guest use dummy
• Sales from npc freeze at "Game::addItemBatch"
• Some fixes related to houses
• Fixed float on look from onslaught and momentum
• Fixed to kill process after 5 seconds from "Shutdown done"
• Fixed to "managed containers" set default backpack on "equip" backpack
and "relogin"
• Fixed "getTimeMsNow" and "getTimeUsNow" return to int64_t
---------
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Stylua is easier to configure than what we had before, since it's
already available as a code action. It also parses the code while it
formats which will help catch syntax errors on PRs automatically.
Overhaul of the loot roll system. The primary motivation behind these changes is to improve the code's maintainability, readability, and efficiency taking advantage of the new EventCallback system from: f518fdf02b
• Code Reusability: The loot roll system has been rewritten to share code more effectively. This reduces code redundancy, making the system easier to maintain and update in the future. It also improves the readability of the code, making it easier for new contributors to understand the system's workings.
• Use of Callbacks: The new system leverages callbacks, which provide a more efficient and flexible way to handle loot rolls. This change allows for better control flow and can help improve the system's performance.
• Configuration Updates: Several updates have been made to the configuration parameters, including the addition of partyShareLootBoostsDimishingFactor and tibiadromeConcoctionTickType in config.lua.dist, and changing the WealthDuplex parameter from multiplier to an additive rate in concoctions.lua. These changes provide more control and flexibility over the loot roll system's behaviour.
Players will be able to access the depot looking from any direction, not just if you are looking in the direction of the depot.
This is useful for depots that don't have "single entry", for example in houses.
Implementing a system for handling concoctions (also known as Tibiadrome potions). https://tibia.fandom.com/wiki/Tibiadrome#Rewards
The system introduces a new concoctions_lib.lua file that contains the majority of the logic. This file provides a registry to create concoction configurations and allows for later inspection of the state and duration of the concoctions for a player.
Additionally, a new configuration key called partyShareLootBoosts has been added. This key enables any party member to provide a loot boost to the entire party through either prey or wealth duplex. This functionality deviates from how Tibia normally operates, but it has been included as an option to address the annoyance associated with the default Tibia behaviour.
Please note that this implementation only includes four of the available concoctions. The remaining concoctions can be implemented at a later stage.
Allows configuration of `authType = "session` in order to use an expiring session instead of a password. This can enable login-server side 2-factor auth as well as greater control over security. SlenderAAC: https://github.com/luan/slenderaac, uses this for security and actually stores the password with bcrypt instead of SHA1 with no other changes to the base.
This allows us to add or remove flags on specific players, for example, so that a certain player is not visible by a monster, or cannot drop loot at a certain time (for example, in a specific quest). Instead of the flags being determined globally, they can be set differently for each player, depending on our wishes.
New talkactions:
• /hasflag playername, flagname or number
• /setflag playername, flagname or number
• /removeflag playername, flagname or number
New string function:
string.trimSpace(str) or string:trimSpace()
Documented the strings functions and moved from global.lua to string.lua
• Small adjustments in code, as best practices in variables, and indentation;
• Created toggles:
- Make gold pouch configurable to put items in it other than gold;
- Set server retro pvp (disabling PARTY_PROTECTION and ADVANCED_SECURE_MODE in globa.lua);
- Make all travel free;
• Set level 10 to use softboots, were level 180;
• Improved testserver_assistant.lua;
• Some TYPO corrections;
• Improved talkaction online.lua;
• Adjusted containersize of gold pouch to 20;
• Improved recompile.sh;
• Other small fixes;
• Created bestiary and bosstiary multiplies factor in config.lua;
• Created a config to multiplier forge dust received, and created notes of forge system;
This fixes an issue where monsters and summons could walk on non-walkable items after their unique ID had been set. The fix ensures that the pathfinding algorithm takes these non-walkable items into account when moving the monsters and summons, preventing them from moving through areas that are designated as non-walkable.
• Added missing magic gold converter id
• Fixed "MESSAGE_INFO_DESCR" not exists to correct enum "MESSAGE_EVENT_ADVANCE"
• Added a function to check if the pack running is the global one and added checks to only run some codes in the global pack
• Fixed to Hireling Lamp so it cannot be moved
• Indented "gamestore.lua" script for tab and removed several whitespace
With this modification, we will be able to focus on just one repository (the canary), and archive otservbr-global repository.
The intention is that we can have two datapacks in the same repository, being able to easily switch from one to the other, just change in config.lua the "dataPackDirectory" from "data-otservbr-global" to "data-canary" or vice versa.
The main purpose is to facilitate our development, at the same time that the community will be able to contribute in a single repository, but keeping the choice of using a "clean" datapack.
I made some more modifications, such as removing the unused C++ gamestore, I also removed the "allowPickupable" tag, which was duplicated, and I made some other adjustments.
Folder structure changes
Now we have the following structure:
• data = this will be the "core" folder, it is where the files that are absolutely necessary for the executable to open correctly, such as libs, xmls, etc. Here we will have files that both the global and the canary datapack will share with each other
• data-otservbr-global = here will be the global datapack files, some libs and folders that are only for the global server, such as scripts, monsters, npcs, world.
• data-canary = a "clean" datapack as far as possible, with only the scripts and files necessary for the server to work.
• NOTE: The "data" folder is actually the "core" of the server, we didn't rename it to avoid having to make changes to the sites and login.php, since they read the "data/xml". The other two folders, data-otservbr-global and data-canary can be changed in config.lua, which one you want the executable to read, by default we'll point to the global one, as that's what most use. If you want to start a custom server with "as few files and scripts as possible", then switch to "data-canary".
We also added a boolean in config.lua that allows choosing another name for the datapack, by default we will also keep this disabled, since we will only maintain support for these two datapacks, it is up to each one to know what they are doing in case they want to change it.
So, in the end, we have the reorganization in the folders:

Note that we made few real changes to the files, the abundance of modified files is due to moving from one folder to another and also adding the global datapack to this repository (with an abundance of files). If you want to migrate your datapack to the global one, you should know what you're doing, if you don't know, just pass your modifications to the "new files" or get in touch on our discord group so we can help you: https://discord.gg/X3mSnMH8jg
Complete rewrite of old prey system from LUA to CPP and implementation of Hunting Tasks system.
Do not test with GOD char or with low amount of creatures registered on bestiary. The PR already include the necessary amount of then.
Addition of hunting task system and entire rework of prey system. All working on CPP with few LUA integration.
Rework on exercise weapon with tibia global equal behavior
Added config key "maxAllowedOnADummy ", default is "1"
Created table for exercise functions and variables
Start training with someone already training on that dummy and the message will be sent that someone is already training.
If someone is training and connects to the game, that user appears as Exercise Dummy Training .
If someone is training, send request to add this player on vip list, that user appears as Exercise Dummy Training.
When are training and disconnect from the game, on reconnect, the training stopped.cise Dummy Training
When are training and disconnect from the game, on reconnect, the training stopped
ItemParse has been refactored and decoupled in a own file to allow for better organization and avoid breakage in the compilation
Fixed some bugs, such as fields in items.xml
This commit is necessary for the pull request (12.72 protocol) to work correctly: #143
Co-authored-by @dudantas <eduardo.dantas@hotmail.com.br>
Added a feature that can be activated in config.lua, so you can save the server from time to time according to the interval you choose automatically.
Set to "true" for enable feature and "false" for disable
Save interval time is configured in hours, in the example below we will have a save every 1 hour
-- Save interval per time
-- NOTE: togleSaveInterval: true = enable the save interval, false = disable the save interval
-- NOTE: saveIntervalType: "minute", "second" or "hour"
-- NOTE: togleSaveIntervalCleanMap: true = enable the clean map, false = disable the clean map
-- NOTE: saveIntervalTime: time based on what was set in "saveIntervalType"
togleSaveInterval = true
saveIntervalType = "hour"
togleSaveIntervalCleanMap = true
saveIntervalTime = 1
These changes allow to win stamina in Protection Zone and Trainers.
To work, need to be changed in the "staminaTrainer = false" to "staminaTrainer = true", for gain stamina in the trainer and set from "staminaPz = false" to "staminaPz = true", for gain stamina in the protection zone.