CloudSaint's Jar

05/19/2014 03:58 InsomniacPro#1
Thanks to CptSky for this thread:
[Only registered and activated users can see links. Click Here To Register...]

I have this structure working fine on 5017. And then when hovered over, client->Server sends 1022, with subtype 30. I echo that packet back to the client with the killcount at offset 28.
Then the client will show this.
[Only registered and activated users can see links. Click Here To Register...]

Now the issue I have is updating the "Killed" number. The client only sends back 1022 subtype 30 once, and thats on the initial hover of the jar. I've tried removing the item, then adding it again. But still no dice. Any one have any experience working past this part?

Edit:
For 5017 it seems to be different from other patches.
Current Duration for 1008 is Required Kills.
Max Duration for 1008 is Monstertype to kill.

The amount currently killed is handled via 1022.
05/19/2014 12:45 Aceking#2
MaxDurability is the monster you need to kill, can be found in an ini file in the client.
Durability is the amount of kills.

The client will automatically update the jar client side, all you need to do is update it server side so a re-log will show the count correctly.

It only sends packet 1022 once, which is the first time you hover the mouse over it.
This is to update the kill count within the client to display it correctly.
05/19/2014 13:06 -impulse-#3
PHP Code:
        public void UpdateJar()
        {
            
Interaction interaction Interaction.Create(GetId(), GetId(), Hunter.Type0Interaction.HunterJar);
            
interaction.dwParam = (uint)((Hunter.Kills << 16) | Hunter.Type);
            
Send(&interaction);
        } 
Where GetId() returns the Id of the player, HunterType is 30 and dwParam is the uint after Damage in the packet 1022.

This is the Interaction.Create prototype:
PHP Code:
public static unsafe Interaction Create(uint uniqueIduint targetushort xushort yuint type
Edit:
dwParam starts at Damage offset + 2.
05/19/2014 18:43 InsomniacPro#4
Quote:
Originally Posted by Aceking View Post
MaxDurability is the monster you need to kill, can be found in an ini file in the client.
Durability is the amount of kills.

The client will automatically update the jar client side, all you need to do is update it server side so a re-log will show the count correctly.

It only sends packet 1022 once, which is the first time you hover the mouse over it.
This is to update the kill count within the client to display it correctly.
You pretty much just said everything I already know/did to get the screenshot that I have in my post.
Besides the duration thing being different for 5017.

Quote:
Originally Posted by -impulse- View Post
PHP Code:
        public void UpdateJar()
        {
            
Interaction interaction Interaction.Create(GetId(), GetId(), Hunter.Type0Interaction.HunterJar);
            
interaction.dwParam = (uint)((Hunter.Kills << 16) | Hunter.Type);
            
Send(&interaction);
        } 
Where GetId() returns the Id of the player, HunterType is 30 and dwParam is the uint after Damage in the packet 1022.

This is the Interaction.Create prototype:
PHP Code:
public static unsafe Interaction Create(uint uniqueIduint targetushort xushort yuint type
Edit:
dwParam starts at Damage offset + 2.
Yeah understood, I got that far. But do you just send it everytime a kill is made that matches the desired mob, because I've tried that with no luck.
05/19/2014 20:07 Aceking#5
The client will automatically increase the jar as mobs are killed, there are no additional packet exchanges each kill. All you need to do is keep track of it server side so that a relog will not lose all progress.

This is how it works in 5065 at least and I can't imagine it being any different on other patches.

I suppose if you truly wanted to update the jar manually you could send the item update packet and change the durability to reflect the kills.

Il double check my source when I get access to it later, but I am 99% sure that no packets are exchanged with each mob kill.
05/19/2014 20:40 -impulse-#6
Quote:
Originally Posted by InsomniacPro View Post
You pretty much just said everything I already know/did to get the screenshot that I have in my post.



Yeah understood, I got that far. But do you just send it everytime a kill is made that matches the desired mob, because I've tried that with no luck.
If your packet is correct it will update all the time, not just when it "feels like it". Wether you should send it after every kill or not is your problem, although you can just send an update after every 50 kills.
05/19/2014 22:30 InsomniacPro#7
Quote:
Originally Posted by Aceking View Post
The client will automatically increase the jar as mobs are killed, there are no additional packet exchanges each kill. All you need to do is keep track of it server side so that a relog will not lose all progress.

I suppose if you truly wanted to update the jar manually you could send the item update packet and change the durability to reflect the kills.
Doesn't automatically increment, so it must be different I guess. Also durability doesn't have anything to do with current kills in 5017. Current Duration is Requirement, and Max duration is the monstertype to kill.

Quote:
Originally Posted by -impulse- View Post
If your packet is correct it will update all the time, not just when it "feels like it". Wether you should send it after every kill or not is your problem, although you can just send an update after every 50 kills.
Correct packet being 1008, or 1022, because both have to do with it, and they are both correct.
And its not just "when it feels like" as if it is a sporadic event that happens. It happens on initial hover, and thats it.
05/19/2014 23:15 -impulse-#8
Well, if you got it working, what are we talking about then?
05/20/2014 00:31 InsomniacPro#9
Quote:
Originally Posted by -impulse- View Post
Well, if you got it working, what are we talking about then?
The jar not updating after the initial hover. The jar STAYS at 0 kills. How does it update?
05/20/2014 01:20 -impulse-#10
Quote:
Originally Posted by InsomniacPro View Post
The jar not updating after the initial hover. The jar STAYS at 0 kills. How does it update?
I told you, if you fill in correctly the information in the packet, then the jar will update whenever you send the packet. The client will request that jar count [when you hover over the jar] only once every few hundred kills or something + when you login or get the jar in your inventory.
05/20/2014 01:30 InsomniacPro#11
Quote:
Originally Posted by -impulse- View Post
I told you, if you fill in correctly the information in the packet, then the jar will update whenever you send the packet. The client will request that jar count [when you hover over the jar] only once every few hundred kills or something + when you login or get the jar in your inventory.
And I told you, I've sent the packet, its the correct structure for 5017 and I'm 100% sure of that, and nothing happens. And iirc, back in the day, it updated whenever a kill was made. And as I try that, nothing happens.
And you saying the client requests only once every hundred kills, I have NOT had that happen yet.
05/20/2014 01:32 -impulse-#12
The request thing - I don't really know.
But, what I know is that on 5065 with the packet I gave you whenever I send the packet the jar updates the count to whatever I send.

[Only registered and activated users can see links. Click Here To Register...]
06/11/2014 10:59 InsomniacPro#13
Quick update on this, I have it working mostly. One issue, is it only works with pheasants, so I know I'm doing something wrong. This is what I do for jar updating whenever the mob needed to be killed, is kill.
Code:
        public unsafe void Jar(bool reset = false)
        {
            if (!reset)
                this.CurrentKills++;
            if (this.CurrentKills % 10 == 0)
                MessageServer.Database.Database.SetJar(Hunter, (ushort)this.Type, this.CurrentKills);

            RequestAttackPacket Packet = RequestAttackPacket.Create();
            Packet.AtkType = AttackID.MonsterJar;
            Packet.Damage = 65536;
            Packet.KillCounter = this.CurrentKills;
            Hunter.Send(&Packet);
        }
It works for pheasants.
Doesn't work for anything else. I've even tried as Alex says with his implementation. Any one see something I'm not where I fucked up?
06/11/2014 14:14 -impulse-#14
65536 is your issue.
06/11/2014 18:24 InsomniacPro#15
Quote:
Originally Posted by -impulse- View Post
65536 is your issue.
Without it, nothing happens ever.