diff --git a/.gitignore b/.gitignore index 4f92b2062d8..4bae39bcc5e 100644 --- a/.gitignore +++ b/.gitignore @@ -389,4 +389,4 @@ canary.old vcpkg_installed # CLION -src/cmake-build-debug +cmake-build-debug* diff --git a/config.lua.dist b/config.lua.dist index f6a9e1f353a..476b04ca3b7 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -88,6 +88,12 @@ taskHuntingBonusRerollPrice = 1 taskHuntingFreeRerollTime = 20 * 60 * 60 -- Forge system +-- NOTE: forgeAmountMultiplier, amount dusts multiplies of influenced monsters, default 3 +-- NOTE: forgeMinSlivers, min slivers from influenced monsters +-- NOTE: forgeMaxSlivers, max slivers from influenced monsters +-- NOTE: forgeInfluencedLimit, limit of influenced monsters that will be created in interval type and time +-- NOTE: forgeFiendishLimit, limit of diabolic monsters that will be created in interval type and time, less than forgeInfluencedLimit +-- NOTE: forgeFiendishIntervalType: "hour", "minute" or "second" forgeMaxItemTier = 10 forgeCostOneSliver = 20 forgeSliverAmount = 3 @@ -98,6 +104,7 @@ forgeTransferCost = 100 forgeBaseSuccessRate = 50 forgeBonusSuccessRate = 15 forgeTierLossReduction = 50 +forgeAmountMultiplier = 3 forgeMinSlivers = 3 forgeMaxSlivers = 7 forgeInfluencedLimit = 300 @@ -105,7 +112,11 @@ forgeFiendishLimit = 3 forgeFiendishIntervalType = "hour" forgeFiendishIntervalTime = "1" --- Bosstiary system +-- Bestiary & Bosstiary system +-- NOTE: bestiaryKillMultiplier, multiplier value of monster killed, default 1 +-- NOTE: bosstiaryKillMultiplier, multiplier value of boss killed, default 1 +bestiaryKillMultiplier = 1 +bosstiaryKillMultiplier = 1 boostedBossSlot = true boostedBossLootBonus = 250 boostedBossKillBonus = 3 @@ -119,17 +130,25 @@ familiarTime = 30 onlyPremiumAccount = false -- Customs +-- NOTE: weatherRain = true, activates weather raining effects +-- NOTE: thunderEffect = true, activates thunder effects +-- NOTE: allConsoleLog = true, show all message logs +-- NOTE: stashMoving = true, stow an container inside your 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 +-- NOTE: toggleServerIsRetroPVP will make this server as retro, setting PARTY_PROTECTION and ADVANCED_SECURE_MODE to 0 +-- NOTE: toggleTravelsFree will make all travels from boat free weatherRain = false thunderEffect = false allConsoleLog = false --- stashMoving = true, stow an container inside your stash --- the non-stackable items will be moved to the selected depot chest(I - XVIII). stashMoving = false depotChest = 4 autoLoot = false --- autoBank = true, the dropped coins from monsters will be automatically --- deposited to your bank account. autoBank = false +toggleGoldPouchAllowAnything = false +toggleServerIsRetroPVP = false +toggleTravelsFree = false -- Teleport summon -- Set to true will never remove the summon @@ -328,3 +347,4 @@ location = "South America" -- The URL layout is https://discord.com/api/webhooks/:id/:token -- Leave empty if you wish to disable. discordWebhookURL = "" + diff --git a/data-canary/scripts/creaturescripts/bestiary_kill.lua b/data-canary/scripts/creaturescripts/bestiary_kill.lua index 0d0aacc068a..b4d86971b21 100644 --- a/data-canary/scripts/creaturescripts/bestiary_kill.lua +++ b/data-canary/scripts/creaturescripts/bestiary_kill.lua @@ -5,10 +5,11 @@ function bestiaryOnKill.onKill(player, creature, lastHit) return true end + local bestiaryMultiplier = (configManager.getNumber(configKeys.BESTIARY_KILL_MULTIPLIER) or 1) for cid, damage in pairs(creature:getDamageMap()) do local participant = Player(cid) if participant and participant:isPlayer() then - participant:addBestiaryKill(creature:getName()) + participant:addBestiaryKill(creature:getName(), bestiaryMultiplier) end end diff --git a/data-canary/scripts/globalevents/global_server_save.lua b/data-canary/scripts/globalevents/global_server_save.lua index f63adc194fa..e99a4521936 100644 --- a/data-canary/scripts/globalevents/global_server_save.lua +++ b/data-canary/scripts/globalevents/global_server_save.lua @@ -16,16 +16,16 @@ end local function ServerSaveWarning(time) -- minus one minutes - local remaningTime = tonumber(time) - 60000 + local remainingTime = tonumber(time) - 60000 if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_MESSAGE) then - local message = "Server is saving game in " .. (remaningTime/60000) .." minute(s). Please logout." + local message = "Server is saving game in " .. (remainingTime/60000) .." minute(s). Please logout." Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING) Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT) end -- if greater than one minute, schedule another warning -- else the next event will be the server save - if remaningTime > 60000 then - addEvent(ServerSaveWarning, 60000, remaningTime) + if remainingTime > 60000 then + addEvent(ServerSaveWarning, 60000, remainingTime) else addEvent(ServerSave, 60000) end @@ -35,13 +35,13 @@ end -- interval is the time between the event start and the the effective save, it will send an notify message every minute local serversave = GlobalEvent("serversave") function serversave.onTime(interval) - local remaningTime = configManager.getNumber(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_DURATION) * 60000 + local remainingTime = configManager.getNumber(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_DURATION) * 60000 if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_MESSAGE) then - local message = "Server is saving game in " .. (remaningTime/60000) .." minute(s). Please logout." + local message = "Server is saving game in " .. (remainingTime/60000) .." minute(s). Please logout." Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING) Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT) end - addEvent(ServerSaveWarning, 60000, remaningTime) -- Schedule next event in 1 minute(60000) + addEvent(ServerSaveWarning, 60000, remainingTime) -- Schedule next event in 1 minute(60000) return not configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_SHUTDOWN) end diff --git a/data-canary/scripts/globalevents/save_interval.lua b/data-canary/scripts/globalevents/save_interval.lua index 2e4eb5a1191..8708dfe98b7 100644 --- a/data-canary/scripts/globalevents/save_interval.lua +++ b/data-canary/scripts/globalevents/save_interval.lua @@ -19,13 +19,13 @@ end local save = GlobalEvent("save") function save.onTime(interval) - local remaningTime = 60 * 1000 + local remainingTime = 60 * 1000 if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) then - local message = "The server will save all accounts within " .. (remaningTime/1000) .." seconds. \z + local message = "The server will save all accounts within " .. (remainingTime/1000) .." seconds. \z You might lag or freeze for 5 seconds, please find a safe place." Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT) Spdlog.info(string.format(message, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE)) - addEvent(serverSave, remaningTime, interval) + addEvent(serverSave, remainingTime, interval) return true end return not configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) diff --git a/data-canary/scripts/movements/unscripted_movements.lua b/data-canary/scripts/movements/unscripted_movements.lua index 944baaab8d0..29f1952409b 100644 --- a/data-canary/scripts/movements/unscripted_movements.lua +++ b/data-canary/scripts/movements/unscripted_movements.lua @@ -14056,14 +14056,14 @@ local items = { itemid = 6529, type = "equip", slot = "feet", - level = 180 + level = 10 }, { -- pair of soft boots itemid = 6529, type = "deequip", slot = "feet", - level = 180 + level = 10 }, { -- tortoise shield @@ -14834,14 +14834,14 @@ local items = { itemid = 3549, type = "equip", slot = "feet", - level = 180 + level = 10 }, { -- pair of soft boots itemid = 3549, type = "deequip", slot = "feet", - level = 180 + level = 10 }, { -- scythe diff --git a/data-canary/scripts/talkactions/god/storage_set.lua b/data-canary/scripts/talkactions/god/storage_set.lua index 48c3ed5c229..aa080fda066 100644 --- a/data-canary/scripts/talkactions/god/storage_set.lua +++ b/data-canary/scripts/talkactions/god/storage_set.lua @@ -2,14 +2,10 @@ local storageSet = TalkAction("/set") function storageSet.onSay(cid, words, param) local player = Player(cid) - if not player:getGroup():getAccess() then + if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then return true end - if player:getAccountType() < ACCOUNT_TYPE_GOD then - return false - end - local split = param:split(",") if split[2] == nil then player:sendCancelMessage("Insufficient parameters.") diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 97b53a75c3c..b2597b0400d 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -15,8 +15,7 @@ Reserved player action storage key ranges (const.h) [103] = key 0010 [303] = key 0303 [1000] = level door. Here 1 must be used followed by the level. - Example: 1010 = level 10, - 1100 = level 100] + Example: 1010 = level 10, 1100 = level 100 [3001-3008] = key 3001/3008 [3012] = key 3012 @@ -1275,10 +1274,10 @@ Storage = { Statue = 51528, LastMissionState = 51529 }, - TheCursedCrystal = { - Oneeyedjoe = 51530, - MedusaOil = 51531, - Questline = 51532 + TheCursedCrystal = { + Oneeyedjoe = 51530, + MedusaOil = 51531, + Questline = 51532 } }, TheShatteredIsles = { @@ -1421,7 +1420,7 @@ Storage = { TrophyWarlord = 51720, GreenhornDoor = 51721, ScrapperDoor = 51722, - WarlordDoor= 51723 + WarlordDoor = 51723 }, QuestChests = { -- Reserved storage from 51730 - 51999 @@ -2124,18 +2123,21 @@ Storage = { TheBeginning = {}, TheDemonOak = {}, FishForASerpent = { - QuestLine = 41651}, + QuestLine = 41651 + }, TheHuntForTheSeaSerpent = { QuestLine = 41652, SuccessSwitch = 41653, Bait = 41654, Direction = 41655, - Access = 41656}, + Access = 41656 + }, TheInquisition = {}, TheThievesGuild = {}, TrollSabotage = { Questline = 41840, - JumpTimer = 41841}, + JumpTimer = 41841 + }, VampireHunter = {}, }, U8_4 = { -- update 8.4 - Reserved Storages 41901 - 42145 @@ -2149,10 +2151,12 @@ Storage = { Lisander = 41906, Ortheus = 41907, Maris = 41908, - Armenius = 41909}, + Armenius = 41909 + }, Mission03 = 41910, Mission04 = 41911, - VengothAccess = 41912}, + VengothAccess = 41912 + }, InServiceOfYalahar = {}, TheHiddenCityOfBeregar = {}, TopOfTheCity = {}, @@ -2259,7 +2263,7 @@ Storage = { FahimCount = 42384, }, AltKillCount = { - -- Grizzly Adams + -- Grizzly Adams -- Apes KongraCount = 42450, MerlkinCount = 42451, @@ -2293,7 +2297,7 @@ Storage = { DrakenEliteCount = 42473, DrakenSpellweaverCount = 42474, DrakenWarmasterCount = 42475, - -- Others + -- Others -- Minotaurs MinotaurCount = 42476, MinotaurGuardCount = 42477, @@ -2343,21 +2347,24 @@ Storage = { U8_54 = { -- update 8.54 - Reserved Storages 42551 - 42950 AnUneasyAlliance = { Questline = 42551, - QuestDoor = 42552}, -- 42551 - 42600 + QuestDoor = 42552 + }, -- 42551 - 42600 ChildrenOfTheRevolution = {}, -- 42601 - 42650 SeaOfLight = {}, -- 42651 - 42700 TheNewFrontier = { -- 42701 - 42750 Questline = 42701, FarmineFirstTravel = 42702, Mission01 = 42703, - Mission02 = {42704, + Mission02 = { + 42704, Beaver1 = 42705, Beaver2 = 42706, Beaver3 = 42707, }, Mission03 = 42708, Mission04 = 42709, - Mission05 = {42710, + Mission05 = { + 42710, KingTibianus = 42711, Leeland = 42712, Angus = 42713, @@ -2371,15 +2378,18 @@ Storage = { HumgolfKeyword = 42845, }, Mission06 = 42717, - Mission07 = {42718, + Mission07 = { + 42718, HiddenNote = 42719, }, Mission08 = 42720, - Mission09 = {42721, + Mission09 = { + 42721, ArenaDoor = 42722, RewardDoor = 42723, }, - Mission10 = {42724, + Mission10 = { + 42724, MagicCarpetDoor = 42725, }, Reward = { @@ -2588,7 +2598,8 @@ Storage = { CultsOfTibia = {}, -- 45651 - 45750 ThreatenedDreams = { -- 45751 - 45850 QuestLine = 45751, - Mission01 = {45752, -- Troubled Animals + Mission01 = { + 45752, -- Troubled Animals PoacherChest = 45753, PoacherNotes = 45754, FeathersCount = 45755, @@ -2597,8 +2608,9 @@ Storage = { Feathers3 = 45758, Feathers4 = 45759, Feathers5 = 45760 - }, - Mission02 = {45761, -- Nightmare Intruders + }, + Mission02 = { + 45761, -- Nightmare Intruders FrazzlemawsCount = 45762, EnfeebledCount = 45763, KroazurAccess = 45764, @@ -2629,16 +2641,18 @@ Storage = { StarlightPos03 = 45789, StarlightPos04 = 45790, StarlightPos05 = 45791 - }, - Mission03 = {45792, -- An Unlikely Couple + }, + Mission03 = { + 45792, -- An Unlikely Couple UnlikelyCouple = 45793, PanpipesTimer = 45794, RavenHerbTimer = 45795, DarkSunCatcher = 45796, EmptyStarlightVial = 45797 - }, - Mission04 = {45798, - }, + }, + Mission04 = { + 45798, + }, Mission05 = 45799 }, }, @@ -2817,7 +2831,7 @@ Storage = { MegasylvanYseldaTimer = 47602, }, CitizenOfIssaviOutfits = {}, - RoyalBounaceanAdvisorOutfits= {}, + RoyalBounaceanAdvisorOutfits = {}, TooHotToHandle = {} }, U12_80 = { -- update 12.80 - Reserved Storages 47801 - 47850 diff --git a/data-otservbr-global/lib/lib.lua b/data-otservbr-global/lib/lib.lua index f96e060fc9b..4d8e347d6a4 100644 --- a/data-otservbr-global/lib/lib.lua +++ b/data-otservbr-global/lib/lib.lua @@ -1,15 +1,15 @@ -- Core API functions implemented in Lua -- Load storages first -dofile(DATA_DIRECTORY.. '/lib/core/load.lua') +dofile(DATA_DIRECTORY .. '/lib/core/load.lua') -- Compatibility library for our old Lua API -dofile(DATA_DIRECTORY.. '/lib/compat/compat.lua') +dofile(DATA_DIRECTORY .. '/lib/compat/compat.lua') -- Tables library -dofile(DATA_DIRECTORY.. '/lib/tables/load.lua') +dofile(DATA_DIRECTORY .. '/lib/tables/load.lua') -- Others library -dofile(DATA_DIRECTORY.. '/lib/others/load.lua') +dofile(DATA_DIRECTORY .. '/lib/others/load.lua') -- Quests library -dofile(DATA_DIRECTORY.. '/lib/quests/quest.lua') +dofile(DATA_DIRECTORY .. '/lib/quests/quest.lua') diff --git a/data-otservbr-global/monster/demons/fire_devil.lua b/data-otservbr-global/monster/demons/fire_devil.lua index f6a55c617f8..757bb737c8a 100644 --- a/data-otservbr-global/monster/demons/fire_devil.lua +++ b/data-otservbr-global/monster/demons/fire_devil.lua @@ -25,7 +25,7 @@ monster.Bestiary = { Occurrence = 0, Locations = "Desert Dungeon, Ancient Temple, Magician Tower, Shadow Tomb, Ghostlands, Goroma, \z Plains of Havoc at Ornamented Shield Quest, Spike Sword Quest." - } +} monster.health = 200 monster.maxHealth = 200 diff --git a/data-otservbr-global/monster/humanoids/dwarf.lua b/data-otservbr-global/monster/humanoids/dwarf.lua index 8cf576d155b..ca1e4840b57 100644 --- a/data-otservbr-global/monster/humanoids/dwarf.lua +++ b/data-otservbr-global/monster/humanoids/dwarf.lua @@ -82,7 +82,7 @@ monster.loot = { {name = "studded armor", chance = 8000}, {name = "copper shield", chance = 10000}, {id = 3456, chance = 10000}, -- pick - {name = "letter", chance = 8000}, + {id = 3505, chance = 8000}, -- letter {name = "leather legs", chance = 10000}, {name = "white mushroom", chance = 50000}, {name = "iron ore", chance = 700} diff --git a/data-otservbr-global/npc/canary.lua b/data-otservbr-global/npc/canary.lua index 627f330a8a0..4721e7bce24 100644 --- a/data-otservbr-global/npc/canary.lua +++ b/data-otservbr-global/npc/canary.lua @@ -59,7 +59,7 @@ npcType.onThink = function(npc, interval) npcHandler:onThink(npc, interval) end --- onAppear +-- onAppear npcType.onAppear = function(npc, creature) npcHandler:onAppear(npc, creature) end diff --git a/data-otservbr-global/npc/captain_dreadnought.lua b/data-otservbr-global/npc/captain_dreadnought.lua index 22bba7043e6..ed033c581b6 100644 --- a/data-otservbr-global/npc/captain_dreadnought.lua +++ b/data-otservbr-global/npc/captain_dreadnought.lua @@ -26,13 +26,15 @@ npcConfig.flags = { npcConfig.voices = { interval = 15000, chance = 50, - {text = "No smuggling aboard this ship! Only 20 pieces of any creature product allowed!"}, - {text = "No fear! The Sea Cat will ship you safely to the mainland!"}, - {text = "All aboard! Prepare to sail!"}, - {text = "Come hell or high water, we'll reach any port I sail you to!"}, - {text = "This island is too small. I need sea water around me."} + { text = "No smuggling aboard this ship! Only 20 pieces of any creature product allowed!" }, + { text = "No fear! The Sea Cat will ship you safely to the mainland!" }, + { text = "All aboard! Prepare to sail!" }, + { text = "Come hell or high water, we'll reach any port I sail you to!" }, + { text = "This island is too small. I need sea water around me." } } +npcConfig.moneyToNeedDonation = 500 --value in gold coins (ex: 500 = 500gp, 10000 = 10k) + local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) @@ -191,7 +193,7 @@ local townNames = {all = "", free = "", premium = ""} -- Function to build town names strings and adds additional data to sailable/premium towns about local function buildStrings() - local townsList = {all = {}, free = {}, premium = {}} + local townsList = { all = {}, free = {}, premium = {} } for id, town in pairs(towns) do if town.canBeSailed then if town.isPremium then @@ -219,15 +221,16 @@ end buildStrings() -- Function to handle donations and its messages -local function donationHandler(npc, creature, message, keywords, parameters, node) local player = Player(creature) +local function donationHandler(npc, creature, message, keywords, parameters, node) + local player = Player(creature) local playerId = player:getId() if (parameters.confirm ~= true) and (parameters.decline ~= true) then - npcHandler:say("So you want to donate " .. (player:getMoney() - 500) .. " gold coins? \z + npcHandler:say("So you want to donate " .. (player:getMoney() - npcConfig.moneyToNeedDonation) .. " gold coins? \z The little kiddies are going to appreciate it.", npc, creature) elseif (parameters.confirm == true) then - if player:getMoney() > 500 then - player:removeMoney((player:getMoney() - 500)) + if player:getMoney() > npcConfig.moneyToNeedDonation then + player:removeMoney((player:getMoney() - npcConfig.moneyToNeedDonation)) npcHandler:say( "Well, that's really generous of you. That'll feed a lot of hungry mouths for a while. \z Right, now which {city} did you say you wanted to go to?", npc, creature) @@ -236,10 +239,10 @@ local function donationHandler(npc, creature, message, keywords, parameters, nod npcHandler:say("Well, har har. Very funny. Come on, pick up the gold you just dropped.", npc, creature) end elseif (parameters.decline == true) then - if player:getMoney() > 500 then + if player:getMoney() > npcConfig.moneyToNeedDonation then npcHandler:say( "By tempest! What's all this gold weighing us down? Don't you think that's a little risky with all \z - these pirates around? You can take 500 with you, but that's it. Drop the rest or {donate} it to the \z + these pirates around? You can take " .. npcConfig.moneyToNeedDonation .. " with you, but that's it. Drop the rest or {donate} it to the \z Adventurers' Orphans Fund, really.", npc, creature) end end @@ -247,7 +250,8 @@ local function donationHandler(npc, creature, message, keywords, parameters, nod end -- Function to handle town travel and its messages -local function townTravelHandler(npc, creature, message, keywords, parameters, node) local player = Player(creature) +local function townTravelHandler(npc, creature, message, keywords, parameters, node) + local player = Player(creature) local playerId = player:getId() if (parameters.confirm ~= true) and (parameters.decline ~= true) and parameters.townId then @@ -267,10 +271,10 @@ local function townTravelHandler(npc, creature, message, keywords, parameters, n end elseif (parameters.confirm == true) then -- Handle money excess at confirm or it may be dropped and picked up in previous steps - if player:getMoney() > 500 then + if player:getMoney() > npcConfig.moneyToNeedDonation then npcHandler:say( "By tempest! What's all this gold weighing us down? Don't you think that's a little risky with all \z - these pirates around? You can take 500 with you, but that's it. Drop the rest or {donate} it to the \z + these pirates around? You can take " .. npcConfig.moneyToNeedDonation .. " with you, but that's it. Drop the rest or {donate} it to the \z Adventurers' Orphans Fund, really.", npc, creature) return true end diff --git a/data-otservbr-global/npc/rashid_custom.lua b/data-otservbr-global/npc/rashid_custom.lua index 05541585f3b..bc80799ae7a 100644 --- a/data-otservbr-global/npc/rashid_custom.lua +++ b/data-otservbr-global/npc/rashid_custom.lua @@ -303,7 +303,7 @@ npcConfig.shop = { { itemName = "crystal crossbow", clientId = 16163, sell = 35000 }, { itemName = "crystal mace", clientId = 3333, sell = 12000 }, { itemName = "crystal necklace", clientId = 3008, sell = 400 }, - { itemName = "crystal ring", clientId = 6093, sell = 250 }, + { itemName = "crystal ring", clientId = 3007, sell = 250 }, { itemName = "crystal sword", clientId = 7449, sell = 600 }, { itemName = "crystalline armor", clientId = 8050, sell = 16000 }, { itemName = "daramian mace", clientId = 3327, sell = 110 }, diff --git a/data-otservbr-global/npc/testserver_assistant.lua b/data-otservbr-global/npc/testserver_assistant.lua index bda688d782f..a0a77d2617f 100644 --- a/data-otservbr-global/npc/testserver_assistant.lua +++ b/data-otservbr-global/npc/testserver_assistant.lua @@ -1,6 +1,10 @@ local internalNpcName = "Testserver Assistant" local npcType = Game.createNpcType(internalNpcName) -local npcConfig = {} +local npcConfig = { + amountMoney = 100, --1kk + amountLevel = 100, + maxLevel = 800 +} npcConfig.name = internalNpcName npcConfig.description = internalNpcName @@ -52,21 +56,63 @@ end local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) - local playerId = player:getId() if not npcHandler:checkInteraction(npc, creature) then return false end - if MsgContains(message, 'money') then + if MsgContains(message, 'money') or MsgContains(message, "gold") then npcHandler:say('There you have', npc, creature) - player:addMoney(100000) + player:addItem(3043, npcConfig.amountMoney) end -end -npcHandler:setMessage(MESSAGE_FAREWELL, "Happy hunting, old chap!") + if MsgContains(message, "exp") or MsgContains(message, "experience") then + if player:getLevel() > npcConfig.maxLevel then + npcHandler:say('You can not take it anymore', npc, creature) + else + npcHandler:say('Here you are |PLAYERNAME|.', npc, creature) + local level = player:getLevel() + npcConfig.amountLevel - 1 + local experience = ((50 * level * level * level) - (150 * level * level) + (400 * level)) / 3 + player:addExperience(experience - player:getExperience(), true, true) + end + end + + if MsgContains(message, "bless") or MsgContains(message, "blessing") then + local hasToF = Blessings.Config.HasToF and player:hasBlessing(1) or true + donthavefilter = function(p, b) return not p:hasBlessing(b) end + local missingBless = player:getBlessings(nil, donthavefilter) + local missingBlessAmt = #missingBless + (hasToF and 0 or 1) + + if missingBlessAmt == 0 then + player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "You are already blessed.") + player:getPosition():sendMagicEffect(CONST_ME_POFF) + return false + end + + for i, v in ipairs(missingBless) do + player:addBlessing(v.id, 1) + end + npcHandler:say("You have been blessed by all gods, |PLAYERNAME|.", npc, creature) + player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "You received the remaining " .. missingBlessAmt .. " blesses.") + player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) + end + + if MsgContains(message, "reset") then + if player:getLevel() > 8 then + local level = 7 + local experience = ((50 * level * level * level) - (150 * level * level) + (400 * level)) / 3 + player:removeExperience(player:getExperience() - experience) + else + npcHandler:say('You can not take it anymore', npc, creature) + end + end + + return true +end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) +npcHandler:setMessage(MESSAGE_GREET, "Hey |PLAYERNAME|. I'm Testserver Assistant and I can give {money}, {experience} and {blessing} which will be useful for testing on " + .. configManager.getString(configKeys.SERVER_NAME) .. " server." .. " You can too to back to level 8 with {reset}.") npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/scripts/creaturescripts/others/bestiary_kill.lua b/data-otservbr-global/scripts/creaturescripts/others/bestiary_kill.lua index 53a047202dd..897d1a4f139 100644 --- a/data-otservbr-global/scripts/creaturescripts/others/bestiary_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/others/bestiary_kill.lua @@ -4,12 +4,13 @@ function bestiaryOnKill.onKill(player, creature, lastHit) return true end + local bestiaryMultiplier = (configManager.getNumber(configKeys.BESTIARY_KILL_MULTIPLIER) or 1) for cid, damage in pairs(creature:getDamageMap()) do local participant = Player(cid) if participant and participant:isPlayer() then - participant:addBestiaryKill(creature:getName()) + participant:addBestiaryKill(creature:getName(), bestiaryMultiplier) end - end + end return true end diff --git a/data-otservbr-global/scripts/creaturescripts/others/bosstiary_kill.lua b/data-otservbr-global/scripts/creaturescripts/others/bosstiary_kill.lua index f8fc3b29463..536d3c05535 100644 --- a/data-otservbr-global/scripts/creaturescripts/others/bosstiary_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/others/bosstiary_kill.lua @@ -4,14 +4,15 @@ function bosstiaryOnKill.onKill(player, creature, lastHit) return true end + local bosstiaryMultiplier = (configManager.getNumber(configKeys.BOSSTIARY_KILL_MULTIPLIER) or 1) + local killBonus = (configManager.getNumber(configKeys.BOOSTED_BOSS_KILL_BONUS) or 3) for cid, damage in pairs(creature:getDamageMap()) do local participant = Player(cid) if participant and participant:isPlayer() then if creature:getName():lower() == (Game.getBoostedBoss()):lower() then - local killBonus = configManager.getNumber(configKeys.BOOSTED_BOSS_KILL_BONUS) - participant:addBosstiaryKill(creature:getName(), killBonus) + participant:addBosstiaryKill(creature:getName(), bosstiaryMultiplier * killBonus) else - participant:addBosstiaryKill(creature:getName()) + participant:addBosstiaryKill(creature:getName(), bosstiaryMultiplier) end end end diff --git a/data-otservbr-global/scripts/globalevents/customs/save_interval.lua b/data-otservbr-global/scripts/globalevents/customs/save_interval.lua index 2e4eb5a1191..3daeb7e8cc3 100644 --- a/data-otservbr-global/scripts/globalevents/customs/save_interval.lua +++ b/data-otservbr-global/scripts/globalevents/customs/save_interval.lua @@ -19,13 +19,13 @@ end local save = GlobalEvent("save") function save.onTime(interval) - local remaningTime = 60 * 1000 + local remainingTime = 60 * 1000 if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) then - local message = "The server will save all accounts within " .. (remaningTime/1000) .." seconds. \z + local message = "The server will save all accounts within " .. (remainingTime / 1000) .. " seconds. \z You might lag or freeze for 5 seconds, please find a safe place." Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT) Spdlog.info(string.format(message, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE)) - addEvent(serverSave, remaningTime, interval) + addEvent(serverSave, remainingTime, interval) return true end return not configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) diff --git a/data-otservbr-global/scripts/globalevents/others/global_server_save.lua b/data-otservbr-global/scripts/globalevents/others/global_server_save.lua index 7773f0f04a3..b3a73e96d0b 100644 --- a/data-otservbr-global/scripts/globalevents/others/global_server_save.lua +++ b/data-otservbr-global/scripts/globalevents/others/global_server_save.lua @@ -16,16 +16,16 @@ end local function ServerSaveWarning(time) -- minus one minutes - local remaningTime = tonumber(time) - 60000 + local remainingTime = tonumber(time) - 60000 if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_MESSAGE) then - local message = "Server is saving game in " .. (remaningTime/60000) .." minute(s). Please logout." + local message = "Server is saving game in " .. (remainingTime / 60000) .. " minute(s). Please logout." Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING) Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT) end -- if greater than one minute, schedule another warning -- else the next event will be the server save - if remaningTime > 60000 then - addEvent(ServerSaveWarning, 60000, remaningTime) + if remainingTime > 60000 then + addEvent(ServerSaveWarning, 60000, remainingTime) else addEvent(ServerSave, 60000) end @@ -33,17 +33,17 @@ end -- Function that is called by the global events when it reaches the time configured -- interval is the time between the event start and the the effective save, it will send an notify message every minute -local serversave = GlobalEvent("serversave") -function serversave.onTime(interval) - local remaningTime = configManager.getNumber(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_DURATION) * 60000 +local serverSaveEvent = GlobalEvent("serversave") +function serverSaveEvent.onTime(interval) + local remainingTime = configManager.getNumber(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_DURATION) * 60000 if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_MESSAGE) then - local message = "Server is saving game in " .. (remaningTime/60000) .." minute(s). Please logout." - Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING) + local message = "Server is saving game in " .. (remainingTime / 60000) .. " minute(s). Please logout." + Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING, announcementChannels["serverAnnouncements"]) Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT) end - addEvent(ServerSaveWarning, 60000, remaningTime) -- Schedule next event in 1 minute(60000) + addEvent(ServerSaveWarning, 60000, remainingTime) -- Schedule next event in 1 minute(60000) return not configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_SHUTDOWN) end -serversave:time(configManager.getString(configKeys.GLOBAL_SERVER_SAVE_TIME)) -serversave:register() +serverSaveEvent:time(configManager.getString(configKeys.GLOBAL_SERVER_SAVE_TIME)) +serverSaveEvent:register() diff --git a/data-otservbr-global/scripts/movements/equipment/unscripted_equipments.lua b/data-otservbr-global/scripts/movements/equipment/unscripted_equipments.lua index e9718c73788..c480c794a66 100644 --- a/data-otservbr-global/scripts/movements/equipment/unscripted_equipments.lua +++ b/data-otservbr-global/scripts/movements/equipment/unscripted_equipments.lua @@ -14730,14 +14730,14 @@ local items = { itemid = 6529, type = "equip", slot = "feet", - level = 180 + level = 10 }, { -- pair of soft boots itemid = 6529, type = "deequip", slot = "feet", - level = 180 + level = 10 }, { -- tortoise shield @@ -15515,14 +15515,14 @@ local items = { itemid = 3549, type = "equip", slot = "feet", - level = 180 + level = 10 }, { -- pair of soft boots itemid = 3549, type = "deequip", slot = "feet", - level = 180 + level = 10 }, { -- scythe diff --git a/data-otservbr-global/scripts/talkactions/player/online.lua b/data-otservbr-global/scripts/talkactions/player/online.lua index 7d57fea312b..d36cc2d9d77 100644 --- a/data-otservbr-global/scripts/talkactions/player/online.lua +++ b/data-otservbr-global/scripts/talkactions/player/online.lua @@ -1,26 +1,30 @@ local maxPlayersPerMessage = 10 local playersOnline = TalkAction("!online") -function playersOnline.onSay(player, words, param) - local hasAccess = player:getGroup():getAccess() - local players = Game.getPlayers() - local onlineList = {} +function playersOnline.onSay(player, words, param) + local hasAccess = player:getGroup():getAccess() + local players = Game.getPlayers() + local onlineList = {} - for _, targetPlayer in ipairs(players) do - if hasAccess or not targetPlayer:isInGhostMode() then - table.insert(onlineList, ("%s [%d]"):format(targetPlayer:getName(), targetPlayer:getLevel())) - end - end + for _, targetPlayer in ipairs(players) do + if hasAccess or not targetPlayer:isInGhostMode() then + table.insert(onlineList, ("%s [%d]"):format(targetPlayer:getName(), targetPlayer:getLevel())) + end + end - local playersOnlineList = #onlineList - player:sendTextMessage(MESSAGE_ATTENTION, ("%d players online!"):format(playersOnlineList)) + local playersOnlineList = #onlineList + player:sendTextMessage(MESSAGE_ATTENTION, ("%d players online!"):format(playersOnlineList)) - for i = 1, playersOnlineList, maxPlayersPerMessage do - local j = math.min(i + maxPlayersPerMessage - 1, playersOnlineList) - local msg = table.concat(onlineList, ", ", i, j) .. "." - player:sendTextMessage(MESSAGE_ATTENTION, msg) - end - return false + local listPlayers + for i = 1, playersOnlineList, maxPlayersPerMessage do + local j = math.min(i + maxPlayersPerMessage - 1, playersOnlineList) + local msg = table.concat(onlineList, ", ", i, j) .. "." + listPlayers = table.concat(onlineList, "\n", i, j) + player:sendTextMessage(MESSAGE_ATTENTION, msg) + end + + player:popupFYI("~ Players Online ~\n\n" .. listPlayers) + return false end playersOnline:register() diff --git a/data/events/scripts/creature.lua b/data/events/scripts/creature.lua index 8ad1e2f8a1a..a6ed2a7be5e 100644 --- a/data/events/scripts/creature.lua +++ b/data/events/scripts/creature.lua @@ -90,7 +90,7 @@ function Creature:onTargetCombat(target) return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE end - if PARTY_PROTECTION ~= 0 then + if not IsRetroPVP() or PARTY_PROTECTION ~= 0 then if self:isPlayer() and target:isPlayer() then local party = self:getParty() if party then @@ -102,7 +102,7 @@ function Creature:onTargetCombat(target) end end - if ADVANCED_SECURE_MODE ~= 0 then + if not IsRetroPVP() or ADVANCED_SECURE_MODE ~= 0 then if self:isPlayer() and target:isPlayer() then if self:hasSecureMode() then return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 8dda119c55e..f655d45bbb3 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -352,17 +352,17 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, self:sendCancelMessage(RETURNVALUE_CONTAINERNOTENOUGHROOM) return false end - -- Gold Pouch - if (containerTo:getId() == ITEM_GOLD_POUCH) then - if (not (item:getId() == ITEM_CRYSTAL_COIN or item:getId() == ITEM_PLATINUM_COIN - or item:getId() == ITEM_GOLD_COIN)) then - self:sendCancelMessage("You can move only money to this container.") - return false + if not configManager.getBoolean(configKeys.TOGGLE_GOLD_POUCH_ALLOW_ANYTHING) then + -- Gold Pouch + if (containerTo:getId() == ITEM_GOLD_POUCH) then + if (not (item:getId() == ITEM_CRYSTAL_COIN or item:getId() == ITEM_PLATINUM_COIN or item:getId() == ITEM_GOLD_COIN)) then + self:sendCancelMessage("You can move only money to this container.") + return false + end end end end - -- Bath tube local toTile = Tile(toCylinder:getPosition()) local topDownItem = toTile:getTopDownItem() diff --git a/data/global.lua b/data/global.lua index e7a4821e8b6..6f2fd97d28f 100644 --- a/data/global.lua +++ b/data/global.lua @@ -15,8 +15,12 @@ function IsRunningGlobalDatapack() end end -PARTY_PROTECTION = 1 -- Set to 0 to disable. -ADVANCED_SECURE_MODE = 1 -- Set to 0 to disable. +function IsRetroPVP() + return configManager.getBoolean(configKeys.TOGGLE_SERVER_IS_RETRO) +end +-- NOTE: 0 is disabled. +PARTY_PROTECTION = (IsRetroPVP() and 0) or 1 +ADVANCED_SECURE_MODE = (IsRetroPVP() and 0) or 1 NORTH = DIRECTION_NORTH EAST = DIRECTION_EAST diff --git a/data/items/items.xml b/data/items/items.xml index 39e3cf470e6..f04d15bba0a 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -35903,7 +35903,8 @@ - + + diff --git a/data/libs/forge_lib.lua b/data/libs/forge_lib.lua index eaf86a7f9cf..eaf03728a3a 100644 --- a/data/libs/forge_lib.lua +++ b/data/libs/forge_lib.lua @@ -45,6 +45,8 @@ function ForgeMonster:onDeath(creature, corpse, killer, mostDamageKiller, unjust return true end + local forgeAmountMultiplier = (configManager.getNumber(configKeys.FORGE_AMOUNT_MULTIPLIER) or 3) + local stack = creature:getForgeStack() if stack > 0 then local party = nil @@ -75,7 +77,7 @@ function ForgeMonster:onDeath(creature, corpse, killer, mostDamageKiller, unjust -- Each stack can multiplied from 1x to 3x -- Example monster with 5 stack and system randomize multiplier 3x, players will receive 15x dusts - local amount = math.random(stack, 3 * stack) + local amount = math.random(stack, forgeAmountMultiplier * stack) local totalDusts = playerKiller:getForgeDusts() local limitDusts = playerKiller:getForgeDustLevel() @@ -89,13 +91,13 @@ function ForgeMonster:onDeath(creature, corpse, killer, mostDamageKiller, unjust local actualTotalDusts = playerKiller:getForgeDusts() playerKiller:sendTextMessage(MESSAGE_EVENT_ADVANCE, - "You received " .. amount .. " dust" .. - " for the Exaltation Forge. You now have " .. actualTotalDusts .. " out of a maximum of " .. - limitDusts .. " dusts.") + "You received " .. amount .. " dust" .. + " for the Exaltation Forge. You now have " .. actualTotalDusts .. " out of a maximum of " .. + limitDusts .. " dusts.") else playerKiller:sendTextMessage(MESSAGE_EVENT_ADVANCE, - "You did not receive " .. amount .. " dust" .. - " for the Exaltation Forge because you have already reached the maximum of " .. limitDusts .. " dust.") + "You did not receive " .. amount .. " dust" .. + " for the Exaltation Forge because you have already reached the maximum of " .. limitDusts .. " dust.") end end end @@ -114,7 +116,7 @@ function ForgeMonster:onDeath(creature, corpse, killer, mostDamageKiller, unjust -- Each stack can multiplied from 1x to 3x -- Example monster with 5 stack and system randomize multiplier 3x, players will receive 15x dusts - local amount = math.random(stack, 3 * stack) + local amount = math.random(stack, forgeAmountMultiplier * stack) local totalDusts = playerKiller:getForgeDusts() local limitDusts = playerKiller:getForgeDustLevel() @@ -128,13 +130,13 @@ function ForgeMonster:onDeath(creature, corpse, killer, mostDamageKiller, unjust local actualTotalDusts = playerKiller:getForgeDusts() playerKiller:sendTextMessage(MESSAGE_EVENT_ADVANCE, - "You received " .. amount .. " dust" .. - " for the Exaltation Forge. You now have " .. actualTotalDusts .. " out of a maximum of " .. - limitDusts .. " dusts.") + "You received " .. amount .. " dust" .. + " for the Exaltation Forge. You now have " .. actualTotalDusts .. " out of a maximum of " .. + limitDusts .. " dusts.") else playerKiller:sendTextMessage(MESSAGE_EVENT_ADVANCE, - "You did not receive " .. amount .. " dust" .. - " for the Exaltation Forge because you have already reached the maximum of " .. limitDusts .. " dust.") + "You did not receive " .. amount .. " dust" .. + " for the Exaltation Forge because you have already reached the maximum of " .. limitDusts .. " dust.") end end end @@ -191,7 +193,7 @@ function ForgeMonster:pickClosestFiendish(creature) local playerPosition = player:getPosition() for _, cid in pairs(Game.getFiendishMonsters()) do if (Monster(cid)) then - creatures[#creatures + 1] = {cid = cid, distance = Monster(cid):getPosition():getDistance(playerPosition)} + creatures[#creatures + 1] = { cid = cid, distance = Monster(cid):getPosition():getDistance(playerPosition) } end end diff --git a/data/libs/functions/functions.lua b/data/libs/functions/functions.lua index 3c1d7e07723..a9435127b39 100644 --- a/data/libs/functions/functions.lua +++ b/data/libs/functions/functions.lua @@ -678,7 +678,7 @@ end local logFormat = "[%s] %s %s" function logCommand(player, words, param) - local file = io.open(DATA_DIRECTORY .. "/logs/" .. player:getName() .. " commands.log", "a") + local file = io.open(CORE_DIRECTORY .. "/logs/" .. player:getName() .. " commands.log", "a") if not file then return end diff --git a/data/npclib/npc_system/modules.lua b/data/npclib/npc_system/modules.lua index 4192ca09091..3de7c0e23c7 100644 --- a/data/npclib/npc_system/modules.lua +++ b/data/npclib/npc_system/modules.lua @@ -46,7 +46,7 @@ if Modules == nil then return false end - local cost, costMessage = parameters.cost, '%d gold' + local cost, costMessage = (configManager.getBoolean(configKeys.TOGGLE_TRAVELS_FREE) and 0) or parameters.cost, '%d gold' if cost and cost > 0 then if parameters.discount then cost = cost - StdModule.travelDiscount(npc, player, parameters.discount) @@ -194,7 +194,7 @@ if Modules == nil then return false end - local cost = parameters.cost + local cost = (configManager.getBoolean(configKeys.TOGGLE_TRAVELS_FREE) and 0) or parameters.cost if cost and cost > 0 then if parameters.discount then cost = cost - StdModule.travelDiscount(npc, player, parameters.discount) @@ -511,7 +511,7 @@ if Modules == nil then return false end - local cost = parameters.cost + local cost = (configManager.getBoolean(configKeys.TOGGLE_TRAVELS_FREE) and 0) or parameters.cost module.npcHandler:say(string.format("Do you want to travel to '%s' for '%d' gold coins?", keywords[1], cost), npc, player) @@ -526,7 +526,7 @@ if Modules == nil then local npcHandler = module.npcHandler - local cost = parameters.cost + local cost = (configManager.getBoolean(configKeys.TOGGLE_TRAVELS_FREE) and 0) or parameters.cost local destination = parameters.destination local premium = parameters.premium diff --git a/data/scripts/talkactions.lua b/data/scripts/talkactions.lua index 9ceefff222d..45a50bb130d 100644 --- a/data/scripts/talkactions.lua +++ b/data/scripts/talkactions.lua @@ -69,7 +69,7 @@ function Player.reloadTalkaction(self, param) return false end - logCommand(self, words, param) + logCommand(self, "/reload", param) local reloadType = reloadTypes[param:lower()] if reloadType then diff --git a/recompile.sh b/recompile.sh index 466c1124d71..101d1958a90 100755 --- a/recompile.sh +++ b/recompile.sh @@ -1,25 +1,33 @@ #!/bin/bash -if [ -d "build" ] -then +cd ~/vcpkg && export VCPKG_FORCE_SYSTEM_BINARIES=1 && cd ~/canary + +if [ -d "build" ]; then echo "Directory 'build' already exists, moving to it" cd build + export VCPKG_FORCE_SYSTEM_BINARIES=1 echo "Clean build directory" rm -rf * echo "Configuring" + # for root directory cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release + # for home directory + # cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release else mkdir "build" && cd build - cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release + export VCPKG_FORCE_SYSTEM_BINARIES=1 + # for root directory + cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release + # for home directory + # cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release fi cmake --build linux-release || exit 1 -if [ $? -eq 1 ] -then +if [ $? -eq 1 ]; then echo "Compilation failed!" else echo "Compilation successful!" - cd .. + cd ~/canary if [ -f "canary" ]; then echo "Saving old build" mv ./canary ./canary.old diff --git a/src/config/config_definitions.hpp b/src/config/config_definitions.hpp index 0f717408287..a58de67cb91 100644 --- a/src/config/config_definitions.hpp +++ b/src/config/config_definitions.hpp @@ -69,6 +69,9 @@ enum booleanConfig_t { ALLOW_RELOAD, BOOSTED_BOSS_SLOT, XP_DISPLAY_MODE, + TOGGLE_GOLD_POUCH_ALLOW_ANYTHING, + TOGGLE_SERVER_IS_RETRO, + TOGGLE_TRAVELS_FREE, LAST_BOOLEAN_CONFIG }; @@ -187,10 +190,13 @@ enum integerConfig_t { FORGE_BASE_SUCCESS_RATE, FORGE_BONUS_SUCCESS_RATE, FORGE_TIER_LOSS_REDUCTION, + FORGE_AMOUNT_MULTIPLIER, FORGE_MIN_SLIVERS, FORGE_MAX_SLIVERS, FORGE_INFLUENCED_CREATURES_LIMIT, FORGE_FIENDISH_CREATURES_LIMIT, + BESTIARY_KILL_MULTIPLIER, + BOSSTIARY_KILL_MULTIPLIER, BOOSTED_BOSS_LOOT_BONUS, BOOSTED_BOSS_KILL_BONUS, FAMILIAR_TIME, diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 0849a7f7f1c..fba044143c3 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -189,7 +189,7 @@ bool ConfigManager::load() { string[DISCORD_WEBHOOK_URL] = getGlobalString(L, "discordWebhookURL", ""); string[SAVE_INTERVAL_TYPE] = getGlobalString(L, "saveIntervalType", ""); string[GLOBAL_SERVER_SAVE_TIME] = getGlobalString(L, "globalServerSaveTime", "06:00"); - string[DATA_DIRECTORY] = getGlobalString(L, "dataPackDirectory", "data-otserbr-global"); + string[DATA_DIRECTORY] = getGlobalString(L, "dataPackDirectory", "data-otservbr-global"); string[CORE_DIRECTORY] = getGlobalString(L, "coreDirectory", "data"); string[FORGE_FIENDISH_INTERVAL_TYPE] = getGlobalString(L, "forgeFiendishIntervalType", "hour"); string[FORGE_FIENDISH_INTERVAL_TIME] = getGlobalString(L, "forgeFiendishIntervalTime", "1"); @@ -259,6 +259,7 @@ bool ConfigManager::load() { integer[FORGE_BASE_SUCCESS_RATE] = getGlobalNumber(L, "forgeBaseSuccessRate", 50); integer[FORGE_BONUS_SUCCESS_RATE] = getGlobalNumber(L, "forgeBonusSuccessRate", 15); integer[FORGE_TIER_LOSS_REDUCTION] = getGlobalNumber(L, "forgeTierLossReduction", 50); + integer[FORGE_AMOUNT_MULTIPLIER] = getGlobalNumber(L, "forgeAmountMultiplier", 3); integer[FORGE_MIN_SLIVERS] = getGlobalNumber(L, "forgeMinSlivers", 3); integer[FORGE_MAX_SLIVERS] = getGlobalNumber(L, "forgeMaxSlivers", 7); integer[FORGE_INFLUENCED_CREATURES_LIMIT] = getGlobalNumber(L, "forgeInfluencedLimit", 300); @@ -299,12 +300,18 @@ bool ConfigManager::load() { integer[TASK_HUNTING_BONUS_REROLL_PRICE] = getGlobalNumber(L, "taskHuntingBonusRerollPrice", 1); integer[TASK_HUNTING_FREE_REROLL_TIME] = getGlobalNumber(L, "taskHuntingFreeRerollTime", 72000); + integer[BESTIARY_KILL_MULTIPLIER] = getGlobalNumber(L, "bestiaryKillMultiplier", 1); + integer[BOSSTIARY_KILL_MULTIPLIER] = getGlobalNumber(L, "bosstiaryKillMultiplier", 1); boolean[BOOSTED_BOSS_SLOT] = getGlobalBoolean(L, "boostedBossSlot", true); integer[BOOSTED_BOSS_LOOT_BONUS] = getGlobalNumber(L, "boostedBossLootBonus", 250); integer[BOOSTED_BOSS_KILL_BONUS] = getGlobalNumber(L, "boostedBossKillBonus", 3); integer[FAMILIAR_TIME] = getGlobalNumber(L, "familiarTime", 30); + boolean[TOGGLE_GOLD_POUCH_ALLOW_ANYTHING] = getGlobalBoolean(L, "toggleGoldPouchAllowAnything", false); + boolean[TOGGLE_SERVER_IS_RETRO] = getGlobalBoolean(L, "toggleServerIsRetroPVP", false); + boolean[TOGGLE_TRAVELS_FREE] = getGlobalBoolean(L, "toggleTravelsFree", false); + loaded = true; lua_close(L); return true; diff --git a/src/game/game.cpp b/src/game/game.cpp index e00d4d7753b..f7b57010a30 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -4394,7 +4394,7 @@ void Game::playerSetLootContainer(uint32_t playerId, ObjectCategory_t category, } Container* container = thing->getContainer(); - if (!container || (container->getID() == ITEM_GOLD_POUCH && category != OBJECTCATEGORY_GOLD)) { + if (!container || (container->getID() == ITEM_GOLD_POUCH && category != OBJECTCATEGORY_GOLD && !g_configManager().getBoolean(TOGGLE_GOLD_POUCH_ALLOW_ANYTHING))) { player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE); return; } diff --git a/src/lua/functions/core/game/config_functions.cpp b/src/lua/functions/core/game/config_functions.cpp index f4bc302af9f..d9a761c1710 100644 --- a/src/lua/functions/core/game/config_functions.cpp +++ b/src/lua/functions/core/game/config_functions.cpp @@ -178,12 +178,20 @@ void ConfigFunctions::init(lua_State* L) { registerEnumIn(L, "configKeys", FORGE_BASE_SUCCESS_RATE); registerEnumIn(L, "configKeys", FORGE_BONUS_SUCCESS_RATE); registerEnumIn(L, "configKeys", FORGE_TIER_LOSS_REDUCTION); + registerEnumIn(L, "configKeys", FORGE_AMOUNT_MULTIPLIER); registerEnumIn(L, "configKeys", FORGE_INFLUENCED_CREATURES_LIMIT); + + registerEnumIn(L, "configKeys", BESTIARY_KILL_MULTIPLIER); + registerEnumIn(L, "configKeys", BOSSTIARY_KILL_MULTIPLIER); registerEnumIn(L, "configKeys", BOOSTED_BOSS_SLOT); registerEnumIn(L, "configKeys", BOOSTED_BOSS_LOOT_BONUS); registerEnumIn(L, "configKeys", BOOSTED_BOSS_KILL_BONUS); registerEnumIn(L, "configKeys", FAMILIAR_TIME); + + registerEnumIn(L, "configKeys", TOGGLE_GOLD_POUCH_ALLOW_ANYTHING); + registerEnumIn(L, "configKeys", TOGGLE_SERVER_IS_RETRO); + registerEnumIn(L, "configKeys", TOGGLE_TRAVELS_FREE); #undef registerEnumIn } diff --git a/src/lua/functions/creatures/player/player_functions.cpp b/src/lua/functions/creatures/player/player_functions.cpp index 8891a212e10..a4766b165cc 100644 --- a/src/lua/functions/creatures/player/player_functions.cpp +++ b/src/lua/functions/creatures/player/player_functions.cpp @@ -281,7 +281,7 @@ int PlayerFunctions::luaPlayerSetAccountType(lua_State* L) { return 1; } -int PlayerFunctions::luaPlayeraddBestiaryKill(lua_State* L) { +int PlayerFunctions::luaPlayerAddBestiaryKill(lua_State* L) { // player:addBestiaryKill(name[, amount = 1]) Player* player = getUserdata(L, 1); if (player) { diff --git a/src/lua/functions/creatures/player/player_functions.hpp b/src/lua/functions/creatures/player/player_functions.hpp index 37d27c68bd9..9a8b2f6ee2c 100644 --- a/src/lua/functions/creatures/player/player_functions.hpp +++ b/src/lua/functions/creatures/player/player_functions.hpp @@ -38,7 +38,7 @@ class PlayerFunctions final : LuaScriptInterface { registerMethod(L, "Player", "setAccountType", PlayerFunctions::luaPlayerSetAccountType); registerMethod(L, "Player", "isMonsterBestiaryUnlocked", PlayerFunctions::luaPlayerIsMonsterBestiaryUnlocked); - registerMethod(L, "Player", "addBestiaryKill", PlayerFunctions::luaPlayeraddBestiaryKill); + registerMethod(L, "Player", "addBestiaryKill", PlayerFunctions::luaPlayerAddBestiaryKill); registerMethod(L, "Player", "charmExpansion", PlayerFunctions::luaPlayercharmExpansion); registerMethod(L, "Player", "getCharmMonsterType", PlayerFunctions::luaPlayergetCharmMonsterType); @@ -318,7 +318,7 @@ class PlayerFunctions final : LuaScriptInterface { static int luaPlayerGetAccountType(lua_State* L); static int luaPlayerSetAccountType(lua_State* L); - static int luaPlayeraddBestiaryKill(lua_State* L); + static int luaPlayerAddBestiaryKill(lua_State* L); static int luaPlayerIsMonsterBestiaryUnlocked(lua_State* L); static int luaPlayercharmExpansion(lua_State* L); static int luaPlayergetCharmMonsterType(lua_State* L); diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 2b67e0ac754..9632f0395d4 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -6897,11 +6897,12 @@ void ProtocolGame::parseSendBosstiarySlots() { auto boostedBossRace = magic_enum::enum_integer(mType->info.bosstiaryRace); auto boostedBossKillCount = player->getBestiaryKillCount(static_cast(boostedBossId)); auto boostedLootBonus = static_cast(g_configManager().getNumber(BOOSTED_BOSS_LOOT_BONUS)); + auto bosstiaryMultiplier = static_cast(g_configManager().getNumber(BOSSTIARY_KILL_MULTIPLIER)); auto boostedKillBonus = static_cast(g_configManager().getNumber(BOOSTED_BOSS_KILL_BONUS)); msg.addByte(boostedBossRace); // Boss Race msg.add(boostedBossKillCount); // Kill Count msg.add(boostedLootBonus); // Loot Bonus - msg.addByte(boostedKillBonus); // Kill Bonus + msg.addByte(bosstiaryMultiplier + boostedKillBonus); // Kill Bonus msg.addByte(boostedBossRace); // Boss Race msg.add(0); // Remove Price msg.addByte(0); // Inactive? (Only true if equal to Boosted Boss) @@ -7050,4 +7051,4 @@ void ProtocolGame::sendBosstiaryEntryChanged(uint32_t bossid) { msg.addByte(0xE6); msg.add(bossid); writeToOutputBuffer(msg); -} \ No newline at end of file +}