Files
Viano-Core/src/server/game/Server/Packets/CombatPackets.h
T

147 lines
4.0 KiB
C++

/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CombatPackets_h__
#define CombatPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
class Unit;
namespace WorldPackets
{
namespace Combat
{
struct ThreatInfo
{
ObjectGuid UnitGUID;
int32 Threat = 0;
};
class ThreatUpdate final : public ServerPacket
{
public:
ThreatUpdate() : ServerPacket(SMSG_THREAT_UPDATE, 20) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
std::vector<ThreatInfo> ThreatList;
};
class HighestThreatUpdate final : public ServerPacket
{
public:
HighestThreatUpdate() : ServerPacket(SMSG_HIGHEST_THREAT_UPDATE, 28) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
std::vector<ThreatInfo> ThreatList;
ObjectGuid HighestThreatGUID;
};
class ThreatRemove final : public ServerPacket
{
public:
ThreatRemove() : ServerPacket(SMSG_THREAT_REMOVE, 16) { }
WorldPacket const* Write() override;
ObjectGuid AboutGUID; // Unit to remove threat from (e.g. player, pet, guardian)
ObjectGuid UnitGUID; // Unit being attacked (e.g. creature, boss)
};
class ThreatClear final : public ServerPacket
{
public:
ThreatClear() : ServerPacket(SMSG_THREAT_CLEAR, 8) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
};
struct PowerUpdatePower
{
PowerUpdatePower(int32 power, uint8 powerType) : Power(power), PowerType(powerType) { }
int32 Power = 0;
uint8 PowerType = 0;
};
class PowerUpdate final : public ServerPacket
{
public:
PowerUpdate() : ServerPacket(SMSG_POWER_UPDATE, 8 + 4 + 1) { }
WorldPacket const* Write() override;
ObjectGuid Guid;
std::vector<PowerUpdatePower> Powers;
};
class BreakTarget final : public ServerPacket
{
public:
BreakTarget() : ServerPacket(SMSG_BREAK_TARGET, 8) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
};
class AIReaction final : public ServerPacket
{
public:
AIReaction() : ServerPacket(SMSG_AI_REACTION, 8 + 4) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
uint32 Reaction = 0;
};
class AttackStart final : public ServerPacket
{
public:
AttackStart() : ServerPacket(SMSG_ATTACK_START, 8 + 8) { }
WorldPacket const* Write() override;
ObjectGuid Attacker;
ObjectGuid Victim;
};
class SAttackStop final : public ServerPacket
{
public:
SAttackStop() : ServerPacket(SMSG_ATTACK_STOP, 8 + 8 + 4) { }
SAttackStop(Unit const* attacker, Unit const* victim);
WorldPacket const* Write() override;
ObjectGuid Attacker;
ObjectGuid Victim;
bool NowDead = false; // sent as int32 prior to 6.x
};
}
}
#endif // CombatPackets_h__