From 54f3f7a8c4da01505fb3438af16101d37631c292 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Tue, 16 Jan 2024 02:56:36 -0300 Subject: [PATCH 1/9] Update protocolgame.cpp --- src/server/network/protocol/protocolgame.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 313bec0d9a4..27d1e102de1 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -6136,6 +6136,7 @@ void ProtocolGame::sendAddCreature(std::shared_ptr creature, const Pos if (isLogin) { sendMagicEffect(pos, CONST_ME_TELEPORT); + sendHotkeyPreset(); } for (int i = CONST_SLOT_FIRST; i <= CONST_SLOT_LAST; ++i) { @@ -8578,3 +8579,14 @@ void ProtocolGame::parseSaveWheel(NetworkMessage &msg) { addGameTask(&Game::playerSaveWheel, player->getID(), msg); } + +void ProtocolGame::sendHotkeyPreset() { + if (!player || oldProtocol) { + return; + } + + NetworkMessage msg; + msg.addByte(0x9D); + msg.add(player->getVocation()->getClientId()); + writeToOutputBuffer(msg); +} From 52e09d2debfd2c9af6c47f8e1a5599e28221c620 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Tue, 16 Jan 2024 02:59:11 -0300 Subject: [PATCH 2/9] Update protocolgame.hpp --- src/server/network/protocol/protocolgame.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/network/protocol/protocolgame.hpp b/src/server/network/protocol/protocolgame.hpp index 8838fc39e7d..a3eee3e6cf7 100644 --- a/src/server/network/protocol/protocolgame.hpp +++ b/src/server/network/protocol/protocolgame.hpp @@ -502,6 +502,8 @@ class ProtocolGame final : public Protocol { void sendSingleSoundEffect(const Position &pos, SoundEffect_t id, SourceEffect_t source); void sendDoubleSoundEffect(const Position &pos, SoundEffect_t mainSoundId, SourceEffect_t mainSource, SoundEffect_t secondarySoundId, SourceEffect_t secondarySource); + void sendHotkeyPreset(); + uint8_t m_playerDeathTime = 0; void resetPlayerDeathTime() { From 361e629a49f61ed1dab5572360fc17b320b15556 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 31 Jan 2024 04:52:51 +0000 Subject: [PATCH 3/9] Code format - (Clang-format) --- src/server/network/protocol/protocolgame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 2d3d56f5556..6f51e49d9a5 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -8776,4 +8776,4 @@ void ProtocolGame::sendHotkeyPreset() { msg.addByte(0x9D); msg.add(player->getVocation()->getClientId()); writeToOutputBuffer(msg); -} \ No newline at end of file +} From d20751c161056d5706cda2db9e57b92246264c9d Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Sat, 23 Mar 2024 22:27:43 -0300 Subject: [PATCH 4/9] Update protocolgame.cpp --- src/server/network/protocol/protocolgame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index deaad024fa0..339d786dcd1 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -8780,6 +8780,6 @@ void ProtocolGame::sendHotkeyPreset() { NetworkMessage msg; msg.addByte(0x9D); - msg.add(player->getVocation()->getClientId()); + msg.add(player->getVocation()->getBaseId()); writeToOutputBuffer(msg); } From a95c6dcc22fcb9607cdcd1d39ac7d7cb43335961 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Sat, 23 Mar 2024 23:20:15 -0300 Subject: [PATCH 5/9] Update protocolgame.cpp --- src/server/network/protocol/protocolgame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 339d786dcd1..943268d63c9 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -8780,6 +8780,6 @@ void ProtocolGame::sendHotkeyPreset() { NetworkMessage msg; msg.addByte(0x9D); - msg.add(player->getVocation()->getBaseId()); + msg.add(static_cast(player->getVocation()->getBaseId())); writeToOutputBuffer(msg); } From 3ced7b3f97f45561c1d04df3c2e02a901028a37c Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Sun, 24 Mar 2024 08:31:56 -0300 Subject: [PATCH 6/9] Update protocolgame.cpp --- src/server/network/protocol/protocolgame.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 943268d63c9..7892b080e37 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -8778,8 +8778,11 @@ void ProtocolGame::sendHotkeyPreset() { return; } - NetworkMessage msg; - msg.addByte(0x9D); - msg.add(static_cast(player->getVocation()->getBaseId())); - writeToOutputBuffer(msg); + auto vocation = g_vocations().getVocation(player->getVocation()->getBaseId()); + if (vocation) { + NetworkMessage msg; + msg.addByte(0x9D); + msg.add(vocation->getClientId()); + writeToOutputBuffer(msg); + } } From 29cb64daca12114a57ad9ced243583660d4f5a61 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Tue, 16 Apr 2024 04:37:43 -0300 Subject: [PATCH 7/9] Update bosslever_death.lua --- .../scripts/globalevents/others/bosslever_death.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua b/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua index 9538fe15eb7..663b5081631 100644 --- a/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua +++ b/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua @@ -24,6 +24,9 @@ function onBossDeath.onDeath(creature) zn:removePlayers() end, bossLever.timeAfterKill * 1000, zone) end + onDeathForDamagingPlayers(creature, function(creature, player) + player:takeScreenshot(SCREENSHOT_TYPE_BOSSDEFEATED) + end) return true end onBossDeath:register() From 39d26e73331eebce407c5e95a4130825c7ec9901 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Tue, 16 Apr 2024 04:39:20 -0300 Subject: [PATCH 8/9] Revert "Update bosslever_death.lua" This reverts commit 29cb64daca12114a57ad9ced243583660d4f5a61. --- .../scripts/globalevents/others/bosslever_death.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua b/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua index 663b5081631..9538fe15eb7 100644 --- a/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua +++ b/data-otservbr-global/scripts/globalevents/others/bosslever_death.lua @@ -24,9 +24,6 @@ function onBossDeath.onDeath(creature) zn:removePlayers() end, bossLever.timeAfterKill * 1000, zone) end - onDeathForDamagingPlayers(creature, function(creature, player) - player:takeScreenshot(SCREENSHOT_TYPE_BOSSDEFEATED) - end) return true end onBossDeath:register() From 1caaf4d884dfe2c580f3c218768236e147855530 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 29 Apr 2024 01:20:55 +0000 Subject: [PATCH 9/9] Code format - (Clang-format) --- src/creatures/players/player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 1f0c9b45dce..a81981bd20c 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1925,7 +1925,7 @@ void Player::onWalk(Direction &dir) { Creature::onWalk(dir); setNextActionTask(nullptr); - + g_callbacks().executeCallback(EventCallback_t::playerOnWalk, &EventCallback::playerOnWalk, getPlayer(), dir); }