Advertisement
Guest User

10017Proto

a guest
Feb 26th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 13.13 KB | None | 0 0
  1. // ☺ Created by AbdallahEl-dosuky
  2. // ☺ Copyright © 2010 - 2016 TQ Digital
  3. // ☺ Emulator - Project
  4.  
  5. using System;
  6. using System.IO;
  7. using ProtoBuf;
  8. using COServer.Game;
  9. using System.Collections.Generic;
  10.  
  11. namespace COServer.Network.GamePackets
  12. {
  13.     [ProtoContract]
  14.     public class MsgUpdateProto
  15.     {
  16.         [ProtoMember(1, IsRequired = true)]
  17.         public ulong TimeStamp;
  18.         [ProtoMember(2, IsRequired = true)]
  19.         public uint UID;
  20.         [ProtoMember(3, IsRequired = true)]
  21.         public List<MsgFlagsProto> Values = new List<MsgFlagsProto>();
  22.     }
  23.     [ProtoContract]
  24.     public class MsgFlagsProto
  25.     {
  26.         [ProtoMember(1, IsRequired = true)]
  27.         public ulong Type;
  28.         [ProtoMember(2, IsRequired = false)]
  29.         public ulong value;
  30.         [ProtoMember(3, IsRequired = false)]
  31.         public ulong[] value2;
  32.         [ProtoMember(4, IsRequired = false)]
  33.         public ulong Flag;
  34.         [ProtoMember(5, IsRequired = false)]
  35.         public ulong Time;
  36.         [ProtoMember(6, IsRequired = false)]
  37.         public ulong Dmg;
  38.         [ProtoMember(7, IsRequired = false)]
  39.         public ulong Level;
  40.  
  41.     }
  42.     public unsafe class MsgUpdate : Writer, Interfaces.IPacket
  43.     {
  44.         public class OnlineTraining
  45.         {
  46.             public const byte
  47.             Show = 0,
  48.             InTraining = 1,
  49.             Review = 2,
  50.             IncreasePoints = 3,
  51.             ReceiveExperience = 4,
  52.             Remove = 5;
  53.         }
  54.         [Flags]
  55.         public enum Flags : ulong
  56.         {
  57.             FlashingName = 1UL << 0,
  58.             Poisoned = 1UL << 1,
  59.             Invisible = 1UL << 2,
  60.             Normal = 1UL << 3,
  61.             XPList = 1UL << 4,
  62.             Dead = 1UL << 5,
  63.             TeamLeader = 1UL << 6,
  64.             StarOfAccuracy = 1UL << 7,
  65.             MagicShield = 1UL << 8,
  66.             Stigma = 1UL << 9,
  67.             Ghost = 1UL << 10,
  68.             FadeAway = 1UL << 11,
  69.             RedName = 1UL << 14,
  70.             BlackName = 1UL << 15,
  71.             ReflectMelee = 1UL << 17,
  72.             Superman = 1UL << 18,
  73.             Ball = 1UL << 19,
  74.             Ball2 = 1UL << 20,
  75.             Invisibility = 1UL << 22,
  76.             Cyclone = 1UL << 23,
  77.             Dodge = 1UL << 26,
  78.             Fly = 1UL << 27,
  79.             Intensify = 1UL << 28,
  80.             CastPray = 1UL << 30,
  81.             Praying = 1UL << 31,
  82.             Cursed = 1UL << 32,
  83.             HeavenBlessing = 1UL << 33,
  84.             TopGuildLeader = 1UL << 34,
  85.             TopDeputyLeader = 1UL << 35,
  86.             MonthlyPKChampion = 1UL << 36,
  87.             WeeklyPKChampion = 1UL << 37,
  88.             TopWarrior = 1UL << 38,
  89.             TopTrojan = 1UL << 39,
  90.             TopArcher = 1UL << 40,
  91.             TopWaterTaoist = 1UL << 41,
  92.             TopFireTaoist = 1UL << 42,
  93.             TopNinja = 1UL << 43,
  94.             ShurikenVortex = 1UL << 46,
  95.             FatalStrike = 1UL << 47,
  96.             Flashy = 1UL << 48,
  97.             Ride = 1UL << 50,
  98.             TopSpouse = 1UL << 51,
  99.             OrangeSparkles = 1UL << 52,
  100.             PurpleSparkles = 1UL << 53,
  101.             FreezeSmall = 1UL << 54,
  102.             SpeedIncreased = 1UL << 55,
  103.             IncMoveSpeed = 1UL << 56,
  104.             GodlyShield = 1UL << 57,
  105.             Stun = 1UL << 58,
  106.             Freeze = 1UL << 59,
  107.             ChaosCycle = 1UL << 60
  108.         }
  109.         [Flags]
  110.         public enum Flags2 : ulong
  111.         {
  112.             Top2Weekly = 1UL << 65,
  113.             Top2Monthly = 1UL << 68,
  114.             Top2Fire = 1UL << 71,
  115.             Top2Water = 1UL << 74,
  116.             Top2Ninja = 1UL << 77,
  117.             Top8Water = 1UL << 9,
  118.             Top3Water = 1UL << 11,
  119.             Top2Warrior = 1UL << 80,
  120.             Top2Trojan = 1UL << 83,
  121.             Top2Archer = 1UL << 86,
  122.             Top3rcher = 1UL << 87,
  123.             Contestant = 1UL << 91,
  124.             ChainBoltActive = 1UL << 92,
  125.             AzureShield = 1UL << 93,
  126.             ScurvyBomb = 1UL << 96,
  127.             TyrantAuraIcon = 1UL << 97,
  128.             TyrantAura = 1UL << 98,
  129.             FendAuraIcon = 1UL << 99,
  130.             FendAura = 1UL << 100,
  131.             MetalAuraIcon = 1UL << 101,
  132.             MetalAura = 1UL << 102,
  133.             WoodAuraIcon = 1UL << 103,
  134.             WoodAura = 1UL << 104,
  135.             WaterAuraIcon = 1UL << 105,
  136.             WaterAura = 1UL << 106,
  137.             FireAuraIcon = 1UL << 107,
  138.             FireAura = 1UL << 108,
  139.             EarthAuraIcon = 1UL << 109,
  140.             EarthAura = 1UL << 110,
  141.             SoulShackle = 1UL << 111,
  142.             Oblivion = 1UL << 112,
  143.             ShieldBlock = 1UL << 113,
  144.             TopMonk = 1UL << 114,
  145.             Top2Monk = 1UL << 116,
  146.             CarryingFlag = 1UL << 118,
  147.             PoisonStar = 1UL << 119,
  148.             CannonBarrage = 1UL << 120,
  149.             BlackbeardsRage = 1UL << 121,
  150.             TopPirate = 1UL << 122,
  151.             TopPirate2 = 1UL << 124,
  152.             DefensiveStance = 1UL << 126,
  153.             MagicDefenderIcon = 1UL << 127
  154.         }
  155.         [Flags]
  156.         public enum Flags3 : ulong
  157.         {
  158.             BackFire = 1UL << 51,
  159.             ManiacDance = 1UL << 53,
  160.             MagicShiled = 1UL << 55,
  161.             MagicDefender = 1UL << 128,
  162.             NinjaFaction = 1UL << 129,
  163.             PirateFaction = 1UL << 130,
  164.             PurpleBall = 1UL << 131,
  165.             BlueBall = 1UL << 132,
  166.             PathOfShadow = 1UL << 145,
  167.             BladeFlurry = 1UL << 146,
  168.             KineticSpark = 1UL << 147,
  169.             DragonFlow = 1UL << 148,
  170.             SuperCyclone = 1UL << 150,
  171.             ConuqerSuperYellow = 1UL << 151,
  172.             ConuqerSuperBlue = 1UL << 152,
  173.             ConuqerSuperUnderBlue = 1UL << 153,
  174.             DragonWarriorTop = 1UL << 154,
  175.             AutoHunting = 1UL << 155,
  176.             DragonFury = 1UL << 158,
  177.             DragonCyclone = 1UL << 159,
  178.             DragonSwing = 1UL << 160,
  179.             MrConquer = 1UL << 166,
  180.             MsConquer = 1UL << 167,
  181.             FlameLayer = 1UL << 168,
  182.             FlameLayer2 = 1UL << 169,
  183.             FlameLayer3 = 1UL << 170,
  184.             FlameLayer4 = 1UL << 171,
  185.             AuroraLotus = 1UL << 172,
  186.             FlameLotus = 1UL << 173,
  187.             rygh_hglx = 1UL << 174,
  188.             rygh_syzs = 1UL << 175,
  189.             battelpower = 1UL << 174,
  190.             battelpower2 = 1UL << 175,
  191.             BPGoldenHalo = 1UL << 174,
  192.             ShieldBreak = 1UL << 176,
  193.             DivineGuard = 1UL << 177,
  194.             BPHalo = 1UL << 175,
  195.             Champion_130 = 1UL << 184,
  196.             _2ndPlace_130 = 1UL << 185,
  197.             _3rdPlace_130 = 1UL << 186,
  198.             _4thPlace_130 = 1UL << 187,
  199.         }
  200.         [Flags]
  201.         public enum Flags4 : ulong
  202.         {
  203.             Omnipotence = 1UL << 192,
  204.             JusticeChant = 1UL << 194,
  205.             BlockFrostGaze = 1UL << 195,
  206.             HealingSnow = 1UL << 196,
  207.             ChillingSnow = 1UL << 197,
  208.             xChillingSnow = 1UL << 198,
  209.             FreezingPelter = 1UL << 200,
  210.             xFreezingPelter = 1UL << 201,
  211.             RevengeTaill = 1UL << 202,
  212.             WindwalkerTop = 1UL << 203,
  213.             ShadowofChaser = 1UL << 204
  214.         }
  215.         [Flags]
  216.         public enum DataType : uint
  217.         {
  218.             mantos = 82,
  219.             mantos1 = 1,
  220.             mantos2 = 2,
  221.             mantos3 = 3,
  222.             mantos4 = 4,
  223.             mantos5 = 5,
  224.             mantos6 = 6,
  225.             mantos7 = 7,
  226.             mantos8 = 8,
  227.             mantos9 = 9,
  228.             mantos10 = 10,
  229.             mantos11 = 11,
  230.             mantos12 = 12,
  231.             mantos13 = 13,
  232.             Hitpoints = 0,
  233.             MaxHitpoints = 1,
  234.             Mana = 2,
  235.             MaxMana = 3,
  236.             Money = 4,
  237.             Experience = 5,
  238.             PKPoints = 6,
  239.             Class = 7,
  240.             Stamina = 8,
  241.             WHMoney = 9,
  242.             Atributes = 10,
  243.             Mesh = 11,
  244.             Level = 12,
  245.             Spirit = 13,
  246.             Vitality = 14,
  247.             Strength = 15,
  248.             Agility = 16,
  249.             HeavensBlessing = 17,
  250.             DoubleExpTimer = 18,
  251.             CursedTimer = 20,
  252.             Reborn = 22,
  253.             StatusFlag = 25,
  254.             HairStyle = 26,
  255.             XPCircle = 27,
  256.             LuckyTimeTimer = 28,
  257.             ConquerPoints = 29,
  258.             OnlineTraining = 31,
  259.             ExtraBattlePower = 36,
  260.             ArsenalBattlepower = 37,
  261.             Merchant = 38,
  262.             VIPLevel = 39,
  263.             QuizPoints = 40,
  264.             EnlightPoints = 41,
  265.             ClanBattlePower = 42,
  266.             GuildBattlePower = 44,
  267.             BoundConquerPoints = 45,
  268.             RaceShopPoints = 47,
  269.             Contestant = 48,
  270.             AzureShield = 49,
  271.             SecondRebornClass = 50,
  272.             FirsRebornClass = 51,
  273.             Team = 52,
  274.             SoulShackle = 54,
  275.             Fatigue = 55,
  276.             DefensiveStance = 56,
  277.             IncreasePStrike = 59,
  278.             IncreaseMStrike = 60,
  279.             IncreaseImunity = 61,
  280.             IncreaseBreack = 62,
  281.             IncreaseAntiBreack = 63,
  282.             IncreaseMaxHp = 64,
  283.             IncreasePAttack = 65,
  284.             IncreaseMAttack = 66,
  285.             IncreaseFinalPDamage = 67,
  286.             IncreaseFinalMDamage = 68,
  287.             IncreaseFinalPAttack = 69,
  288.             IncreaseFinalMAttack = 70,
  289.             FirstCreditGift = 71,
  290.             ExpProtection = 73,
  291.             DragonFury = 74,
  292.             DragonSwing = 75,
  293.             InnerPowerPotency = 77,
  294.             Lotus = 78,
  295.             ExtraInventory = 79,
  296.             AvailableSlots = 80,
  297.             UnionMember = 81,
  298.             MilitaryRank = 82,
  299.             UnionRank = 83,
  300.             MilitaryExploits = 84,
  301.             FlameLayer = 168,
  302.             FlameLayer2 = 169,
  303.             FlameLayer3 = 170,
  304.             FlameLayer4 = 171,
  305.             AuroraLotus = 172,
  306.             FlameLotus = 173
  307.         }
  308.         public MsgUpdateProto Info;
  309.         public MsgUpdate(bool Count)
  310.         {
  311.             if (Count)
  312.             {
  313.                 Info = new MsgUpdateProto();
  314.                 Info.TimeStamp = (uint)Time32.timeGetTime().GetHashCode();
  315.             }
  316.         }
  317.         public uint UID
  318.         {
  319.             get { return Info.UID; }
  320.             set { Info.UID = value; }
  321.         }
  322.         public void Clear()
  323.         {
  324.             Info = new MsgUpdateProto();
  325.         }
  326.         public void Append(byte type, byte value)
  327.         {
  328.             Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
  329.         }
  330.         public void Append(byte type, uint value)
  331.         {
  332.             Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
  333.         }
  334.         public void Append(Byte type, UInt64 value)
  335.         {
  336.             Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
  337.         }
  338.         public void Append(Byte type, UInt16 value)
  339.         {
  340.             Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
  341.         }
  342.         public void Append(ulong Flag, ulong Flag2, ulong Flag3, ulong Flag4, ulong Flag5, ulong Flag6, ulong Flag7)
  343.         {
  344.             Info.Values.Add(new MsgFlagsProto() { Type = (ulong)DataType.StatusFlag, value = 0, value2 = new ulong[7] { Flag, Flag2, Flag3, Flag4, Flag5, Flag6, Flag7 } });
  345.         }
  346.         public void Append(byte type, ulong val1, ulong val2, ulong val3, ulong val4)
  347.         {
  348.             Info.Values.Add(new MsgFlagsProto() { Type = type });
  349.         }
  350.         public void Append(Byte type, UInt32 Flag, UInt32 Time, UInt32 Dmg, UInt32 Level)
  351.         {
  352.             Info.Values.Add(new MsgFlagsProto() { Type = type, Flag = Flag, Time = Time, Dmg = Dmg, Level = Level });
  353.         }
  354.         public void Aura(Player Entity, Enums.AuraDataTypes State, Enums.AuraType AuraType, UInt32 Level, UInt32 Power)
  355.         {
  356.             Byte[] Packet = new Byte[40];
  357.             fixed (Byte* Pack = Packet)
  358.             {
  359.                 *(UInt16*)(Pack + (Packet.Length - 8)) = 0;
  360.                 *((UInt16*)(Pack + 2)) = (ushort)MsgTypes.MsgAura;
  361.                 *((UInt32*)(Pack + 8)) = (UInt32)State;
  362.                 *((UInt32*)(Pack + 12)) = Entity.UID;
  363.                 *((UInt32*)(Pack + 16)) = (UInt32)AuraType;
  364.                 *((UInt32*)(Pack + 20)) = Level;
  365.                 *((UInt32*)(Pack + 24)) = Power;
  366.                 *((UInt32*)(Pack + 28)) = Power;
  367.                 if (Kernel.GamePool.ContainsKey(Entity.UID))
  368.                 {
  369.                     Kernel.GamePool[Entity.UID].Send(Packet);
  370.                 }
  371.             }
  372.         }
  373.         public void Aura(Player Entity, Enums.AuraDataTypes State, Enums.AuraType AuraType, Database.SpellInformation spell)
  374.         {
  375.             Aura(Entity, State, AuraType, spell.Level, spell.Power);
  376.         }
  377.         public Byte[] ToArray()
  378.         {
  379.             return Info.ToConquerPacket(10017);
  380.         }
  381.         public void Deserialize(Byte[] buffer)
  382.         {
  383.             Info = buffer.ConvertToProto<MsgUpdateProto>();
  384.         }
  385.         public void Send(Client.GameState client)
  386.         {
  387.             client.Send(Info.ToConquerPacket(10017));
  388.         }
  389.     }
  390. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement