예제 #1
0
        public static void TestCorpse(Session session, params string[] parameters)
        {
            if (session.Player.SelectedTarget != 0)
            {
                var target = new ObjectGuid(session.Player.SelectedTarget);
                var wo     = LandblockManager.GetWorldObject(session, target);

                if (target.IsCreature())
                {
                    if (wo != null)
                    {
                        (wo as Creature).OnKill(session);
                    }
                }
            }
            else
            {
                ChatPacket.SendServerMessage(session, "No creature selected.", ChatMessageType.Broadcast);
            }
        }
예제 #2
0
        private void RemoveWorldObjectInternal(ObjectGuid objectId, bool adjacencyMove)
        {
            WorldObject wo = null;

            Log($"removing {objectId.Full:X}");

            if (worldObjects.ContainsKey(objectId))
            {
                wo = worldObjects[objectId];
                if (!objectId.IsCreature())
                {
                    worldObjects.Remove(objectId);
                }
            }

            if (wo != null)
            {
                wo.SetParent(null);
                EnqueueActionBroadcast(wo.Location, MaxObjectRange, (Player p) => p.StopTrackingObject(wo, true));
            }
        }