diff --git a/modules/gamelib/game.lua b/modules/gamelib/game.lua index 0a5b2cb7..401a01e7 100644 --- a/modules/gamelib/game.lua +++ b/modules/gamelib/game.lua @@ -48,8 +48,9 @@ end function g_game.getSupportedProtocols() return { - 810, 853, 854, 860, 861, 862, 870, - 910, 940, 944, 953, 954, 960, 961 + 810, 853, 854, 860, 861, 862, 870, + 910, 940, 944, 953, 954, 960, 961, + 963 } end diff --git a/src/framework/luaengine/luainterface.cpp b/src/framework/luaengine/luainterface.cpp index fc7a7ce0..e4b19299 100644 --- a/src/framework/luaengine/luainterface.cpp +++ b/src/framework/luaengine/luainterface.cpp @@ -692,13 +692,6 @@ void LuaInterface::createLuaState() rawSeti(5); pop(2); - // replace loadfile - getGlobal("package"); - getField("loaders"); - pushCFunction(&LuaInterface::luaScriptLoader); - rawSeti(5); - pop(2); - // replace dofile pushCFunction(&LuaInterface::lua_dofile); setGlobal("dofile"); diff --git a/src/otclient/game.cpp b/src/otclient/game.cpp index b6688efd..fd7b8549 100644 --- a/src/otclient/game.cpp +++ b/src/otclient/game.cpp @@ -635,7 +635,10 @@ void Game::look(const ThingPtr& thing) if(!canPerformGameAction() || !thing) return; - m_protocolGame->sendLook(thing->getPosition(), thing->getId(), thing->getStackpos()); + if(thing->isCreature() && m_clientVersion >= 961) + m_protocolGame->sendLookCreature(thing->getId()); + else + m_protocolGame->sendLook(thing->getPosition(), thing->getId(), thing->getStackpos()); } void Game::move(const ThingPtr& thing, const Position& toPos, int count) @@ -774,7 +777,12 @@ void Game::attack(CreaturePtr creature) cancelFollow(); setAttackingCreature(creature); - m_seq++; + + if(m_clientVersion >= 963) + m_seq = creature->getId(); + else + m_seq++; + m_protocolGame->sendAttack(creature ? creature->getId() : 0, m_seq); } @@ -791,7 +799,12 @@ void Game::follow(CreaturePtr creature) cancelAttack(); setFollowingCreature(creature); - m_seq++; + + if(m_clientVersion >= 963) + m_seq = creature->getId(); + else + m_seq++; + m_protocolGame->sendFollow(creature ? creature->getId() : 0, m_seq); } @@ -1151,7 +1164,7 @@ void Game::setClientVersion(int version) if(isOnline()) stdext::throw_exception("Unable to change client version while online"); - if(version != 0 && (version < 810 || version > 961)) + if(version != 0 && (version < 810 || version > 963)) stdext::throw_exception(stdext::format("Protocol version %d not supported", version)); m_features.reset(); diff --git a/src/otclient/protocolcodes.h b/src/otclient/protocolcodes.h index a83e5b32..4fd1c954 100644 --- a/src/otclient/protocolcodes.h +++ b/src/otclient/protocolcodes.h @@ -191,6 +191,7 @@ namespace Proto { ClientEditText = 137, ClientEditList = 138, ClientLook = 140, + ClientLookCreature = 141, ClientTalk = 150, ClientRequestChannels = 151, ClientJoinChannel = 152, diff --git a/src/otclient/protocolgame.h b/src/otclient/protocolgame.h index 40c88322..2fbcd64b 100644 --- a/src/otclient/protocolgame.h +++ b/src/otclient/protocolgame.h @@ -72,6 +72,7 @@ public: void sendEditText(uint id, const std::string& text); void sendEditList(uint id, int doorId, const std::string& text); void sendLook(const Position& position, int thingId, int stackpos); + void sendLookCreature(uint creatureId); void sendTalk(Otc::MessageMode mode, int channelId, const std::string& receiver, const std::string& message); void sendRequestChannels(); void sendJoinChannel(int channelId); diff --git a/src/otclient/protocolgameparse.cpp b/src/otclient/protocolgameparse.cpp index 1009ff1d..ac82d452 100644 --- a/src/otclient/protocolgameparse.cpp +++ b/src/otclient/protocolgameparse.cpp @@ -1254,9 +1254,18 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) void ProtocolGame::parseVipAdd(const InputMessagePtr& msg) { - uint id = msg->getU32(); - std::string name = g_game.formatCreatureName(msg->getString()); - bool online = msg->getU8() != 0; + uint id, markId; + std::string name, desc; + bool online, notifyLogin; + + id = msg->getU32(); + name = g_game.formatCreatureName(msg->getString()); + if(g_game.getClientVersion() >= 963) { + desc = msg->getString(); + markId = msg->getU32(); + notifyLogin = msg->getU8(); + } + online = msg->getU8(); g_game.processVipAdd(id, name, online); } diff --git a/src/otclient/protocolgamesend.cpp b/src/otclient/protocolgamesend.cpp index 6c8d1870..642ab2d1 100644 --- a/src/otclient/protocolgamesend.cpp +++ b/src/otclient/protocolgamesend.cpp @@ -436,6 +436,14 @@ void ProtocolGame::sendLook(const Position& position, int thingId, int stackpos) send(msg); } +void ProtocolGame::sendLookCreature(uint32 creatureId) +{ + OutputMessagePtr msg(new OutputMessage); + msg->addU8(0x8D); + msg->addU32(creatureId); + send(msg); +} + void ProtocolGame::sendTalk(Otc::MessageMode mode, int channelId, const std::string& receiver, const std::string& message) { if(message.empty())