mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Pets] Client Pet summoned by NPC should not change guard location. (#2967)
* [Pets] Client Pet summoned by NPC should not change guard location. * Update mob.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
+28
-6
@@ -2374,14 +2374,14 @@ void Mob::ShowBuffList(Client* client) {
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::GMMove(float x, float y, float z, float heading) {
|
||||
void Mob::GMMove(float x, float y, float z, float heading, bool save_guard_spot) {
|
||||
m_Position.x = x;
|
||||
m_Position.y = y;
|
||||
m_Position.z = z;
|
||||
SetHeading(heading);
|
||||
mMovementManager->SendCommandToClients(this, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeAny);
|
||||
|
||||
if (IsNPC()) {
|
||||
if (IsNPC() && save_guard_spot) {
|
||||
CastToNPC()->SaveGuardSpot(glm::vec4(x, y, z, heading));
|
||||
}
|
||||
}
|
||||
@@ -3714,10 +3714,32 @@ bool Mob::HateSummon() {
|
||||
// probably should be like half melee range, but we can't get melee range nicely because reasons :)
|
||||
new_pos = target->TryMoveAlong(new_pos, 5.0f, angle);
|
||||
|
||||
if (target->IsClient())
|
||||
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), new_pos.x, new_pos.y, new_pos.z, new_pos.w, 0, SummonPC);
|
||||
else
|
||||
target->GMMove(new_pos.x, new_pos.y, new_pos.z, new_pos.w);
|
||||
if (target->IsClient()) {
|
||||
target->CastToClient()->MovePC(
|
||||
zone->GetZoneID(),
|
||||
zone->GetInstanceID(),
|
||||
new_pos.x,
|
||||
new_pos.y,
|
||||
new_pos.z,
|
||||
new_pos.w,
|
||||
0,
|
||||
SummonPC
|
||||
);
|
||||
} else {
|
||||
bool target_is_client_pet = (
|
||||
target->IsPet() &&
|
||||
target->IsPetOwnerClient()
|
||||
);
|
||||
bool set_new_guard_spot = !(IsNPC() && target_is_client_pet);
|
||||
|
||||
target->GMMove(
|
||||
new_pos.x,
|
||||
new_pos.y,
|
||||
new_pos.z,
|
||||
new_pos.w,
|
||||
set_new_guard_spot
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if(summon_level == 2) {
|
||||
|
||||
Reference in New Issue
Block a user