mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-04-30 03:09:20 +02:00
Version 2.5.2 - http://otclient.net/showthread.php?tid=255
This commit is contained in:
parent
760162d581
commit
a65844f182
@ -303,9 +303,9 @@ function CharacterList.create(characters, account, otui)
|
|||||||
status = tr(' (Suspended)')
|
status = tr(' (Suspended)')
|
||||||
end
|
end
|
||||||
|
|
||||||
if account.subStatus == SubscriptionStatus.Free then
|
if account.subStatus == SubscriptionStatus.Free and account.premDays < 1 then
|
||||||
accountStatusLabel:setText(('%s%s'):format(tr('Free Account'), status))
|
accountStatusLabel:setText(('%s%s'):format(tr('Free Account'), status))
|
||||||
elseif account.subStatus == SubscriptionStatus.Premium then
|
else
|
||||||
if account.premDays == 0 or account.premDays == 65535 then
|
if account.premDays == 0 or account.premDays == 65535 then
|
||||||
accountStatusLabel:setText(('%s%s'):format(tr('Gratis Premium Account'), status))
|
accountStatusLabel:setText(('%s%s'):format(tr('Gratis Premium Account'), status))
|
||||||
else
|
else
|
||||||
|
@ -166,6 +166,16 @@ local function onTibia12HTTPResult(session, playdata)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- proxies
|
||||||
|
if g_proxy then
|
||||||
|
g_proxy.clear()
|
||||||
|
if playdata["proxies"] then
|
||||||
|
for i, proxy in ipairs(playdata["proxies"]) do
|
||||||
|
g_proxy.addProxy(proxy["host"], tonumber(proxy["port"]), tonumber(proxy["priority"]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
g_game.setCustomProtocolVersion(0)
|
g_game.setCustomProtocolVersion(0)
|
||||||
g_game.chooseRsa(G.host)
|
g_game.chooseRsa(G.host)
|
||||||
g_game.setClientVersion(G.clientVersion)
|
g_game.setClientVersion(G.clientVersion)
|
||||||
@ -414,7 +424,7 @@ function EnterGame.doLogin()
|
|||||||
G.host = server_params[1] .. ":" .. server_params[2] .. ":" .. server_params[3]
|
G.host = server_params[1] .. ":" .. server_params[2] .. ":" .. server_params[3]
|
||||||
G.clientVersion = tonumber(server_params[4])
|
G.clientVersion = tonumber(server_params[4])
|
||||||
elseif #server_params >= 3 then
|
elseif #server_params >= 3 then
|
||||||
if tonumber(server_params[3]) == server_params[3] then
|
if tostring(tonumber(server_params[3])) == server_params[3] then
|
||||||
G.host = server_params[1] .. ":" .. server_params[2]
|
G.host = server_params[1] .. ":" .. server_params[2]
|
||||||
G.clientVersion = tonumber(server_params[3])
|
G.clientVersion = tonumber(server_params[3])
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,6 @@
|
|||||||
function init()
|
function init()
|
||||||
-- add manually your shaders from /data/shaders
|
-- add manually your shaders from /data/shaders
|
||||||
g_shaders.createOutfitShader("default", "/shaders/outfit_default_vertex", "/shaders/outfit_default_fragment")
|
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.addTexture("stars", "/shaders/stars.png")
|
|
||||||
|
|
||||||
g_shaders.createOutfitShader("gold", "/shaders/outfit_gold_vertex", "/shaders/outfit_gold_fragment")
|
|
||||||
g_shaders.addTexture("gold", "/data/shaders/gold.png")
|
|
||||||
|
|
||||||
g_shaders.createOutfitShader("rainbow", "/shaders/outfit_rainbow_vertex", "/shaders/outfit_rainbow_fragment")
|
|
||||||
g_shaders.addTexture("rainbow", "/shaders/rainbow.png")
|
|
||||||
|
|
||||||
g_shaders.createOutfitShader("line", "/shaders/outfit_line_vertex", "/shaders/outfit_line_fragment")
|
|
||||||
|
|
||||||
g_shaders.createOutfitShader("outline", "/shaders/outfit_outline_vertex", "/shaders/outfit_outline_fragment") ]]--
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
|
@ -486,7 +486,11 @@ function changeCategory(widget, newCategory)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if g_game.getFeature(GameIngameStore) and widget ~= newCategory and not otcv8shop then
|
if g_game.getFeature(GameIngameStore) and widget ~= newCategory and not otcv8shop then
|
||||||
g_game.requestStoreOffers(newCategory.name:getText())
|
local serviceType = 0
|
||||||
|
if g_game.getFeature(GameTibia12Protocol) then
|
||||||
|
serviceType = 2
|
||||||
|
end
|
||||||
|
g_game.requestStoreOffers(newCategory.name:getText(), serviceType)
|
||||||
end
|
end
|
||||||
|
|
||||||
browsingHistory = false
|
browsingHistory = false
|
||||||
|
BIN
otclient_dx.exe
BIN
otclient_dx.exe
Binary file not shown.
BIN
otclient_gl.exe
BIN
otclient_gl.exe
Binary file not shown.
BIN
otclient_linux
BIN
otclient_linux
Binary file not shown.
BIN
otclientv8.apk
BIN
otclientv8.apk
Binary file not shown.
BIN
pdb/pdb.7z
BIN
pdb/pdb.7z
Binary file not shown.
@ -56,6 +56,8 @@ namespace Proto {
|
|||||||
GameServerPing = 30,
|
GameServerPing = 30,
|
||||||
GameServerChallenge = 31,
|
GameServerChallenge = 31,
|
||||||
GameServerDeath = 40,
|
GameServerDeath = 40,
|
||||||
|
GameServerSupplyStash = 41,
|
||||||
|
GameServerDepotState = 42,
|
||||||
|
|
||||||
// all in game opcodes must be greater than 50
|
// all in game opcodes must be greater than 50
|
||||||
GameServerFirstGameOpcode = 50,
|
GameServerFirstGameOpcode = 50,
|
||||||
@ -125,7 +127,8 @@ namespace Proto {
|
|||||||
GameServerEditText = 150,
|
GameServerEditText = 150,
|
||||||
GameServerEditList = 151,
|
GameServerEditList = 151,
|
||||||
GameServerNews = 152,
|
GameServerNews = 152,
|
||||||
GameServerSendBlessDialog = 155,
|
GameUnkown154 = 154,
|
||||||
|
GameServerBlessDialog = 155,
|
||||||
GameServerBlessings = 156,
|
GameServerBlessings = 156,
|
||||||
GameServerPreset = 157,
|
GameServerPreset = 157,
|
||||||
GameServerPremiumTrigger = 158, // 1038
|
GameServerPremiumTrigger = 158, // 1038
|
||||||
@ -157,6 +160,8 @@ namespace Proto {
|
|||||||
GameServerPvpSituations = 184,
|
GameServerPvpSituations = 184,
|
||||||
GameServerFloorChangeUp = 190,
|
GameServerFloorChangeUp = 190,
|
||||||
GameServerFloorChangeDown = 191,
|
GameServerFloorChangeDown = 191,
|
||||||
|
GameServerLootContainers = 192,
|
||||||
|
GameServerTournamentLeaderboard = 197,
|
||||||
GameServerChooseOutfit = 200,
|
GameServerChooseOutfit = 200,
|
||||||
GameServerImpactTracker = 204,
|
GameServerImpactTracker = 204,
|
||||||
GameServerItemsPrices = 205,
|
GameServerItemsPrices = 205,
|
||||||
@ -166,10 +171,10 @@ namespace Proto {
|
|||||||
GameServerKillTracker = 209,
|
GameServerKillTracker = 209,
|
||||||
GameServerVipAdd = 210,
|
GameServerVipAdd = 210,
|
||||||
GameServerVipState = 211,
|
GameServerVipState = 211,
|
||||||
GameServerVipLogout = 212,
|
GameServerVipLogoutOrGroupData = 212,
|
||||||
GameServerCyclopediaNewDetails = 217,
|
GameServerCyclopediaNewDetails = 217,
|
||||||
GameServerTutorialHint = 220,
|
GameServerTutorialHint = 220,
|
||||||
GameServerAutomapFlag = 221,
|
GameServerCyclopediaMapData = 221,
|
||||||
GameServerDailyRewardState = 222,
|
GameServerDailyRewardState = 222,
|
||||||
GameServerCoinBalance = 223,
|
GameServerCoinBalance = 223,
|
||||||
GameServerStoreError = 224, // 1080
|
GameServerStoreError = 224, // 1080
|
||||||
@ -183,7 +188,7 @@ namespace Proto {
|
|||||||
GameServerPreyPrices = 233,
|
GameServerPreyPrices = 233,
|
||||||
GameServerStoreOfferDescription = 234,
|
GameServerStoreOfferDescription = 234,
|
||||||
GameServerImbuementWindow = 235,
|
GameServerImbuementWindow = 235,
|
||||||
GaneServerCloseImbuementWindow = 236,
|
GameServerCloseImbuementWindow = 236,
|
||||||
GameServerMessageDialog = 237,
|
GameServerMessageDialog = 237,
|
||||||
GameServerResourceBalance = 238,
|
GameServerResourceBalance = 238,
|
||||||
GameServerTime = 239,
|
GameServerTime = 239,
|
||||||
|
@ -251,8 +251,9 @@ private:
|
|||||||
void parseVipAdd(const InputMessagePtr& msg);
|
void parseVipAdd(const InputMessagePtr& msg);
|
||||||
void parseVipState(const InputMessagePtr& msg);
|
void parseVipState(const InputMessagePtr& msg);
|
||||||
void parseVipLogout(const InputMessagePtr& msg);
|
void parseVipLogout(const InputMessagePtr& msg);
|
||||||
|
void parseVipGroupData(const InputMessagePtr& msg);
|
||||||
void parseTutorialHint(const InputMessagePtr& msg);
|
void parseTutorialHint(const InputMessagePtr& msg);
|
||||||
void parseAutomapFlag(const InputMessagePtr& msg);
|
void parseCyclopediaMapData(const InputMessagePtr& msg);
|
||||||
void parseQuestLog(const InputMessagePtr& msg);
|
void parseQuestLog(const InputMessagePtr& msg);
|
||||||
void parseQuestLine(const InputMessagePtr& msg);
|
void parseQuestLine(const InputMessagePtr& msg);
|
||||||
void parseChannelEvent(const InputMessagePtr& msg);
|
void parseChannelEvent(const InputMessagePtr& msg);
|
||||||
@ -274,7 +275,11 @@ private:
|
|||||||
void parseDailyReward(const InputMessagePtr& msg);
|
void parseDailyReward(const InputMessagePtr& msg);
|
||||||
void parseDailyRewardHistory(const InputMessagePtr& msg);
|
void parseDailyRewardHistory(const InputMessagePtr& msg);
|
||||||
void parseKillTracker(const InputMessagePtr& msg);
|
void parseKillTracker(const InputMessagePtr& msg);
|
||||||
|
void parseLootContainers(const InputMessagePtr& msg);
|
||||||
|
void parseSupplyStash(const InputMessagePtr& msg);
|
||||||
|
void parseDepotState(const InputMessagePtr& msg);
|
||||||
void parseSupplyTracker(const InputMessagePtr& msg);
|
void parseSupplyTracker(const InputMessagePtr& msg);
|
||||||
|
void parseTournamentLeaderboard(const InputMessagePtr& msg);
|
||||||
void parseImpactTracker(const InputMessagePtr& msg);
|
void parseImpactTracker(const InputMessagePtr& msg);
|
||||||
void parseItemsPrices(const InputMessagePtr& msg);
|
void parseItemsPrices(const InputMessagePtr& msg);
|
||||||
void parseLootTracker(const InputMessagePtr& msg);
|
void parseLootTracker(const InputMessagePtr& msg);
|
||||||
|
@ -305,14 +305,17 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
|||||||
case Proto::GameServerVipState:
|
case Proto::GameServerVipState:
|
||||||
parseVipState(msg);
|
parseVipState(msg);
|
||||||
break;
|
break;
|
||||||
case Proto::GameServerVipLogout:
|
case Proto::GameServerVipLogoutOrGroupData:
|
||||||
|
if (g_game.getFeature(Otc::GameTibia12Protocol))
|
||||||
|
parseVipGroupData(msg);
|
||||||
|
else
|
||||||
parseVipLogout(msg);
|
parseVipLogout(msg);
|
||||||
break;
|
break;
|
||||||
case Proto::GameServerTutorialHint:
|
case Proto::GameServerTutorialHint:
|
||||||
parseTutorialHint(msg);
|
parseTutorialHint(msg);
|
||||||
break;
|
break;
|
||||||
case Proto::GameServerAutomapFlag:
|
case Proto::GameServerCyclopediaMapData:
|
||||||
parseAutomapFlag(msg);
|
parseCyclopediaMapData(msg);
|
||||||
break;
|
break;
|
||||||
case Proto::GameServerQuestLog:
|
case Proto::GameServerQuestLog:
|
||||||
parseQuestLog(msg);
|
parseQuestLog(msg);
|
||||||
@ -420,6 +423,8 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
|||||||
case Proto::GameServerNews:
|
case Proto::GameServerNews:
|
||||||
parseGameNews(msg);
|
parseGameNews(msg);
|
||||||
break;
|
break;
|
||||||
|
case Proto::GameUnkown154: // spotted on skelot
|
||||||
|
break;
|
||||||
case Proto::GameServerBlessDialog:
|
case Proto::GameServerBlessDialog:
|
||||||
parseBlessDialog(msg);
|
parseBlessDialog(msg);
|
||||||
break;
|
break;
|
||||||
@ -486,6 +491,18 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
|||||||
case Proto::GameServerDailyRewardHistory:
|
case Proto::GameServerDailyRewardHistory:
|
||||||
parseDailyRewardHistory(msg);
|
parseDailyRewardHistory(msg);
|
||||||
break;
|
break;
|
||||||
|
case Proto::GameServerLootContainers:
|
||||||
|
parseLootContainers(msg);
|
||||||
|
break;
|
||||||
|
case Proto::GameServerSupplyStash:
|
||||||
|
parseSupplyStash(msg);
|
||||||
|
break;
|
||||||
|
case Proto::GameServerDepotState:
|
||||||
|
parseDepotState(msg);
|
||||||
|
break;
|
||||||
|
case Proto::GameServerTournamentLeaderboard:
|
||||||
|
parseTournamentLeaderboard(msg);
|
||||||
|
break;
|
||||||
// otclient ONLY
|
// otclient ONLY
|
||||||
case Proto::GameServerExtendedOpcode:
|
case Proto::GameServerExtendedOpcode:
|
||||||
parseExtendedOpcode(msg);
|
parseExtendedOpcode(msg);
|
||||||
@ -529,14 +546,14 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
|||||||
}
|
}
|
||||||
} catch (stdext::exception& e) {
|
} catch (stdext::exception& e) {
|
||||||
g_logger.error(stdext::format("ProtocolGame parse message exception (%d bytes, %d unread, last opcode is 0x%02x (%d), prev opcode is 0x%02x (%d)): %s"
|
g_logger.error(stdext::format("ProtocolGame parse message exception (%d bytes, %d unread, last opcode is 0x%02x (%d), prev opcode is 0x%02x (%d)): %s"
|
||||||
"\nPacket has been saved to packet.log, you can use it to find what was wrong.",
|
"\nPacket has been saved to packet.log, you can use it to find what was wrong. (Protocol: %i)",
|
||||||
msg->getMessageSize(), msg->getUnreadSize(), opcode, opcode, prevOpcode, prevOpcode, e.what()));
|
msg->getMessageSize(), msg->getUnreadSize(), opcode, opcode, prevOpcode, prevOpcode, e.what(), g_game.getProtocolVersion()));
|
||||||
|
|
||||||
std::ofstream packet("packet.log", std::ifstream::app);
|
std::ofstream packet("packet.log", std::ifstream::app);
|
||||||
if (!packet.is_open())
|
if (!packet.is_open())
|
||||||
return;
|
return;
|
||||||
packet << stdext::format("ProtocolGame parse message exception (%d bytes, %d unread, last opcode is 0x%02x (%d), prev opcode is 0x%02x (%d)): %s\n",
|
packet << stdext::format("ProtocolGame parse message exception (%d bytes, %d unread, last opcode is 0x%02x (%d), prev opcode is 0x%02x (%d), proto: %i): %s\n",
|
||||||
msg->getMessageSize(), msg->getUnreadSize(), opcode, opcode, prevOpcode, prevOpcode, e.what());
|
msg->getMessageSize(), msg->getUnreadSize(), opcode, opcode, prevOpcode, prevOpcode, g_game.getProtocolVersion(), e.what());
|
||||||
std::string buffer = msg->getBuffer();
|
std::string buffer = msg->getBuffer();
|
||||||
opcodePos -= msg->getHeaderPos();
|
opcodePos -= msg->getHeaderPos();
|
||||||
prevOpcodePos -= msg->getHeaderPos();
|
prevOpcodePos -= msg->getHeaderPos();
|
||||||
@ -1410,10 +1427,14 @@ void ProtocolGame::parseMagicEffect(const InputMessagePtr& msg)
|
|||||||
if (g_game.getFeature(Otc::GameTibia12Protocol) && g_game.getClientVersion() >= 1203) {
|
if (g_game.getFeature(Otc::GameTibia12Protocol) && g_game.getClientVersion() >= 1203) {
|
||||||
Otc::MagicEffectsType_t effectType = (Otc::MagicEffectsType_t)msg->getU8();
|
Otc::MagicEffectsType_t effectType = (Otc::MagicEffectsType_t)msg->getU8();
|
||||||
while (effectType != Otc::MAGIC_EFFECTS_END_LOOP) {
|
while (effectType != Otc::MAGIC_EFFECTS_END_LOOP) {
|
||||||
if (effectType == Otc::MAGIC_EFFECTS_CREATE_DISTANCEEFFECT) {
|
if (effectType == Otc::MAGIC_EFFECTS_DELTA) {
|
||||||
|
msg->getU8();
|
||||||
|
} else if (effectType == Otc::MAGIC_EFFECTS_DELAY) {
|
||||||
|
msg->getU8(); // ?
|
||||||
|
} else if (effectType == Otc::MAGIC_EFFECTS_CREATE_DISTANCEEFFECT) {
|
||||||
uint8_t shotId = msg->getU8();
|
uint8_t shotId = msg->getU8();
|
||||||
uint8_t offsetX = msg->getU8();
|
int8_t offsetX = static_cast<int8_t>(msg->getU8());
|
||||||
uint8_t offsetY = msg->getU8();
|
int8_t offsetY = static_cast<int8_t>(msg->getU8());
|
||||||
if (!g_things.isValidDatId(shotId, ThingCategoryMissile)) {
|
if (!g_things.isValidDatId(shotId, ThingCategoryMissile)) {
|
||||||
g_logger.traceError(stdext::format("invalid missile id %d", shotId));
|
g_logger.traceError(stdext::format("invalid missile id %d", shotId));
|
||||||
return;
|
return;
|
||||||
@ -1423,6 +1444,19 @@ void ProtocolGame::parseMagicEffect(const InputMessagePtr& msg)
|
|||||||
missile->setId(shotId);
|
missile->setId(shotId);
|
||||||
missile->setPath(pos, Position(pos.x + offsetX, pos.y + offsetY, pos.z));
|
missile->setPath(pos, Position(pos.x + offsetX, pos.y + offsetY, pos.z));
|
||||||
g_map.addThing(missile, pos);
|
g_map.addThing(missile, pos);
|
||||||
|
} else if (effectType == Otc::MAGIC_EFFECTS_CREATE_DISTANCEEFFECT_REVERSED) {
|
||||||
|
uint8_t shotId = msg->getU8();
|
||||||
|
int8_t offsetX = static_cast<int8_t>(msg->getU8());
|
||||||
|
int8_t offsetY = static_cast<int8_t>(msg->getU8());
|
||||||
|
if (!g_things.isValidDatId(shotId, ThingCategoryMissile)) {
|
||||||
|
g_logger.traceError(stdext::format("invalid missile id %d", shotId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MissilePtr missile = MissilePtr(new Missile());
|
||||||
|
missile->setId(shotId);
|
||||||
|
missile->setPath(Position(pos.x + offsetX, pos.y + offsetY, pos.z), pos);
|
||||||
|
g_map.addThing(missile, pos);
|
||||||
} else if (effectType == Otc::MAGIC_EFFECTS_CREATE_EFFECT) {
|
} else if (effectType == Otc::MAGIC_EFFECTS_CREATE_EFFECT) {
|
||||||
uint8_t effectId = msg->getU8();
|
uint8_t effectId = msg->getU8();
|
||||||
if (!g_things.isValidDatId(effectId, ThingCategoryEffect)) {
|
if (!g_things.isValidDatId(effectId, ThingCategoryEffect)) {
|
||||||
@ -1814,7 +1848,7 @@ void ProtocolGame::parsePlayerStats(const InputMessagePtr& msg)
|
|||||||
else
|
else
|
||||||
freeCapacity = msg->getU16() / 100.0;
|
freeCapacity = msg->getU16() / 100.0;
|
||||||
|
|
||||||
double totalCapacity = 0;
|
double totalCapacity = freeCapacity;
|
||||||
if (g_game.getFeature(Otc::GameTotalCapacity) && !g_game.getFeature(Otc::GameTibia12Protocol))
|
if (g_game.getFeature(Otc::GameTotalCapacity) && !g_game.getFeature(Otc::GameTibia12Protocol))
|
||||||
totalCapacity = msg->getU32() / 100.0;
|
totalCapacity = msg->getU32() / 100.0;
|
||||||
|
|
||||||
@ -1837,8 +1871,9 @@ void ProtocolGame::parsePlayerStats(const InputMessagePtr& msg)
|
|||||||
/*double experienceBonus = */msg->getDouble();
|
/*double experienceBonus = */msg->getDouble();
|
||||||
} else {
|
} else {
|
||||||
/*int baseXpGain = */msg->getU16();
|
/*int baseXpGain = */msg->getU16();
|
||||||
if(!g_game.getFeature(Otc::GameTibia12Protocol))
|
if (!g_game.getFeature(Otc::GameTibia12Protocol)) {
|
||||||
/*int voucherAddend = */msg->getU16();
|
/*int voucherAddend = */msg->getU16();
|
||||||
|
}
|
||||||
/*int grindingAddend = */msg->getU16();
|
/*int grindingAddend = */msg->getU16();
|
||||||
/*int storeBoostAddend = */ msg->getU16();
|
/*int storeBoostAddend = */ msg->getU16();
|
||||||
/*int huntingBoostFactor = */ msg->getU16();
|
/*int huntingBoostFactor = */ msg->getU16();
|
||||||
@ -2188,21 +2223,24 @@ void ProtocolGame::parseTextMessage(const InputMessagePtr& msg)
|
|||||||
std::string text;
|
std::string text;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case Otc::MessageChannelManagement: {
|
case Otc::MessageChannelManagement:
|
||||||
|
{
|
||||||
/*int channel = */msg->getU16();
|
/*int channel = */msg->getU16();
|
||||||
text = msg->getString();
|
text = msg->getString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Otc::MessageGuild:
|
case Otc::MessageGuild:
|
||||||
case Otc::MessagePartyManagement:
|
case Otc::MessagePartyManagement:
|
||||||
case Otc::MessageParty: {
|
case Otc::MessageParty:
|
||||||
|
{
|
||||||
/*int channel = */msg->getU16();
|
/*int channel = */msg->getU16();
|
||||||
text = msg->getString();
|
text = msg->getString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Otc::MessageDamageDealed:
|
case Otc::MessageDamageDealed:
|
||||||
case Otc::MessageDamageReceived:
|
case Otc::MessageDamageReceived:
|
||||||
case Otc::MessageDamageOthers: {
|
case Otc::MessageDamageOthers:
|
||||||
|
{
|
||||||
Position pos = getPosition(msg);
|
Position pos = getPosition(msg);
|
||||||
uint value[2];
|
uint value[2];
|
||||||
int color[2];
|
int color[2];
|
||||||
@ -2230,7 +2268,8 @@ void ProtocolGame::parseTextMessage(const InputMessagePtr& msg)
|
|||||||
case Otc::MessageMana:
|
case Otc::MessageMana:
|
||||||
case Otc::MessageExp:
|
case Otc::MessageExp:
|
||||||
case Otc::MessageHealOthers:
|
case Otc::MessageHealOthers:
|
||||||
case Otc::MessageExpOthers: {
|
case Otc::MessageExpOthers:
|
||||||
|
{
|
||||||
Position pos = getPosition(msg);
|
Position pos = getPosition(msg);
|
||||||
uint value = msg->getU32();
|
uint value = msg->getU32();
|
||||||
int color = msg->getU8();
|
int color = msg->getU8();
|
||||||
@ -2310,8 +2349,7 @@ void ProtocolGame::parseFloorChangeDown(const InputMessagePtr& msg)
|
|||||||
int j, i;
|
int j, i;
|
||||||
for (i = pos.z, j = -1; i <= pos.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE; ++i, --j)
|
for (i = pos.z, j = -1; i <= pos.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE; ++i, --j)
|
||||||
skip = setFloorDescription(msg, pos.x - range.left, pos.y - range.top, i, range.horizontal(), range.vertical(), j, skip);
|
skip = setFloorDescription(msg, pos.x - range.left, pos.y - range.top, i, range.horizontal(), range.vertical(), j, skip);
|
||||||
}
|
} else if (pos.z > Otc::UNDERGROUND_FLOOR && pos.z < Otc::MAX_Z - 1)
|
||||||
else if(pos.z > Otc::UNDERGROUND_FLOOR && pos.z < Otc::MAX_Z-1)
|
|
||||||
skip = setFloorDescription(msg, pos.x - range.left, pos.y - range.top, pos.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, range.horizontal(), range.vertical(), -3, skip);
|
skip = setFloorDescription(msg, pos.x - range.left, pos.y - range.top, pos.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, range.horizontal(), range.vertical(), -3, skip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2415,6 +2453,12 @@ void ProtocolGame::parseVipAdd(const InputMessagePtr& msg)
|
|||||||
}
|
}
|
||||||
status = msg->getU8();
|
status = msg->getU8();
|
||||||
|
|
||||||
|
if (g_game.getFeature(Otc::GameTibia12Protocol)) {
|
||||||
|
int groups = msg->getU8();
|
||||||
|
for (int i = 0; i < groups; ++i)
|
||||||
|
msg->getU8(); // group id
|
||||||
|
}
|
||||||
|
|
||||||
g_game.processVipAdd(id, name, status, desc, iconId, notifyLogin);
|
g_game.processVipAdd(id, name, status, desc, iconId, notifyLogin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2424,8 +2468,7 @@ void ProtocolGame::parseVipState(const InputMessagePtr& msg)
|
|||||||
if (g_game.getFeature(Otc::GameLoginPending)) {
|
if (g_game.getFeature(Otc::GameLoginPending)) {
|
||||||
uint status = msg->getU8();
|
uint status = msg->getU8();
|
||||||
g_game.processVipStateChange(id, status);
|
g_game.processVipStateChange(id, status);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
g_game.processVipStateChange(id, 1);
|
g_game.processVipStateChange(id, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2436,16 +2479,117 @@ void ProtocolGame::parseVipLogout(const InputMessagePtr& msg)
|
|||||||
g_game.processVipStateChange(id, 0);
|
g_game.processVipStateChange(id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProtocolGame::parseVipGroupData(const InputMessagePtr& msg)
|
||||||
|
{
|
||||||
|
int size = msg->getU8();
|
||||||
|
for (int i = 0; i < size; ++i) {
|
||||||
|
msg->getU8(); // group id
|
||||||
|
msg->getString(); // group name
|
||||||
|
msg->getU8(); // unkown
|
||||||
|
}
|
||||||
|
|
||||||
|
msg->getU8(); // max vip groups
|
||||||
|
}
|
||||||
|
|
||||||
void ProtocolGame::parseTutorialHint(const InputMessagePtr& msg)
|
void ProtocolGame::parseTutorialHint(const InputMessagePtr& msg)
|
||||||
{
|
{
|
||||||
int id = msg->getU8();
|
int id = msg->getU8();
|
||||||
g_game.processTutorialHint(id);
|
g_game.processTutorialHint(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProtocolGame::parseAutomapFlag(const InputMessagePtr& msg)
|
void ProtocolGame::parseCyclopediaMapData(const InputMessagePtr& msg)
|
||||||
{
|
{
|
||||||
if (g_game.getFeature(Otc::GameTibia12Protocol)) {
|
if (g_game.getFeature(Otc::GameTibia12Protocol)) {
|
||||||
msg->getU8(); // unknown
|
int type = msg->getU8();
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
int count = msg->getU16();
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
}
|
||||||
|
count = msg->getU16();
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
msg->getU16();
|
||||||
|
}
|
||||||
|
count = msg->getU16();
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
msg->getU16();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2: // raid
|
||||||
|
{
|
||||||
|
getPosition(msg);
|
||||||
|
msg->getU8();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
msg->getU16();
|
||||||
|
msg->getU8();
|
||||||
|
int count = msg->getU8();
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
getPosition(msg);
|
||||||
|
msg->getU8();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 7:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 8:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 9:
|
||||||
|
{
|
||||||
|
msg->getU32();
|
||||||
|
msg->getU32();
|
||||||
|
int count = msg->getU8();
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
msg->getU16();
|
||||||
|
msg->getU32();
|
||||||
|
msg->getU32();
|
||||||
|
msg->getU8();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 10:
|
||||||
|
{
|
||||||
|
msg->getU16();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 11:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type != 0)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Position pos = getPosition(msg);
|
Position pos = getPosition(msg);
|
||||||
@ -2554,8 +2698,7 @@ void ProtocolGame::parseModalDialog(const InputMessagePtr& msg)
|
|||||||
if (g_game.getClientVersion() > 970) {
|
if (g_game.getClientVersion() > 970) {
|
||||||
escapeButton = msg->getU8();
|
escapeButton = msg->getU8();
|
||||||
enterButton = msg->getU8();
|
enterButton = msg->getU8();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
enterButton = msg->getU8();
|
enterButton = msg->getU8();
|
||||||
escapeButton = msg->getU8();
|
escapeButton = msg->getU8();
|
||||||
}
|
}
|
||||||
@ -2745,6 +2888,39 @@ Imbuement ProtocolGame::getImbuementInfo(const InputMessagePtr& msg)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProtocolGame::parseLootContainers(const InputMessagePtr& msg)
|
||||||
|
{
|
||||||
|
msg->getU8(); // quickLootFallbackToMainContainer ? 1 : 0
|
||||||
|
int containers = msg->getU8();
|
||||||
|
for (int i = 0; i < containers; ++i) {
|
||||||
|
msg->getU8(); // id?
|
||||||
|
msg->getU16();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProtocolGame::parseSupplyStash(const InputMessagePtr& msg)
|
||||||
|
{
|
||||||
|
int size = msg->getU16();
|
||||||
|
for (int i = 0; i < size; ++i) {
|
||||||
|
msg->getU16(); // item id
|
||||||
|
msg->getU32(); // unknown
|
||||||
|
}
|
||||||
|
msg->getU16(); // available slots?
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProtocolGame::parseDepotState(const InputMessagePtr& msg)
|
||||||
|
{
|
||||||
|
msg->getU8(); // unknown, true/false
|
||||||
|
if (g_game.getProtocolVersion() >= 1230) {
|
||||||
|
msg->getU8(); // unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProtocolGame::parseTournamentLeaderboard(const InputMessagePtr& msg)
|
||||||
|
{
|
||||||
|
msg->getU8();
|
||||||
|
msg->getU8();
|
||||||
|
}
|
||||||
|
|
||||||
void ProtocolGame::parseKillTracker(const InputMessagePtr& msg)
|
void ProtocolGame::parseKillTracker(const InputMessagePtr& msg)
|
||||||
{
|
{
|
||||||
@ -2861,6 +3037,9 @@ void ProtocolGame::parseCreatureType(const InputMessagePtr& msg)
|
|||||||
uint32 id = msg->getU32();
|
uint32 id = msg->getU32();
|
||||||
uint8 type = msg->getU8();
|
uint8 type = msg->getU8();
|
||||||
|
|
||||||
|
if (g_game.getFeature(Otc::GameTibia12Protocol) && type == Proto::CreatureTypeSummonOwn)
|
||||||
|
msg->getU32();
|
||||||
|
|
||||||
CreaturePtr creature = g_map.getCreatureById(id);
|
CreaturePtr creature = g_map.getCreatureById(id);
|
||||||
if (creature)
|
if (creature)
|
||||||
creature->setType(type);
|
creature->setType(type);
|
||||||
@ -2910,8 +3089,7 @@ void ProtocolGame::setMapDescription(const InputMessagePtr& msg, int x, int y, i
|
|||||||
startz = z - Otc::AWARE_UNDEGROUND_FLOOR_RANGE;
|
startz = z - Otc::AWARE_UNDEGROUND_FLOOR_RANGE;
|
||||||
endz = std::min<int>(z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
|
endz = std::min<int>(z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
|
||||||
zstep = 1;
|
zstep = 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
startz = Otc::SEA_FLOOR;
|
startz = Otc::SEA_FLOOR;
|
||||||
endz = 0;
|
endz = 0;
|
||||||
zstep = -1;
|
zstep = -1;
|
||||||
@ -2999,14 +3177,12 @@ Outfit ProtocolGame::getOutfit(const InputMessagePtr& msg, bool ignoreMount)
|
|||||||
outfit.setLegs(legs);
|
outfit.setLegs(legs);
|
||||||
outfit.setFeet(feet);
|
outfit.setFeet(feet);
|
||||||
outfit.setAddons(addons);
|
outfit.setAddons(addons);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
int lookTypeEx = msg->getU16();
|
int lookTypeEx = msg->getU16();
|
||||||
if (lookTypeEx == 0) {
|
if (lookTypeEx == 0) {
|
||||||
outfit.setCategory(ThingCategoryEffect);
|
outfit.setCategory(ThingCategoryEffect);
|
||||||
outfit.setAuxId(13); // invisible effect id
|
outfit.setAuxId(13); // invisible effect id
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (!g_things.isValidDatId(lookTypeEx, ThingCategoryItem)) {
|
if (!g_things.isValidDatId(lookTypeEx, ThingCategoryItem)) {
|
||||||
g_logger.traceError(stdext::format("invalid outfit looktypeex %d", lookTypeEx));
|
g_logger.traceError(stdext::format("invalid outfit looktypeex %d", lookTypeEx));
|
||||||
lookTypeEx = 0;
|
lookTypeEx = 0;
|
||||||
@ -3120,8 +3296,7 @@ CreaturePtr ProtocolGame::getCreature(const InputMessagePtr& msg, int type)
|
|||||||
creature = m_localPlayer;
|
creature = m_localPlayer;
|
||||||
else
|
else
|
||||||
creature = PlayerPtr(new Player);
|
creature = PlayerPtr(new Player);
|
||||||
}
|
} else if (creatureType == Proto::CreatureTypeMonster)
|
||||||
else if (creatureType == Proto::CreatureTypeMonster)
|
|
||||||
creature = MonsterPtr(new Monster);
|
creature = MonsterPtr(new Monster);
|
||||||
else if (creatureType == Proto::CreatureTypeNpc)
|
else if (creatureType == Proto::CreatureTypeNpc)
|
||||||
creature = NpcPtr(new Npc);
|
creature = NpcPtr(new Npc);
|
||||||
@ -3162,11 +3337,13 @@ CreaturePtr ProtocolGame::getCreature(const InputMessagePtr& msg, int type)
|
|||||||
|
|
||||||
if (g_game.getFeature(Otc::GameThingMarks)) {
|
if (g_game.getFeature(Otc::GameThingMarks)) {
|
||||||
creatureType = msg->getU8();
|
creatureType = msg->getU8();
|
||||||
|
if (g_game.getFeature(Otc::GameTibia12Protocol)) {
|
||||||
if (creatureType == Proto::CreatureTypeSummonOwn)
|
if (creatureType == Proto::CreatureTypeSummonOwn)
|
||||||
msg->getU32(); // master
|
msg->getU32(); // master
|
||||||
if (g_game.getClientVersion() >= 1220 && creatureType == Proto::CreatureTypePlayer)
|
if (g_game.getClientVersion() >= 1220 && creatureType == Proto::CreatureTypePlayer)
|
||||||
msg->getU8(); // vocation id
|
msg->getU8(); // vocation id
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g_game.getFeature(Otc::GameCreatureIcons)) {
|
if (g_game.getFeature(Otc::GameCreatureIcons)) {
|
||||||
icon = msg->getU8();
|
icon = msg->getU8();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user