diff --git a/data-otxserver/lib/core/storages.lua b/data-otxserver/lib/core/storages.lua index 6ce299674..fce8059f7 100644 --- a/data-otxserver/lib/core/storages.lua +++ b/data-otxserver/lib/core/storages.lua @@ -1570,6 +1570,8 @@ Storage = { WarriorSkeleton = 52146, DragonCounter = 52147, }, + QuestLine = 52148, + TheLostBrother = 52149, }, DreamersChallenge = { -- Reserved storage from 52160 - 52199 @@ -2534,7 +2536,6 @@ Storage = { NightmareTeddy = {}, PoacherCavesMiniWorldChange = {}, TheGreatDragonHunt = {}, - TheLostBrother = {}, TheTaintedSouls = {}, }, U10_90 = { -- update 10.90 - Reserved Storages 45201 - 45350 diff --git a/data-otxserver/scripts/creaturescripts/others/login.lua b/data-otxserver/scripts/creaturescripts/others/login.lua index 3af77c869..f31d58e1d 100644 --- a/data-otxserver/scripts/creaturescripts/others/login.lua +++ b/data-otxserver/scripts/creaturescripts/others/login.lua @@ -1,6 +1,23 @@ local playerLogin = CreatureEvent("PlayerLogin") function playerLogin.onLogin(player) + -- Premium Ends, change addon (citizen) houseless + if not player:isPremium() then + player:sendTextMessage(MESSAGE_FAILURE, "Your premium time has expired.") + + if sex == 1 then + player:setOutfit({ lookType = 128, lookFeet = 114, lookLegs = 134, lookHead = 114, lookAddons = 0 }) + elseif sex == 0 then + player:setOutfit({ lookType = 136, lookFeet = 114, lookLegs = 134, lookHead = 114, lookAddons = 0 }) + end + + if home and not player:isPremium() then + setHouseOwner(home, 0) + player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, "You've lost your house because you are not premium anymore.") + player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, "Your items from house are send to your inbox.") + end + end + -- Open channels if table.contains({ TOWNS_LIST.DAWNPORT, TOWNS_LIST.DAWNPORT_TUTORIAL }, player:getTown():getId()) then player:openChannel(3) -- World chat diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index aeeed9842..a9f4cd8d8 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -140,8 +140,8 @@ local function useStaminaXpBoost(player) return false end - local staminaMinutes = player:getExpBoostStamina() / 60 - if staminaMinutes == 0 then + local xpBoostMinutes = player:getXpBoostTime() / 60 + if xpBoostMinutes == 0 then return end @@ -156,18 +156,26 @@ local function useStaminaXpBoost(player) return end + local xpBoostLeftMinutesByDailyReward = player:kv():get("daily-reward-xp-boost") or 0 if timePassed > 60 then - if staminaMinutes > 2 then - staminaMinutes = staminaMinutes - 2 + if xpBoostMinutes > 2 then + xpBoostMinutes = xpBoostMinutes - 2 + if xpBoostLeftMinutesByDailyReward > 2 then + player:kv():set("daily-reward-xp-boost", xpBoostLeftMinutesByDailyReward - 2) + end else - staminaMinutes = 0 + xpBoostMinutes = 0 + player:kv():remove("daily-reward-xp-boost") end _G.NextUseXpStamina[playerId] = currentTime + 120 else - staminaMinutes = staminaMinutes - 1 + xpBoostMinutes = xpBoostMinutes - 1 + if xpBoostLeftMinutesByDailyReward > 0 then + player:kv():set("daily-reward-xp-boost", xpBoostLeftMinutesByDailyReward - 1) + end _G.NextUseXpStamina[playerId] = currentTime + 60 end - player:setExpBoostStamina(staminaMinutes * 60) + player:setXpBoostTime(xpBoostMinutes * 60) end local function useConcoctionTime(player) @@ -483,14 +491,14 @@ function Player:onGainExperience(target, exp, rawExp) self:addCondition(soulCondition) end - -- Store Bonus - useStaminaXpBoost(self) -- Use store boost stamina + -- XP Boost Bonus + useStaminaXpBoost(self) -- Use stamina XP boost (store or daily reward) - local Boost = self:getExpBoostStamina() - local stillHasBoost = Boost > 0 - local storeXpBoostAmount = stillHasBoost and self:getStoreXpBoost() or 0 + local xpBoostTimeLeft = self:getXpBoostTime() + local stillHasXpBoost = xpBoostTimeLeft > 0 + local xpBoostPercent = stillHasXpBoost and self:getXpBoostPercent() or 0 - self:setStoreXpBoost(storeXpBoostAmount) + self:setXpBoostPercent(xpBoostPercent) -- Stamina Bonus local staminaBonusXp = 1 @@ -528,7 +536,7 @@ function Player:onGainExperience(target, exp, rawExp) local lowLevelBonuxExp = self:getFinalLowLevelBonus() local baseRate = self:getFinalBaseRateExperience() - return (exp + (exp * (storeXpBoostAmount / 100) + (exp * (lowLevelBonuxExp / 100)))) * staminaBonusXp * baseRate + return (exp + (exp * (xpBoostPercent / 100) + (exp * (lowLevelBonuxExp / 100)))) * staminaBonusXp * baseRate end function Player:onLoseExperience(exp) diff --git a/data/libs/functions/functions.lua b/data/libs/functions/functions.lua index f2354b897..4466f118e 100644 --- a/data/libs/functions/functions.lua +++ b/data/libs/functions/functions.lua @@ -67,17 +67,28 @@ end function getTimeInWords(secsParam) local secs = tonumber(secsParam) + local days = math.floor(secs / (24 * 3600)) + secs = secs - (days * 24 * 3600) local hours, minutes, seconds = getHours(secs), getMinutes(secs), getSeconds(secs) local timeStr = "" + if days > 0 then + timeStr = days .. (days > 1 and " days" or " day") + end + if hours > 0 then - timeStr = hours .. (hours > 1 and " hours" or " hour") + if timeStr ~= "" then + timeStr = timeStr .. ", " + end + + timeStr = timeStr .. hours .. (hours > 1 and " hours" or " hour") end if minutes > 0 then if timeStr ~= "" then timeStr = timeStr .. ", " end + timeStr = timeStr .. minutes .. (minutes > 1 and " minutes" or " minute") end @@ -85,9 +96,9 @@ function getTimeInWords(secsParam) if timeStr ~= "" then timeStr = timeStr .. " and " end + timeStr = timeStr .. seconds .. (seconds > 1 and " seconds" or " second") end - return timeStr end diff --git a/data/modules/scripts/daily_reward/daily_reward.lua b/data/modules/scripts/daily_reward/daily_reward.lua index 1f0e80570..09b927ced 100644 --- a/data/modules/scripts/daily_reward/daily_reward.lua +++ b/data/modules/scripts/daily_reward/daily_reward.lua @@ -476,8 +476,15 @@ function Player.selectDailyReward(self, msg) end dailyRewardMessage = "Picked items: " .. description elseif dailyTable.type == DAILY_REWARD_TYPE_XP_BOOST then - self:setExpBoostStamina(self:getExpBoostStamina() + (rewardCount * 60)) - self:setStoreXpBoost(50) + local rewardCountReviewed = rewardCount + local xpBoostLeftMinutes = self:kv():get("daily-reward-xp-boost") or 0 + if xpBoostLeftMinutes > 0 then + rewardCountReviewed = rewardCountReviewed - xpBoostLeftMinutes + end + + self:setXpBoostTime(self:getXpBoostTime() + (rewardCountReviewed * 60)) + self:kv():set("daily-reward-xp-boost", rewardCount) + self:setXpBoostPercent(50) dailyRewardMessage = "Picked reward: XP Bonus for " .. rewardCount .. " minutes." elseif dailyTable.type == DAILY_REWARD_TYPE_PREY_REROLL then self:addPreyCards(rewardCount) diff --git a/data/modules/scripts/gamestore/init.lua b/data/modules/scripts/gamestore/init.lua index e53bab813..ba7398d9d 100644 --- a/data/modules/scripts/gamestore/init.lua +++ b/data/modules/scripts/gamestore/init.lua @@ -479,7 +479,7 @@ function parseBuyStoreOffer(playerId, msg) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_SEXCHANGE then GameStore.processSexChangePurchase(player) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_EXPBOOST then - GameStore.processExpBoostPuchase(player) + GameStore.processExpBoostPurchase(player) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_HUNTINGSLOT then GameStore.processTaskHuntingThirdSlot(player) elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_PREYSLOT then @@ -732,7 +732,7 @@ function Player.canBuyOffer(self, offer) disabled = 1 disabledReason = "You can't buy XP Boost for today." end - if self:getExpBoostStamina() > 0 then + if self:getXpBoostTime() > 0 then disabled = 1 disabledReason = "You already have an active XP boost." end @@ -1742,12 +1742,12 @@ function GameStore.processSexChangePurchase(player) player:toggleSex() end -function GameStore.processExpBoostPuchase(player) - local currentExpBoostTime = player:getExpBoostStamina() +function GameStore.processExpBoostPurchase(player) + local currentXpBoostTime = player:getXpBoostTime() local expBoostCount = player:getStorageValue(GameStore.Storages.expBoostCount) - player:setStoreXpBoost(50) - player:setExpBoostStamina(currentExpBoostTime + 3600) + player:setXpBoostPercent(50) + player:setXpBoostTime(currentXpBoostTime + 3600) if expBoostCount == -1 or expBoostCount == 6 then expBoostCount = 1 diff --git a/data/scripts/actions/items/exercise_training_weapons.lua b/data/scripts/actions/items/exercise_training_weapons.lua index 4a72f19e5..3c62d7c11 100644 --- a/data/scripts/actions/items/exercise_training_weapons.lua +++ b/data/scripts/actions/items/exercise_training_weapons.lua @@ -133,7 +133,7 @@ end local exerciseTraining = Action() function exerciseTraining.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not target or not target:getId() then + if not target or type(target) == "table" or not target:getId() then return true end diff --git a/data/scripts/spells/house/kick.lua b/data/scripts/spells/house/kick.lua index b4b583c10..265ac48f7 100644 --- a/data/scripts/spells/house/kick.lua +++ b/data/scripts/spells/house/kick.lua @@ -4,6 +4,7 @@ function spell.onCastSpell(player, variant) local targetPlayer = Player(variant:getString()) or player local guest = targetPlayer:getTile():getHouse() local owner = player:getTile():getHouse() + -- Owner kick yourself from house if targetPlayer == player then player:getPosition():sendMagicEffect(CONST_ME_POFF) @@ -11,6 +12,13 @@ function spell.onCastSpell(player, variant) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end + + if not owner:canEditAccessList(GUEST_LIST, player) then + player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) + player:getPosition():sendMagicEffect(CONST_ME_POFF) + return false + end + if not owner or not guest or not guest:kickPlayer(player, targetPlayer) then player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) player:getPosition():sendMagicEffect(CONST_ME_POFF) diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 000000000..bfa88a7fa --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1,11 @@ +vcproj/ +tests/ +docs/ +docker/ + +sonar-project.properties +*.md +Jenkinsfile +.* +gdb_debug +client_assertions.txt diff --git a/docker/.env.dist b/docker/.env.dist new file mode 100644 index 000000000..b38fc9d92 --- /dev/null +++ b/docker/.env.dist @@ -0,0 +1,25 @@ +# Mariadb +MYSQL_DATABASE=otservbr-global +MYSQL_USER=otxserver +MYSQL_PASSWORD=otxserver +MYSQL_ROOT_PASSWORD=root + +# Login +LOGIN_HTTP_PORT=8080 +LOGIN_GRPC_PORT=9090 +MYSQL_HOST=database +MYSQL_PORT=3306 +MYSQL_DBNAME=otservbr-global +MYSQL_USER=otxserver +MYSQL_PASS=otxserver +SERVER_NAME=OTServBR-Global +SERVER_IP=127.0.0.1 +SERVER_PORT=7172 +SERVER_LOCATION=BRA +RATE_LIMITER_RATE=2 +RATE_LIMITER_BURST=5 + +# Server +toggleDownloadMap=false +statusProtocolPort=7171 +gameProtocolPort=7172 diff --git a/docker/DOCKER.md b/docker/DOCKER.md new file mode 100644 index 000000000..b1b747395 --- /dev/null +++ b/docker/DOCKER.md @@ -0,0 +1,37 @@ +# Getting Started with docker + +## - Requirements +- Docker 19 and docker-compose 1.17 +- Execute the script root directory /docker/data/download-myaac.sh +- To use global ip change the login.py on world to use that ip and +also change in config.lua.dist +- Client pointing to http://:8080/login.php + +### Default Values (docker-compose.yml) +- Ports: 7171, 7172, 80(web), 3306, 8080(login) +- Database Server: database +- Database Name/User/Password: otserver + +### - Commands +To compile and start database, webserver and otserver just run +``` +$ docker-compose up -d +``` +Sometimes the server will not start due to database take too long to start +so you can restart it +``` +docker-compose restart otserver + +or + +docker-compose stop otserver +docker-compose start otserver +``` + +To compile your changes in otserver, just stop and start +``` +$ docker-compose up -d --build otserver +``` + +### - Observations +- The data folder persist db and webserver data; diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm new file mode 100644 index 000000000..c9ee9efa0 --- /dev/null +++ b/docker/Dockerfile.arm @@ -0,0 +1,55 @@ +# Stage 1: Download all dependencies +FROM ubuntu:23.04 AS dependencies + +RUN apt-get update && apt-get install -y --no-install-recommends cmake git \ + unzip build-essential ca-certificates curl zip unzip tar \ + pkg-config ninja-build autoconf automake libtool libluajit-5.1-dev libluajit-5.1-common \ + python3 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt +COPY vcpkg.json /opt +RUN vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') \ + && echo "vcpkg commit ID: $vcpkgCommitId" \ + && git clone https://github.com/Microsoft/vcpkg.git \ + && cd vcpkg \ + && git checkout $vcpkgCommitId \ + && ./bootstrap-vcpkg.sh + +WORKDIR /opt/vcpkg +COPY vcpkg.json /opt/vcpkg/ +RUN VCPKG_FORCE_SYSTEM_BINARIES=1 /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install + +# Stage 2: create build +FROM dependencies AS build + +COPY . /srv/ +WORKDIR /srv + +RUN export VCPKG_ROOT=/opt/vcpkg/ && VCPKG_FORCE_SYSTEM_BINARIES=1 cmake --preset linux-release && cmake --build --preset linux-release + +# Stage 3: load data and execute +FROM ubuntu:23.04 + +VOLUME [ "/data" ] + +COPY --from=build /srv/build/linux-release/bin/otxserver /bin/otxserver +COPY LICENSE *.sql key.pem /otxserver/ +COPY data /otxserver/data +COPY data-otxserver /otxserver/data-otxserver +COPY data-otservbr-global /otxserver/data-otservbr-global +COPY config.lua.dist /otxserver/config.lua + +WORKDIR /otxserver + +RUN apt-get update && apt-get install -y --no-install-recommends \ + mariadb-client libluajit-5.1-dev libluajit-5.1-common wget curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker/data/01-test_account.sql 01-test_account.sql +COPY docker/data/02-test_account_players.sql 02-test_account_players.sql +COPY docker/data/start.sh start.sh + +ENTRYPOINT ["/otxserver/start.sh"] diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev new file mode 100644 index 000000000..acbd6f52b --- /dev/null +++ b/docker/Dockerfile.dev @@ -0,0 +1,39 @@ +# Stage 1: Download all dependencies +FROM ubuntu:23.04 AS dependencies + +RUN --mount=type=cache,target=/var/cache/apt \ + apt-get update && apt-get install -y --no-install-recommends cmake git \ + unzip build-essential ca-certificates curl zip unzip tar \ + pkg-config ninja-build autoconf automake libtool \ + python3 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt +COPY vcpkg.json /opt +RUN vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') \ + && echo "vcpkg commit ID: $vcpkgCommitId" \ + && git clone https://github.com/Microsoft/vcpkg.git \ + && cd vcpkg \ + && git checkout "$vcpkgCommitId" \ + && ./bootstrap-vcpkg.sh + +WORKDIR /opt/vcpkg +COPY vcpkg.json /opt/vcpkg/ +RUN --mount=type=cache,target=/var/cache/vcpkg \ + /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install + +# Stage 2: create build +FROM dependencies AS build +WORKDIR /srv/build +COPY src ./src +COPY cmake ./cmake +COPY recompile.sh CMakeLists.txt CMakePresets.json vcpkg.json ./ +RUN ./recompile.sh "/opt" + +# Stage 3: execute +FROM ubuntu:23.04 AS prod +COPY --from=build /srv/build/build/linux-release/bin/otxserver /bin/otxserver +WORKDIR /srv/otxserver +ENTRYPOINT ["/srv/otxserver/start.sh", "otxserver"] + diff --git a/docker/Dockerfile.x86 b/docker/Dockerfile.x86 new file mode 100644 index 000000000..b0e0533af --- /dev/null +++ b/docker/Dockerfile.x86 @@ -0,0 +1,54 @@ +# Stage 1: Download all dependencies +FROM ubuntu:23.04 AS dependencies + +RUN apt-get update && apt-get install -y --no-install-recommends cmake git \ + unzip build-essential ca-certificates curl zip unzip tar \ + pkg-config ninja-build autoconf automake libtool \ + python3 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt +COPY vcpkg.json /opt +RUN vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') \ + && echo "vcpkg commit ID: $vcpkgCommitId" \ + && git clone https://github.com/Microsoft/vcpkg.git \ + && cd vcpkg \ + && git checkout $vcpkgCommitId \ + && ./bootstrap-vcpkg.sh + +WORKDIR /opt/vcpkg +COPY vcpkg.json /opt/vcpkg/ +RUN /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install + +# Stage 2: create build +FROM dependencies AS build + +COPY . /srv/ +WORKDIR /srv + +RUN export VCPKG_ROOT=/opt/vcpkg/ && cmake --preset linux-release && cmake --build --preset linux-release + +# Stage 3: load data and execute +FROM ubuntu:23.04 +VOLUME [ "/data" ] + +COPY --from=build /srv/build/linux-release/bin/otxserver /bin/otxserver +COPY LICENSE *.sql key.pem /otxserver/ +COPY data /otxserver/data +COPY data-otxserver /otxserver/data-otxserver +COPY data-otservbr-global /otxserver/data-otservbr-global +COPY config.lua.dist /otxserver/config.lua + +WORKDIR /otxserver + +RUN apt-get update && apt-get install -y --no-install-recommends \ + mariadb-client curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker/data/01-test_account.sql 01-test_account.sql +COPY docker/data/02-test_account_players.sql 02-test_account_players.sql +COPY docker/data/start.sh start.sh + +ENTRYPOINT ["/otxserver/start.sh"] diff --git a/docker/config.sh b/docker/config.sh new file mode 100644 index 000000000..18061f1b0 --- /dev/null +++ b/docker/config.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# ./config.sh +# ./config.sh maxPlayers 88 +# ./config.sh maxPlayers 88 serverName Teste maxItem 5 --file other_name.lua --env .env + +# Replace values in .lua file +substitute_lua_variable() { + variable_name="$1" + new_value="$2" + if [[ "$new_value" == "true" || "$new_value" == "false" ]]; then + sed "s|$variable_name =.*|$variable_name = $new_value|" "$lua_file" > "$lua_file.tmp" + elif [[ $( echo "$new_value" | grep -E "^[0-9]+$") ]]; then + sed "s|$variable_name =.*|$variable_name = $new_value|" "$lua_file" > "$lua_file.tmp" + else + sed "s|$variable_name =.*|$variable_name = \"$new_value\"|" "$lua_file" > "$lua_file.tmp" + fi + + mv "$lua_file.tmp" "$lua_file" 2>&1 +} + +# Get a named argument +get_named_arg() { + arg_name="$1" + shift + while [[ $# -gt 0 ]]; do + if [[ $1 == "$arg_name" && $# -gt 1 ]]; then + echo "$2" + return + fi + shift + done +} + +lua_file=$( get_named_arg "--file" "$@") +env_file=$( get_named_arg "--env" "$@") + +if [ -z "$lua_file" ]; then + lua_file="config.lua" +fi +if [ -z "$env_file" ]; then + env_file=".env" +fi + +verify_file() { + if [ ! -f "$1" ]; then + echo "$2 not found" + echo "path: $1" + exit 1 + fi +} + +verify_file "$env_file" "env" +verify_file "$lua_file" "lua" + +# Reads the env file +while IFS='=' read -r key value; do + if [[ "$key" != "#"* && "$key" != "" ]]; then + case $key in + MYSQL_HOST) + substitute_lua_variable "mysqlHost" "$value" + ;; + MYSQL_DBNAME) + substitute_lua_variable "mysqlDatabase" "$value" + ;; + MYSQL_USER) + substitute_lua_variable "mysqlUser" "$value" + ;; + MYSQL_PASS) + substitute_lua_variable "mysqlPass" "$value" + ;; + SERVER_NAME) + substitute_lua_variable "serverName" "$value" + ;; + SERVER_IP) + substitute_lua_variable "ip" "$value" + ;; + SERVER_PORT) + substitute_lua_variable "gameProtocolPort" "$value" + ;; + *) + substitute_lua_variable "$key" "$value" + ;; + esac + fi +done < "$env_file" + +# # Substitutes other variables provided as command line arguments +args=("$@") +for ((i=0; i<${#args[@]}; i+=2)); do + if [[ "${args[i]}" != "--file" ]]; then + variable_name="${args[i]}" + new_value="${args[i+1]}" + substitute_lua_variable "$variable_name" "$new_value" + fi +done diff --git a/docker/data/01-test_account.sql b/docker/data/01-test_account.sql new file mode 100644 index 000000000..1e02cdb6b --- /dev/null +++ b/docker/data/01-test_account.sql @@ -0,0 +1,22 @@ +-- +-- Accounts for test server +-- + +INSERT INTO `accounts` +(`id`, `name` , `email` , `password` , `type`, `coins`) VALUES +(100 , 'dawn' , '@dawn' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(101 , 'test1' , '@test1' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(102 , 'test2' , '@test2' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(103 , 'test3' , '@test3' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(104 , 'test4' , '@test4' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(105 , 'test5' , '@test5' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(106 , 'test6' , '@test6' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(107 , 'test7' , '@test7' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(108 , 'test8' , '@test8' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(109 , 'test9' , '@test9' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(110 , 'test10', '@test10' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(111 , 'test11', '@test11' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(112 , 'test12', '@test12' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(113 , 'test13', '@test13' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(114 , 'test14', '@test14' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000), +(115 , 'test15', '@test15' , 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1 , 10000); diff --git a/docker/data/02-test_account_players.sql b/docker/data/02-test_account_players.sql new file mode 100644 index 000000000..d51877dc6 --- /dev/null +++ b/docker/data/02-test_account_players.sql @@ -0,0 +1,184 @@ +-- +-- Account players for test server +-- + +INSERT INTO `players` +(`id`, `name` , `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `mana`, `manamax`, `town_id`, `conditions`, `cap`, `sex`) VALUES +(0 , 'Rook Noob 1' , 1 , 101 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 1' , 1 , 101 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 1' , 1 , 101 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 1' , 1 , 101 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 1' , 1 , 101 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 1' , 1 , 101 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 1' , 1 , 101 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 1' , 1 , 101 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 1' , 1 , 101 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 1' , 1 , 101 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 2' , 1 , 102 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 2' , 1 , 102 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 2' , 1 , 102 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 2' , 1 , 102 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 2' , 1 , 102 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 2' , 1 , 102 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 2' , 1 , 102 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 2' , 1 , 102 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 2' , 1 , 102 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 2' , 1 , 102 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 3' , 1 , 103 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 3' , 1 , 103 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 3' , 1 , 103 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 3' , 1 , 103 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 3' , 1 , 103 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 3' , 1 , 103 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 3' , 1 , 103 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 3' , 1 , 103 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 3' , 1 , 103 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 3' , 1 , 103 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 4' , 1 , 104 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 4' , 1 , 104 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 4' , 1 , 104 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 4' , 1 , 104 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 4' , 1 , 104 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 4' , 1 , 104 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 4' , 1 , 104 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 4' , 1 , 104 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 4' , 1 , 104 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 4' , 1 , 104 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 5' , 1 , 105 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 5' , 1 , 105 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 5' , 1 , 105 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 5' , 1 , 105 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 5' , 1 , 105 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 5' , 1 , 105 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 5' , 1 , 105 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 5' , 1 , 105 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 5' , 1 , 105 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 5' , 1 , 105 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 6' , 1 , 106 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 6' , 1 , 106 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 6' , 1 , 106 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 6' , 1 , 106 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 6' , 1 , 106 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 6' , 1 , 106 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 6' , 1 , 106 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 6' , 1 , 106 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 6' , 1 , 106 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 6' , 1 , 106 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 7' , 1 , 107 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 7' , 1 , 107 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 7' , 1 , 107 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 7' , 1 , 107 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 7' , 1 , 107 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 7' , 1 , 107 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 7' , 1 , 107 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 7' , 1 , 107 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 7' , 1 , 107 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 7' , 1 , 107 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 8' , 1 , 108 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 8' , 1 , 108 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 8' , 1 , 108 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 8' , 1 , 108 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 8' , 1 , 108 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 8' , 1 , 108 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 8' , 1 , 108 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 8' , 1 , 108 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 8' , 1 , 108 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 8' , 1 , 108 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 9' , 1 , 109 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 9' , 1 , 109 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 9' , 1 , 109 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 9' , 1 , 109 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 9' , 1 , 109 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 9' , 1 , 109 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 9' , 1 , 109 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 9' , 1 , 109 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 9' , 1 , 109 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 9' , 1 , 109 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 10' , 1 , 110 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 10', 1 , 110 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 10' , 1 , 110 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 10' , 1 , 110 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 10' , 1 , 110 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 10' , 1 , 110 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 10' , 1 , 110 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 10' , 1 , 110 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 10' , 1 , 110 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 10' , 1 , 110 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 11' , 1 , 111 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 11', 1 , 111 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 11' , 1 , 111 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 11' , 1 , 111 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 11' , 1 , 111 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 11' , 1 , 111 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 11' , 1 , 111 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 11' , 1 , 111 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 11' , 1 , 111 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 11' , 1 , 111 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 12' , 1 , 112 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 12', 1 , 112 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 12' , 1 , 112 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 12' , 1 , 112 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 12' , 1 , 112 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 12' , 1 , 112 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 12' , 1 , 112 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 12' , 1 , 112 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 12' , 1 , 112 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 12' , 1 , 112 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 13' , 1 , 113 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 13', 1 , 113 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 13' , 1 , 113 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 13' , 1 , 113 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 13' , 1 , 113 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 13' , 1 , 113 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 13' , 1 , 113 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 13' , 1 , 113 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 13' , 1 , 113 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 13' , 1 , 113 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 14' , 1 , 114 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 14', 1 , 114 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 14' , 1 , 114 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 14' , 1 , 114 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 14' , 1 , 114 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 14' , 1 , 114 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 14' , 1 , 114 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 14' , 1 , 114 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 14' , 1 , 114 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'Knight 14' , 1 , 114 , 500 , 4 , 7565 , 7565 , 2058474 , 106 , 95 , 78 , 116 , 128 , 2500 , 2500 , 8 , '' , 12770, 1), +(0 , 'Rook Noob 15' , 1 , 115 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer Noob 15', 1 , 115 , 8 , 1 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Druid Noob 15' , 1 , 115 , 8 , 2 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Paladin Noob 15' , 1 , 115 , 8 , 3 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Knight Noob 15' , 1 , 115 , 8 , 4 , 185 , 185 , 4200 , 106 , 95 , 78 , 116 , 128 , 40 , 40 , 8 , '' , 470 , 1), +(0 , 'Rook 15' , 1 , 115 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 1 , '' , 400 , 0), +(0 , 'Sorcerer 15' , 1 , 115 , 500 , 1 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Druid 15' , 1 , 115 , 500 , 2 , 2645 , 2645 , 2058474 , 106 , 95 , 78 , 116 , 128 , 14800 , 14800 , 8 , '' , 5390 , 1), +(0 , 'Paladin 15' , 1 , 115 , 500 , 3 , 5105 , 5105 , 2058474 , 106 , 95 , 78 , 116 , 128 , 7420 , 7420 , 8 , '' , 10310, 1), +(0 , 'ADM1' , 6 , 115 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM2' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM3' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM4' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM5' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM6' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM7' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM8' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'ADM9' , 6 , 1 , 1 , 0 , 150 , 150 , 0 , 106 , 95 , 78 , 116 , 128 , 5 , 5 , 8 , '' , 400 , 1), +(0 , 'Dawn1' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn2' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn3' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn4' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn5' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn6' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn7' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn8' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn9' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn10' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn11' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn12' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn13' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn14' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn15' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn16' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn17' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn18' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn19' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0), +(0 , 'Dawn20' , 1 , 100 , 2 , 0 , 155 , 155 , 0 , 106 , 95 , 78 , 116 , 128 , 60 , 60 , 1 , '' , 410 , 0); diff --git a/docker/data/start.sh b/docker/data/start.sh new file mode 100644 index 000000000..b18d36ad3 --- /dev/null +++ b/docker/data/start.sh @@ -0,0 +1,173 @@ +#!/bin/bash -e + +OT_DB_HOST="${OT_DB_HOST:-127.0.0.1}" +OT_DB_PORT="${OT_DB_PORT:-3306}" +OT_DB_USER="${OT_DB_USER:-otxserver}" +OT_DB_PASSWORD="${OT_DB_PASSWORD:-otxserver}" +OT_DB_DATABASE="${OT_DB_DATABASE:-otxserver}" +OT_SERVER_IP="${OT_SERVER_IP:-127.0.0.1}" +OT_SERVER_LOGIN_PORT="${OT_SERVER_LOGIN_PORT:-7171}" +OT_SERVER_GAME_PORT="${OT_SERVER_GAME_PORT:-7172}" +OT_SERVER_STATUS_PORT="${OT_SERVER_STATUS_PORT:-7171}" +OT_SERVER_TEST_ACCOUNTS="${OT_SERVER_TEST_ACCOUNTS:-false}" +OT_SERVER_DATA="${OT_SERVER_DATA:-data-otxserver}" +OT_SERVER_MAP="${OT_SERVER_MAP:-https://github.com/opentibiabr/otservbr-global/releases/download/v1.5.0/otservbr.otbm}" + +echo "" +echo "===== Print Variables =====" +echo "" + +echo "OT_DB_HOST:[$OT_DB_HOST]" +echo "OT_DB_PORT:[$OT_DB_PORT]" +echo "OT_DB_USER:[$OT_DB_USER]" +echo "OT_DB_PASSWORD:[$OT_DB_PASSWORD]" +echo "OT_DB_DATABASE:[$OT_DB_DATABASE]" +echo "OT_SERVER_IP:[$OT_SERVER_IP]" +echo "OT_SERVER_LOGIN_PORT:[$OT_SERVER_LOGIN_PORT]" +echo "OT_SERVER_GAME_PORT:[$OT_SERVER_GAME_PORT]" +echo "OT_SERVER_STATUS_PORT:[$OT_SERVER_STATUS_PORT]" +echo "OT_SERVER_TEST_ACCOUNTS:[$OT_SERVER_TEST_ACCOUNTS]" +echo "OT_SERVER_DATA:[$OT_SERVER_DATA]" +echo "OT_SERVER_MAP:[$OT_SERVER_MAP]" + +echo "" +echo "================================" +echo "" + +echo "" +echo "===== OTBR Global Data Pack =====" +echo "" + +if [ "$OT_SERVER_DATA" = "data-otservbr-global" ] && [ ! -f data-otservbr-global/world/otservbr.otbm ]; then + echo "YES" + + echo "Downloading OTBR Map..." + wget --no-check-certificate "$OT_SERVER_MAP" -O data-otservbr-global/world/otservbr.otbm + + echo "Done" + +else + echo "Not Using OTBR Data pack" +fi + +echo "" +echo "================================" +echo "" + +echo "" +echo "===== Wait For The DB To Be Up =====" +echo "" + +until mysql -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" --port="$OT_DB_PORT" -e "SHOW DATABASES;"; do + echo "DB offline, trying again" + sleep 5s +done + +echo "" +echo "================================" +echo "" + +echo "" +echo "===== Check If DB Already Exists =====" +echo "" +if mysql -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" --port="$OT_DB_PORT" -e "use $OT_DB_DATABASE"; then + echo "Creating Database Backup" + echo "Saving database to all_databases.sql" + mysqldump -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" --port="$OT_DB_PORT" --all-databases >/data/all_databases.sql +else + echo "Creating Database" + mysql -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" --port="$OT_DB_PORT" -e "CREATE DATABASE $OT_DB_DATABASE;" + mysql -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" --port="$OT_DB_PORT" -e "SHOW DATABASES;" +fi +echo "" +echo "================================" +echo "" + +echo "" +echo "===== Check If We Need To Import Schema.sql =====" +echo "" + +if [[ $(mysql -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" -e 'SHOW TABLES LIKE "server_config"' -D "$OT_DB_DATABASE") ]]; then + echo "Table server_config exists so we don't need to import" +else + echo "Import otxserver-Server Schema" + mysql -u "$OT_DB_USER" -p"$OT_DB_PASSWORD" -h "$OT_DB_HOST" --port="$OT_DB_PORT" -D "$OT_DB_DATABASE" lastHitCreature, std::shared auto monster = getMonster(); if (monster && !monster->isRewardBoss()) { std::ostringstream lootMessage; - lootMessage << "Loot of " << getNameDescription() << ": " << corpseContainer->getContentDescription(player->getProtocolVersion() < 1200) << "."; + auto collorMessage = player->getProtocolVersion() < 1200 || player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX; + lootMessage << "Loot of " << getNameDescription() << ": " << corpseContainer->getContentDescription(collorMessage) << "."; auto suffix = corpseContainer->getAttribute(ItemAttribute_t::LOOTMESSAGE_SUFFIX); if (!suffix.empty()) { lootMessage << suffix; diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 516ed7b5c..149f41380 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1925,7 +1925,6 @@ void Player::onWalk(Direction &dir) { Creature::onWalk(dir); setNextActionTask(nullptr); - setNextAction(OTSYS_TIME() + getStepDuration(dir)); g_callbacks().executeCallback(EventCallback_t::playerOnWalk, &EventCallback::playerOnWalk, getPlayer(), dir); } @@ -5372,6 +5371,7 @@ uint16_t Player::getSkillLevel(skills_t skill) const { } else if (skill == SKILL_MANA_LEECH_AMOUNT) { skillLevel += m_wheelPlayer->getStat(WheelStat_t::MANA_LEECH); } else if (skill == SKILL_CRITICAL_HIT_DAMAGE) { + skillLevel += m_wheelPlayer->getStat(WheelStat_t::CRITICAL_DAMAGE); skillLevel += m_wheelPlayer->getMajorStatConditional("Combat Mastery", WheelMajor_t::CRITICAL_DMG_2); skillLevel += m_wheelPlayer->getMajorStatConditional("Ballistic Mastery", WheelMajor_t::CRITICAL_DMG); skillLevel += m_wheelPlayer->checkAvatarSkill(WheelAvatarSkill_t::CRITICAL_DAMAGE); diff --git a/src/creatures/players/player.hpp b/src/creatures/players/player.hpp index 70c8c05ae..c2a9f2983 100644 --- a/src/creatures/players/player.hpp +++ b/src/creatures/players/player.hpp @@ -1807,11 +1807,11 @@ class Player final : public Creature, public Cylinder, public Bankable { void setGrindingXpBoost(uint16_t value) { grindingXpBoost = std::min(std::numeric_limits::max(), value); } - uint16_t getStoreXpBoost() const { - return storeXpBoost; + uint16_t getXpBoostPercent() const { + return xpBoostPercent; } - void setStoreXpBoost(uint16_t exp) { - storeXpBoost = exp; + void setXpBoostPercent(uint16_t percent) { + xpBoostPercent = percent; } uint16_t getStaminaXpBoost() const { return staminaXpBoost; @@ -1820,17 +1820,17 @@ class Player final : public Creature, public Cylinder, public Bankable { staminaXpBoost = std::min(std::numeric_limits::max(), value); } - void setExpBoostStamina(uint16_t stamina) { - // only allow stamina boosts of 12 hours or less - if (stamina > 12 * 3600) { - expBoostStamina = 12 * 3600; + void setXpBoostTime(uint16_t timeLeft) { + // only allow time boosts of 12 hours or less + if (timeLeft > 12 * 3600) { + xpBoostTime = 12 * 3600; return; } - expBoostStamina = stamina; + xpBoostTime = timeLeft; } - uint16_t getExpBoostStamina() { - return expBoostStamina; + uint16_t getXpBoostTime() { + return xpBoostTime; } int32_t getIdleTime() const { @@ -2811,7 +2811,7 @@ class Player final : public Creature, public Cylinder, public Bankable { int32_t m_deathTime = 0; uint32_t coinBalance = 0; uint32_t coinTransferableBalance = 0; - uint16_t expBoostStamina = 0; + uint16_t xpBoostTime = 0; uint8_t randomMount = 0; uint16_t lastStatsTrainingTime = 0; @@ -2821,7 +2821,7 @@ class Player final : public Creature, public Cylinder, public Bankable { uint16_t baseXpGain = 100; uint16_t voucherXpBoost = 0; uint16_t grindingXpBoost = 0; - uint16_t storeXpBoost = 0; + uint16_t xpBoostPercent = 0; uint16_t staminaXpBoost = 100; int16_t lastDepotId = -1; StashItemList stashItems; // [ItemID] = amount diff --git a/src/game/game.cpp b/src/game/game.cpp index 4e83325b6..b1d76f9f7 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -3199,7 +3199,13 @@ void Game::playerEquipItem(uint32_t playerId, uint16_t itemId, bool hasTier /* = } else { const int32_t &slotPosition = equipItem->getSlotPosition(); // Checks if a two-handed item is being equipped in the left slot when the right slot is already occupied and move to backpack - if (slotPosition & SLOTP_LEFT && rightItem && (slotPosition & SLOTP_TWO_HAND)) { + if ( + (slotPosition & SLOTP_LEFT) + && (slotPosition & SLOTP_TWO_HAND) + && rightItem + && !(it.weaponType == WEAPON_DISTANCE) + && !rightItem->isQuiver() + ) { ret = internalCollectManagedItems(player, rightItem, getObjectCategory(rightItem), false); } @@ -3744,6 +3750,19 @@ void Game::playerUseWithCreature(uint32_t playerId, const Position &fromPos, uin return; } } + + const std::shared_ptr monster = creature->getMonster(); + if (monster && monster->isFamiliar() && creature->getMaster()->getPlayer() == player && (it.isRune() || it.type == ITEM_TYPE_POTION)) { + player->setNextPotionAction(OTSYS_TIME() + g_configManager().getNumber(EX_ACTIONS_DELAY_INTERVAL, __FUNCTION__)); + + if (it.isMultiUse()) { + player->sendUseItemCooldown(g_configManager().getNumber(EX_ACTIONS_DELAY_INTERVAL, __FUNCTION__)); + } + + player->sendCancelMessage(RETURNVALUE_CANNOTUSETHISOBJECT); + return; + } + Position toPos = creature->getPosition(); Position walkToPos = fromPos; ReturnValue ret = g_actions().canUse(player, fromPos); diff --git a/src/io/functions/iologindata_load_player.cpp b/src/io/functions/iologindata_load_player.cpp index d4a4f3377..2c3cbf48f 100644 --- a/src/io/functions/iologindata_load_player.cpp +++ b/src/io/functions/iologindata_load_player.cpp @@ -177,8 +177,8 @@ bool IOLoginDataLoad::loadPlayerFirst(std::shared_ptr player, DBResult_p } player->staminaMinutes = result->getNumber("stamina"); - player->setStoreXpBoost(result->getNumber("xpboost_value")); - player->setExpBoostStamina(result->getNumber("xpboost_stamina")); + player->setXpBoostPercent(result->getNumber("xpboost_value")); + player->setXpBoostTime(result->getNumber("xpboost_stamina")); player->setManaShield(result->getNumber("manashield")); player->setMaxManaShield(result->getNumber("max_manashield")); diff --git a/src/io/functions/iologindata_save_player.cpp b/src/io/functions/iologindata_save_player.cpp index 7bc1b34c8..82ba286d6 100644 --- a/src/io/functions/iologindata_save_player.cpp +++ b/src/io/functions/iologindata_save_player.cpp @@ -292,8 +292,8 @@ bool IOLoginDataSave::savePlayerFirst(std::shared_ptr player) { query << "`skill_mana_leech_amount_tries` = " << player->skills[SKILL_MANA_LEECH_AMOUNT].tries << ","; query << "`manashield` = " << player->getManaShield() << ","; query << "`max_manashield` = " << player->getMaxManaShield() << ","; - query << "`xpboost_value` = " << player->getStoreXpBoost() << ","; - query << "`xpboost_stamina` = " << player->getExpBoostStamina() << ","; + query << "`xpboost_value` = " << player->getXpBoostPercent() << ","; + query << "`xpboost_stamina` = " << player->getXpBoostTime() << ","; query << "`quickloot_fallback` = " << (player->quickLootFallbackToMainContainer ? 1 : 0) << ","; if (!player->isOffline()) { diff --git a/src/items/containers/container.cpp b/src/items/containers/container.cpp index 7bd7dcef2..5d2ffd987 100644 --- a/src/items/containers/container.cpp +++ b/src/items/containers/container.cpp @@ -218,7 +218,7 @@ std::string Container::getContentDescription(bool oldProtocol) { return getContentDescription(os, oldProtocol).str(); } -std::ostringstream &Container::getContentDescription(std::ostringstream &os, bool oldProtocol) { +std::ostringstream &Container::getContentDescription(std::ostringstream &os, bool sendColoredMessage) { bool firstitem = true; for (ContainerIterator it = iterator(); it.hasNext(); it.advance()) { std::shared_ptr item = *it; @@ -234,10 +234,10 @@ std::ostringstream &Container::getContentDescription(std::ostringstream &os, boo os << ", "; } - if (oldProtocol) { - os << item->getNameDescription(); - } else { + if (sendColoredMessage) { os << "{" << item->getID() << "|" << item->getNameDescription() << "}"; + } else { + os << item->getNameDescription(); } } diff --git a/src/lua/functions/creatures/player/player_functions.cpp b/src/lua/functions/creatures/player/player_functions.cpp index 94da8f4ff..94100a1f4 100644 --- a/src/lua/functions/creatures/player/player_functions.cpp +++ b/src/lua/functions/creatures/player/player_functions.cpp @@ -3219,23 +3219,23 @@ int PlayerFunctions::luaPlayerSetGrindingXpBoost(lua_State* L) { return 1; } -int PlayerFunctions::luaPlayerGetStoreXpBoost(lua_State* L) { - // player:getStoreXpBoost() +int PlayerFunctions::luaPlayerGetXpBoostPercent(lua_State* L) { + // player:getXpBoostPercent() std::shared_ptr player = getUserdataShared(L, 1); if (player) { - lua_pushnumber(L, player->getStoreXpBoost()); + lua_pushnumber(L, player->getXpBoostPercent()); } else { lua_pushnil(L); } return 1; } -int PlayerFunctions::luaPlayerSetStoreXpBoost(lua_State* L) { - // player:setStoreXpBoost(value) +int PlayerFunctions::luaPlayerSetXpBoostPercent(lua_State* L) { + // player:setXpBoostPercent(value) std::shared_ptr player = getUserdataShared(L, 1); if (player) { - uint16_t experience = getNumber(L, 2); - player->setStoreXpBoost(experience); + uint16_t percent = getNumber(L, 2); + player->setXpBoostPercent(percent); pushBoolean(L, true); } else { lua_pushnil(L); @@ -3267,12 +3267,12 @@ int PlayerFunctions::luaPlayerSetStaminaXpBoost(lua_State* L) { return 1; } -int PlayerFunctions::luaPlayerSetExpBoostStamina(lua_State* L) { - // player:setExpBoostStamina(percent) +int PlayerFunctions::luaPlayerSetXpBoostTime(lua_State* L) { + // player:setXpBoostTime(timeLeft) std::shared_ptr player = getUserdataShared(L, 1); if (player) { - uint16_t stamina = getNumber(L, 2); - player->setExpBoostStamina(stamina); + uint16_t timeLeft = getNumber(L, 2); + player->setXpBoostTime(timeLeft); player->sendStats(); pushBoolean(L, true); } else { @@ -3281,11 +3281,11 @@ int PlayerFunctions::luaPlayerSetExpBoostStamina(lua_State* L) { return 1; } -int PlayerFunctions::luaPlayerGetExpBoostStamina(lua_State* L) { - // player:getExpBoostStamina() +int PlayerFunctions::luaPlayerGetXpBoostTime(lua_State* L) { + // player:getXpBoostTime() std::shared_ptr player = getUserdataShared(L, 1); if (player) { - lua_pushnumber(L, player->getExpBoostStamina()); + lua_pushnumber(L, player->getXpBoostTime()); } else { lua_pushnil(L); } diff --git a/src/lua/functions/creatures/player/player_functions.hpp b/src/lua/functions/creatures/player/player_functions.hpp index fafc99ff9..2be6e5076 100644 --- a/src/lua/functions/creatures/player/player_functions.hpp +++ b/src/lua/functions/creatures/player/player_functions.hpp @@ -273,12 +273,12 @@ class PlayerFunctions final : LuaScriptInterface { registerMethod(L, "Player", "setVoucherXpBoost", PlayerFunctions::luaPlayerSetVoucherXpBoost); registerMethod(L, "Player", "getGrindingXpBoost", PlayerFunctions::luaPlayerGetGrindingXpBoost); registerMethod(L, "Player", "setGrindingXpBoost", PlayerFunctions::luaPlayerSetGrindingXpBoost); - registerMethod(L, "Player", "getStoreXpBoost", PlayerFunctions::luaPlayerGetStoreXpBoost); - registerMethod(L, "Player", "setStoreXpBoost", PlayerFunctions::luaPlayerSetStoreXpBoost); + registerMethod(L, "Player", "getXpBoostPercent", PlayerFunctions::luaPlayerGetXpBoostPercent); + registerMethod(L, "Player", "setXpBoostPercent", PlayerFunctions::luaPlayerSetXpBoostPercent); registerMethod(L, "Player", "getStaminaXpBoost", PlayerFunctions::luaPlayerGetStaminaXpBoost); registerMethod(L, "Player", "setStaminaXpBoost", PlayerFunctions::luaPlayerSetStaminaXpBoost); - registerMethod(L, "Player", "getExpBoostStamina", PlayerFunctions::luaPlayerGetExpBoostStamina); - registerMethod(L, "Player", "setExpBoostStamina", PlayerFunctions::luaPlayerSetExpBoostStamina); + registerMethod(L, "Player", "getXpBoostTime", PlayerFunctions::luaPlayerGetXpBoostTime); + registerMethod(L, "Player", "setXpBoostTime", PlayerFunctions::luaPlayerSetXpBoostTime); registerMethod(L, "Player", "getIdleTime", PlayerFunctions::luaPlayerGetIdleTime); registerMethod(L, "Player", "getFreeBackpackSlots", PlayerFunctions::luaPlayerGetFreeBackpackSlots); @@ -627,12 +627,12 @@ class PlayerFunctions final : LuaScriptInterface { static int luaPlayerSetVoucherXpBoost(lua_State* L); static int luaPlayerGetGrindingXpBoost(lua_State* L); static int luaPlayerSetGrindingXpBoost(lua_State* L); - static int luaPlayerGetStoreXpBoost(lua_State* L); - static int luaPlayerSetStoreXpBoost(lua_State* L); + static int luaPlayerGetXpBoostPercent(lua_State* L); + static int luaPlayerSetXpBoostPercent(lua_State* L); static int luaPlayerGetStaminaXpBoost(lua_State* L); static int luaPlayerSetStaminaXpBoost(lua_State* L); - static int luaPlayerGetExpBoostStamina(lua_State* L); - static int luaPlayerSetExpBoostStamina(lua_State* L); + static int luaPlayerGetXpBoostTime(lua_State* L); + static int luaPlayerSetXpBoostTime(lua_State* L); static int luaPlayerGetIdleTime(lua_State* L); static int luaPlayerGetFreeBackpackSlots(lua_State* L); diff --git a/src/server/network/connection/connection.cpp b/src/server/network/connection/connection.cpp index cc27eb0e9..1c575ff00 100644 --- a/src/server/network/connection/connection.cpp +++ b/src/server/network/connection/connection.cpp @@ -399,9 +399,9 @@ void Connection::handleTimeout(ConnectionWeak_ptr connectionWeak, const std::err if (auto connection = connectionWeak.lock()) { if (!error) { - g_logger().warn("Connection Timeout, IP: {}", convertIPToString(connection->getIP())); + g_logger().debug("Connection Timeout, IP: {}", convertIPToString(connection->getIP())); } else { - g_logger().warn("Connection Timeout or error: {}, IP: {}", error.message(), convertIPToString(connection->getIP())); + g_logger().debug("Connection Timeout or error: {}, IP: {}", error.message(), convertIPToString(connection->getIP())); } connection->close(FORCE_CLOSE); } diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 22a5ae614..c822ff4af 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -3390,9 +3390,9 @@ void ProtocolGame::sendCyclopediaCharacterGeneralStats() { msg.addByte(player->getLevelPercent()); msg.add(player->getBaseXpGain()); // BaseXPGainRate msg.add(player->getGrindingXpBoost()); // LowLevelBonus - msg.add(player->getStoreXpBoost()); // XPBoost + msg.add(player->getXpBoostPercent()); // XPBoost msg.add(player->getStaminaXpBoost()); // StaminaMultiplier(100=x1.0) - msg.add(player->getExpBoostStamina()); // xpBoostRemainingTime + msg.add(player->getXpBoostTime()); // xpBoostRemainingTime msg.addByte(0x01); // canBuyXpBoost msg.add(std::min(player->getHealth(), std::numeric_limits::max())); msg.add(std::min(player->getMaxHealth(), std::numeric_limits::max())); @@ -3802,7 +3802,7 @@ void ProtocolGame::sendCyclopediaCharacterStoreSummary() { msg.addByte(CYCLOPEDIA_CHARACTERINFO_STORESUMMARY); msg.addByte(0x00); // Remaining Store Xp Boost Time - msg.add(player->getExpBoostStamina()); + msg.add(player->getXpBoostTime()); // RemainingDailyRewardXpBoostTime msg.add(0); msg.addByte(0x00); @@ -4088,11 +4088,11 @@ void ProtocolGame::sendTextMessage(const TextMessage &message) { break; } case MESSAGE_MARKET: { - internalType = MESSAGE_GAME_HIGHLIGHT; + internalType = MESSAGE_EVENT_ADVANCE; break; } case MESSAGE_MANA: { - internalType = MESSAGE_THANK_YOU; + internalType = MESSAGE_HEALED; break; } case MESSAGE_BEYOND_LAST: { @@ -4100,7 +4100,7 @@ void ProtocolGame::sendTextMessage(const TextMessage &message) { break; } case MESSAGE_ATTENTION: { - internalType = MESSAGE_DAMAGE_DEALT; + internalType = MESSAGE_EVENT_ADVANCE; break; } case MESSAGE_BOOSTED_CREATURE: { @@ -4143,11 +4143,9 @@ void ProtocolGame::sendTextMessage(const TextMessage &message) { } case MESSAGE_HEALED: case MESSAGE_HEALED_OTHERS: { - if (!oldProtocol) { - msg.addPosition(message.position); - msg.add(message.primary.value); - msg.addByte(message.primary.color); - } + msg.addPosition(message.position); + msg.add(message.primary.value); + msg.addByte(message.primary.color); break; } case MESSAGE_EXPERIENCE: @@ -6707,17 +6705,21 @@ void ProtocolGame::sendOutfitWindow() { msg.addByte(0x00); ++outfitSize; } else if (outfit->lookType == 1210 || outfit->lookType == 1211) { - msg.add(outfit->lookType); - msg.addString(outfit->name, "ProtocolGame::sendOutfitWindow - outfit->name"); - msg.addByte(3); - msg.addByte(0x02); - ++outfitSize; + if (player->canWear(1210, 0) || player->canWear(1211, 0)) { + msg.add(outfit->lookType); + msg.addString(outfit->name, "ProtocolGame::sendOutfitWindow - outfit->name"); + msg.addByte(3); + msg.addByte(0x02); + ++outfitSize; + } } else if (outfit->lookType == 1456 || outfit->lookType == 1457) { - msg.add(outfit->lookType); - msg.addString(outfit->name, "ProtocolGame::sendOutfitWindow - outfit->name"); - msg.addByte(3); - msg.addByte(0x03); - ++outfitSize; + if (player->canWear(1456, 0) || player->canWear(1457, 0)) { + msg.add(outfit->lookType); + msg.addString(outfit->name, "ProtocolGame::sendOutfitWindow - outfit->name"); + msg.addByte(3); + msg.addByte(0x03); + ++outfitSize; + } } else if (outfit->from == "store") { msg.add(outfit->lookType); msg.addString(outfit->name, "ProtocolGame::sendOutfitWindow - outfit->name"); @@ -7299,7 +7301,7 @@ void ProtocolGame::AddPlayerStats(NetworkMessage &msg) { } msg.add(player->getGrindingXpBoost()); // low level bonus - msg.add(player->getStoreXpBoost()); // xp boost + msg.add(player->getXpBoostPercent()); // xp boost msg.add(player->getStaminaXpBoost()); // stamina multiplier (100 = 1.0x) if (!oldProtocol) { @@ -7325,7 +7327,7 @@ void ProtocolGame::AddPlayerStats(NetworkMessage &msg) { msg.add(player->getOfflineTrainingTime() / 60 / 1000); - msg.add(player->getExpBoostStamina()); // xp boost time (seconds) + msg.add(player->getXpBoostTime()); // xp boost time (seconds) msg.addByte(1); // enables exp boost in the store if (!oldProtocol) { @@ -8768,7 +8770,7 @@ void ProtocolGame::parseSaveWheel(NetworkMessage &msg) { } void ProtocolGame::sendDisableLoginMusic() { - if (oldProtocol) { + if (oldProtocol || !player || player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX) { return; } diff --git a/src/server/network/protocol/protocolstatus.cpp b/src/server/network/protocol/protocolstatus.cpp index ff6827177..93f2e458a 100644 --- a/src/server/network/protocol/protocolstatus.cpp +++ b/src/server/network/protocol/protocolstatus.cpp @@ -19,7 +19,7 @@ #include "server/network/message/outputmessage.hpp" std::string ProtocolStatus::SERVER_NAME = "OTX Server"; -std::string ProtocolStatus::SERVER_VERSION = "6.2"; +std::string ProtocolStatus::SERVER_VERSION = "6"; std::string ProtocolStatus::SERVER_DEVELOPERS = "OpenTibiaBR Organization. Based on: Canary (3.1.2). And data edited by: Mattyx14"; std::map ProtocolStatus::ipConnectMap;