From 38d50ac6a85f25d5e80eb9024fda5975d9561094 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 Oct 2014 16:33:10 +0300 Subject: Move processBeingSelfEffect from ea namespace into eathena and tmwa. --- src/net/tmwa/beinghandler.cpp | 34 ++++++++++++++++++++++++++++++++++ src/net/tmwa/beinghandler.h | 2 ++ 2 files changed, 36 insertions(+) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index a996f97da..9ff7b3ad0 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -23,12 +23,15 @@ #include "net/tmwa/beinghandler.h" #include "actormanager.h" +#include "effectmanager.h" #include "guild.h" #include "guildmanager.h" #include "party.h" #include "being/localplayer.h" +#include "particle/particle.h" + #include "input/keyboardconfig.h" #include "gui/windows/killstats.h" @@ -1644,4 +1647,35 @@ void BeingHandler::processPlayerGuilPartyInfo(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processPlayerGuilPartyInfo") } +void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) const +{ + BLOCK_START("BeingHandler::processBeingSelfEffect") + if (!effectManager || !actorManager) + { + BLOCK_END("BeingHandler::processBeingSelfEffect") + return; + } + + const int id = static_cast(msg.readInt32("being id")); + Being *const being = actorManager->findBeing(id); + if (!being) + { + BLOCK_END("BeingHandler::processBeingSelfEffect") + return; + } + + const int effectType = msg.readInt32("effect type"); + + if (Particle::enabled) + effectManager->trigger(effectType, being); + + // +++ need dehard code effectType == 3 + if (effectType == 3 && being->getType() == ActorType::Player + && socialWindow) + { // reset received damage + socialWindow->resetDamage(being->getName()); + } + BLOCK_END("BeingHandler::processBeingSelfEffect") +} + } // namespace TmwAthena diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h index 7c22c3e93..9a5bc993b 100644 --- a/src/net/tmwa/beinghandler.h +++ b/src/net/tmwa/beinghandler.h @@ -92,6 +92,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void applyPlayerAction(Being *const being, const uint8_t type); + + void processBeingSelfEffect(Net::MessageIn &msg) const; }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2