|
You last visited: Today at 02:53
Advertisement
Traps
Discussion on Traps within the CO2 Private Server forum part of the Conquer Online 2 category.
03/04/2014, 03:49
|
#1
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Traps
So I have been playing around with traps lately using the ground item packet (1101) on patch 5065.
Not really getting the results I was expecting.
So I am able to display a trap, using either subtype 10 or 11. Its there on the ground, I can see it etc.
Now, I was under the impression that the client would then send a packet to the server when a trap is stood on or 'activated'. However, I have not had this happen yet.
Am I correct in this assumption? Am I just doing something wrong so the client doesn't really know its a trap?
Or am I going to have to check for traps manually on each location change.
Lastly, I am unable to remove the trap. It will disappear if you go off screen, but I cannot make it disappear while on screen.
I have tried sending subtype 12, with the trap info to remove it.
I have also tried sending subtype 2 (DeleteItem).
I even tried sending the GeneralData packet with the remove entity subtype.
All of the above had no luck.
I was using the UID between 900,000 and 999999. All with no luck
Does anyone have any idea how traps work?
I know there is a way to remove them, since TQ does it with squamas, I just haven't figured out how...
And I also can't really imagine having to check for a trap every location change. I know you will have to validate that there is a trap, but checking for a trap every jump seems quite inefficient, even for TQ.
|
|
|
03/04/2014, 20:47
|
#2
|
elite*gold: 0
Join Date: Oct 2010
Posts: 44
Received Thanks: 7
|
not really sure, what kind of traps ur looking for...
but for spawn traps, just place hidden portals..*(just thinking out of the box)
probabaly uselless but hey goodluck xD
|
|
|
03/04/2014, 21:16
|
#3
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Yeah, not really helpful there sorry.
Traps as in squamas, mine portals, and any other ground effect that activates when stepped on.
And some indication of how they work.
|
|
|
03/05/2014, 06:19
|
#4
|
elite*gold: 0
Join Date: Mar 2008
Posts: 309
Received Thanks: 208
|
The client doesn't send a "pick up" to the server because a method like that could be exploited. Place your trap in your map objects collection, proximity check each character server-side, if a character comes close you can remove the trap and activate the effect associated.
|
|
|
03/05/2014, 12:54
|
#5
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
And I was half expecting that to be the case, just needed confirmation.
But still need to be able to remove the trap, and from everything I have read and seen. Subtype 10 sets the trap, and subtype 12 removes it.
Subtype 10 works fine, but so far I have had no luck with subtype 12.
|
|
|
03/06/2014, 13:11
|
#6
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
So out of curiosity I loaded up a 5518 server.
Send packet 1101 with subtype 10 to create the trap.
Worked fine and the trap displayed.
Sent packet 1101 again with subtype 12, and voila, trap disappeared!
I go back to my 5065 version, do everything exactly the same.
Nope, trap stays where it is.
Is there a different way of removing these in lower patches?
Does anyone have some kind of clue.
|
|
|
03/06/2014, 13:26
|
#7
|
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
|
He made me do it on 5018.
Same result. It spawns, but can't be removed anymore.
|
|
|
03/06/2014, 20:47
|
#8
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Does anyone have some kind of an idea?
Trying alot of things without any success....
|
|
|
03/06/2014, 21:12
|
#9
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
You validate things server side, not client side. You should validate trap coordinates on the server. Store the traps in some sort of collection and check whether the coords match the players.
Ex. use a point struct.
Code:
struct Point
{
public int X;
public int Y;
public Point(int x, int y)
{
X = x;
Y = y;
}
}
Code:
ConcurrentDictionary<Point, Trap> Traps; // var trap = Traps[new Point(100, 150)];
|
|
|
03/06/2014, 21:18
|
#10
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Quote:
Originally Posted by Super Aids
You validate things server side, not client side. You should validate trap coordinates on the server. Store the traps in some sort of collection and check whether the coords match the players.
Ex. use a point struct.
Code:
struct Point
{
public int X;
public int Y;
public Point(int x, int y)
{
X = x;
Y = y;
}
}
Code:
ConcurrentDictionary<Point, Trap> Traps; // var trap = Traps[new Point(100, 150)];
|
I fully intend to validate server side.
But right now that is pretty useless if they cannot be removed
|
|
|
03/06/2014, 21:40
|
#11
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
According to TQ's source code, you also have to specify the location and type of the trap. This is the method they use for creating the removal packet (using subtype 12):
Code:
//////////////////////////////////////////////////////////////////////
BOOL CMsgMapItem::Create(int nAction, CMapItem* pMapItem)
{
CHECKF(pMapItem && nAction);
// init
this->Init();
// fill info now
m_pInfo->nAction = nAction;
m_pInfo->id = pMapItem->GetID();
m_pInfo->idType = pMapItem->GetType();
m_pInfo->nPosX = pMapItem->GetPosX();
m_pInfo->nPosY = pMapItem->GetPosY();
ItemInfoStruct* pInfo = pMapItem->GetInfo();
if (strlen(pInfo->szName)>0)
m_StrPacker.AddString(pInfo->szName);
// hide id
m_pInfo->idType = CItem::HideTypeQuality(m_pInfo->idType);
m_unMsgType =_MSG_MAPITEM;
m_unMsgSize =sizeof(MSG_Info)-1+m_StrPacker.GetSize();
return true;
}
|
|
|
03/06/2014, 21:47
|
#12
|
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
|
Nope, still not disappearing :3
|
|
|
03/06/2014, 22:02
|
#13
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
The identity range for a normal trap (called a magic trap for TQ) should be 900001 - 989999. The identity range for a synchro trap (I haven't tested with this) should be 990001 - 999999. be sure that you're using that identity range. I haven't tested traps this low of a patch, so it's possible that you might have to reverse engineer the client a bit to see what inputs it's expecting.
|
|
|
03/06/2014, 23:41
|
#14
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Any idea what the type of traps would be?
Those offsets look different too.
Wonder if later patches they made it easier to remove them.
Will have to test it later when I get access to my source again
|
|
|
03/07/2014, 01:15
|
#15
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Ignore the offsets. That's not what I was trying to show, and they're not assigning things in the order of the offsets in the packet structure.
|
|
|
 |
|
Similar Threads
|
[ BOT TRAPS ] In Jangan
04/23/2014 - Silkroad Online - 8 Replies
Wtf , people gone crazy or what ? why are you doing bot traps in jangan ? there is only few gold bots lvl 80+ . Yesterday i came home high as a cow and gone to bed. i woke up and WTF -20 % ?? I got breakdown lol :D . In future , people , please dont do bot traps in jangan , cause in jangan 98 % = player bots ;) Bye
|
Request codes traps
07/25/2013 - Facebook - 1 Replies
you can have the codes of the traps WOM thanks
|
[Sammeltherad] Mob Traps
01/21/2011 - Minecraft - 11 Replies
Hier könnt ihr
- eure mob traps posten (mit bau einleitung)
- gegen seitig mob traps tauschen
- Oder Fragen zu mob traps stellen
Viel Spaß
Mfg
|
Be able to put infinite traps?
02/06/2009 - RF Online - 0 Replies
is there a way to be able to put more traps like 30 , 40 etc on a same spot?
|
Nid Help How to murder x-traps from p servers...
09/17/2008 - Cabal Online - 1 Replies
as the topic says any existing threads has been posted here just asking lame on click the search button...
|
All times are GMT +1. The time now is 02:53.
|
|