Merge branch '4.3.4' of https://github.com/Ovahlord/TrinityCore into 4.3.4

This commit is contained in:
Ovahlord committed 2019-10-08 15:14:44 +02:00
commit 3640c11096
8 files changed
+23 -16

No files matched your search

+12 -7
View File
@@ -256,15 +256,16 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const
data->AddOutOfRangeGUID(GetGUID());
}
void Object::DestroyForPlayer(Player* target) const
void Object::DestroyForPlayer(Player* target, bool onDeath /*= false*/) const
{
ASSERT(target);
UpdateData updateData(target->GetMapId());
BuildOutOfRangeUpdateBlock(&updateData);
WorldPacket packet;
updateData.BuildPacket(&packet);
target->SendDirectMessage(&packet);
WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1);
data << uint64(GetGUID());
//! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object.
//! OnDeath() does for eg trigger death animation and interrupts certain spells/missiles/auras/sounds...
data << uint8(onDeath ? 1 : 0);
target->SendDirectMessage(&data);
}
int32 Object::GetInt32Value(uint16 index) const
@@ -2679,7 +2680,11 @@ void WorldObject::DestroyForNearbyPlayers()
if (isType(TYPEMASK_UNIT) && ToUnit()->GetCharmerGUID() == player->GetGUID()) /// @todo this is for puppet
continue;
DestroyForPlayer(player); // at remove from world (destroy) show kill animation
if (GetTypeId() == TYPEID_UNIT)
DestroyForPlayer(player, ToUnit()->IsDuringRemoveFromWorld() && ToCreature()->isDead()); // at remove from world (destroy) show kill animation
else
DestroyForPlayer(player);
player->m_clientGUIDs.erase(GetGUID());
}
}
+1 -1
View File
@@ -89,7 +89,7 @@ class TC_GAME_API Object
void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void BuildOutOfRangeUpdateBlock(UpdateData* data) const;
virtual void DestroyForPlayer(Player* target) const;
virtual void DestroyForPlayer(Player* target, bool onDeath = false) const;
int32 GetInt32Value(uint16 index) const;
uint32 GetUInt32Value(uint16 index) const;
+3 -3
View File
@@ -4056,9 +4056,9 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
Unit::BuildCreateUpdateBlockForPlayer(data, target);
}
void Player::DestroyForPlayer(Player* target) const
void Player::DestroyForPlayer(Player* target, bool onDeath /*= false*/) const
{
Unit::DestroyForPlayer(target);
Unit::DestroyForPlayer(target, onDeath);
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
@@ -5656,7 +5656,7 @@ inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLeve
return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_GREY) * 10;
if (SkillValue >= GreenLevel)
return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_GREEN)* 10;
if (SkillValue >= YellowLevel)
if (SkillValue >= YellowLevel)
return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_YELLOW) * 10;
return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_ORANGE) * 10;
}
+1 -1
View File
@@ -1856,7 +1856,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
WorldSession* GetSession() const { return m_session; }
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override;
void DestroyForPlayer(Player* target) const override;
void DestroyForPlayer(Player* target, bool onDeath = false) const override;
void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f) const;
// notifiers
+1 -1
View File
@@ -14665,7 +14665,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
data->append(fieldBuffer);
}
void Unit::DestroyForPlayer(Player* target) const
void Unit::DestroyForPlayer(Player* target, bool onDeath /*= false*/) const
{
if (Battleground* bg = target->GetBattleground())
{
+2 -2
View File
@@ -438,7 +438,7 @@ enum UnitState : uint32
UNIT_STATE_FOLLOW_MOVE = 0x08000000,
UNIT_STATE_IGNORE_PATHFINDING = 0x10000000, // do not use pathfinding in any MovementGenerator
UNIT_STATE_ALL_STATE_SUPPORTED = UNIT_STATE_DIED | UNIT_STATE_MELEE_ATTACKING | UNIT_STATE_CHARMED | UNIT_STATE_STUNNED | UNIT_STATE_ROAMING | UNIT_STATE_CHASE
UNIT_STATE_ALL_STATE_SUPPORTED = UNIT_STATE_DIED | UNIT_STATE_MELEE_ATTACKING | UNIT_STATE_CHARMED | UNIT_STATE_STUNNED | UNIT_STATE_ROAMING | UNIT_STATE_CHASE
| UNIT_STATE_FOCUSING | UNIT_STATE_FLEEING | UNIT_STATE_IN_FLIGHT | UNIT_STATE_FOLLOW | UNIT_STATE_ROOT | UNIT_STATE_CONFUSED
| UNIT_STATE_DISTRACTED | UNIT_STATE_ISOLATED | UNIT_STATE_ATTACK_PLAYER | UNIT_STATE_CASTING
| UNIT_STATE_POSSESSED | UNIT_STATE_CHARGING | UNIT_STATE_JUMPING | UNIT_STATE_MOVE | UNIT_STATE_ROTATING
@@ -1912,7 +1912,7 @@ class TC_GAME_API Unit : public WorldObject
explicit Unit (bool isWorldObject);
void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override;
void DestroyForPlayer(Player* target) const override;
void DestroyForPlayer(Player* target, bool onDeath = false) const override;
UnitAI* i_AI, *i_disabledAI;
+2 -1
View File
@@ -651,7 +651,7 @@ void OpcodeTable::Initialize()
#define DEFINE_SERVER_OPCODE_HANDLER(opcode, status, con) \
ValidateAndSetServerOpcode(opcode, #opcode, status, con)
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
@@ -808,6 +808,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, CONNECTION_TYPE_REALM);
@@ -747,6 +747,7 @@ enum OpcodeServer
SMSG_DEBUG_RUNE_REGEN = 0x31B3,
SMSG_DEBUG_SERVER_GEO = 0x0235,
SMSG_DEFENSE_MESSAGE = 0x0314,
SMSG_DESTROY_OBJECT = 0x4724,
SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x4825,
SMSG_DIFFERENT_INSTANCE_FROM_PARTY = 0x15B1,
SMSG_DISENCHANT_CREDIT = 0x55A2,