public void ReturnToSpawn() { if (!Obj.IsCreature()) { return; } Creature Crea = Obj.GetCreature(); Crea.MvtInterface.CancelWalkTo(); Crea.SetPosition((UInt16)Crea.SpawnPoint.X, (UInt16)Crea.SpawnPoint.Y, (UInt16)Crea.SpawnPoint.Z, Crea.SpawnHeading); }
private void ReturnToSpawn() { AI.Debugger?.SendClientMessage("[MR]: Retreating to the spawnpoint."); if (_unit.IsInstanceSpawn()) { InstanceSpawn npc = (InstanceSpawn)_unit; npc.BuffInterface.RemoveAllBuffs(); npc.ReceiveHeal(null, npc.MaxHealth); npc.SetPosition((ushort)npc.SpawnPoint.X, (ushort)npc.SpawnPoint.Y, (ushort)npc.SpawnPoint.Z, npc.SpawnHeading, npc.Spawn.ZoneId, true); } else { Creature npc = (Creature)_unit; npc.BuffInterface.RemoveAllBuffs(); npc.ReceiveHeal(null, npc.MaxHealth); npc.SetPosition((ushort)npc.SpawnPoint.X, (ushort)npc.SpawnPoint.Y, (ushort)npc.SpawnPoint.Z, npc.SpawnHeading, npc.Spawn.ZoneId, true); } }