refactor(Core/Creature): Remove Inhabit Type (#9272)

This is in reference to issue: https://github.com/azerothcore/azerothcore-wotlk/issues/4361
This is comprised of a cherry pick and partial tc cherry pick:
592516ae69
dbadb6369c
34cfa69efd
12de860b4a
a22bc236eb
This commit is contained in:
acidmanifesto
2022-01-06 14:33:22 +01:00
committed by GitHub
parent d504a62293
commit 2d4e17fd16
26 changed files with 4948 additions and 230 deletions

View File

@@ -44,7 +44,9 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
return;
// Stop the npc if moving
unit->StopMoving();
if (uint32 pause = unit->GetMovementTemplate().GetInteractionPauseTimer())
unit->PauseMovement(pause);
unit->SetHomePosition(unit->GetPosition());
BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(unit->GetEntry());

View File

@@ -1001,10 +1001,9 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
}
// Stop the npc if moving
if (vendor->HasUnitState(UNIT_STATE_MOVING))
{
vendor->StopMoving();
}
if (uint32 pause = vendor->GetMovementTemplate().GetInteractionPauseTimer())
vendor->PauseMovement(pause);
vendor->SetHomePosition(vendor->GetPosition());
SetCurrentVendor(vendorEntry);

View File

@@ -491,6 +491,13 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
}
}
if (plrMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plrMover->IsInWater())
{
// now client not include swimming flag in case jumping under water
plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetMap()->IsUnderWater(plrMover->GetPhaseMask(), movementInfo.pos.GetPositionX(),
movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ(), plrMover->GetCollisionHeight()));
}
bool jumpopcode = false;
if (opcode == MSG_MOVE_JUMP)
{

View File

@@ -302,12 +302,10 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
//if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
// GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// xinef: and if he has pure gossip or is banker and moves or is tabard designer?
//if (unit->IsArmorer() || unit->IsCivilian() || unit->IsQuestGiver() || unit->IsServiceProvider() || unit->IsGuard())
{
//if (!unit->GetTransport()) // pussywizard: reverted with new spline (old: without this check, npc would stay in place and the transport would continue moving, so the npc falls off. NPCs on transports don't have waypoints, so stopmoving is not needed)
unit->StopMoving();
}
// Stop the npc if moving
if (uint32 pause = unit->GetMovementTemplate().GetInteractionPauseTimer())
unit->PauseMovement(pause);
unit->SetHomePosition(unit->GetPosition());
// If spiritguide, no need for gossip menu, just put player into resurrect queue
if (unit->IsSpiritGuide())

View File

@@ -90,9 +90,11 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
//if (!creature->GetTransport()) // pussywizard: reverted with new spline (old: without this check, npc would stay in place and the transport would continue moving, so the npc falls off. NPCs on transports don't have waypoints, so stopmoving is not needed)
creature->StopMoving();
if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
creature->PauseMovement(pause);
creature->SetHomePosition(creature->GetPosition());
if (sScriptMgr->OnGossipHello(_player, creature))
return;