Esempio n. 1
0
 public void OnActorAppears(Actor aActor)
 {
     if (Client == null) return;
     switch (aActor.type)
     {
         case ActorType.PC:
             Packets.Server.SSMG_ACTOR_PC_APPEAR p = new SagaMap.Packets.Server.SSMG_ACTOR_PC_APPEAR();
             ActorPC pc = (ActorPC)aActor;
             p.ActorID = pc.ActorID;
             p.Dir = (byte)(pc.Dir / 45);
             p.HP = pc.HP;
             p.MaxHP = pc.MaxHP;
             p.PossessionActorID = 0xFFFFFFFF;
             p.PossessionPosition = PossessionPosition.NONE;
             p.Speed = pc.Speed;
             p.X = Global.PosX16to8(pc.X);
             p.Y = Global.PosY16to8(pc.Y);
             this.Client.netIO.SendPacket(p);
             break;
         case ActorType.ITEM:
             Packets.Server.SSMG_ITEM_ACTOR_APPEAR p1 = new SagaMap.Packets.Server.SSMG_ITEM_ACTOR_APPEAR();
             p1.Item = (ActorItem)aActor;
             this.Client.netIO.SendPacket(p1);
             break;
         default:
             break;
     }
 }
Esempio n. 2
0
        public void OnActorAppears(Actor aActor)
        {
            if (Client == null)
            {
                return;
            }
            switch (aActor.type)
            {
            case ActorType.PC:
                Packets.Server.SSMG_ACTOR_PC_APPEAR p = new SagaMap.Packets.Server.SSMG_ACTOR_PC_APPEAR();
                ActorPC pc = (ActorPC)aActor;
                p.ActorID            = pc.ActorID;
                p.Dir                = (byte)(pc.Dir / 45);
                p.HP                 = pc.HP;
                p.MaxHP              = pc.MaxHP;
                p.PossessionActorID  = 0xFFFFFFFF;
                p.PossessionPosition = PossessionPosition.NONE;
                p.Speed              = pc.Speed;
                p.X = Global.PosX16to8(pc.X);
                p.Y = Global.PosY16to8(pc.Y);
                this.Client.netIO.SendPacket(p);
                break;

            case ActorType.ITEM:
                Packets.Server.SSMG_ITEM_ACTOR_APPEAR p1 = new SagaMap.Packets.Server.SSMG_ITEM_ACTOR_APPEAR();
                p1.Item = (ActorItem)aActor;
                this.Client.netIO.SendPacket(p1);
                break;

            default:
                break;
            }
        }