fix(Scripts/Karazhan): Chess Event. (#14736)

This commit is contained in:
UltraNix
2023-03-15 04:07:49 +01:00
committed by GitHub
parent 6cf0f57616
commit b21f98d639
11 changed files with 2570 additions and 57 deletions

View File

@@ -18575,15 +18575,15 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
// Charmer stop charming
if (playerCharmer)
{
playerCharmer->StopCastingCharm();
playerCharmer->StopCastingBindSight();
playerCharmer->StopCastingCharm(aurApp ? aurApp->GetBase() : nullptr);
playerCharmer->StopCastingBindSight(aurApp ? aurApp->GetBase() : nullptr);
}
// Charmed stop charming
if (GetTypeId() == TYPEID_PLAYER)
{
ToPlayer()->StopCastingCharm();
ToPlayer()->StopCastingBindSight();
ToPlayer()->StopCastingCharm(aurApp ? aurApp->GetBase() : nullptr);
ToPlayer()->StopCastingBindSight(aurApp ? aurApp->GetBase() : nullptr);
}
// StopCastingCharm may remove a possessed pet?
@@ -18695,8 +18695,11 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime().count())); // cast can't be helped
}
}
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
playerCharmer->CharmSpellInitialize();
if (playerCharmer->m_seer != this)
{
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
playerCharmer->CharmSpellInitialize();
}
break;
default:
break;