Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 28.11.2006, 18:45   #1
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default [QUESTION]CCreature::DeleteItemInInventory()

Mcrabben maybe you or someone else could answer this question ...

Basically I'm trying to figure out the way the arguments are passed to this function to delete an item from a players inventory.

What I've gathered so far is that it takes two arguments before the call which I'm guessing are a pointer to the item you want to delete and a value which is the number of that item to delete. Previous calls to that function in the server have the same instructions mov ecx, ebx before the call which should be the pointer to the user struct.

I've gotten it to work, but I get a server error with ObjectDB complaining of an undefined classID followed by another error saying the item does not exist.

Has anyone had any luck using this function or does anyone know any more about the arguments it takes etc? Thanks!
HongK is offline  
Old 28.11.2006, 20:08   #2
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default

so I'm wondering if maybe the function doesn't take a pointer to the item, but just accepts the item value itself as a DWORD... :O

In CCreature::AddItemToInventory(int nItemClassID, int nCount, bool isPick)

it takes 2 ints and a bool rather than pointers
HongK is offline  
Old 28.11.2006, 20:18   #3
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

i'd venture $20 on the 2nd one. Want a good way to check? Olly debug, or go there in IDA/Olly and compare the argument passing code for both. If the passing is the same for both i'd go with that.

A lot of l2server functions take more parameters than ncsoft wrote in the debug messages. Don't trust the strings, trust the assembly
mcrabben7 is offline  
Old 28.11.2006, 21:26   #4
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default

Quote:
Originally Posted by mcrabben7 View Post
i'd venture $20 on the 2nd one. Want a good way to check? Olly debug, or go there in IDA/Olly and compare the argument passing code for both. If the passing is the same for both i'd go with that.

A lot of l2server functions take more parameters than ncsoft wrote in the debug messages. Don't trust the strings, trust the assembly
yea I did check them in the assembly .. all local calls to the function tend to push two registers and move ebx to ecx which is typical for getting a pointer to the user struct ... I was confused because I was passing it a pointer to the item and it was executing successfully, but it was erroring in the server console with bad item id .. So I'm guessing it just takes the straight value ..

and yea those debug messages are tricky not showing you all the parameters the functions take >< It's kind of annoying
HongK is offline  
Old 28.11.2006, 23:40   #5
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default

haha I owe you $20 .. the item was just a value and not a pointer

thanks for your help :P
HongK is offline  
Old 01.12.2006, 02:27   #6
Nevyn
Архивный участник
 
Join Date: Sep 2006
Posts: 114
Default

HongK Its nice seeing you going through all this
Wish you goodluck in your continued studying.
Nevyn is offline  
Old 01.12.2006, 14:28   #7
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default

Well you guy's project was just the catalyst I needed. The great thing about it all is that you can take what you learn from it and go do other things not related to lineage 2. To me, that's what you should take away from PP. People came here with a desire to create a better server from c1 and they should leave with the ability to not only be able to do that, but to have the skills to move on to bigger and better things.
HongK is offline  
Old 02.12.2006, 06:35   #8
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

You will never know the sweat, blood, and tears poured into that code ^^ it is of course great to see you coding C2 stuff in, and that's awesome.

Btw, did you ever fix the small CP bug I left behind? Just curious.

You are the only person I know who's really taken something big away from it, but, that's enough for me I guess. We all move on to bigger and better things, anyways
mcrabben7 is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:06.