本文整理汇总了C#中Packet.WriteZero方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteZero方法的具体用法?C# Packet.WriteZero怎么用?C# Packet.WriteZero使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteZero方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMonsterStatus
public static void AddMonsterStatus(Packet pPacket, Mob pMob)
{
pPacket.WriteByte(0);
pPacket.WriteZero(40);
pPacket.WriteShort(5088);
pPacket.WriteShort(72);
pPacket.WriteZero(3);
pPacket.WriteByte(136);
for (int i = 0; i < 4; i++)
{
pPacket.WriteLong(0);
pPacket.WriteHexString("30 3B");
}
pPacket.WriteZero(7);
pPacket.WriteZero(12);
}
示例2: SpawnMonster
public static Packet SpawnMonster(Mob pMob, int pSpawnType, int pLink, bool pAzwan)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Monster_Spawn);
p.WriteInt(pMob.SpawnID);
p.WriteByte(1);
p.WriteInt(pMob.MobID);
MobPacketHelper.AddMonsterStatus(p, pMob);
p.WriteShort(pMob.Position.X);
p.WriteShort(pMob.Position.Y);
p.WriteByte(pMob.Stance); // Stance, TODO.
p.WriteShort(pMob.Foothold);
p.WriteShort(pMob.OriginalFoothold);
p.WriteByte((byte)pSpawnType);
if (pSpawnType == -3 || pSpawnType >= 0)
p.WriteInt(pLink);
p.WriteByte(0); // TODO: Carnival.
p.WriteInt(125);
p.WriteZero(16);
p.WriteByte(0);
p.WriteInt(-1);
p.WriteInt(0);
p.WriteInt(46);
p.WriteInt(0);
p.WriteByte(0);
p.WriteByte(0xFF);
return p;
}
示例3: Cash_Shop_Disable
public static Packet Cash_Shop_Disable()
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop_Use);
p.WriteZero(5);
return p;
}
示例4: CharacterEnter
public static Packet CharacterEnter(Character pCharacter)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Player_Spawn);
p.WriteInt(pCharacter.Id);
p.WriteByte(pCharacter.Level);
p.WriteMapleString(pCharacter.Name);
// Quest 111111 - I don't care for now.
p.WriteMapleString("");
// TODO: Guilds!
p.WriteZero(8);
p.WriteByte(0);
// Buffs
List<Pair<int, int>> BuffValue = new List<Pair<int, int>>();
List<Pair<int, int>> BuffValueNew = new List<Pair<int, int>>();
int[] Mask = new int[12];
Mask[0] |= -33554432;
Mask[1] |= 512;
Mask[5] |= 163840;
for (int i = 0; i < Mask.Length; i++)
{
p.WriteInt(Mask[i]);
}
foreach (Pair<int, int> i in BuffValue)
{
if (i.Right == 3)
{
p.WriteInt(i.Left);
}
else if (i.Right == 2)
{
p.WriteShort((short)i.Left);
}
else if (i.Right == 1)
{
p.WriteByte((byte)i.Left);
}
}
p.WriteInt(-1);
if (BuffValueNew.Count < 1)
{
p.WriteZero(10);
}
else
{
p.WriteByte(0);
foreach (Pair<int, int> i in BuffValueNew)
{
if (i.Right == 4)
{
p.WriteInt(i.Left);
}
else if (i.Right == 2)
{
p.WriteShort((short)i.Left);
}
else if (i.Right == 1)
{
p.WriteByte((byte)i.Left);
}
else if (i.Right == 0)
{
p.WriteZero((byte)i.Left);
}
}
}
p.WriteZero(20);
int Magic_Spawn = new Random().Next();
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(10);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(10);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteShort(0);
// TODO: Mounts.
p.WriteLong(0L);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteLong(0L);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(15);
p.WriteByte(1);
//.........这里部分代码省略.........
示例5: AddJaguarInfo
public static void AddJaguarInfo(Packet p, Character c)
{
p.WriteByte(0); // Record of quest: 111112.
p.WriteZero(20);
}
示例6: AddCharacterInformation
public static void AddCharacterInformation(Packet pPacket, Character pCharacter)
{
pPacket.WriteInt(-1);
pPacket.WriteInt(-2097153);
pPacket.WriteZero(20);
AddCharacterStats(pPacket, pCharacter);
pPacket.WriteByte(20); // TODO: Buddylist class.
pPacket.WriteByte(0);
pPacket.WriteByte(0);
pPacket.WriteByte(0);
AddInventoryInfo(pPacket, pCharacter);
AddSkillInfo(pPacket, pCharacter);
AddCooldownInfo(pPacket, pCharacter);
AddQuestInfo(pPacket, pCharacter);
AddRingInfo(pPacket, pCharacter);
AddRocksInfo(pPacket, pCharacter);
AddMonsterBookInfo(pPacket, pCharacter);
pPacket.WriteShort(0);
pPacket.WriteShort(0);
// TODO: Quest info packet.
pPacket.WriteShort(0);
if (Constants.JobConstants.isWildHunter(pCharacter.Job))
AddJaguarInfo(pPacket, pCharacter);
pPacket.WriteByte(0);
AddStealSkills(pPacket, pCharacter);
AddInnerStats(pPacket, pCharacter);
pPacket.WriteLong(1);
pPacket.WriteLong(1);
pPacket.WriteLong(0);
pPacket.WriteLong(0);
pPacket.WriteByte(0);
pPacket.WriteLong(Tools.GetTime(-2));
pPacket.WriteInt(0);
pPacket.WriteByte(0);
//TODO: Farm Info.
pPacket.WriteMapleString("Creating...");
pPacket.WriteInt(0); // Waru.
pPacket.WriteInt(0); // Level
pPacket.WriteInt(0); // EXP
pPacket.WriteInt(0); // AestheticPoints
pPacket.WriteInt(0); // Gems
pPacket.WriteInt(0); // ?
pPacket.WriteZero(5);
pPacket.WriteInt(0);
pPacket.WriteZero(13);
pPacket.WriteLong(Tools.GetTime(-2));
pPacket.WriteInt(0);
pPacket.WriteInt(322037760);
pPacket.WriteZero(68);
pPacket.WriteLong(Tools.GetTime(Tools.CurrentTimeMillis()));
pPacket.WriteInt(0);
pPacket.WriteByte(1);
pPacket.WriteShort(0);
pPacket.WriteInt(41870555);
pPacket.WriteInt(6550069);
pPacket.WriteLong(4);
for (int i = 0; i < 4; i++)
pPacket.WriteLong(9410165 + i);
}
示例7: AddInventoryInfo
//.........这里部分代码省略.........
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIPPED].Equips)
//{
// if (equip.Key < 0 && equip.Key > -100)
// {
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
// }
//}
p.WriteShort(0);
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIPPED].Equips)
//{
// if (equip.Key <= -100 && equip.Key > -1000)
// {
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
// }
//}
p.WriteShort(0);
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIP].Equips)
//{
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
//}
p.WriteShort(0);
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIPPED].Equips)
//{
// if (equip.Key <= -1000 && equip.Key > - 1100) {
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
// }
//}
p.WriteShort(0);
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIPPED].Equips)
//{
// if (equip.Key <= -1100 && equip.Key > - 1200) {
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
// }
//}
p.WriteShort(0);
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIPPED].Equips)
//{
// if (equip.Key >= -1200) {
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
// }
//}
p.WriteShort(0);
p.WriteShort(0);
p.WriteShort(0);
//foreach (KeyValuePair<short, Equip> equip in c.Inventory[InventoryType.EQUIPPED].Equips)
//{
// if (equip.Key <= -5000 && equip.Key >= -5002) {
// AddEquipPosition(p, equip.Value, false, false);
// AddEquipInfo(p, equip.Value, c);
// }
//}
p.WriteShort(0);
p.WriteShort(0);
p.WriteShort(0);
p.WriteShort(0);
p.WriteShort(0);
//foreach (KeyValuePair<byte, Item> item in c.Inventory[InventoryType.USE].Items)
//{
// AddItemPosition(p, item.Value, false, false);
// AddItemInfo(p, item.Value, c);
//}
p.WriteByte(0);
//foreach (KeyValuePair<byte, Item> item in c.Inventory[InventoryType.SETUP].Items)
//{
// AddItemPosition(p, item.Value, false, false);
// AddItemInfo(p, item.Value, c);
//}
p.WriteByte(0);
//foreach (KeyValuePair<byte, Item> item in c.Inventory[InventoryType.ETC].Items)
//{
// AddItemPosition(p, item.Value, false, false);
// AddItemInfo(p, item.Value, c);
//}
p.WriteByte(0);
//foreach (KeyValuePair<byte, Item> item in c.Inventory[InventoryType.CASH].Items)
//{
// AddItemPosition(p, item.Value, false, false);
// AddItemInfo(p, item.Value, c);
//}
p.WriteByte(0);
//TODO: Extended slots~
p.WriteZero(17);
}
示例8: AddCharacterStats
public static void AddCharacterStats(Packet pPacket, Character pCharacter)
{
pCharacter.Subcategory = Constants.JobConstants.GetSubcategory(pCharacter.Job);
pPacket.WriteInt(pCharacter.Id);
pPacket.WritePaddedString(pCharacter.Name, 13);
pPacket.WriteByte(pCharacter.Gender);
pPacket.WriteByte(pCharacter.SkinColor);
pPacket.WriteInt(pCharacter.FaceId);
pPacket.WriteInt(pCharacter.HairId);
pPacket.WriteZero(24);
pPacket.WriteByte(pCharacter.Level);
pPacket.WriteShort(pCharacter.Job);
pPacket.WriteShort(pCharacter.Str);
pPacket.WriteShort(pCharacter.Dex);
pPacket.WriteShort(pCharacter.Int);
pPacket.WriteShort(pCharacter.Luk);
pPacket.WriteInt(pCharacter.HP);
pPacket.WriteInt(pCharacter.MaxHP);
pPacket.WriteInt(pCharacter.MP);
pPacket.WriteInt(pCharacter.MaxMP);
pPacket.WriteShort(pCharacter.AP);
if (Constants.JobConstants.isSeparatedSp(pCharacter.Job))
{
byte length = (byte)pCharacter.SP.Count((b) => b > 0);
pPacket.WriteByte(length);
foreach (int i in pCharacter.SP)
{
if (i > 0)
{
pPacket.WriteByte((byte)(i + 1));
pPacket.WriteInt(pCharacter.SP[i]);
}
}
}
else
{
pPacket.WriteShort(pCharacter.SP[0]);
}
pPacket.WriteLong(pCharacter.EXP);
pPacket.WriteInt(pCharacter.Fame);
pPacket.WriteShort(0); // Migration Data, v141.
pPacket.WriteShort(-1800); // Migration Data, v141.
pPacket.WriteInt(0); // Gachapon EXP.
pPacket.WriteInt(pCharacter.MapId);
pPacket.WriteByte(pCharacter.MapPosition);
pPacket.WriteInt(0);
pPacket.WriteShort(pCharacter.Subcategory);
if (Constants.JobConstants.isDemonAvenger(pCharacter.Job) || Constants.JobConstants.isDemonSlayer(pCharacter.Job) || Constants.JobConstants.isXenon(pCharacter.Job))
pPacket.WriteInt(pCharacter.FaceMarking);
pPacket.WriteByte(pCharacter.Fatigue);
pPacket.WriteInt(Constants.GetCurrentDate());
pPacket.WriteInt(pCharacter.Ambition);
pPacket.WriteInt(pCharacter.Insight);
pPacket.WriteInt(pCharacter.Willpower);
pPacket.WriteInt(pCharacter.Diligence);
pPacket.WriteInt(pCharacter.Empathy);
pPacket.WriteInt(pCharacter.Charm);
pPacket.WriteZero(13);
pPacket.WriteLong(Tools.GetTime(Tools.CurrentTimeMillis()));
pPacket.WriteInt(pCharacter.BattleEXP);
pPacket.WriteByte(pCharacter.BattleRank);
pPacket.WriteInt(pCharacter.BattlePoints);
pPacket.WriteByte(5);
pPacket.WriteByte(6);
pPacket.WriteByte(0);
pPacket.WriteInt(0);
pPacket.WriteBytes(new byte[] { 59, 55, 79, 1, 0, 64 });
pPacket.WriteSByte(-32);
pPacket.WriteSByte(-3);
pPacket.WriteShort(0);
pPacket.WriteZero(3);
for (int i = 0; i < 9; i++)
{
pPacket.WriteInt(0);
pPacket.WriteByte(0);
pPacket.WriteInt(0);
}
pPacket.WriteReversedLong(Tools.GetTime(Tools.CurrentTimeMillis()));
}
示例9: AddCharacterLooks
public static void AddCharacterLooks(Packet pPacket, Character pCharacter, bool pMega)
{
pPacket.WriteByte(pCharacter.Gender);
pPacket.WriteByte(pCharacter.SkinColor);
pPacket.WriteInt(pCharacter.FaceId);
pPacket.WriteInt(pCharacter.Job);
pPacket.WriteByte((byte)(pMega ? 0 : 1));
pPacket.WriteInt(pCharacter.HairId);
foreach (KeyValuePair<short, Equip> kvp in pCharacter.Inventory[InventoryType.EQUIPPED].Equips)
{
pPacket.WriteByte((byte)(Math.Abs(kvp.Key)));
pPacket.WriteInt(kvp.Value.ItemID);
}
pPacket.WriteByte(255); // End of Regular Equips.
pPacket.WriteByte(255); // End of Masked Equips. TODO.
pPacket.WriteByte(255); // v140.1 - Unknown equip type.
pPacket.WriteInt(0); // TODO: Cash Weapon.
pPacket.WriteInt(0); // TODO: Reg Weapon.
pPacket.WriteInt(0); // TODO: Shield.
pPacket.WriteByte(0); // Elf Ears (isMercedes).
pPacket.WriteZero(12);
if (Constants.JobConstants.isDemonAvenger(pCharacter.Job) || Constants.JobConstants.isDemonAvenger(pCharacter.Job) || Constants.JobConstants.isXenon(pCharacter.Job))
pPacket.WriteInt(pCharacter.FaceMarking);
}