Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ☺ Created by AbdallahEl-dosuky
- // ☺ Copyright © 2010 - 2016 TQ Digital
- // ☺ Emulator - Project
- using System;
- using System.IO;
- using ProtoBuf;
- using COServer.Game;
- using System.Collections.Generic;
- namespace COServer.Network.GamePackets
- {
- [ProtoContract]
- public class MsgUpdateProto
- {
- [ProtoMember(1, IsRequired = true)]
- public ulong TimeStamp;
- [ProtoMember(2, IsRequired = true)]
- public uint UID;
- [ProtoMember(3, IsRequired = true)]
- public List<MsgFlagsProto> Values = new List<MsgFlagsProto>();
- }
- [ProtoContract]
- public class MsgFlagsProto
- {
- [ProtoMember(1, IsRequired = true)]
- public ulong Type;
- [ProtoMember(2, IsRequired = false)]
- public ulong value;
- [ProtoMember(3, IsRequired = false)]
- public ulong[] value2;
- [ProtoMember(4, IsRequired = false)]
- public ulong Flag;
- [ProtoMember(5, IsRequired = false)]
- public ulong Time;
- [ProtoMember(6, IsRequired = false)]
- public ulong Dmg;
- [ProtoMember(7, IsRequired = false)]
- public ulong Level;
- }
- public unsafe class MsgUpdate : Writer, Interfaces.IPacket
- {
- public class OnlineTraining
- {
- public const byte
- Show = 0,
- InTraining = 1,
- Review = 2,
- IncreasePoints = 3,
- ReceiveExperience = 4,
- Remove = 5;
- }
- [Flags]
- public enum Flags : ulong
- {
- FlashingName = 1UL << 0,
- Poisoned = 1UL << 1,
- Invisible = 1UL << 2,
- Normal = 1UL << 3,
- XPList = 1UL << 4,
- Dead = 1UL << 5,
- TeamLeader = 1UL << 6,
- StarOfAccuracy = 1UL << 7,
- MagicShield = 1UL << 8,
- Stigma = 1UL << 9,
- Ghost = 1UL << 10,
- FadeAway = 1UL << 11,
- RedName = 1UL << 14,
- BlackName = 1UL << 15,
- ReflectMelee = 1UL << 17,
- Superman = 1UL << 18,
- Ball = 1UL << 19,
- Ball2 = 1UL << 20,
- Invisibility = 1UL << 22,
- Cyclone = 1UL << 23,
- Dodge = 1UL << 26,
- Fly = 1UL << 27,
- Intensify = 1UL << 28,
- CastPray = 1UL << 30,
- Praying = 1UL << 31,
- Cursed = 1UL << 32,
- HeavenBlessing = 1UL << 33,
- TopGuildLeader = 1UL << 34,
- TopDeputyLeader = 1UL << 35,
- MonthlyPKChampion = 1UL << 36,
- WeeklyPKChampion = 1UL << 37,
- TopWarrior = 1UL << 38,
- TopTrojan = 1UL << 39,
- TopArcher = 1UL << 40,
- TopWaterTaoist = 1UL << 41,
- TopFireTaoist = 1UL << 42,
- TopNinja = 1UL << 43,
- ShurikenVortex = 1UL << 46,
- FatalStrike = 1UL << 47,
- Flashy = 1UL << 48,
- Ride = 1UL << 50,
- TopSpouse = 1UL << 51,
- OrangeSparkles = 1UL << 52,
- PurpleSparkles = 1UL << 53,
- FreezeSmall = 1UL << 54,
- SpeedIncreased = 1UL << 55,
- IncMoveSpeed = 1UL << 56,
- GodlyShield = 1UL << 57,
- Stun = 1UL << 58,
- Freeze = 1UL << 59,
- ChaosCycle = 1UL << 60
- }
- [Flags]
- public enum Flags2 : ulong
- {
- Top2Weekly = 1UL << 65,
- Top2Monthly = 1UL << 68,
- Top2Fire = 1UL << 71,
- Top2Water = 1UL << 74,
- Top2Ninja = 1UL << 77,
- Top8Water = 1UL << 9,
- Top3Water = 1UL << 11,
- Top2Warrior = 1UL << 80,
- Top2Trojan = 1UL << 83,
- Top2Archer = 1UL << 86,
- Top3rcher = 1UL << 87,
- Contestant = 1UL << 91,
- ChainBoltActive = 1UL << 92,
- AzureShield = 1UL << 93,
- ScurvyBomb = 1UL << 96,
- TyrantAuraIcon = 1UL << 97,
- TyrantAura = 1UL << 98,
- FendAuraIcon = 1UL << 99,
- FendAura = 1UL << 100,
- MetalAuraIcon = 1UL << 101,
- MetalAura = 1UL << 102,
- WoodAuraIcon = 1UL << 103,
- WoodAura = 1UL << 104,
- WaterAuraIcon = 1UL << 105,
- WaterAura = 1UL << 106,
- FireAuraIcon = 1UL << 107,
- FireAura = 1UL << 108,
- EarthAuraIcon = 1UL << 109,
- EarthAura = 1UL << 110,
- SoulShackle = 1UL << 111,
- Oblivion = 1UL << 112,
- ShieldBlock = 1UL << 113,
- TopMonk = 1UL << 114,
- Top2Monk = 1UL << 116,
- CarryingFlag = 1UL << 118,
- PoisonStar = 1UL << 119,
- CannonBarrage = 1UL << 120,
- BlackbeardsRage = 1UL << 121,
- TopPirate = 1UL << 122,
- TopPirate2 = 1UL << 124,
- DefensiveStance = 1UL << 126,
- MagicDefenderIcon = 1UL << 127
- }
- [Flags]
- public enum Flags3 : ulong
- {
- BackFire = 1UL << 51,
- ManiacDance = 1UL << 53,
- MagicShiled = 1UL << 55,
- MagicDefender = 1UL << 128,
- NinjaFaction = 1UL << 129,
- PirateFaction = 1UL << 130,
- PurpleBall = 1UL << 131,
- BlueBall = 1UL << 132,
- PathOfShadow = 1UL << 145,
- BladeFlurry = 1UL << 146,
- KineticSpark = 1UL << 147,
- DragonFlow = 1UL << 148,
- SuperCyclone = 1UL << 150,
- ConuqerSuperYellow = 1UL << 151,
- ConuqerSuperBlue = 1UL << 152,
- ConuqerSuperUnderBlue = 1UL << 153,
- DragonWarriorTop = 1UL << 154,
- AutoHunting = 1UL << 155,
- DragonFury = 1UL << 158,
- DragonCyclone = 1UL << 159,
- DragonSwing = 1UL << 160,
- MrConquer = 1UL << 166,
- MsConquer = 1UL << 167,
- FlameLayer = 1UL << 168,
- FlameLayer2 = 1UL << 169,
- FlameLayer3 = 1UL << 170,
- FlameLayer4 = 1UL << 171,
- AuroraLotus = 1UL << 172,
- FlameLotus = 1UL << 173,
- rygh_hglx = 1UL << 174,
- rygh_syzs = 1UL << 175,
- battelpower = 1UL << 174,
- battelpower2 = 1UL << 175,
- BPGoldenHalo = 1UL << 174,
- ShieldBreak = 1UL << 176,
- DivineGuard = 1UL << 177,
- BPHalo = 1UL << 175,
- Champion_130 = 1UL << 184,
- _2ndPlace_130 = 1UL << 185,
- _3rdPlace_130 = 1UL << 186,
- _4thPlace_130 = 1UL << 187,
- }
- [Flags]
- public enum Flags4 : ulong
- {
- Omnipotence = 1UL << 192,
- JusticeChant = 1UL << 194,
- BlockFrostGaze = 1UL << 195,
- HealingSnow = 1UL << 196,
- ChillingSnow = 1UL << 197,
- xChillingSnow = 1UL << 198,
- FreezingPelter = 1UL << 200,
- xFreezingPelter = 1UL << 201,
- RevengeTaill = 1UL << 202,
- WindwalkerTop = 1UL << 203,
- ShadowofChaser = 1UL << 204
- }
- [Flags]
- public enum DataType : uint
- {
- mantos = 82,
- mantos1 = 1,
- mantos2 = 2,
- mantos3 = 3,
- mantos4 = 4,
- mantos5 = 5,
- mantos6 = 6,
- mantos7 = 7,
- mantos8 = 8,
- mantos9 = 9,
- mantos10 = 10,
- mantos11 = 11,
- mantos12 = 12,
- mantos13 = 13,
- Hitpoints = 0,
- MaxHitpoints = 1,
- Mana = 2,
- MaxMana = 3,
- Money = 4,
- Experience = 5,
- PKPoints = 6,
- Class = 7,
- Stamina = 8,
- WHMoney = 9,
- Atributes = 10,
- Mesh = 11,
- Level = 12,
- Spirit = 13,
- Vitality = 14,
- Strength = 15,
- Agility = 16,
- HeavensBlessing = 17,
- DoubleExpTimer = 18,
- CursedTimer = 20,
- Reborn = 22,
- StatusFlag = 25,
- HairStyle = 26,
- XPCircle = 27,
- LuckyTimeTimer = 28,
- ConquerPoints = 29,
- OnlineTraining = 31,
- ExtraBattlePower = 36,
- ArsenalBattlepower = 37,
- Merchant = 38,
- VIPLevel = 39,
- QuizPoints = 40,
- EnlightPoints = 41,
- ClanBattlePower = 42,
- GuildBattlePower = 44,
- BoundConquerPoints = 45,
- RaceShopPoints = 47,
- Contestant = 48,
- AzureShield = 49,
- SecondRebornClass = 50,
- FirsRebornClass = 51,
- Team = 52,
- SoulShackle = 54,
- Fatigue = 55,
- DefensiveStance = 56,
- IncreasePStrike = 59,
- IncreaseMStrike = 60,
- IncreaseImunity = 61,
- IncreaseBreack = 62,
- IncreaseAntiBreack = 63,
- IncreaseMaxHp = 64,
- IncreasePAttack = 65,
- IncreaseMAttack = 66,
- IncreaseFinalPDamage = 67,
- IncreaseFinalMDamage = 68,
- IncreaseFinalPAttack = 69,
- IncreaseFinalMAttack = 70,
- FirstCreditGift = 71,
- ExpProtection = 73,
- DragonFury = 74,
- DragonSwing = 75,
- InnerPowerPotency = 77,
- Lotus = 78,
- ExtraInventory = 79,
- AvailableSlots = 80,
- UnionMember = 81,
- MilitaryRank = 82,
- UnionRank = 83,
- MilitaryExploits = 84,
- FlameLayer = 168,
- FlameLayer2 = 169,
- FlameLayer3 = 170,
- FlameLayer4 = 171,
- AuroraLotus = 172,
- FlameLotus = 173
- }
- public MsgUpdateProto Info;
- public MsgUpdate(bool Count)
- {
- if (Count)
- {
- Info = new MsgUpdateProto();
- Info.TimeStamp = (uint)Time32.timeGetTime().GetHashCode();
- }
- }
- public uint UID
- {
- get { return Info.UID; }
- set { Info.UID = value; }
- }
- public void Clear()
- {
- Info = new MsgUpdateProto();
- }
- public void Append(byte type, byte value)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
- }
- public void Append(byte type, uint value)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
- }
- public void Append(Byte type, UInt64 value)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
- }
- public void Append(Byte type, UInt16 value)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = type, value = value });
- }
- public void Append(ulong Flag, ulong Flag2, ulong Flag3, ulong Flag4, ulong Flag5, ulong Flag6, ulong Flag7)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = (ulong)DataType.StatusFlag, value = 0, value2 = new ulong[7] { Flag, Flag2, Flag3, Flag4, Flag5, Flag6, Flag7 } });
- }
- public void Append(byte type, ulong val1, ulong val2, ulong val3, ulong val4)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = type });
- }
- public void Append(Byte type, UInt32 Flag, UInt32 Time, UInt32 Dmg, UInt32 Level)
- {
- Info.Values.Add(new MsgFlagsProto() { Type = type, Flag = Flag, Time = Time, Dmg = Dmg, Level = Level });
- }
- public void Aura(Player Entity, Enums.AuraDataTypes State, Enums.AuraType AuraType, UInt32 Level, UInt32 Power)
- {
- Byte[] Packet = new Byte[40];
- fixed (Byte* Pack = Packet)
- {
- *(UInt16*)(Pack + (Packet.Length - 8)) = 0;
- *((UInt16*)(Pack + 2)) = (ushort)MsgTypes.MsgAura;
- *((UInt32*)(Pack + 8)) = (UInt32)State;
- *((UInt32*)(Pack + 12)) = Entity.UID;
- *((UInt32*)(Pack + 16)) = (UInt32)AuraType;
- *((UInt32*)(Pack + 20)) = Level;
- *((UInt32*)(Pack + 24)) = Power;
- *((UInt32*)(Pack + 28)) = Power;
- if (Kernel.GamePool.ContainsKey(Entity.UID))
- {
- Kernel.GamePool[Entity.UID].Send(Packet);
- }
- }
- }
- public void Aura(Player Entity, Enums.AuraDataTypes State, Enums.AuraType AuraType, Database.SpellInformation spell)
- {
- Aura(Entity, State, AuraType, spell.Level, spell.Power);
- }
- public Byte[] ToArray()
- {
- return Info.ToConquerPacket(10017);
- }
- public void Deserialize(Byte[] buffer)
- {
- Info = buffer.ConvertToProto<MsgUpdateProto>();
- }
- public void Send(Client.GameState client)
- {
- client.Send(Info.ToConquerPacket(10017));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement