diff --git a/init.lua b/init.lua index ea0af49..c24bc29 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,6 @@ -- CONFIG APP_NAME = "otclientv8" -- important, change it, it's name for config dir and files in appdata -APP_VERSION = 1337 -- client version for updater and login to identify outdated client +APP_VERSION = 1340 -- client version for updater and login to identify outdated client DEFAULT_LAYOUT = "retro" -- on android it's forced to "mobile", check code bellow -- If you don't use updater or other service, set it to updater = "" diff --git a/modules/client_entergame/entergame.lua b/modules/client_entergame/entergame.lua index 4c3d98f..d3eb180 100644 --- a/modules/client_entergame/entergame.lua +++ b/modules/client_entergame/entergame.lua @@ -15,7 +15,7 @@ local serverSelector local clientVersionSelector local serverHostTextEdit local rememberPasswordBox -local protos = {"740", "760", "772", "792", "800", "810", "854", "860", "870", "961", "1000", "1077", "1090", "1096", "1098", "1099", "1100", "1200"} +local protos = {"740", "760", "772", "792", "800", "810", "854", "860", "870", "961", "1000", "1077", "1090", "1096", "1098", "1099", "1100", "1200", "1220"} local checkedByUpdater = {} @@ -149,8 +149,8 @@ local function onTibia12HTTPResult(session, playdata) for _, world in pairs(playdata["worlds"]) do worlds[world.id] = { name = world.name, - port = world.externalportunprotected or world.externalportprotected, - address = world.externaladdressunprotected or world.externaladdressprotected + port = world.externalportunprotected or world.externalportprotected or world.externaladdress, + address = world.externaladdressunprotected or world.externaladdressprotected or world.externalport } end @@ -414,8 +414,10 @@ function EnterGame.doLogin() G.host = server_params[1] .. ":" .. server_params[2] .. ":" .. server_params[3] G.clientVersion = tonumber(server_params[4]) elseif #server_params >= 3 then - G.host = server_params[1] .. ":" .. server_params[2] - G.clientVersion = tonumber(server_params[3]) + if tonumber(server_params[3]) == server_params[3] then + G.host = server_params[1] .. ":" .. server_params[2] + G.clientVersion = tonumber(server_params[3]) + end end return EnterGame.doLoginHttp() end diff --git a/modules/game_bot/default_configs/cavebot_1.2/cavebot/recorder.lua b/modules/game_bot/default_configs/cavebot_1.2/cavebot/recorder.lua index 1e67150..27206ba 100644 --- a/modules/game_bot/default_configs/cavebot_1.2/cavebot/recorder.lua +++ b/modules/game_bot/default_configs/cavebot_1.2/cavebot/recorder.lua @@ -38,7 +38,7 @@ local function setup() local targetPos = target:getPosition() if targetPos.x == 0xFFFF then return end lastPos = pos - CaveBot.addAction("usewith", itemId .. "," .. pos.x .. "," .. pos.y .. "," .. pos.z, true) + CaveBot.addAction("usewith", itemId .. "," .. targetPos.x .. "," .. targetPos.y .. "," .. targetPos.z, true) end) end diff --git a/modules/game_imbuing/imbuing.lua b/modules/game_imbuing/imbuing.lua index d7f2e1a..a4704c6 100644 --- a/modules/game_imbuing/imbuing.lua +++ b/modules/game_imbuing/imbuing.lua @@ -111,11 +111,13 @@ end function setProtection(value) protection = value if protection then + emptyImbue.cost:setText(selectedImbue["cost"] + selectedImbue["protectionCost"]) emptyImbue.successRate:setText("100%") emptyImbue.successRate:setColor("green") protectionBtn:setImageClip(torect("66 0 66 66")) else if selectedImbue then + emptyImbue.cost:setText(selectedImbue["cost"]) emptyImbue.successRate:setText(selectedImbue["successRate"] .. "%") if selectedImbue["successRate"] > 50 then emptyImbue.successRate:setColor("white") @@ -219,7 +221,13 @@ function selectSlot(widget, slotId, activeSlot) emptyImbue.imbue.onClick = function() imbuingWindow:hide() - clearConfirmWindow = displayGeneralBox(tr('Confirm Imbuing Attempt'), tr('You are about to imbue your item with "' .. selectedImbue["name"] .. '".\nYour chance to succeed is ' .. selectedImbue["successRate"] .. '. It will consume the required astral sources and '.. selectedImbue["cost"]..' gold coins.\nDo you wish to proceed?'), { + local cost = selectedImbue["cost"] + local successRate = selectedImbue["successRate"] + if protection then + cost = cost + selectedImbue["protectionCost"] + successRate = "100" + end + clearConfirmWindow = displayGeneralBox(tr('Confirm Imbuing Attempt'), 'You are about to imbue your item with "' .. selectedImbue["name"] .. '".\nYour chance to succeed is ' .. successRate .. '%. It will consume the required astral sources and '.. cost ..' gold coins.\nDo you wish to proceed?', { { text=tr('Yes'), callback=yesCallback }, { text=tr('No'), callback=noCallback }, anchor=AnchorHorizontalCenter}, yesCallback, noCallback) diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 5c3e1a0..433e474 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -106,7 +106,7 @@ function setupSelector(widget, id, outfit, list) widget.label:setText(list[pos][2]) updateOutfit() end - return w + return widget end function create(currentOutfit, outfitList, mountList, wingList, auraList, shaderList) @@ -219,10 +219,12 @@ end function accept() local outfit = outfitWindow.type.creature:getOutfit() for i, child in pairs(outfitWindow.extensions:getChildren()) do - if child:getId() == "shader" then - outfit[child:getId()] = child.creature:getOutfit().shader - else - outfit[child:getId()] = child.creature:getOutfit().type + if child.creature:getCreature() then + if child:getId() == "shader" then + outfit[child:getId()] = child.creature:getOutfit().shader + else + outfit[child:getId()] = child.creature:getOutfit().type + end end end g_game.changeOutfit(outfit) diff --git a/modules/game_outfit/outfitwindow.otui b/modules/game_outfit/outfitwindow.otui index 09d8a18..9834e23 100644 --- a/modules/game_outfit/outfitwindow.otui +++ b/modules/game_outfit/outfitwindow.otui @@ -157,13 +157,6 @@ MainWindow fit-children: true spacing: 3 - HorizontalSeparator - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: next.top - margin-bottom: 5 - margin-top: 5 - Button id: outfitOkButton !text: tr('Ok') diff --git a/modules/game_shaders/shaders.lua b/modules/game_shaders/shaders.lua index eca5202..39c0cf3 100644 --- a/modules/game_shaders/shaders.lua +++ b/modules/game_shaders/shaders.lua @@ -2,7 +2,7 @@ function init() -- add manually your shaders from /data/shaders g_shaders.createOutfitShader("default", "/shaders/outfit_default_vertex", "/shaders/outfit_default_fragment") ---[[ g_shaders.createOutfitShader("stars", "/shaders/outfit_stars_vertex", "/shaders/outfit_stars_fragment") + g_shaders.createOutfitShader("stars", "/shaders/outfit_stars_vertex", "/shaders/outfit_stars_fragment") g_shaders.addTexture("stars", "/shaders/stars.png") g_shaders.createOutfitShader("gold", "/shaders/outfit_gold_vertex", "/shaders/outfit_gold_fragment") @@ -13,7 +13,7 @@ function init() g_shaders.createOutfitShader("line", "/shaders/outfit_line_vertex", "/shaders/outfit_line_fragment") - g_shaders.createOutfitShader("outline", "/shaders/outfit_outline_vertex", "/shaders/outfit_outline_fragment") ]]-- + g_shaders.createOutfitShader("outline", "/shaders/outfit_outline_vertex", "/shaders/outfit_outline_fragment") end function terminate() diff --git a/modules/game_shop/shop.lua b/modules/game_shop/shop.lua index 8a9fb3d..7b47f8b 100644 --- a/modules/game_shop/shop.lua +++ b/modules/game_shop/shop.lua @@ -366,7 +366,7 @@ function processAd(data) if data['image'] and data['image']:sub(1, 4):lower() == "http" then HTTP.downloadImage(data['image'], function(path, err) - if err then g_logger.warning("HTTP error: " .. err) return end + if err then g_logger.warning("HTTP error: " .. err .. " - " .. data['image']) return end shop.adPanel:setHeight(shop.infoPanel:getHeight()) shop.adPanel.ad:setText("") shop.adPanel.ad:setImageSource(path) @@ -407,7 +407,7 @@ function addCategory(data) category = g_ui.createWidget('ShopCategoryImage', shop.categories) if data["image"] and data["image"]:sub(1, 4):lower() == "http" then HTTP.downloadImage(data['image'], function(path, err) - if err then g_logger.warning("HTTP error: " .. err) return end + if err then g_logger.warning("HTTP error: " .. err .. " - " .. data["image"]) return end category.image:setImageSource(path) end) else @@ -456,7 +456,7 @@ function addOffer(category, data) offer = g_ui.createWidget('ShopOfferImage', shop.offers) if data["image"] and data["image"]:sub(1, 4):lower() == "http" then HTTP.downloadImage(data['image'], function(path, err) - if err then g_logger.warning("HTTP error: " .. err) return end + if err then g_logger.warning("HTTP error: " .. err .. " - " .. data['image']) return end if not offer.image then return end offer.image:setImageSource(path) end) diff --git a/otclient_dx.exe b/otclient_dx.exe index 9c417ce..0bc6453 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index f3e6a04..c04e04a 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/otclient_linux b/otclient_linux index 153a24f..8f28c52 100644 Binary files a/otclient_linux and b/otclient_linux differ diff --git a/otclientv8.apk b/otclientv8.apk index 1864cd8..871ec85 100644 Binary files a/otclientv8.apk and b/otclientv8.apk differ diff --git a/pdb/pdb.7z b/pdb/pdb.7z index 67e1cad..d3e913b 100644 Binary files a/pdb/pdb.7z and b/pdb/pdb.7z differ diff --git a/src/client/effect.cpp b/src/client/effect.cpp index e4d667f..b650e90 100644 --- a/src/client/effect.cpp +++ b/src/client/effect.cpp @@ -32,7 +32,7 @@ void Effect::draw(const Point& dest, int offsetX, int offsetY, bool animate, Lig return; if(animate) { - if(g_game.getFeature(Otc::GameEnhancedAnimations)) { + if(g_game.getFeature(Otc::GameEnhancedAnimations) && rawGetThingType()->getAnimator()) { // This requires a separate getPhaseAt method as using getPhase would make all magic effects use the same phase regardless of their appearance time m_animationPhase = rawGetThingType()->getAnimator()->getPhaseAt(m_animationTimer, m_animationPhase); } else { @@ -46,11 +46,11 @@ void Effect::draw(const Point& dest, int offsetX, int offsetY, bool animate, Lig } } - int xPattern = offsetX % getNumPatternX(); + int xPattern = m_position.x % getNumPatternX(); if(xPattern < 0) xPattern += getNumPatternX(); - int yPattern = offsetY % getNumPatternY(); + int yPattern = m_position.y % getNumPatternY(); if(yPattern < 0) yPattern += getNumPatternY(); diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 860f952..74d361a 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -420,7 +420,7 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg) case Proto::GameServerNews: parseGameNews(msg); break; - case Proto::GameServerSendBlessDialog: + case Proto::GameServerBlessDialog: parseBlessDialog(msg); break; case Proto::GameServerMessageDialog: @@ -468,7 +468,7 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg) case Proto::GameServerImbuementWindow: parseImbuementWindow(msg); break; - case Proto::GaneServerCloseImbuementWindow: + case Proto::GameServerCloseImbuementWindow: parseCloseImbuementWindow(msg); break; case Proto::GameServerCyclopediaNewDetails: @@ -633,8 +633,9 @@ void ProtocolGame::parseRestingAreaState(const InputMessagePtr& msg) void ProtocolGame::parseBlessings(const InputMessagePtr& msg) { uint16 blessings = msg->getU16(); - if (g_game.getFeature(Otc::GameTibia12Protocol)) + if (g_game.getFeature(Otc::GameTibia12Protocol)) { msg->getU8(); // blessStatus - 1 = Disabled | 2 = normal | 3 = green + } m_localPlayer->setBlessings(blessings); } @@ -716,7 +717,7 @@ void ProtocolGame::parseCompleteStorePurchase(const InputMessagePtr& msg) std::string message = msg->getString(); g_lua.callGlobalField("g_game", "onStorePurchase", message); - if (g_game.getFeature(Otc::GameTibia12Protocol) && g_game.getProtocolVersion() < 1220) { + if (g_game.getProtocolVersion() < 1220) { int coins = msg->getU32(); int transferableCoins = msg->getU32(); g_lua.callGlobalField("g_game", "onCoinBalance", coins, transferableCoins); @@ -813,7 +814,8 @@ void ProtocolGame::parseStoreOffers(const InputMessagePtr& msg) msg->getU16(); } if (g_game.getProtocolVersion() >= 1212) - msg->getU8(); + msg->getU8(); // has category? + msg->getString(); // filter msg->getU32(); // TimeAddedToStore msg->getU16(); // TimesBought @@ -2590,6 +2592,9 @@ void ProtocolGame::parseBlessDialog(const InputMessagePtr& msg) for (int i = 0; i < totalBless; i++) { msg->getU16(); // bless bit wise msg->getU8(); // player bless count + if (g_game.getClientVersion() >= 1220) { + msg->getU8(); // store? + } } // parse general info @@ -3102,7 +3107,7 @@ CreaturePtr ProtocolGame::getCreature(const InputMessagePtr& msg, int type) creatureType = Proto::CreatureTypeNpc; } - if (creatureType == Proto::CreatureTypeSummonOwn) + if (g_game.getFeature(Otc::GameTibia12Protocol) && creatureType == Proto::CreatureTypeSummonOwn) msg->getU32(); // master std::string name = g_game.formatCreatureName(msg->getString()); @@ -3159,6 +3164,8 @@ CreaturePtr ProtocolGame::getCreature(const InputMessagePtr& msg, int type) creatureType = msg->getU8(); if (creatureType == Proto::CreatureTypeSummonOwn) msg->getU32(); // master + if (g_game.getClientVersion() >= 1220 && creatureType == Proto::CreatureTypePlayer) + msg->getU8(); // vocation id } if(g_game.getFeature(Otc::GameCreatureIcons)) { diff --git a/src/client/protocolgamesend.cpp b/src/client/protocolgamesend.cpp index 2690613..c01fd11 100644 --- a/src/client/protocolgamesend.cpp +++ b/src/client/protocolgamesend.cpp @@ -802,6 +802,11 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit) { OutputMessagePtr msg(new OutputMessage); msg->addU8(Proto::ClientChangeOutfit); + + if (g_game.getFeature(Otc::GameTibia12Protocol) && g_game.getClientVersion() >= 1220) { + msg->addU8(0); // outfit type + } + if(g_game.getFeature(Otc::GameLooktypeU16)) msg->addU16(outfit.getId()); else