Core/Misc: updated a bunch of packets to packet class

This commit is contained in:
Ovahlord committed 2020-10-21 12:04:13 +02:00
1 parent 0fe70b3518
commit 90e5e85afd
23 files changed
+413 -145

No files matched your search

+2
View File
@@ -226,6 +226,7 @@ DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftEntryfmt);
DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt);
DBCStorage <SpellVisualEntry> sSpellVisualStore(SpellVisualfmt);
DBCStorage <SpellVisualKitEntry> sSpellVisualKitStore(SpellVisualKitfmt);
DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt);
TalentSpellPosMap sTalentSpellPosMap;
@@ -492,6 +493,7 @@ void DBCManager::LoadStores(const std::string& dataPath, uint32 defaultLocale)
LOAD_DBC(sSpellShapeshiftStore, "SpellShapeshift.dbc");//15595
LOAD_DBC(sSpellShapeshiftFormStore, "SpellShapeshiftForm.dbc");//15595
LOAD_DBC(sSpellVisualStore, "SpellVisual.dbc");//15595
LOAD_DBC(sSpellVisualKitStore, "SpellVisualKit.dbc");//15595
LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");//15595
LOAD_DBC(sTalentStore, "Talent.dbc");//15595
LOAD_DBC(sTalentTabStore, "TalentTab.dbc");//15595
+1
View File
@@ -171,6 +171,7 @@ TC_GAME_API extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftSto
TC_GAME_API extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore;
TC_GAME_API extern DBCStorage <SpellEntry> sSpellStore;
TC_GAME_API extern DBCStorage <SpellVisualEntry> sSpellVisualStore;
TC_GAME_API extern DBCStorage <SpellVisualKitEntry> sSpellVisualKitStore;
TC_GAME_API extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore;
TC_GAME_API extern DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
TC_GAME_API extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore;
+26
View File
@@ -2381,6 +2381,32 @@ struct SpellVisualEntry
uint32 AlternativeVisualID;
};
struct SpellVisualKitEntry
{
uint32 ID;
uint32 StartAnimID;
uint32 AnimID;
uint32 AnimKitID;
uint32 HeadEffect;
uint32 ChestEffect;
uint32 BaseEffect;
uint32 LeftHandEffect;
uint32 RightHandEffect;
uint32 BreathEffect;
uint32 LeftWeaponEffect;
uint32 RightWeaponEffect;
uint32 SpecialEffect[3];
uint32 WorldEffect;
uint32 SoundID;
uint32 ShakeID;
uint32 CharProc[4];
uint32 CharParamZero[4];
uint32 CharParamOne[4];
uint32 CharParamTwo[4];
uint32 CharParamThree[4];
uint32 Flags;
};
struct SummonPropertiesEntry
{
uint32 ID; // 0
+1
View File
@@ -175,6 +175,7 @@ char const SpellRuneCostfmt[] = "niiii";
char const SpellShapeshiftEntryfmt[] = "niiiix";
char const SpellShapeshiftFormfmt[] = "nxxiixiiiiiiiiiiiiiix";
char const SpellVisualfmt[] = "dxxxxxxiixxxxxxxxxxxxxxxxxxxxxxxi";
char const SpellVisualKitfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
char const StableSlotPricesfmt[] = "ni";
char const SummonPropertiesfmt[] = "niiiii";
char const TalentEntryfmt[] = "niiiiiiiiiiiiiixxxx";
@@ -22,6 +22,7 @@
#include "CreatureAI.h"
#include "CreatureAISelector.h"
#include "CreatureGroups.h"
#include "CombatPackets.h"
#include "DatabaseEnv.h"
#include "Formulas.h"
#include "GameEventMgr.h"
@@ -1567,7 +1568,7 @@ bool Creature::CreateFromProto(ObjectGuid::LowType guidlow, uint32 entry, Creatu
}
if (vehId)
if (CreateVehicleKit(vehId, entry))
if (CreateVehicleKit(vehId, entry, true))
UpdateDisplayPower();
return true;
@@ -2335,12 +2336,10 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
void Creature::SendAIReaction(AiReaction reactionType)
{
WorldPacket data(SMSG_AI_REACTION, 12);
data << uint64(GetGUID());
data << uint32(reactionType);
((WorldObject*)this)->SendMessageToSet(&data, true);
WorldPackets::Combat::AIReaction packet;
packet.UnitGUID = GetGUID();
packet.Reaction = reactionType;
SendMessageToSet(packet.Write(), false);
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
}
+56 -98
View File
@@ -75,6 +75,7 @@
#include "UpdateFieldFlags.h"
#include "Util.h"
#include "Vehicle.h"
#include "VehiclePackets.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
@@ -2398,25 +2399,15 @@ uint32 Unit::CalculateDamage(WeaponAttackType attType, bool normalized, bool add
void Unit::SendMeleeAttackStart(Unit* victim)
{
WorldPacket data(SMSG_ATTACKSTART, 8 + 8);
data << uint64(GetGUID());
data << uint64(victim->GetGUID());
SendMessageToSet(&data, true);
TC_LOG_DEBUG("entities.unit", "WORLD: Sent SMSG_ATTACKSTART");
WorldPackets::Combat::AttackStart packet;
packet.Attacker = GetGUID();
packet.Victim = victim->GetGUID();
SendMessageToSet(packet.Write(), IsPlayer());
}
void Unit::SendMeleeAttackStop(Unit* victim)
{
WorldPacket data(SMSG_ATTACKSTOP, (8+8+4));
data << GetPackGUID();
if (victim)
data << victim->GetPackGUID();
else
data << uint8(0);
data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation
SendMessageToSet(&data, true);
TC_LOG_DEBUG("entities.unit", "WORLD: Sent SMSG_ATTACKSTOP");
SendMessageToSet(WorldPackets::Combat::SAttackStop(this, victim).Write(), IsPlayer());
if (victim)
TC_LOG_DEBUG("entities.unit", "%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().GetCounter(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUID().GetCounter());
@@ -8175,12 +8166,6 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry)
{
if (CreateVehicleKit(VehicleId, creatureEntry))
{
// Send others that we now have a vehicle
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, GetPackGUID().size()+4);
data << GetPackGUID();
data << uint32(VehicleId);
SendMessageToSet(&data, true);
player->SendOnCancelExpectedVehicleRideAura();
// mounts can also have accessories
@@ -8228,15 +8213,7 @@ void Unit::Dismount()
// dismount as a vehicle
if (GetTypeId() == TYPEID_PLAYER && GetVehicleKit())
{
// Send other players that we are no longer a vehicle
data.Initialize(SMSG_PLAYER_VEHICLE_DATA, 8+4);
data << GetPackGUID();
data << uint32(0);
ToPlayer()->SendMessageToSet(&data, true);
// Remove vehicle from player
RemoveVehicleKit();
}
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_MOUNTED);
@@ -9931,12 +9908,10 @@ void Unit::SetPower(Powers power, int32 val)
if (IsInWorld())
{
WorldPacket data(SMSG_POWER_UPDATE, 8 + 4 + 1 + 4);
data << GetPackGUID();
data << uint32(1); //power count
data << uint8(power);
data << int32(val);
SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER);
WorldPackets::Combat::PowerUpdate packet;
packet.Guid = GetGUID();
packet.Powers.emplace_back(val, power);
SendMessageToSet(packet.Write(), IsPlayer());
}
// group update
@@ -10123,7 +10098,7 @@ void Unit::RemoveFromWorld()
GetAI()->LeavingWorld();
if (IsVehicle())
RemoveVehicleKit();
RemoveVehicleKit(true);
RemoveCharmAuras();
RemoveBindSightAuras();
@@ -10865,10 +10840,11 @@ void Unit::SendPetAIReaction(ObjectGuid guid)
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return;
WorldPacket data(SMSG_AI_REACTION, 8 + 4);
data << uint64(guid);
data << uint32(AI_REACTION_HOSTILE);
owner->ToPlayer()->SendDirectMessage(&data);
WorldPackets::Combat::AIReaction packet;
packet.UnitGUID = guid;
packet.Reaction = AI_REACTION_HOSTILE;
owner->ToPlayer()->SendDirectMessage(packet.Write());
}
///----------End of Pet responses methods----------
@@ -10936,11 +10912,11 @@ void Unit::SetStandState(uint8 state)
if (IsStandState())
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_SEATED);
if (GetTypeId() == TYPEID_PLAYER)
if (IsPlayer())
{
WorldPacket data(SMSG_STANDSTATE_UPDATE, 1);
data << (uint8)state;
ToPlayer()->SendDirectMessage(&data);
WorldPackets::Misc::StandStateUpdate packet;
packet.State = state;
ToPlayer()->SendDirectMessage(packet.Write());
}
}
@@ -12266,7 +12242,7 @@ void Unit::RestoreFaction()
}
}
bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry)
bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading /*= false*/)
{
VehicleEntry const* vehInfo = sVehicleStore.LookupEntry(id);
if (!vehInfo)
@@ -12275,14 +12251,21 @@ bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry)
m_vehicleKit = new Vehicle(this, vehInfo, creatureEntry);
m_updateFlag |= UPDATEFLAG_VEHICLE;
m_unitTypeMask |= UNIT_MASK_VEHICLE;
if (!loading)
SendSetVehicleRecId(id);
return true;
}
void Unit::RemoveVehicleKit()
void Unit::RemoveVehicleKit(bool onRemoveFromWorld /*= false*/)
{
if (!m_vehicleKit)
return;
if (!onRemoveFromWorld)
SendSetVehicleRecId(0);
m_vehicleKit->Uninstall();
delete m_vehicleKit;
@@ -12470,30 +12453,15 @@ void Unit::SetAuraStack(uint32 spellId, Unit* target, uint32 stack)
void Unit::SendPlaySpellVisualKit(uint32 id, uint32 type, uint32 duration) const
{
ObjectGuid guid = GetGUID();
if (!sSpellVisualKitStore.LookupEntry(id))
return;
WorldPacket data(SMSG_PLAY_SPELL_VISUAL_KIT, 4 + 4+ 4 + 8);
data << uint32(duration);
data << uint32(id); // SpellVisualKit.dbc index
data << uint32(type);
data.WriteBit(guid[4]);
data.WriteBit(guid[7]);
data.WriteBit(guid[5]);
data.WriteBit(guid[3]);
data.WriteBit(guid[1]);
data.WriteBit(guid[2]);
data.WriteBit(guid[0]);
data.WriteBit(guid[6]);
data.FlushBits();
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[4]);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[5]);
SendMessageToSet(&data, true);
WorldPackets::Spells::PlaySpellVisualKit packet;
packet.Unit = GetGUID();
packet.KitRecID = id; // SpellVisualKit.dbc index
packet.KitType = type;
packet.Duration = duration;
SendMessageToSet(packet.Write(), IsPlayer());
}
void Unit::CancelSpellMissiles(uint32 spellId, bool reverseMissile /*= false*/)
@@ -13866,9 +13834,9 @@ uint32 Unit::GetRemainingPeriodicAmount(ObjectGuid caster, uint32 spellId, AuraT
void Unit::SendClearTarget()
{
WorldPacket data(SMSG_BREAK_TARGET, GetPackGUID().size());
data << GetPackGUID();
SendMessageToSet(&data, false);
WorldPackets::Combat::BreakTarget packet;
packet.UnitGUID = GetGUID();
SendMessageToSet(packet.Write(), false);
}
uint32 Unit::GetResistance(SpellSchoolMask mask) const
@@ -14186,38 +14154,28 @@ bool Unit::SetHover(bool enable, bool packetOnly /*= false*/, bool /*updateAnima
return true;
}
void Unit::SendSetVehicleRecId(uint32 vehicleId)
{
WorldPackets::Vehicle::SetVehicleRecID setVehicleRec;
setVehicleRec.VehicleGUID = GetGUID();
setVehicleRec.VehicleRecID = vehicleId;
SendMessageToSet(setVehicleRec.Write(), true);
}
void Unit::SendSetPlayHoverAnim(bool enable)
{
ObjectGuid guid = GetGUID();
WorldPacket data(SMSG_SET_PLAY_HOVER_ANIM, 10);
data.WriteBit(guid[4]);
data.WriteBit(guid[0]);
data.WriteBit(guid[1]);
data.WriteBit(enable);
data.WriteBit(guid[3]);
data.WriteBit(guid[7]);
data.WriteBit(guid[5]);
data.WriteBit(guid[2]);
data.WriteBit(guid[6]);
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[5]);
data.WriteByteSeq(guid[4]);
data.WriteByteSeq(guid[6]);
SendMessageToSet(&data, true);
WorldPackets::Misc::SetPlayHoverAnim packet;
packet.UnitGUID = GetGUID();
packet.PlayHoverAnim = enable;
SendMessageToSet(packet.Write(), IsPlayer());
}
void Unit::SendMovementSetSplineAnim(AnimationTier anim)
{
WorldPacket data(SMSG_SPLINE_MOVE_SET_ANIM, 8 + 4);
data << GetPackGUID();
data << uint32(anim);
SendMessageToSet(&data, false);
WorldPackets::Misc::SetAnimTier packet;
packet.Unit = GetGUID();
packet.Tier = AsUnderlyingType(anim);
SendMessageToSet(packet.Write(), false);
}
bool Unit::IsSplineEnabled() const
+3 -2
View File
@@ -1364,6 +1364,7 @@ class TC_GAME_API Unit : public WorldObject
bool SetWaterWalking(bool enable, bool packetOnly = false);
bool SetFeatherFall(bool enable, bool packetOnly = false);
virtual bool SetHover(bool enable, bool packetOnly = false, bool updateAnimationTier = true);
void SendSetVehicleRecId(uint32 vehicleId);
// Sets the internal orientation value to face the provided target. Does NOT have clientside effects.
void SetOrientationTowards(WorldObject const* target);
@@ -1848,8 +1849,8 @@ class TC_GAME_API Unit : public WorldObject
friend class VehicleJoinEvent;
bool IsAIEnabled, NeedChangeAI;
ObjectGuid LastCharmerGUID;
bool CreateVehicleKit(uint32 id, uint32 creatureEntry);
void RemoveVehicleKit();
bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading = false);
void RemoveVehicleKit(bool onRemoveFromWorld = false);
Vehicle* GetVehicleKit()const { return m_vehicleKit; }
Vehicle* GetVehicle() const { return m_vehicle; }
void SetVehicle(Vehicle* vehicle) { m_vehicle = vehicle; }
+2 -2
View File
@@ -31,10 +31,10 @@ class VehicleJoinEvent;
class TC_GAME_API Vehicle : public TransportBase
{
protected:
friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry);
friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading /*= false*/);
Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry);
friend void Unit::RemoveVehicleKit();
friend void Unit::RemoveVehicleKit(bool onRemoveFromWorld /*= false*/);
~Vehicle();
public:
+2 -9
View File
@@ -18,6 +18,7 @@
#include "WorldSession.h"
#include "Common.h"
#include "CreatureAI.h"
#include "CombatPackets.h"
#include "DBCStores.h"
#include "Log.h"
#include "ObjectAccessor.h"
@@ -88,13 +89,5 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
void WorldSession::SendAttackStop(Unit const* enemy)
{
WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); // we guess size
data << GetPlayer()->GetPackGUID();
if (enemy)
data << enemy->GetPackGUID();
else
data << uint8(0);
data << uint32(0); // unk, can be 1 also
SendPacket(&data);
SendPacket(WorldPackets::Combat::SAttackStop(GetPlayer(), enemy).Write());
}
@@ -30,6 +30,7 @@
#include "QuestPackets.h"
#include "QueryPackets.h"
#include "SystemPackets.h"
#include "VehiclePackets.h"
#include "WhoPackets.h"
#include "WorldStatePackets.h"
@@ -16,6 +16,7 @@
*/
#include "CombatPackets.h"
#include "Unit.h"
WorldPacket const* WorldPackets::Combat::ThreatUpdate::Write()
{
@@ -57,3 +58,58 @@ WorldPacket const* WorldPackets::Combat::ThreatClear::Write()
_worldPacket << UnitGUID.WriteAsPacked();
return &_worldPacket;
}
WorldPacket const* WorldPackets::Combat::PowerUpdate::Write()
{
_worldPacket << Guid.WriteAsPacked();
_worldPacket << uint32(Powers.size());
for (PowerUpdatePower const& power : Powers)
{
_worldPacket << uint8(power.PowerType);
_worldPacket << int32(power.Power);
}
return &_worldPacket;
}
WorldPacket const* WorldPackets::Combat::BreakTarget::Write()
{
_worldPacket << UnitGUID.WriteAsPacked();
return &_worldPacket;
}
WorldPacket const* WorldPackets::Combat::AIReaction::Write()
{
_worldPacket << UnitGUID;
_worldPacket << uint32(Reaction);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Combat::AttackStart::Write()
{
_worldPacket << Attacker;
_worldPacket << Victim;
return &_worldPacket;
}
WorldPackets::Combat::SAttackStop::SAttackStop(Unit const* attacker, Unit const* victim) : ServerPacket(SMSG_ATTACK_STOP, 8 + 8 + 4)
{
Attacker = attacker->GetGUID();
if (victim)
{
Victim = victim->GetGUID();
NowDead = victim->isDead();
}
}
WorldPacket const* WorldPackets::Combat::SAttackStop::Write()
{
_worldPacket << Attacker.WriteAsPacked();
_worldPacket << Victim.WriteAsPacked();
_worldPacket << int32(NowDead);
return &_worldPacket;
}
@@ -21,6 +21,8 @@
#include "Packet.h"
#include "ObjectGuid.h"
class Unit;
namespace WorldPackets
{
namespace Combat
@@ -74,6 +76,70 @@ namespace WorldPackets
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
};
}
}
@@ -249,3 +249,43 @@ WorldPacket const* WorldPackets::Misc::DestroyObject::Write()
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::StandStateUpdate::Write()
{
_worldPacket << uint8(State);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::SetAnimTier::Write()
{
_worldPacket << Unit.WriteAsPacked();
_worldPacket << int32(Tier);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::SetPlayHoverAnim::Write()
{
_worldPacket.WriteBit(UnitGUID[4]);
_worldPacket.WriteBit(UnitGUID[0]);
_worldPacket.WriteBit(UnitGUID[1]);
_worldPacket.WriteBit(PlayHoverAnim);
_worldPacket.WriteBit(UnitGUID[3]);
_worldPacket.WriteBit(UnitGUID[7]);
_worldPacket.WriteBit(UnitGUID[5]);
_worldPacket.WriteBit(UnitGUID[2]);
_worldPacket.WriteBit(UnitGUID[6]);
_worldPacket.FlushBits();
_worldPacket.WriteByteSeq(UnitGUID[3]);
_worldPacket.WriteByteSeq(UnitGUID[2]);
_worldPacket.WriteByteSeq(UnitGUID[1]);
_worldPacket.WriteByteSeq(UnitGUID[7]);
_worldPacket.WriteByteSeq(UnitGUID[0]);
_worldPacket.WriteByteSeq(UnitGUID[5]);
_worldPacket.WriteByteSeq(UnitGUID[4]);
_worldPacket.WriteByteSeq(UnitGUID[6]);
return &_worldPacket;
}
@@ -306,6 +306,38 @@ namespace WorldPackets
ObjectGuid Guid;
bool IsDead = false;
};
class StandStateUpdate : public ServerPacket
{
public:
StandStateUpdate() : ServerPacket(SMSG_STAND_STATE_UPDATE, 1) { }
WorldPacket const* Write() override;
uint8 State = 0;
};
class SetAnimTier final : public ServerPacket
{
public:
SetAnimTier() : ServerPacket(SMSG_SET_ANIM_TIER, 8 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
int32 Tier = 0;
};
class SetPlayHoverAnim final : public ServerPacket
{
public:
SetPlayHoverAnim() : ServerPacket(SMSG_SET_PLAY_HOVER_ANIM, 8 + 1) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
bool PlayHoverAnim = false;
};
}
}
@@ -302,3 +302,30 @@ WorldPacket const* WorldPackets::Spells::CategoryCooldown::Write()
return &_worldPacket;
}
WorldPacket const* WorldPackets::Spells::PlaySpellVisualKit::Write()
{
_worldPacket << uint32(Duration);
_worldPacket << int32(KitRecID);
_worldPacket << int32(KitType);
_worldPacket.WriteBit(Unit[4]);
_worldPacket.WriteBit(Unit[7]);
_worldPacket.WriteBit(Unit[5]);
_worldPacket.WriteBit(Unit[3]);
_worldPacket.WriteBit(Unit[1]);
_worldPacket.WriteBit(Unit[2]);
_worldPacket.WriteBit(Unit[0]);
_worldPacket.WriteBit(Unit[6]);
_worldPacket.WriteByteSeq(Unit[0]);
_worldPacket.WriteByteSeq(Unit[4]);
_worldPacket.WriteByteSeq(Unit[1]);
_worldPacket.WriteByteSeq(Unit[6]);
_worldPacket.WriteByteSeq(Unit[7]);
_worldPacket.WriteByteSeq(Unit[2]);
_worldPacket.WriteByteSeq(Unit[3]);
_worldPacket.WriteByteSeq(Unit[5]);
return &_worldPacket;
}
@@ -249,6 +249,19 @@ namespace WorldPackets
std::vector<CategoryCooldownInfo> CategoryCooldowns;
};
class PlaySpellVisualKit final : public ServerPacket
{
public:
PlaySpellVisualKit() : ServerPacket(SMSG_PLAY_SPELL_VISUAL_KIT, 8 + 4 + 4 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
int32 KitRecID = 0;
int32 KitType = 0;
uint32 Duration = 0;
};
}
}
@@ -0,0 +1,26 @@
/*
* 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/>.
*/
#include "VehiclePackets.h"
WorldPacket const* WorldPackets::Vehicle::SetVehicleRecID::Write()
{
_worldPacket << VehicleGUID.WriteAsPacked();
_worldPacket << int32(VehicleRecID);
return &_worldPacket;
}
@@ -0,0 +1,41 @@
/*
* 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 VehiclePackets_h__
#define VehiclePackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
namespace WorldPackets
{
namespace Vehicle
{
class SetVehicleRecID final : public ServerPacket
{
public:
SetVehicleRecID() : ServerPacket(SMSG_SET_VEHICLE_REC_ID, 8 + 4) { }
WorldPacket const* Write() override;
ObjectGuid VehicleGUID;
int32 VehicleRecID = 0;
};
}
}
#endif // VehiclePackets_h__
+5 -5
View File
@@ -677,8 +677,8 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACKER_STATE_UPDATE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACK_START, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACK_STOP, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, CONNECTION_TYPE_REALM);
@@ -1117,7 +1117,6 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, CONNECTION_TYPE_REALM);
@@ -1197,6 +1196,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_AI_ANIM_KIT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_ANIM_TIER, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_FACTION_NOT_VISIBLE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
@@ -1212,6 +1212,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SET_VEHICLE_REC_ID, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, CONNECTION_TYPE_REALM);
@@ -1244,7 +1245,6 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_ANIM, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
@@ -1268,7 +1268,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STAND_STATE_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, CONNECTION_TYPE_REALM);
+7 -7
View File
@@ -606,8 +606,8 @@ enum OpcodeServer
SMSG_ARENA_TEAM_ROSTER = 0x2717,
SMSG_ARENA_TEAM_STATS = 0x4425,
SMSG_ATTACKER_STATE_UPDATE = 0x0B25,
SMSG_ATTACKSTART = 0x2D15,
SMSG_ATTACKSTOP = 0x0934,
SMSG_ATTACK_START = 0x2D15,
SMSG_ATTACK_STOP = 0x0934,
SMSG_ATTACKSWING_BADFACING = 0x6C07,
SMSG_ATTACKSWING_CANT_ATTACK = 0x0016,
SMSG_ATTACKSWING_DEADTARGET = 0x2B26,
@@ -1073,7 +1073,6 @@ enum OpcodeServer
SMSG_PLAYERBOUND = 0x2516,
SMSG_PLAYER_DIFFICULTY_CHANGE = 0x2217,
SMSG_PLAYER_SKINNED = 0x0116,
SMSG_PLAYER_VEHICLE_DATA = 0x4115,
SMSG_PLAY_DANCE = 0x4704,
SMSG_PLAY_MUSIC = 0x4B06,
SMSG_PLAY_OBJECT_SOUND = 0x2635,
@@ -1156,6 +1155,7 @@ enum OpcodeServer
SMSG_SERVER_MESSAGE = 0x6C04,
SMSG_SERVER_PERF = 0x74B6,
SMSG_SET_AI_ANIM_KIT = 0x4626,
SMSG_SET_ANIM_TIER = 0x4335,
SMSG_SET_DF_FAST_LAUNCH_RESULT = 0x35B6,
SMSG_SET_FACTION_ATWAR = 0x4216,
SMSG_SET_FACTION_NOT_VISIBLE = 0x6737,
@@ -1171,6 +1171,7 @@ enum OpcodeServer
SMSG_SET_PLAY_HOVER_ANIM = 0x30A6,
SMSG_SET_PROFICIENCY = 0x6207,
SMSG_SET_PROJECTILE_POSITION = 0x2616,
SMSG_SET_VEHICLE_REC_ID = 0x4115,
SMSG_SHOWTAXINODES = 0x2A36,
SMSG_SHOW_BANK = 0x2627,
SMSG_SHOW_MAILBOX = 0x2524,
@@ -1203,7 +1204,6 @@ enum OpcodeServer
SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x5DB5,
SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6,
SMSG_SPLINE_MOVE_ROOT = 0x51B4,
SMSG_SPLINE_MOVE_SET_ANIM = 0x4335,
SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5,
SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x38B3,
SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x39A0,
@@ -1228,7 +1228,7 @@ enum OpcodeServer
SMSG_SPLINE_MOVE_UNSET_HOVER = 0x7DA5,
SMSG_SPLINE_MOVE_WATER_WALK = 0x50A2,
SMSG_STABLE_RESULT = 0x2204,
SMSG_STANDSTATE_UPDATE = 0x6F04,
SMSG_STAND_STATE_UPDATE = 0x6F04,
SMSG_START_MIRROR_TIMER = 0x6824,
SMSG_START_TIMER = 0x59A5,
SMSG_STOP_DANCE = 0x4637,
@@ -1390,7 +1390,7 @@ inline bool IsInstanceOnlyOpcode(uint32 opcode)
{
switch (opcode)
{
case SMSG_ATTACKSTOP:
case SMSG_ATTACK_STOP:
case SMSG_DUEL_INBOUNDS:
case SMSG_DUEL_OUTOFBOUNDS:
case SMSG_ITEM_PUSH_RESULT:
@@ -1400,7 +1400,7 @@ inline bool IsInstanceOnlyOpcode(uint32 opcode)
case SMSG_DUEL_COMPLETE:
case SMSG_LOOT_MONEY_NOTIFY:
case SMSG_COIN_REMOVED:
case SMSG_ATTACKSTART:
case SMSG_ATTACK_START:
case SMSG_DUEL_WINNER:
case SMSG_DUEL_REQUESTED:
case SMSG_LOOT_RESPONSE:
@@ -5129,11 +5129,6 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode,
if (target->GetTypeId() != TYPEID_PLAYER)
return;
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, target->GetPackGUID().size()+4);
data << target->GetPackGUID();
data << uint32(apply ? vehicleId : 0);
target->SendMessageToSet(&data, true);
if (apply)
target->ToPlayer()->SendOnCancelExpectedVehicleRideAura();
}
@@ -157,10 +157,6 @@ class instance_vortex_pinnacle : public InstanceMapScript
{
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, creature->GetPackGUID().size() + 4);
data << creature->GetPackGUID();
data << uint32(info.VehicleId);
creature->SendMessageToSet(&data, true);
}
AddObject(creature, info.GuidDataId, true);
break;
@@ -746,12 +746,6 @@ class npc_gunship : public CreatureScript
if (isVictory)
{
cannon->CastSpell(cannon, SPELL_EJECT_ALL_PASSENGERS_BELOW_ZERO, TRIGGERED_FULL_MASK);
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, cannon->GetPackGUID().size() + 4);
data << cannon->GetPackGUID();
data << uint32(0);
cannon->SendMessageToSet(&data, true);
cannon->RemoveVehicleKit();
}
else