Beispiel #1
0
        public void NotifyMinionSpawned(IMinion minion, TeamId team)
        {
            var spawnPacket = new LeaguePackets.GamePackets.SpawnMinionS2C();

            spawnPacket.NetID       = (NetID)minion.NetId;
            spawnPacket.SenderNetID = (NetID)minion.NetId;
            if (minion.Owner == null)
            {
                spawnPacket.OwnerNetID = (NetID)minion.NetId;
            }
            else
            {
                spawnPacket.OwnerNetID = (NetID)minion.Owner.NetId;
            }
            spawnPacket.NetNodeID          = NetNodeID.Spawned;
            spawnPacket.Position           = new Vector3(minion.GetPosition().X, minion.GetZ(), minion.GetPosition().Y); // check if work, probably not
            spawnPacket.TeamID             = (TeamID)minion.Team;
            spawnPacket.Name               = minion.Name;
            spawnPacket.SkinName           = minion.Model;
            spawnPacket.InitialLevel       = 1;
            spawnPacket.VisibilitySize     = 0;
            spawnPacket.SkinID             = 0;
            spawnPacket.IsTargetable       = true;
            spawnPacket.IsWard             = true;
            spawnPacket.IsTargetableToTeam = SpellFlags.TargetableToAll;
            var visionPacket = new LeaguePackets.GamePackets.OnEnterVisiblityClient();
            var vd           = new LeaguePackets.CommonData.VisibilityDataAIMinion();

            vd.LookAtPosition = new Vector3(1, 0, 0);
            var md = new LeaguePackets.CommonData.MovementDataStop();

            md.Position                 = minion.GetPosition();
            md.Forward                  = new Vector2(0, 1);
            vd.MovementSyncID           = 0x0006E4CF;
            vd.MovementData             = md;
            visionPacket.VisibilityData = vd;
            visionPacket.Packets.Add(spawnPacket);
            visionPacket.SenderNetID = (NetID)minion.NetId;
            _packetHandlerManager.BroadcastPacketVision(minion, visionPacket.GetBytes(), Channel.CHL_S2C);
            //var spawnPacket = new SpawnMinion(minion);
            //_packetHandlerManager.BroadcastPacketVision(minion, spawnPacket, Channel.CHL_S2C);
        }
Beispiel #2
0
        public SpawnMinion(IMinion m)
            : base(PacketCmd.PKT_S2C_OBJECT_SPAWN)
        {
            WriteNetId(m);

            Write((byte)0xB5);
            Write((byte)0x00);
            Write((byte)0xB3);
            Write((byte)0x00);
            Write((byte)0x7C);

            WriteNetId(m);
            WriteNetId(m);
            WriteNetId(m.Owner);

            Write((byte)0x40);

            Write(m.X);      //x
            Write(m.GetZ()); //z
            Write(m.Y);      //y

            Fill(0, 8);

            Write((short)m.Team);
            Write((byte)0x92);
            Write((byte)0x00);

            Write((byte)0x00);
            Write((byte)0x00);
            Write((byte)0x02);
            Write((byte)0x00);
            Write((byte)0x00);
            Write((byte)0x00);
            Write((byte)0x00);

            WriteConstLengthString(m.Name, 64);

            WriteConstLengthString(m.Model, 64);

            Write((byte)0x01);

            Fill(0, 16);

            Write(1.0f); // Unk

            Fill(0, 13);

            Write((byte)0x03);

            Write((byte)0xB1); // <--|
            Write((byte)0x20); //    | Unknown, changes between packets
            Write((byte)0x18); //    |
            Write((byte)0x00); // <--|

            Write(m.X);
            Write(m.Y);

            Write((byte)0x00); // 0.0f
            Write((byte)0x00); // Probably a float, see SpawnMonster
            Write((byte)0x00);
            Write((byte)0x00);

            Write((byte)0xFF); // 1.0f
            Write((byte)0xFF); // Probably a float, see SpawnMonster
            Write((byte)0x7F);
            Write((byte)0x3F);
        }