public static void AppendNpcXY(IMap map, PacketHitList hitlist, int mapSlot)
 {
     MapNpc mapNpc = map.ActiveNpc[mapSlot];
     hitlist.AddPacketToOthers(mapNpc, map, CreateNpcXY(mapNpc), Enums.OutdateType.Location);
 }
 //public static void AppendNpcConfusion(IMap map, PacketHitList hitlist, int mapNpcNum) {
 //    MapNpc mapNpc = map.ActiveNpc[mapNpcNum];
 //    hitlist.AddPacketToOthers(mapNpc, map, CreateNpcConfusion(mapNpc), Enums.OutdateType.Condition);
 //}
 public static void AppendNpcStatusAilment(MapNpc npc, PacketHitList hitlist)
 {
     hitlist.AddPacketToOthers(npc, Maps.MapManager.RetrieveActiveMap(npc.MapID), CreateNpcStatusAilment(npc), Enums.OutdateType.Condition);
 }
 public static void AppendNpcVolatileStatus(IMap map, PacketHitList hitlist, int mapNpcNum)
 {
     MapNpc mapNpc = map.ActiveNpc[mapNpcNum];
     hitlist.AddPacketToOthers(mapNpc, map, CreateNpcVolatileStatus(mapNpc), Enums.OutdateType.Condition);
 }
        public static void AppendEmote(Client client, int emote, int speed, int rounds, PacketHitList hitlist)
        {
            TcpPacket myPacket = TcpPacket.CreatePacket("emote", emote.ToString(), speed.ToString(), rounds.ToString());

            hitlist.AddPacket(client, myPacket);

            hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, CreatePlayerEmote(client, emote, speed, rounds), Enums.OutdateType.Condition);
        }
        public static void AppendHunted(Client client, PacketHitList hitlist)
        {
            hitlist.AddPacket(client, TcpPacket.CreatePacket("hunted", client.Player.Hunted.ToIntString()));

            hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, TcpPacket.CreatePacket("playerhunted", client.ConnectionID.ToString(), client.Player.Hunted.ToIntString()), Enums.OutdateType.Condition);
        }
        public static void AppendVolatileStatus(Client client, PacketHitList hitlist)
        {
            TcpPacket myPacket = TcpPacket.CreatePacket("volatilestatus", client.Player.GetActiveRecruit().VolatileStatus.Count.ToString());

            for (int j = 0; j < client.Player.GetActiveRecruit().VolatileStatus.Count; j++) {
                myPacket.AppendParameter(client.Player.GetActiveRecruit().VolatileStatus[j].Emoticon);
            }

            hitlist.AddPacket(client, myPacket);

            hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, CreatePlayerVolatileStatus(client), Enums.OutdateType.Condition);
        }
 public static void AppendAttackPacket(Client attacker, PacketHitList hitlist)
 {
     hitlist.AddPacketToOthers(attacker.Player.GetActiveRecruit(), attacker.Player.Map, CreateAttackPacket(attacker), Enums.OutdateType.None);
     //hitlist.AddPacketToMapBut(attacker, attacker.Player.Map, CreateAttackPacket(attacker));
 }
        public static void AppendStatusAilment(Client client, PacketHitList hitlist)
        {
            TcpPacket packet = new TcpPacket("teamstatus");
            for (int i = 0; i < Constants.MAX_ACTIVETEAM; i++) {
                if (client.Player.Team[i].Loaded == true) {
                    packet.AppendParameter(((int)client.Player.Team[i].StatusAilment).ToString());
                } else {
                    packet.AppendParameter("0");
                }
            }
            packet.FinalizePacket();
            hitlist.AddPacket(client, packet);

            hitlist.AddPacket(client, TcpPacket.CreatePacket("statusailment", ((int)client.Player.GetActiveRecruit().StatusAilment).ToString()));

            hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, CreatePlayerStatusAilment(client), Enums.OutdateType.Condition);
        }
        public static void AppendSprite(Client client, PacketHitList hitlist)
        {
            Recruit player = client.Player.GetActiveRecruit();
            hitlist.AddPacket(client, TcpPacket.CreatePacket("sprite", (player.Sprite).ToString(), (player.Form).ToString(), ((int)player.Shiny).ToString(), ((int)player.Sex).ToString()));

            hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, TcpPacket.CreatePacket("playersprite", client.ConnectionID.ToString(),
                player.Sprite.ToString(), player.Form.ToString(), ((int)player.Shiny).ToString(), ((int)player.Sex).ToString()), Enums.OutdateType.Condition);
        }
 public static void AppendPlayerXY(Client client, PacketHitList hitlist)
 {
     hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, CreatePlayerXY(client), Enums.OutdateType.Location);
     //hitlist.AddPacketToMapBut(client, client.Player.Map, CreatePlayerXY(client));
     AppendOwnXY(client, hitlist);
 }
 public static void AppendPlayerMove(Client client, PacketHitList hitlist, Enums.Direction direction, Enums.Speed speed)
 {
     hitlist.AddPacketToOthers(client.Player.GetActiveRecruit(), client.Player.Map, CreatePlayerMovePacket(client, direction, speed), Enums.OutdateType.Location);
 }
Exemple #12
0
        public static void RefreshCharacterVisibility(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            //invisibility
            ExtraStatus status;
            bool visible = true;

            status = character.VolatileStatus.GetStatus("SemiInvul");
            if (status != null && status.Tag == "ShadowForce" ||
                character.VolatileStatus.GetStatus("Invisible") != null) {
                visible = false;
            }

            character.Visible = visible;
            if (map != null)
            {
                if (character.CharacterType == Enums.CharacterType.Recruit)
                {
                    Client client = ((Recruit)character).Owner;
                    hitlist.AddPacketToOthers(character, map, PacketBuilder.CreatePlayerActivation(client, character.Visible), Enums.OutdateType.Location);
                    PacketBuilder.AppendVisibility(client, hitlist, character.Visible);
                }
                else
                {
                    hitlist.AddPacketToOthers(character, map, PacketBuilder.CreateNpcActivation((MapNpc)character, character.Visible), Enums.OutdateType.Location);
                }
            }
            PacketHitList.MethodEnded(ref hitlist);
        }