[Question] walk, attack

07/15/2009 10:11 natinet#1
hello everyone!
i got a question:
i am sick of it...
its not moving directly to where i need!
its always missing
here is my currect code for the moving to dropped item: and plzzzzzzzzzzzzzz help me

PHP Code:
if (buf2[2] == 0x36)
{
        
DWORD itemid,x,y;
        
memcpy((void*)&itemid,(void*)((DWORD)buf2+5),4);
        
memcpy((void*)&x,(void*)((DWORD)buf2+5+4),4);
        
memcpy((void*)&y,(void*)((DWORD)buf2+5+4+4),4);
        if (
pick == 1)
        {
            
int difx=x-Player[0].X;
            
int dify=y-Player[0].Y;
            
int timex=difx/10,timey=dify/10;
            if(
timex<10000&&timey<10000)
            {
                if(
timex<0)
                    for(
int i=0;i>timex;i--)
                        
SendPacket(0x15,"bbb",-10,0,0);
                else if(
timex>0)
                    for(
int i=0;i<timex;i++)
                        
SendPacket(0x15,"bbb",10,0,0);
                if(
timey<0)
                    for(
int i=0;i>timey;i--)
                        
SendPacket(0x15,"bbb",0,-10,0);
                else if(
timey>0)
                    for(
int i=0;i<timey;i++)
                        
SendPacket(0x15,"bbb",0,10,0);
            }
            
SendPacket(0x20,"ddd",itemid,x/32,y/32);
        }

can you fix it/recode it?

thanks to kalhacker9000 for the walk packets tut and for bakabug and all others (bloodx...) for sources
thanks alot ^^
07/15/2009 10:19 katze123#2
Quote:
Originally Posted by natinet View Post
hello everyone!
i got a question:
PHP Code:
int difx=Mob[tr].X-Player[0].X;
int dify=Mob[tr].Y-Player[0].Y;
float range=(difx*difx+dify*dify)*1.0;
DWORD MobRangesqrtsqrt(range);
unsigned char tempx=(double(difx)/MobRangesqrt)*30;
unsigned char tempy=(double(dify)/MobRangesqrt)*30;
SendPacket(0x15,"bbb",tempx,tempy,0);
SendPacket(0x15,"bbb",tempx,tempy,0);
SendPacket(0x15,"bbb",tempx,tempy,0); 
the below code should take me the mob right?
ok question one:
1-should i see my player move or it will "move" serverside only and i wont see it?
2-if i want to attack the mob the packet:
PHP Code:
SendPacket(0x0f,"bdd",1,tar); 
will do it?
or i need the lastweapon?
PHP Code:
(SendPacket(0x0f,"bdd",1,tar,lastweapon);) 
3-does it make any difference with this:
PHP Code:
SendPacket(0x15,"Ubbb",last_u,tempx,tempy,0); 
and this?
PHP Code:
SendPacket(0x0f,"Ubdd",last_u,1,tar,lastweapon); 
4-after i make the first 0x0f packet-will it keep fighting like if i click a double click or i need to repeat the packet for a single attack?

thanks to kalhacker9000 for the walk packets tut and for bakabug and all others (bloodx...) for sources
thanks alot ^^
1: only serverside
2: "bdd" but only 2 numbers after it?
3: just cross out the "U" from "Ubbb/Ubdd" and cross out the "last_u"^^
4: you have to repeat the packet...
07/15/2009 10:26 natinet#3
thanks....
the lastweapon-it should be my weapon id? (the weap that i wear while attack?)
and..the Z axis doesnt matter?
i mean in bakabug's source he calculated the Z axis
i tried to use his calculatiob but MyHeightDetour made an error so that the game exists...
here the source: [Only registered and activated users can see links. Click Here To Register...]
07/15/2009 16:01 meak1#4
hm at me it works the myheightdetour, (0x0f, "bd",1,tar) or (0x0f,"bdd",1,tar,0)
07/16/2009 21:44 natinet#5
i am sick of it...
its not moving directly to where i need!
its always missing
here is my currect code for the moving to dropped item: and plzzzzzzzzzzzzzz help me

PHP Code:
if (buf2[2] == 0x36)
{
        
DWORD itemid,x,y;
        
memcpy((void*)&itemid,(void*)((DWORD)buf2+5),4);
        
memcpy((void*)&x,(void*)((DWORD)buf2+5+4),4);
        
memcpy((void*)&y,(void*)((DWORD)buf2+5+4+4),4);
        if (
pick == 1)
        {
            
int difx=x-Player[0].X;
            
int dify=y-Player[0].Y;
            
int timex=difx/10,timey=dify/10;
            if(
timex<10000&&timey<10000)
            {
                if(
timex<0)
                    for(
int i=0;i>timex;i--)
                        
SendPacket(0x15,"bbb",-10,0,0);
                else if(
timex>0)
                    for(
int i=0;i<timex;i++)
                        
SendPacket(0x15,"bbb",10,0,0);
                if(
timey<0)
                    for(
int i=0;i>timey;i--)
                        
SendPacket(0x15,"bbb",0,-10,0);
                else if(
timey>0)
                    for(
int i=0;i<timey;i++)
                        
SendPacket(0x15,"bbb",0,10,0);
            }
            
SendPacket(0x20,"ddd",itemid,x/32,y/32);
        }

can you fix it/recode it?
thanks alot
07/16/2009 22:46 katze123#6
PHP Code:
if (buf2[2] == 0x36)
{
        
int i;
        
DWORD itemid,x,y;
        
memcpy((void*)&itemid,(void*)((DWORD)buf2+5),4);
        
memcpy((void*)&x,(void*)((DWORD)buf2+5+4),4);
        
memcpy((void*)&y,(void*)((DWORD)buf2+5+4+4),4);
//here you need to divide x + y through 32 // [not sure^^]
        
if (pick == 1)
        {
        
int difx=x-Player[0].X;
        
int dify=y-Player[0].Y;
        
int timex=difx/10;
        
int timey=dify/10;
        if(
timex<10000&&timey<10000)
        {
            if (
timex>0)
            {
                    for (
i=0;i<timex;i++)
                    
SendPacket(0x15,"bbb",10,0,0);
            }
            if (
timex<0)
            {
                for (
i=0;i>timex;i--)
                    
SendPacket(0x15,"bbb",-10,0,0);
            }
            
//for y the same thing
        
    
SendPacket(0x20,"ddd",itemid,x/32,y/32);
    }

now every mistake from my side should be deleted
07/16/2009 22:54 natinet#7
thnaks i will try it now
thanks alot dude
07/16/2009 22:55 natinet#8
Ah Not working.....
Quote:
//here you need to divide x + y through 32 // [not sure^^]
ahh....no way
any other idea?
thanks alot
07/16/2009 23:09 katze123#9
printf("..."); is ur friend ^^
07/16/2009 23:42 natinet#10
lol its sometimes working and sometimes not...
its driving me crazy
good ni8