[svn] Possession:
* Fixed player not having PvP flag on remove * Fixed pet resetting its aggro on remove * Fixed pet bar resetting on remove (?) * Added dummy handler for NOT_ACTIVE_MOVER, display message only in debug logging mode --HG-- branch : trunk
This commit is contained in:
@@ -538,6 +538,11 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
|
|||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldSession::HandleNotActiveMoverOpcode(WorldPacket& /*recv_data*/)
|
||||||
|
{
|
||||||
|
sLog.outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER");
|
||||||
|
}
|
||||||
|
|
||||||
void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
|
void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
|
||||||
{
|
{
|
||||||
//sLog.outDebug("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM");
|
//sLog.outDebug("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM");
|
||||||
|
|||||||
@@ -749,7 +749,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
|||||||
/*0x2CE*/ { "CMSG_MOVE_TIME_SKIPPED", STATUS_LOGGEDIN, &WorldSession::HandleMoveTimeSkippedOpcode },
|
/*0x2CE*/ { "CMSG_MOVE_TIME_SKIPPED", STATUS_LOGGEDIN, &WorldSession::HandleMoveTimeSkippedOpcode },
|
||||||
/*0x2CF*/ { "CMSG_MOVE_FEATHER_FALL_ACK", STATUS_LOGGEDIN, &WorldSession::HandleFeatherFallAck },
|
/*0x2CF*/ { "CMSG_MOVE_FEATHER_FALL_ACK", STATUS_LOGGEDIN, &WorldSession::HandleFeatherFallAck },
|
||||||
/*0x2D0*/ { "CMSG_MOVE_WATER_WALK_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveWaterWalkAck },
|
/*0x2D0*/ { "CMSG_MOVE_WATER_WALK_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveWaterWalkAck },
|
||||||
/*0x2D1*/ { "CMSG_MOVE_NOT_ACTIVE_MOVER", STATUS_NEVER, &WorldSession::Handle_NULL },
|
/*0x2D1*/ { "CMSG_MOVE_NOT_ACTIVE_MOVER", STATUS_LOGGEDIN, &WorldSession::HandleNotActiveMoverOpcode },
|
||||||
/*0x2D2*/ { "SMSG_PLAY_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
/*0x2D2*/ { "SMSG_PLAY_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
||||||
/*0x2D3*/ { "CMSG_BATTLEFIELD_STATUS", STATUS_LOGGEDIN, &WorldSession::HandleBattlefieldStatusOpcode },
|
/*0x2D3*/ { "CMSG_BATTLEFIELD_STATUS", STATUS_LOGGEDIN, &WorldSession::HandleBattlefieldStatusOpcode },
|
||||||
/*0x2D4*/ { "SMSG_BATTLEFIELD_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
/*0x2D4*/ { "SMSG_BATTLEFIELD_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
||||||
|
|||||||
+13
-10
@@ -18660,6 +18660,8 @@ void Player::Possess(Unit *target)
|
|||||||
// Update the proper unit fields
|
// Update the proper unit fields
|
||||||
SetPossessedTarget(target);
|
SetPossessedTarget(target);
|
||||||
|
|
||||||
|
uint32 flags1 = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||||
|
|
||||||
target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
|
target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
|
||||||
target->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
target->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
|
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
|
||||||
@@ -18667,6 +18669,8 @@ void Player::Possess(Unit *target)
|
|||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||||
SetUInt64Value(PLAYER_FARSIGHT, target->GetGUID());
|
SetUInt64Value(PLAYER_FARSIGHT, target->GetGUID());
|
||||||
|
|
||||||
|
uint32 flags2 = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||||
|
|
||||||
if(target->GetTypeId() == TYPEID_UNIT)
|
if(target->GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
// Set target to active in the grid and place it in the world container to be picked up by all regular player cell visits
|
// Set target to active in the grid and place it in the world container to be picked up by all regular player cell visits
|
||||||
@@ -18720,6 +18724,10 @@ void Player::RemovePossess(bool attack)
|
|||||||
++itr;
|
++itr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Interrupt any current casting of the target
|
||||||
|
if(target->IsNonMeleeSpellCasted(true))
|
||||||
|
target->InterruptNonMeleeSpells(true);
|
||||||
|
|
||||||
RemovePossessedTarget();
|
RemovePossessedTarget();
|
||||||
|
|
||||||
if(target->GetTypeId() == TYPEID_PLAYER)
|
if(target->GetTypeId() == TYPEID_PLAYER)
|
||||||
@@ -18743,7 +18751,6 @@ void Player::RemovePossess(bool attack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
|
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
|
||||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
|
||||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||||
SetUInt64Value(PLAYER_FARSIGHT, 0);
|
SetUInt64Value(PLAYER_FARSIGHT, 0);
|
||||||
|
|
||||||
@@ -18758,18 +18765,14 @@ void Player::RemovePossess(bool attack)
|
|||||||
((Player*)target)->SetViewport(target->GetGUID(), true);
|
((Player*)target)->SetViewport(target->GetGUID(), true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
if(((Creature*)target)->isPet())
|
if(((Creature*)target)->isPet())
|
||||||
{
|
|
||||||
((Pet*)target)->InitPetCreateSpells();
|
|
||||||
PetSpellInitialize();
|
PetSpellInitialize();
|
||||||
}
|
else if (target->isAlive())
|
||||||
|
|
||||||
if (target->isAlive())
|
|
||||||
{
|
{
|
||||||
// If we're still hostile to our target, continue attacking otherwise reset threat and go home
|
// If we're still hostile to our target, continue attacking otherwise reset threat and go home
|
||||||
if (target->getVictim())
|
if (Unit* victim = target->getVictim())
|
||||||
{
|
{
|
||||||
Unit* victim = target->getVictim();
|
|
||||||
FactionTemplateEntry const* t_faction = target->getFactionTemplateEntry();
|
FactionTemplateEntry const* t_faction = target->getFactionTemplateEntry();
|
||||||
FactionTemplateEntry const* v_faction = victim->getFactionTemplateEntry();
|
FactionTemplateEntry const* v_faction = victim->getFactionTemplateEntry();
|
||||||
// Unit::IsHostileTo will always return true since the unit is always hostile to its victim
|
// Unit::IsHostileTo will always return true since the unit is always hostile to its victim
|
||||||
@@ -18783,14 +18786,14 @@ void Player::RemovePossess(bool attack)
|
|||||||
target->GetMotionMaster()->MoveTargetedHome();
|
target->GetMotionMaster()->MoveTargetedHome();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (target->GetTypeId() == TYPEID_UNIT)
|
else
|
||||||
{
|
{
|
||||||
target->GetMotionMaster()->Clear();
|
target->GetMotionMaster()->Clear();
|
||||||
target->GetMotionMaster()->MoveTargetedHome();
|
target->GetMotionMaster()->MoveTargetedHome();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add high amount of threat on the player
|
// Add high amount of threat on the player
|
||||||
if(target != GetPet() && attack)
|
if(attack)
|
||||||
target->AddThreat(this, 1000000.0f);
|
target->AddThreat(this, 1000000.0f);
|
||||||
}
|
}
|
||||||
// Delete the assigned possessed AI
|
// Delete the assigned possessed AI
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ class TRINITY_DLL_SPEC WorldSession
|
|||||||
void HandleMovementOpcodes(WorldPacket& recvPacket);
|
void HandleMovementOpcodes(WorldPacket& recvPacket);
|
||||||
void HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& movementInfo, uint32& MovementFlags);
|
void HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& movementInfo, uint32& MovementFlags);
|
||||||
void HandleSetActiveMoverOpcode(WorldPacket &recv_data);
|
void HandleSetActiveMoverOpcode(WorldPacket &recv_data);
|
||||||
|
void HandleNotActiveMoverOpcode(WorldPacket &recv_data);
|
||||||
void HandleMoveTimeSkippedOpcode(WorldPacket &recv_data);
|
void HandleMoveTimeSkippedOpcode(WorldPacket &recv_data);
|
||||||
|
|
||||||
void HandleRequestRaidInfoOpcode( WorldPacket & recv_data );
|
void HandleRequestRaidInfoOpcode( WorldPacket & recv_data );
|
||||||
|
|||||||
Reference in New Issue
Block a user