[Help]- Potency Fix

01/08/2009 14:15 TruthCo#1
Does someone know how to make it so potency will add up like TQ, you know level,reborn , that kind of stuff? please help


- im noob =] :mofo:
01/08/2009 17:08 damianpesta#2
Packets.... you gotta make packets for them
01/08/2009 18:19 TruthCo#3
hehe noob question

how do i make packets :D
01/08/2009 18:38 damianpesta#4
Quote:
Originally Posted by TruthCo View Post
hehe noob question

how do i make packets :D
Go to your packets.cs And there should be a lot of examples.
01/08/2009 18:42 _Emme_#5
@damian
You cant really say that, All the packets are unique, different ID's and such. Im sure you cannot even do packets yourself, and that is why you threw that lame answer that really didnt answer any question ( Hey, I suck at making packets, atleast im honest. )
01/08/2009 18:44 damianpesta#6
Quote:
Originally Posted by EmmeTheCoder View Post
@damian
You cant really say that, All the packets are unique, different ID's and such. Im sure you cannot even do packets yourself, and that is why you threw that lame answer that really didnt answer any question ( Hey, I suck at making packets, atleast im honest. )
@True but He wanted a example of it I quess , he didnt ask for Specific ones.And your right , I cant LoL Not bothering doing it untill I reach collage (Next year)
01/08/2009 19:35 TruthCo#7
well if you can help me please say because i do suck at coding but im getting better =]
01/08/2009 20:08 reborn666#8
find and replace with this codes...
Quote:
public byte[] SpawnEntity(Character Player)
{
string[] equip;
long HeadId = 0;
long ArmorId = 0;
long RightHandId = 0;
long LeftHandId = 0;
long GarmentId = 0;

if (Player.Equips[1] != null)
{
equip = Player.Equips[1].Split('-');
HeadId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[3] != null)
{
equip = Player.Equips[3].Split('-');
ArmorId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[4] != null)
{
equip = Player.Equips[4].Split('-');
RightHandId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[5] != null)
{
equip = Player.Equips[5].Split('-');
LeftHandId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[9] != null)
{
equip = Player.Equips[9].Split('-');
GarmentId = Convert.ToInt64(equip[0]);
}

long ToArmor;

if (Player.Equips[9] != null)
ToArmor = GarmentId;
else
ToArmor = ArmorId;

uint Model;
if (Player.Alive)
Model = uint.Parse(Convert.ToString(Player.Avatar) + Convert.ToString(Player.Model));
else
{
if (Player.Model == 1003 || Player.Model == 1004)
Model = uint.Parse(Convert.ToString(Player.Avatar) + 1098.ToString());
else
Model = uint.Parse(Convert.ToString(Player.Avatar) + 1099.ToString());
}

ushort PacketType = 0x3f6;
byte[] Packet = new byte[85 + Player.Name.Length];

fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = (ushort)PacketType;
*((uint*)(p + 4)) = (uint)Player.UID;
*((uint*)(p + 8)) = (uint)Model;
*((uint*)(p + 12)) = (uint)Player.GetStat();
*((ushort*)(p + 20)) = (ushort)Player.GuildID;
*(p + 23) = Player.GuildPosition;

if (Player.Alive)
{
*((uint*)(p + 28)) = (uint)HeadId;
*((uint*)(p + 32)) = (uint)ToArmor;
*((uint*)(p + 36)) = (uint)RightHandId;
*((uint*)(p + 40)) = (uint)LeftHandId;
}
*((ushort*)(p + 52)) = (ushort)Player.LocX;
*((ushort*)(p + 54)) = (ushort)Player.LocY;
*((ushort*)(p + 56)) = (ushort)Player.Hair;

*(p + 58) = Player.Direction;
*(p + 59) = Player.Action;
p[60] = (byte)Player.RBCount;
p[62] = (byte)Player.Level;
*(p + 80) = 1;
*(p + 81) = (byte)Player.Name.Length;
for (int i = 0; i < Player.Name.Length; i++)
{
*(p + 82 + i) = Convert.ToByte(Player.Name[i]);
}
}
return Packet;
}
and this

Quote:
public byte[] CharacterInfo(Character Charr)
{
byte[] Packet = new byte[70 + Charr.Name.Length + Charr.Spouse.Length];
long Model = Convert.ToInt64(Convert.ToString(Charr.Avatar) + Convert.ToString(Charr.Model));

fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = 1006;
*((uint*)(p + 4)) = (uint)Charr.UID;
*((uint*)(p + 8)) = (uint)Model;
*((ushort*)(p + 12)) = (ushort)Charr.Hair;
*((uint*)(p + 14)) = (uint)Charr.Silvers;
*((uint*)(p + 18)) = (uint)Charr.CPs;
*((uint*)(p + 22)) = (uint)Charr.Exp;
*((ushort*)(p + 42)) = (ushort)5130;
*((ushort*)(p + 46)) = (ushort)Charr.Str;
*((ushort*)(p + 48)) = (ushort)Charr.Agi;
*((ushort*)(p + 50)) = (ushort)Charr.Vit;
*((ushort*)(p + 52)) = (ushort)Charr.Spi;
*((ushort*)(p + 54)) = (ushort)Charr.StatP;
*((ushort*)(p + 56)) = (ushort)Charr.CurHP;
*((ushort*)(p + 58)) = (ushort)Charr.MaxMana();
*((ushort*)(p + 60)) = (ushort)Charr.PKPoints;
*(p + 62) = Charr.Level;
*(p + 63) = Charr.Job;
*(p + 65) = (byte)Charr.RBCount;
*(p + 66) = 1;
*(p + 67) = 2;
*(p + 68) = (byte)Charr.Name.Length;

Packet[69 + Charr.Name.Length] = (byte)Charr.Spouse.Length;

for (sbyte i = 0; i < Charr.Name.Length; i++)
{
*(p + 69 + i) = (byte)Charr.Name[i];
}
for (sbyte i = 0; i < Charr.Spouse.Length; i++)
{
*(p + 70 + Charr.Name.Length + i) = (byte)Charr.Spouse[i];
}

}
return Packet;
}
done:p
01/08/2009 22:02 Korvacs#9
Quote:
Originally Posted by reborn666 View Post
find and replace with this codes...

and this


done:p
Your assuming hes using the same client as you, and source o.O

Also, you posted 2 packets with different offsets in them, which implys different versions =/
01/08/2009 22:07 TruthCo#10
well im going to add that in abit but will others be able to view the potency?
01/08/2009 22:22 tao4229#11
Quote:
Originally Posted by Korvacs View Post
Your assuming hes using the same client as you, and source o.O

Also, you posted 2 packets with different offsets in them, which implys different versions =/
What source do you think they're using >_>

Also, it's 0x3F6 and 0x3EE, two different packets, not different versions.
10/02/2009 17:52 CompacticCo#12
Is there a code like this that works with Powersoruce CO? Please post.
10/02/2009 18:00 Basser#13
PowerSource isn't a different source, just an LOTF edited.
So this should work.
10/13/2009 13:27 pintser#14
what if i have 5017 client, will potency work?
And my char+ eternity thingies in packet.cs look way diffrent

Quote:
public byte[] CharacterInfo(Character Charr)
{
ushort PacketType = 0x3ee;
string Spouse = "None";
short Length = (short)(70 + Charr.Name.Length + Spouse.Length);

byte[] Packet = new byte[Length];

long Model = Convert.ToInt64(Convert.ToString(Charr.Avatar) + Convert.ToString(Charr.Model));

fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = (ushort)PacketType;
*((uint*)(p + 4)) = (uint)Charr.UID;
*((uint*)(p + 8)) = (uint)Model;
*((ushort*)(p + 12)) = (ushort)Charr.Hair;
*((uint*)(p + 14)) = (uint)Charr.Silvers;
*((uint*)(p + 18)) = (uint)Charr.CPs;
*((uint*)(p + 22)) = (uint)Charr.Exp;
*((ushort*)(p + 42)) = (ushort)5130;
*((ushort*)(p + 46)) = (ushort)Charr.Str;
*((ushort*)(p + 48)) = (ushort)Charr.Agi;
*((ushort*)(p + 50)) = (ushort)Charr.Vit;
*((ushort*)(p + 52)) = (ushort)Charr.Spi;
*((ushort*)(p + 54)) = (ushort)Charr.StatP;
*((ushort*)(p + 56)) = (ushort)Charr.CurHP;
*((ushort*)(p + 58)) = (ushort)Charr.MaxMana();
*((ushort*)(p + 60)) = (ushort)Charr.PKPoints;

*(p + 62) = Charr.Level;
*(p + 63) = Charr.Job;
*(p + 66) = 1;
*(p + 67) = 2;
*(p + 68) = (byte)Charr.Name.Length;

for (int i = 0; i < Charr.Name.Length; i++)
{
*(p + 69 + i) = Convert.ToByte(Charr.Name[i]);
}

*(p + 70 + Charr.Name.Length) = (byte)Spouse.Length;

for (int i = 0; i < Spouse.Length; i++)
{
*(p + Charr.Name.Length + 71 + i) = Convert.ToByte(Spouse[i]);
}
}

/*
Len|ID |UID |Modell n Avatar |Hair |Silvers |
Cps| Exp| 16 nulls| Nobility rank| str| agi| vit| spi| statp|
hp| nulls| pkp| level| class| nulls| 1 n 2| name..spouse

55 00| ee 03| fa 56 17 00| cb 97 04 00| 7f 02| ba 68 ; U....V.........h
00 00| 00 00 00 00| 66 96 01 00| 00 00 00 00 00 00 ; ......f.........
00 00 00 00 00 00 00 00 00 00| 0a 14 00 00| e3 00| ; ................
42 00| 2f 00| 00 00| 00 00| 2b 08| 00 00| 00 00| 6f| 19| ; B./.....+.....o.
00 00| 01 02| 0b 50 72 69 6d 65 4b 6e 69 67 68 74 ; .....PrimeKnight
04 4e 6f 6e 65|
*
*/

return Packet;
}
And this is the eternity part:

Quote:
public byte[] SpawnEntity(Character Player)
{
string[] equip;
long HeadId = 0;
long ArmorId = 0;
long RightHandId = 0;
long LeftHandId = 0;
long GarmentId = 0;

if (Player.Equips[1] != null)
{
equip = Player.Equips[1].Split('-');
HeadId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[3] != null)
{
equip = Player.Equips[3].Split('-');
ArmorId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[4] != null)
{
equip = Player.Equips[4].Split('-');
RightHandId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[5] != null)
{
equip = Player.Equips[5].Split('-');
LeftHandId = Convert.ToInt64(equip[0]);
}

if (Player.Equips[9] != null)
{
equip = Player.Equips[9].Split('-');
GarmentId = Convert.ToInt64(equip[0]);
}

long ToArmor;

if (Player.Equips[9] != null)
ToArmor = GarmentId;
else
ToArmor = ArmorId;

uint Model;
if (Player.Alive)
Model = uint.Parse(Convert.ToString(Player.Avatar) + Convert.ToString(Player.Model));
else
{
if (Player.Model == 1003 || Player.Model == 1004)
Model = uint.Parse(Convert.ToString(Player.Avatar) + 1098.ToString());
else
Model = uint.Parse(Convert.ToString(Player.Avatar) + 1099.ToString());
}

ushort PacketType = 0x3f6;
byte[] Packet = new byte[85 + Player.Name.Length];

fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = (ushort)PacketType;
*((uint*)(p + 4)) = (uint)Player.UID;
*((uint*)(p + 8)) = (uint)Model;
*((uint*)(p + 12)) = (uint)Player.GetStat();
*((ushort*)(p + 20)) = (ushort)Player.GuildID;
*(p + 23) = Player.GuildPosition;

if (Player.Alive)
{
*((uint*)(p + 28)) = (uint)HeadId;
*((uint*)(p + 32)) = (uint)ToArmor;
*((uint*)(p + 36)) = (uint)RightHandId;
*((uint*)(p + 40)) = (uint)LeftHandId;
}
*((ushort*)(p + 52)) = (ushort)Player.LocX;
*((ushort*)(p + 54)) = (ushort)Player.LocY;
*((ushort*)(p + 56)) = (ushort)Player.Hair;

*(p + 58) = Player.Direction;
*(p + 59) = Player.Action;
*(p + 80) = 1;
*(p + 81) = (byte)Player.Name.Length;
for (int i = 0; i < Player.Name.Length; i++)
{
*(p + 82 + i) = Convert.ToByte(Player.Name[i]);
}
}
return Packet;
}
I know old post blabla, but it can be helpfull in future.. so please explain me,
Because i get alot errors if i take the 1 from Rebon666 and i can fix errors but then i have to get whole other packets...(liek totally new packet.cs)

(#By the way, potency work, only not see see from other players...)
10/13/2009 14:22 ImmortalYashi#15
Quote:
Originally posted by pintser
Progress:

-Learned c#2007-2008-2009
-Learned programming
-Quitted at 2008
-Restarted after august 2009
-searching for Good helpfull posts .
I thougt you learned C# 2007-2008-2009 ?.. Then explain me asking for help for something that's easy to fix?

Thank you,
Yashi.