Como adicionar as Wings 100%

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Como adicionar as Wings 100%

Mensagem por FelipeXP em Sab Jan 23, 2016 10:40 pm

Download dos arquivos necessários: https://mega.nz/#!r1tGBSTb!y2nOwEGreQHI_fPnH273VEP35Q9K1_E5z0hj3Q-8xv0

Em Equipment.cs procure por #region Offsets e substitua por ese código, e assim você vai fazer com todos os outros codigos abaixo (Procurar pela #Region e substituir pelo código postado).

Código:
#region Offsets

public const int
Head = 48 + 4,
Garment = 52 + 4,
Armor = 56 + 4,
LeftWeapon = 60 + 4,
RightWeapon = 64 + 4,
LeftWeaponAccessory = 68 + 4,
RightWeaponAccessory = 72 + 4,
Steed = 76 + 4,
MountArmor = 80 + 4,
ArmorColor = 141 + 4 + 9,
LeftWeaponColor = 143 + 4 + 9,
HeadColor = 145 + 4 + 9,
SteedPlus = 151 + 4 + 9,
SteedColor = 157 + 4 + 9,
HeadSoul = 200 + 4 + 9,
ArmorSoul = 204 + 4 + 9,
LeftWeaponSoul = 208 + 4 + 9,
RightWeaponSoul = 212 + 4 + 9;

#endregion  

EM Entity.cs. se não tiver a Entity, adicione em  SpawnEntity.cs
Código:
#region offsets
public static int num = 4;
public static int _Mesh = 4 + num,
_UID = 8 + num,
_GuildID = 12 + num,
_GuildRank = 16 + num,
_StatusFlag = 22 + num,
_StatusFlag2 = 30 + num,
_StatusFlag3 = 38 + num,
_AppearanceType = 42 + num + 4,
_Hitpoints = 86 + num + 4 + 9,
_MonsterLevel = 92 + 4 + num + 9,
_X = 94 + num + 4 + 9,
_Y = 96 + num + 4 + 9,
_HairStyle = 98 + num + 4 + 9,
_Facing = 100 + num + 4 + 9,
_Action = 101 + num + 4 + 9,
_Reborn = 108 + num + 4 + 9,
_Level = 109 + num + 4 + 9,
_WindowSpawn = 111 + num + 4 + 9,
_Away = 112 + num + 4 + 9,
_ExtraBattlepower = 113 + num + 4 + 9,
_FlowerIcon = 125 + num + 4 + 4 + 9,
_NobilityRank = 133 + num + 4 + 9,
_QuizPoints = 143 + num + 4 + 9,
_ClanUID = 169 + num + 4 + 9,
_ClanRank = 173 + num + 4 + 9,
_Title = 181 + num + 4 + 9,
_ShowArenaGlow = 192 + num + 4 + 9,
_Boss = 195 + num + 4 + 9,
_RaceItem = 197 + num + 4 + 9,
_ActiveSubclass = 212 + num + 4 + 9,
_FirstRebornClass = 221 + num + 4 + 9,
_SecondRebornClass = 223 + num + 4 + 9,
_Class = 225 + num + 4 + 9,
_CountryCode = 227 + num + 4 + 9,
_AssassinColor = 233 + 4 + 4 + 9,
_JingHu_Talen = 241 + 4 + 9,
_JiangHuActive = 242 + 4 + 9,
_skillsoul = 240 + 4 + 9,
_skillsoul2 = 243 + 4 + 9,
_CUID = 249 + 8 + 9,
_Names = 284;
#endregion  

Em CharacterInfo.cs
Código:
public byte[] ToArray()
{
byte[] Packet = new byte[138 + client.Entity.Spouse.Length + client.Entity.Name.Length];
WriteUInt16((ushort)(Packet.Length - 8), 0, Packet);
WriteUInt16(1006, 2, Packet);
WriteUInt32((uint)Time32.timeGetTime().GetHashCode (), 4, Packet);
WriteUInt32(client.Entity.UID, 8, Packet);
WriteUInt32(client.Entity.Mesh, 14, Packet);
WriteUInt16(client.Entity.HairStyle, 18, Packet);
WriteUInt32(client.Entity.Money, 20, Packet);
WriteUInt32((uint)client.Entity.ConquerPoints, 28, Packet);
WriteUInt32(client.Entity.BoundCps, 107, Packet);//103
WriteUInt64(client.Entity.Experience, 32, Packet);
WriteUInt16(client.Entity.Strength, 60, Packet);
WriteUInt16(client.Entity.Agility, 62, Packet);
WriteUInt16(client.Entity.Vitality, 64, Packet);
WriteUInt16(client.Entity.Spirit, 66, Packet);
WriteUInt16(client.Entity.Atributes, 68, Packet);
WriteUInt32(client.Entity.Hitpoints, 70, Packet);
WriteUInt16(client.Entity.Mana, 74, Packet);
WriteUInt16(client.Entity.PKPoints, 76, Packet);
Packet[78] = client.Entity.Level;
Packet[79] = client.Entity.Class;
Packet[80] = client.Entity.FirstRebornClass;
Packet[81] = client.Entity.SecondRebornClass;
Packet[83] = client.Entity.Reborn;
WriteUInt32(client.Entity.QuizPoints, 85, Packet);
WriteUInt32(1, 89, Packet);
WriteUInt16(0/*enlightened time left*/, 93, Packet);
WriteByte(client.Entity.SubClasses.Active, 111, Packet);
WriteUInt32(client.Entity.SubClasses.GetHashPoint( ), 112, Packet);
WriteUInt16((UInt16)client.Entity.MyTitle, 105, Packet);
Packet[119] = 1;
Packet[124] = 1;
WriteUInt16((ushort)client.Entity.CountryID, 128, Packet);
Writer.WriteByte(3, 130, Packet);
Packet[131] = (byte)client.Entity.Name.Length;
Writer.WriteString(client.Entity.Name, 132, Packet);
Writer.WriteByte((byte)client.Entity.Spouse.Length , 133 + client.Entity.Name.Length, Packet);
Writer.WriteString(client.Entity.Spouse, 134 + client.Entity.Name.Length, Packet);
return Packet;
}  

No Items.txt da source.
E no itemtype do cliente

Código:
http://pastebin.com/GznbZZuL

Em ClientEquip.cs
Código:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CaptainJoe.Client;
using CaptainJoe.Interfaces;

namespace CaptainJoe.Network.GamePackets
{
public class ClientEquip : Interfaces.IPacket
{
private Byte[] mData;

public ClientEquip()
{
this.mData = new Byte[103];
Writer.WriteUInt16((UInt16)(this.mData.Length - 8), 0, mData);
Writer.WriteUInt16((UInt16)1009, 2, mData);
Writer.WriteUInt32((uint)Time64.timeGetTime().GetH ashCode(), 4, mData);
Writer.WriteUInt16((UInt16)46, 20, mData);
}

public ClientEquip(GameClient c)
{
this.mData = new Byte[96];
Writer.WriteUInt16((UInt16)(this.mData.Length - 8), 0, mData);
Writer.WriteUInt16((UInt16)1009, 2, mData);
Writer.WriteUInt32((uint)Time64.timeGetTime().GetH ashCode(), 4, mData);
Writer.WriteUInt16((UInt16)46, 20, mData);

DoEquips(c);
}

public void DoEquips(GameClient client)
{
if (client.Equipment == null) return;
ConquerItem[] Items = client.Equipment.Objects;
Writer.WriteUInt32((uint)Time64.timeGetTime().GetH ashCode(), 4, mData);
Writer.WriteUInt32(client.Entity.UID, 8, mData);
AlternativeEquipment = client.AlternateEquipment;
foreach (var Item in client.Equipment.Objects)
{
if (Item == null)
continue;
if (Item.IsWorn)
{
switch (Item.Position)
{
#region Equipment
case ConquerItem.Head:
this.Helm = Item.UID; break;
case ConquerItem.Wing:
Wing = Item.UID;
break;
case ConquerItem.Necklace:
this.Necklace = Item.UID;
break;
case ConquerItem.Armor:
this.Armor = Item.UID;
break;
case ConquerItem.RightWeapon:
this.RHand = Item.UID;
break;
case ConquerItem.LeftWeapon:
this.LHand = Item.UID;
break;
case ConquerItem.Ring:
this.Ring = Item.UID;
break;
case ConquerItem.Boots:
this.Boots = Item.UID;
break;
case ConquerItem.Garment:
this.Garment = Item.UID;
break;
case ConquerItem.Bottle:
this.Talisman = Item.UID; break;
case ConquerItem.RightWeaponAccessory:
AccessoryOne = Item.UID;
break;
case ConquerItem.LeftWeaponAccessory:
AccessoryTwo = Item.UID;
break;
case ConquerItem.SteedArmor:
SteedArmor = Item.UID;
break;
case ConquerItem.SteedCrop:
SteedTalisman = Item.UID;
break;
#endregion
#region AlternateEquipment
case ConquerItem.AlternateArmor:
Armor = Item.UID;
break;
case ConquerItem.AlternateHead:
Helm = Item.UID;
break;
case ConquerItem.AlternateNecklace:
Necklace = Item.UID;
break;
case ConquerItem.AlternateRing:
Ring = Item.UID;
break;
case ConquerItem.AlternateBoots:
Boots = Item.UID;
break;
case ConquerItem.AlternateBottle:
Talisman = Item.UID;
break;
case ConquerItem.AlternateGarment:
this.Garment = Item.UID;
break;
case ConquerItem.AlternateLeftWeapon:
LHand = Item.UID;
break;
case ConquerItem.AlternateRightWeapon:
RHand = Item.UID;
break;
#endregion
}
}
}
if (client.ArmorLook > 0) Garment = Armor = uint.MaxValue - 1;
if (client.HeadgearLook > 0) Helm = uint.MaxValue - 2;
}

public void Deserialize(byte[] buffer) { this.mData = buffer; }
public byte[] ToArray()
{ return mData; }
public void Send(Client.GameClient client) { client.Send(mData); }


public bool AlternativeEquipment
{
get { return this.mData[12] == 1 ? true : false; }
set { this.mData[12] = value ? (byte)1 : (byte)0; }
}

public UInt32 Helm
{
get { return BitConverter.ToUInt32(this.mData, 35); }
set { Writer.WriteUInt32(value, 35, mData); }
}

public UInt32 Necklace
{
get { return BitConverter.ToUInt32(this.mData, 39); }
set { Writer.WriteUInt32(value, 39, mData); }
}
public UInt32 Wing
{
get { return BitConverter.ToUInt32(mData, 87); }
set { Writer.WriteUInt32(value, 87, mData); }
}

public UInt32 Armor
{
get { return BitConverter.ToUInt32(this.mData, 43); }
set { Writer.WriteUInt32(value, 43, mData); }
}

public UInt32 RHand
{
get { return BitConverter.ToUInt32(this.mData, 47); }
set { Writer.WriteUInt32(value, 47, mData); }
}

public UInt32 LHand
{
get { return BitConverter.ToUInt32(this.mData, 51); }
set { Writer.WriteUInt32(value, 51, mData); }
}

public UInt32 Ring
{
get { return BitConverter.ToUInt32(this.mData, 55); }
set { Writer.WriteUInt32(value, 55, mData); }
}

public UInt32 Talisman
{
get { return BitConverter.ToUInt32(this.mData, 59); }
set { Writer.WriteUInt32(value, 59, mData); }
}

public UInt32 Boots
{
get { return BitConverter.ToUInt32(this.mData, 63); }
set { Writer.WriteUInt32(value, 63, mData); }
}

public UInt32 Garment
{
get { return BitConverter.ToUInt32(this.mData, 67); }
set { Writer.WriteUInt32(value, 67, mData); }
}

public uint AccessoryOne
{
get { return BitConverter.ToUInt32(mData, 71); }
set { Writer.WriteUInt32(value, 71, mData); }
}

public uint AccessoryTwo
{
get { return BitConverter.ToUInt32(mData, 75); }
set { Writer.WriteUInt32(value, 75, mData); }
}
public UInt32 SteedArmor
{
get { return BitConverter.ToUInt32(this.mData, 79); }
set { Writer.WriteUInt32(value, 79, mData); }
}

public UInt32 SteedTalisman
{
get { return BitConverter.ToUInt32(this.mData, 83); }
set { Writer.WriteUInt32(value, 83, mData); }
}
}
}  
Em Equipment.cs
Código:
"switch ((ushort)item.Position)"
case Network.GamePackets.ConquerItem.Wing:
Network.Writer.WriteUInt32(item.ID, 88, Owner.Entity.SpawnPacket);
break;  
Em ConquerItem.cs
Código:
Wing = 19,  
Em Class Message.cs
Código:
public void Deserialize(byte[] buffer)
{
Color = Color.FromArgb(BitConverter.ToInt32(buffer, 8));
ChatType = BitConverter.ToUInt32(buffer, 12);
MessageUID1 = BitConverter.ToUInt32(buffer, 16);
MessageUID2 = BitConverter.ToUInt32(buffer, 20);
Mesh = BitConverter.ToUInt32(buffer, 24);
_From = Encoding.Default.GetString(buffer, 35, buffer[34]);
_To = Encoding.Default.GetString(buffer, 36 + _From.Length, buffer[35 + _From.Length]);
__Message = Encoding.Default.GetString(buffer, (38 + _From.Length) + _To.Length, buffer[(37 + _From.Length) + _To.Length]);
}

public byte[] ToArray()
{
byte[] Packet = new byte[(((32 + _From.Length) + _To.Length) + __Message.Length) + 18];
Writer.WriteUInt16((ushort)(Packet.Length - 8), 0, Packet);
Writer.WriteUInt32((uint)Time32.timeGetTime().GetH ashCode(), 4, Packet);
Writer.WriteUInt16(1004, 2, Packet);
Writer.WriteUInt32((uint)Color.ToArgb(), 8, Packet);
Writer.WriteUInt32(ChatType, 12, Packet);
Writer.WriteUInt32(MessageUID1, 16, Packet);
Writer.WriteUInt32(MessageUID2, 20, Packet);
Writer.WriteUInt32(Mesh, 24, Packet);
Writer.WriteStringList(new List<string>() { _From, _To, "", __Message }, 33, Packet);
return Packet;
}  
Procure em PacketHandler.cs por public enum Positions : byte
e adicione
Código:
Wing = 19,
Na mesma classe procure por public static Positions ItemPositionFromID
e coloque
Código:
else if (iType == 204)
return Positions.Wing;

Continuação do tutorial, logo abaixo!
avatar
FelipeXP
Administrador
Administrador

Mensagens : 293
Data de inscrição : 28/05/2014

Ver perfil do usuário https://www.youtube.com/channel/UCOmLJd3M1OSrMmlcR7UGlhw

Voltar ao Topo Ir em baixo

Re: Como adicionar as Wings 100%

Mensagem por FelipeXP em Sab Jan 23, 2016 10:46 pm

Na mesma classe procure por public static byte ItemMaxLeve
e adicione:
Código:
case ConquerItem.Wing: return 100;

Na mesma classe procure porpublic static byte ItemMinLeve
e adicione:

Código:
case ConquerItem.Wing: return 0;

Na mesma classe procure por public static Positions GetPositionFromID e adicione
Código:
else if (iType == 204)
return Positions.Wing;

Na mesma classe procure por public static ushort ItemPosition e adicione
Código:
if (ID >= 204005 && ID <= 204009)
return ConquerItem.Wing;

Na mesma classe procure por public static Positions ItemPositionFromID e adicione

Código:
else if (iType == 204)
return Positions.Wing;
avatar
FelipeXP
Administrador
Administrador

Mensagens : 293
Data de inscrição : 28/05/2014

Ver perfil do usuário https://www.youtube.com/channel/UCOmLJd3M1OSrMmlcR7UGlhw

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum