Traps

03/07/2014 02:14 Aceking#16
Alright. I will definitely test it out.
Only thing I could possibly be missing is the type of trap.
Which is the offset that controls item color, at least I assume.

So no idea what those types would be?

Just gonna hafta guess them I suppose

Edit.
I just tried a bunch of different ways, still nothing....
Just dont understand why it works on later patches, can't see why it would change...
09/26/2023 14:05 chetos20123#17
So 9 years later, did you manage to find a solution for this? XD
I am trying to implement the same feature and stuck with the same weird behavior.
i even tried reverse engineering the client using Ghidra, but i got lost and could not manage to get to the function that is triggered.
09/27/2023 18:31 .Nostalgia#18
Quote:
Originally Posted by chetos20123 View Post
So 9 years later, did you manage to find a solution for this? XD
I am trying to implement the same feature and stuck with the same weird behavior.
i even tried reverse engineering the client using Ghidra, but i got lost and could not manage to get to the function that is triggered.
I think you can remove the traps starting somewhere around 5065-5165. On older clients, the remove subtype is ignored. Also the client never sends a packet when you step on a trap, you have to check that server side
09/29/2023 01:57 chetos20123#19
Quote:
Originally Posted by .Nostalgia View Post
I think you can remove the traps starting somewhere around 5065-5165. On older clients, the remove subtype is ignored. Also the client never sends a packet when you step on a trap, you have to check that server side
I tried it on 5065 but still same issue, guess i have to look for another workaround, i tried to attach role effect using MsgName to the dropped item but it did not show anything on the field, guess it works only on characters.
09/29/2023 21:37 teroareboss1#20
I use in my 5017 to remove trap:

Code:
stream.CreateMapItem(UID, 17, X, Y, MsgMapItem.GroundItemAction.DropTrap, 0)
I don't remember the reason for 17(for id).. this source is old.

DropTrap = 12

The packet is: [Only registered and activated users can see links. Click Here To Register...]
The cast is: [Only registered and activated users can see links. Click Here To Register...]

The UID is: 994454+ [Only registered and activated users can see links. Click Here To Register...]
09/30/2023 02:36 Arcо#21
Quote:
Originally Posted by teroareboss1 View Post
I use in my 5017 to remove trap:

Code:
stream.CreateMapItem(UID, 17, X, Y, MsgMapItem.GroundItemAction.DropTrap, 0)
I don't remember the reason for 17(for id).. this source is old.

DropTrap = 12

The packet is: [Only registered and activated users can see links. Click Here To Register...]
The cast is: [Only registered and activated users can see links. Click Here To Register...]

The UID is: 994454+ [Only registered and activated users can see links. Click Here To Register...]
Tero, how many damn databases do you need?
10/02/2023 23:52 chetos20123#22
Quote:
Originally Posted by teroareboss1 View Post
I use in my 5017 to remove trap:

Code:
stream.CreateMapItem(UID, 17, X, Y, MsgMapItem.GroundItemAction.DropTrap, 0)
I don't remember the reason for 17(for id).. this source is old.

DropTrap = 12

The packet is: [Only registered and activated users can see links. Click Here To Register...]
The cast is: [Only registered and activated users can see links. Click Here To Register...]

The UID is: 994454+ [Only registered and activated users can see links. Click Here To Register...]
ok, so i tried what you have proposed but still no luck.
here is how i sent the message to cast trap:
Code:
await user.Client.SendAsync(new MsgMapItem
{
    Identity = 994464,
    MapX = user.X,
    MapY = user.Y,
    Itemtype = type,
    Mode = DropType.LayTrap,
    Color = 1
});
Here is how i sent the message to drop trap
Code:
await user.Client.SendAsync(new MsgMapItem
{
    Identity = 994464,
    MapX = user.X,
    MapY = user.Y,
    Itemtype = 17,
    Mode = DropType.DropTrap,
    Color = 0
});
here is how the message is encoded:
Code:
public override byte[] Encode()
{
    using var writer = new PacketWriter();
    writer.Write((ushort)PacketType.MsgMapItem);
    writer.Write(Identity);      // 4
    writer.Write(Itemtype);      // 8
    writer.Write(MapX);          // 12
    writer.Write(MapY);          // 14
    writer.Write((ushort)Mode);    // 16
    writer.Write((ushort)Color); // 18
    return writer.ToArray();
}
i tested on the bomb trap (itemType 23), on stigma effect (itemType 22) and on itemtype 17
the trap appears below the character but it never disappears until i go off screen or until default period finishes (in case of item types 22 and 17)

can you spot where the issue is? :/
10/09/2023 17:49 .Nostalgia#23
He is using an edited client with type 17 set to not loop in 3DEffect.ini iirc, so it looks like it gets removed instantly. That's the only explanation i got because that was my workaround too, although with a different Id.
10/09/2023 20:32 chetos20123#24
Quote:
Originally Posted by .Nostalgia View Post
He is using an edited client with type 17 set to not loop in 3DEffect.ini iirc, so it looks like it gets removed instantly. That's the only explanation i got because that was my workaround too, although with a different Id.
can you explain that workaround? maybe i will try to follow it as well :)
10/10/2023 07:49 .Nostalgia#25
I'm sorry, I misremembered, I used packet 1015 (MsgName) and i keep sending the effect packet if players are in range once a second, i set the LoopTime to 2 and the FrameInterval to 30 in 3DEffect.ini in the client.

Once a player steps on it, I simply stop sending the MsgName packet that displays it.