-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] rework for enable choosing of a custom datapack name (#572
) 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: ![58855](https://user-images.githubusercontent.com/8551443/202463807-c0902611-4d6e-493d-b72d-8d85d5009d55.jpg) 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
- Loading branch information
Showing
5,159 changed files
with
616,037 additions
and
13,543 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dofile(DATA_DIRECTORY.. '/lib/core/storages.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/core/constants.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/core/quests.lua') |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Core API functions implemented in Lua | ||
dofile(DATA_DIRECTORY.. '/lib/core/load.lua') | ||
|
||
|
||
-- Tables library | ||
dofile(DATA_DIRECTORY.. '/lib/tables/load.lua') |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dofile(DATA_DIRECTORY.. '/lib/tables/vocation.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/tables/door.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/tables/exercise_training.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/tables/familiar.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/tables/npc_spells.lua') | ||
dofile(DATA_DIRECTORY.. '/lib/tables/window.lua') |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- return true = There are others migrations file | ||
-- return false = This is the last migration file | ||
function onUpdateDatabase() | ||
return false | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dofile(DATA_DIRECTORY .. "/npclib/npc.lua") | ||
dofile(DATA_DIRECTORY .. "/npclib/npc_system/npc_handler.lua") | ||
dofile(DATA_DIRECTORY .. "/npclib/npc_system/keyword_handler.lua") | ||
dofile(DATA_DIRECTORY .. "/npclib/npc_system/modules.lua") | ||
dofile(DATA_DIRECTORY .. "/npclib/npc_system/custom_modules.lua") | ||
dofile(DATA_DIRECTORY .. "/npclib/npc_system/bank_system.lua") |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dofile(CORE_DIRECTORY .. "/modules/scripts/blessings/blessings.lua") | ||
|
||
local blessingCharms = Action() | ||
|
||
function blessingCharms.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
return Blessings.useCharm(player, item) | ||
end | ||
|
||
for blessingId = 10341, 10345 do | ||
blessingCharms:id(blessingId) | ||
end | ||
|
||
blessingCharms:register() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dofile(CORE_DIRECTORY .. "/modules/scripts/blessings/blessings.lua") | ||
|
||
local checkBless = Action() | ||
|
||
function checkBless.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
return Blessings.checkBless(player) | ||
end | ||
|
||
checkBless:id(6561, 11468) | ||
checkBless:register() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
local login = CreatureEvent("PlayerLogin") | ||
|
||
function login.onLogin(player) | ||
local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!" | ||
if player:getLastLoginSaved() <= 0 then | ||
loginStr = loginStr .. " Please choose your outfit." | ||
player:sendOutfitWindow() | ||
else | ||
if loginStr ~= "" then | ||
player:sendTextMessage(MESSAGE_LOGIN, loginStr) | ||
end | ||
|
||
player:sendTextMessage(MESSAGE_LOGIN, string.format("Your last visit in ".. SERVER_NAME ..": %s.", os.date("%d. %b %Y %X", player:getLastLoginSaved()))) | ||
end | ||
|
||
-- Stamina | ||
nextUseStaminaTime[player.uid] = 0 | ||
|
||
-- Promotion | ||
local vocation = player:getVocation() | ||
local promotion = vocation:getPromotion() | ||
if player:isPremium() then | ||
local value = player:getStorageValue(Storage.Promotion) | ||
if not promotion and value ~= 1 then | ||
player:setStorageValue(STORAGEVALUE_PROMOTION, 1) | ||
elseif value == 1 then | ||
player:setVocation(promotion) | ||
end | ||
elseif not promotion then | ||
player:setVocation(vocation:getDemotion()) | ||
end | ||
|
||
-- Events | ||
player:registerEvent("PlayerDeath") | ||
player:registerEvent("DropLoot") | ||
player:registerEvent("BossParticipation") | ||
|
||
|
||
if onExerciseTraining[player:getId()] then -- onLogin & onLogout | ||
stopEvent(onExerciseTraining[player:getId()].event) | ||
onExerciseTraining[player:getId()] = nil | ||
player:setTraining(false) | ||
end | ||
|
||
-- Boosted creature | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Today's boosted creature: " .. Game.getBoostedCreature() .. " \ | ||
Boosted creatures yield more experience points, carry more loot than usual and respawn at a faster rate.") | ||
|
||
if SCHEDULE_EXP_RATE ~= 100 then | ||
if SCHEDULE_EXP_RATE > 100 then | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Exp Rate Event! Monsters yield more experience points than usual \ | ||
Happy Hunting!") | ||
else | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Exp Rate Decreased! Monsters yield less experience points than usual.") | ||
end | ||
end | ||
|
||
if SCHEDULE_SPAWN_RATE ~= 100 then | ||
if SCHEDULE_SPAWN_RATE > 100 then | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Spawn Rate Event! Monsters respawn at a faster rate \ | ||
Happy Hunting!") | ||
else | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Spawn Rate Decreased! Monsters respawn at a slower rate.") | ||
end | ||
end | ||
|
||
if SCHEDULE_LOOT_RATE ~= 100 then | ||
if SCHEDULE_LOOT_RATE > 100 then | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Loot Rate Event! Monsters carry more loot than usual \ | ||
Happy Hunting!") | ||
else | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Loot Rate Decreased! Monsters carry less loot than usual.") | ||
end | ||
end | ||
|
||
if SCHEDULE_SKILL_RATE ~= 100 then | ||
if SCHEDULE_SKILL_RATE > 100 then | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Skill Rate Event! Your skills progresses at a higher rate \ | ||
Happy Hunting!") | ||
else | ||
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Skill Rate Decreased! Your skills progresses at a lower rate.") | ||
end | ||
end | ||
|
||
local playerId = player:getId() | ||
|
||
-- Stamina | ||
nextUseStaminaTime[playerId] = 1 | ||
|
||
-- EXP Stamina | ||
nextUseXpStamina[playerId] = 1 | ||
|
||
-- Set Client XP Gain Rate -- | ||
local rateExp = 1 | ||
if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then | ||
rateExp = getRateFromTable(experienceStages, player:getLevel(), configManager.getNumber(configKeys.RATE_EXPERIENCE)) | ||
if SCHEDULE_EXP_RATE ~= 100 then | ||
rateExp = math.max(0, (rateExp * SCHEDULE_EXP_RATE)/100) | ||
end | ||
end | ||
|
||
player:setBaseXpGain(rateExp * 100) | ||
|
||
return true | ||
end | ||
|
||
login:register() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.