KO Kill Counter Issue

01/29/2016 22:33 InsomniacPro#1
Hey all,

So I've been working on this issue for a few days now and I've had other eyes look into my code and we see nothing wrong. Hoping I can find someone that sees what we're not seeing. This is for 5017.
I am using the 5-17 structure from: [Only registered and activated users can see links. Click Here To Register...]
MY KO Counter doesn't increase at all, whether I'm in XP Mode or not. It stays at zero.
I used this test packet to see if I can get the number to update, here is the packet.

Then I send the packet once the kill has been completed.
Code:
AttackerClient.Send(TestItemInfo.TestKillInfo(AttackerClient.Entity.UID, Death.X, Death.Y,Death.OpponentUID, 1));
The kill counter still remains 0. Is there anything I'm missing?
01/29/2016 23:05 pro4never#2
Quote:
Originally Posted by InsomniacPro View Post
Hey all,

So I've been working on this issue for a few days now and I've had other eyes look into my code and we see nothing wrong. Hoping I can find someone that sees what we're not seeing. This is for 5017.
I am using the 5-17 structure from: [Only registered and activated users can see links. Click Here To Register...]
MY KO Counter doesn't increase at all, whether I'm in XP Mode or not. It stays at zero.
I used this test packet to see if I can get the number to update, here is the packet.

Then I send the packet once the kill has been completed.
Code:
AttackerClient.Send(TestItemInfo.TestKillInfo(AttackerClient.Entity.UID, Death.X, Death.Y,Death.OpponentUID, 1));
The kill counter still remains 0. Is there anything I'm missing?
When sending interacttype.kill the first 2 bytes of the effect value (where dmg normally goes) are the death type (value of 2) and second 2 bytes are the KO count.

Here's the shit example from redux

target.Kill(2 | ((Player)owner).KOCount << 16, owner.UID);

That will populate the ko count over their head. The actual bottom right counter is simply by sending proper death packets (target x killed by attacker y)

PS: for monsters I do not use a X/Y value... for players I do. Not sure if that's me being wrong or you but hope it helps.
01/29/2016 23:30 turk55#3
Quote:
Originally Posted by pro4never View Post

PS: for players I do not use a X/Y value... for players I do.
ehh??
01/29/2016 23:40 InsomniacPro#4
Quote:
Originally Posted by pro4never View Post
When sending interacttype.kill the first 2 bytes of the effect value (where dmg normally goes) are the death type (value of 2) and second 2 bytes are the KO count.

Here's the shit example from redux

target.Kill(2 | ((Player)owner).KOCount, owner.UID);

That will populate the ko count over their head. The actual bottom right counter is simply by sending proper death packets (target x killed by attacker y)

PS: for players I do not use a X/Y value... for players I do. Not sure if that's me being wrong or you but hope it helps.
I've gotten the kill counter over the head correct, its the one in the corner that's not working. Thats even if the client is not in xp mode.
01/29/2016 23:59 pro4never#5
Quote:
Originally Posted by turk55 View Post
ehh??

Edited. Monsters I send 0,0 players I send coords

Quote:
Originally Posted by InsomniacPro View Post
I've gotten the kill counter over the head correct, its the one in the corner that's not working. Thats even if the client is not in xp mode.

Try with 0,0 x/y for monster deaths and make sure it's sending proper killer/killed.

Code:
 var packet = new InteractPacket
            {
                UID = _attacker,
                Target = _target,
                X = _x,
                Y = _y,
                Action = _action,
                Value = _value,
                Timestamp = (uint)Common.Clock
            };

Code:
 var packet = new InteractPacket();
            packet.Timestamp = *((uint*)(ptr + 4));
            packet.UID = *((uint*)(ptr + 8));
            packet.Target = *((uint*)(ptr + 12));
            packet.X = *((ushort*)(ptr + 16));
            packet.Y = *((ushort*)(ptr + 18));
            packet.Action = *((InteractAction*)(ptr + 20));
            packet.Value = *((uint*)(ptr + 24));
            packet.KOCount = *((uint*)(ptr + 28));
Note: KOCount here is ONLY used for resetting jar quests, it's not used for actual KO counter from what I've seen.

Note x2: in this example value should be 2 | KoCount if in XP skill and action should be 14
01/30/2016 01:01 InsomniacPro#6
Quote:
Originally Posted by pro4never View Post
Edited. Monsters I send 0,0 players I send coords




Try with 0,0 x/y for monster deaths and make sure it's sending proper killer/killed.

Code:
 var packet = new InteractPacket
            {
                UID = _attacker,
                Target = _target,
                X = _x,
                Y = _y,
                Action = _action,
                Value = _value,
                Timestamp = (uint)Common.Clock
            };

Code:
 var packet = new InteractPacket();
            packet.Timestamp = *((uint*)(ptr + 4));
            packet.UID = *((uint*)(ptr + 8));
            packet.Target = *((uint*)(ptr + 12));
            packet.X = *((ushort*)(ptr + 16));
            packet.Y = *((ushort*)(ptr + 18));
            packet.Action = *((InteractAction*)(ptr + 20));
            packet.Value = *((uint*)(ptr + 24));
            packet.KOCount = *((uint*)(ptr + 28));
Note: KOCount here is ONLY used for resetting jar quests, it's not used for actual KO counter from what I've seen.

Note x2: in this example value should be 2 | KoCount if in XP skill and action should be 14
My packet structure is the same, besides counting the packet.KOCount, just zero filled on the last 4 bytes.
Code:
AttackerClient.Send(TestItemInfo.TestKillInfo(AttackerClient.Entity.UID, Death.OpponentUID, (uint)2 | AttackerClient.CurrentKOs));


            byte[] Buf = new byte[32];
            WriteUInt16(32, 0, Buf);
            WriteUInt16(1022  , 2, Buf);
            WriteUInt32((uint)Environment.TickCount, 4, Buf);
            WriteUInt32(Sender, 8, Buf);
            WriteUInt32(Attacked, 12, Buf);
            WriteUInt16(0, 16, Buf);//x
            WriteUInt16(0, 18, Buf);//y
            WriteUInt32((uint)AttackID.Death, 20, Buf);//0x0E:14
            WriteUInt32(Parameter, 24, Buf);

            return Buf;
01/30/2016 03:06 Spirited#7
I had no idea that was a thing.
The more you know, I suppose.
02/01/2016 16:56 CptSky#8
Your packet seems correct (I've validated the offsets) :

Code:
        public MsgInteract(Entity aSender, Entity aTarget, UInt32 aData, Action aAction)
            : base(32)
        {
            Timestamp = Environment.TickCount;
            Sender = aSender.UniqId;
            if (aTarget != null)
            {
                Target = aTarget.UniqId;
                PosX = aTarget.X;
                PosY = aTarget.Y;
            }
            _Action = aAction;
            Data = aData;
        }
For the calculation, here's what I did for COPS v6 long time ago and it works :

Code:
if (Attacker.HasStatus(Status.SuperAtk) || Attacker.HasStatus(Status.SuperSpeed))
    World.BroadcastMapMsg(Attacker, new MsgInteract(Attacker, Target, 0xFFFF * (Attacker.CurKO + 1), MsgInteract.Action.Kill), true);
else
    World.BroadcastMapMsg(Attacker, new MsgInteract(Attacker, Target, 1, MsgInteract.Action.Kill), true);
02/01/2016 17:28 { Angelius }#9
(0xFFFF * Attacker.KOCounter + 1) is what I have too except that I have -1 for the target ID.