Exemplo n.º 1
0
        private async void RemoveCorpse(object sender, ElapsedEventArgs e)
        {
            CorpseTimer.Stop();
            CorpseTimer.Enabled = false;
            await BroadcastPacketAsync(new DeleteObject(ObjectId));

            L2World.RemoveObject(this);
        }
Exemplo n.º 2
0
        public override async Task OnActionAsync(L2Player player)
        {
            double dis = Calcs.CalculateDistance(this, player, true);
            await player.SendMessageAsync($"{AsString()} dis {(int)dis}");

            if (dis < 80)
            {
                foreach (L2Player p in Region.GetAllNeighbourPlayers())
                {
                    p.SendPacketAsync(new GetItem(p.ObjectId, ObjectId, X, Y, Z));
                    p.SendPacketAsync(new DeleteObject(ObjectId));
                }

                player.OnPickUp(this);

                L2World.RemoveObject(this);
            }
            else // TODO: Rework this
            {
                await player.Movement.MoveTo(X, Y, Z);
            }
        }
Exemplo n.º 3
0
        public override async Task OnActionAsync(L2Player player)
        {
            double dis = Calcs.CalculateDistance(this, player, true);
            await player.SendMessageAsync($"{AsString()} dis {(int)dis}");

            if (dis < 80)
            {
                foreach (L2Player o in KnownObjects.Values.OfType <L2Player>())
                {
                    await o.SendPacketAsync(new GetItem(player.ObjectId, ObjectId, X, Y, Z));

                    await o.SendPacketAsync(new DeleteObject(ObjectId));
                }

                player.OnPickUp(this);

                L2World.RemoveObject(this);
            }
            else
            {
                await player.CharMovement.MoveTo(X, Y, Z);
            }
        }
Exemplo n.º 4
0
 public virtual void DecayMe()
 {
     L2World.RemoveObject(this);
 }
Exemplo n.º 5
0
        //public virtual void ReduceHp(L2Character attacker, double damage) { }

        public virtual void DecayMe()
        {
            Region = null;

            L2World.RemoveObject(this);
        }