Oh, thanks for telling, I didn't really beleive that the packet would have more functions for it.
Will take a look at it right away.
But it's said what you do not believe in can never be accomplished.
~ Nicco
Printable View
Oh, thanks for telling, I didn't really beleive that the packet would have more functions for it.
Will take a look at it right away.
But it's said what you do not believe in can never be accomplished.
~ Nicco
I tried few times before you fixed the -1 thing, lol failure, i was going to play with the Lua sending packets because I hate to recompile everytime I fix edit one small thing everytime.
Lets see if the -1 works...
Well, my test's return fail, I even tested LUA to modify it fast, is there something wrong in this lua?
It's convert from what the actual code is in osaflyff.Code:local mvrID = 9386;
pak:StartNewMergedPacket(mvrID, 0x000000F0);
pak:Addbyte(4); -- 4 = item
pak:Addint(mvrID);-- mover id
pak:Addbyte(4); -- 4 = item
pak:Addshort(mvrID); -- mover id
pak:Addshort(1); -- mover size
pak:Addfloat(6944); -- position x
pak:Addfloat(100); -- position y
pak:Addfloat(3239); -- position z
pak:Addshort(1); -- angle
pak:Addshort(mvrID); -- mover id
pak:Addint(-1);
-- Here is the item data:
pak:Addint(21); -- item id
pak:Addint(0x00); -- null
pak:Addint(0x00); -- null
pak:Addshort(1); -- quantity
pak:Addbyte(0x00); -- null
pak:Addint(2100000000); -- expire time
pak:Addint(0x00); -- null
pak:Addbyte(0); -- 0 = not exired, 1 = expired
pak:Addint(0); -- refine
pak:Addint(0x00); -- null
pak:Addbyte(0); -- element
pak:Addint(0); -- elementrefine
pak:Addint(0x00); -- null
pak:Addbyte(0); -- total sockets
pak:Addshort(0); -- socket 1
pak:Addshort(0); -- socket 2
pak:Addshort(0); -- socket 3
pak:Addshort(0); -- socket 4
pak:Addint(0); -- (item.timeLastUntil > -1 && !item.expired) ? 1 : 0
pak:Addlong(0); -- awakening
pak:Addint(0x00); -- null
pak:Addbyte(0);
Are there any fields that has to be unique for just that item or anything?
MoverID should be unique yes, but it doesn't matter what I set moverid as, it always crash.
There added some comments to help explain what I think might be wrong
Code:pak:Addint(mvrID);-- mover id <- not mover id in that sense, item id like 21 for wooden sword
pak:Addbyte(4); -- 4 = item
pak:Addshort(mvrID); -- mover id <- item id
pak:Addshort(1); -- mover size
pak:Addfloat(6944); -- position x
pak:Addfloat(100); -- position y
pak:Addfloat(3239); -- position z
pak:Addshort(1); -- angle
pak:Addshort(mvrID); -- mover id <- unique mover id
Still crash :mellow:
Console debugging:Code:Packet pak = new Packet();
pak.StartNewMergedPacket(drop.dwMoverID, PAK_MOVER_SPAWN);
pak.Addbyte(4); // 4 = item
pak.Addint(drop.item.itemid); // Item ID
pak.Addbyte(4); // 4 = item
pak.Addshort(drop.item.itemid); // Item ID
pak.Addshort(drop.dwMoverSize); // Mover Size
pak.Addfloat(drop.c_position.x); // X
pak.Addfloat(drop.c_position.y); // Y
pak.Addfloat(drop.c_position.z); // Z
pak.Addshort(drop.c_position.angle); // Angle
pak.Addshort(drop.dwMoverID); // Mover ID
pak.Addint(-1);
pak.AddItemData(drop.item);
pak.Send(this);
Quote:
[09:46]: Spawning item (Ultimate Legendary Golden Axe)...
[09:46]: Drop sent for this client: Nicco [nicco, ID: 8273]
[09:46]: [Drop] Position: World: 1 6946,252 - 100 - 3240,018, Owner: 0, MoverID: 8275, Size: 1, Free time: 1239582371
[09:46]: ItemID: 22381, Refine: 0 Element: 0, Ele refine: 0, Awakening: 0, ItemSlot: 0 Quantity: 1, Sockets: 0, Last Until: -1, UniqueID: 0
You sent size as 1, size should be **** otherwise it will be a really small item.
If you send 0 sockets, you dont send the sockets as 0, just like this:
pak.AddByte(socketSize); //0
for (int i = 0; i < socketSize; i++)
pak.AddShort(0); //wont come here
Thats what I got from it
In C# it does do that:
However, for the size, what should it be? Your text got censored lolCode:Addbyte(item.sockets.Length);
for (int i = 0; i < item.sockets.Length; i++)
Addshort(item.sockets[i]);
lol I cant write 100 , without that space between the 0 and coma '-' idk why, but I cant lol
I had some problems before with that packet when trying to find where to put awaken and refines, before I realise it was similar(if not equal) addItem function, anyways, use a simple function like this:
It is from the old emulator I was working on, the first 2 "itemid" is wrong I think, but worked :P well, its pretty incomplete, but worked, try it :PCode:pakout.StartPacket( 0xFFFFFF00 );
pakout.StartNewMergedPacket( thisdrop->clientid, PC_ON_ADD_OBJ );
pakout.AddByte(4);// 4=item, 5=mob or npc
pakout.AddDWord(thisdrop->item.itemid);//itemid
pakout.AddByte(4);
pakout.AddWord(thisdrop->item.itemid);//itemid
pakout.AddWord(100);
pakout.AddFloat(thisclient->PositionInfo.x);
pakout.AddFloat(thisclient->PositionInfo.y);
pakout.AddFloat(thisclient->PositionInfo.z);
pakout.AddWord(0);
pakout.AddDWord(thisdrop->clientid);
pakout.AddDWord(-1);
pakout.AddWord(thisdrop->item.itemid);//itemid
pakout.AddWord(0);
pakout.AddDWord(0x484b3490);
pakout.AddDWord(0);
pakout.AddWord(thisdrop->item.count); //amount
pakout.AddByte(0);
pakout.AddDWord(-1);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0);
pakout.AddDWord(0); //
SendPacket( thisclient, &pakout );
Quote:
[10:19]: Spawning item (Wooden Sword)...
[10:19]: Drop sent for this client: Nicco [nicco, ID: 8272]
[10:19]: [Drop] Position: World: 1 6947,252 - 100 - 3245,018, Owner: 0, MoverID: 8274, Size: **** Free time: 1239584392
[10:19]: ItemID: 21, Refine: 0 Element: 0, Ele refine: 0, Awakening: 0, ItemSlot: 0 Quantity: 1, Sockets: 0, Last Until: -1, UniqueID: 0
Thats what I get, im getting clueless.......Quote:
start new packet
added byte: '4'
added int: '21'
added byte: '4'
added short: '21'
added short: '100'
added float: '6947,252'
added float: '100'
added float: '3245,018'
added short: '0'
added short: '8274'
added int: '-1'
added int: '21'
added int: '0'
added int: '0'
added short: '1'
added byte: '0'
added int: '2100000000'
added int: '0'
added byte: '0'
added int: '0'
added int: '0'
added byte: '0'
added int: '0'
added int: '0'
added byte: '0'
added int: '0'
added long: '0'
added int: '0'
added byte: '0'
Well an Item id can never be a Short right?, theres items like 22381, ultimate LGA, and thats 5 bytes, isn't Short only 4? as in max 9999...
Okay, Items drops now!
I had to add a new AddData type of function, the one you pointed me to is only for when a player spawns.
Really diving into rhisis code made me see that they are not written same, there where some swapped ones in osaflyff where it was byte instead of short and reverse.
Thank you so much for the help :rolleyes:
Edit: Fixed skin, works now! Only need to implement ability to pick it up also :lol:
http://image-storage.co.uk/Images/e4...44993bb617.jpg
if you guys share we will have an complete OSA and rhisis before we know it:D