Stripped ProjectAlchemy Source Code

01/08/2011 14:52 gorgone#541
Quote:
Originally Posted by [GM] View Post
ty for ur explanation, but since iam weak in C#
can you give me an example?
something similar to gabrola publish at first of this topic take a look in around in 5 or 6 page
01/08/2011 16:18 argon69#542
Quote:
Originally Posted by gorgone View Post
sorry now is clear wht u mean .. :))

sometimes i don t understood clearly wht mates ur write ^.^ i used a dictionary of items dorped by mine and items that i can t take from ground becouse are items locked (other player kills them and drop it) all this dictionary are don t loot item and i cleaning from my item grounds ( if u loook my Filter ground items function)
Sorry about not being clear :)

Did you anything about detecting end of XP cycle? Somehow, Client.InXp is always true and not gets reset. i should put some debugging point to see if there is any change in server packet.
01/08/2011 16:46 [GM]#543
anyone can share the RandomJump code?
01/08/2011 17:42 argon69#544
Quote:
Originally Posted by [GM] View Post
anyone can share the RandomJump code?
I don't use random jump. I refined a spiral hunting path from current location and jump one point to another. It is so basic at the moment. After I implement all the functionality, I am planning to improve it. Anyway, I can give you pseudo code for random jump.

void randomJump(Client C)
{
Coord next = randomJumpCoord(C.X, C.Y);
if (next is valid location) // I left this as challenge. where is while loop?....
{
jump to next;
update Client position
}
}

Coord randomJumpCoord(ushort currentX, ushort currentY)
{
Random ran = new Random();
Coord newCoord = new Coord();
newCoord.X = ran.Next(currentX-18, currentX+18);
newCoord.Y = ran.Next(currentY-18, currentY+18);
return newCoord;
}

Of course, you need to check this Coord is valid before you make a jump.
01/08/2011 17:52 argon69#545
P4N,
I am trying to find char's max HP. Char info in Handler only gives current HP. Do you know which packet gives that information?

BTW, I think I am done with looting and dropping normal items. Thanks to P4N and gorgone :) I am trying to implement autopot function. If anyone is in this process, let's share basic ideas. I am trying to maintain at least 50% of max HP. If it goes below, use pot. If you run out of pot, start picking up pots (maybe upto 5 in inventory). Let's see how it goes.
01/08/2011 17:57 gorgone#546
Quote:
Originally Posted by argon69 View Post
Sorry about not being clear :)

Did you anything about detecting end of XP cycle? Somehow, Client.InXp is always true and not gets reset. i should put some debugging point to see if there is any change in server packet.
is a particualar send pack in cyrcle handler.cs in packet folder

try to find this sequence

Client.InXp = true;
if (Client.XpSkill == 6011)
{
Client.HuntMode = HuntMode.FatalStrike;
Client.FatalStrikeActivated = DateTime.Now;
Client.InFatalStrike = true;
}

is event XPSkill is avable cast spell on it (must pay attention to moddy this section if u suspt without idea to do go immidiatly in botjail for ur sake is better that u test with a noob
01/08/2011 18:01 demon17#547
Hy I wana ask some things like :
1) How can i add the Monk XP skill to auto activate?
-Where exactly
-what is the skill ID
-How I implement it
2) How can i add the Loot Costum item ( Mean /loot " " )<("Metoer" < with id)
-Where
-How
Cuz i start to be lazzy to stop every time when 1 met is dropped

[I know no one wana help each others ( i mean no one wana send me a code wich i can place in bot.cs or no one help me to make it work) , for this i will be glad when someone post some pseudo codes ..]
01/08/2011 18:09 gorgone#548
Quote:
Originally Posted by demon17 View Post
Hy I wana ask some things like :
1) How can i add the Monk XP skill to auto activate?
-Where exactly
-what is the skill ID
-How I implement it
2) How can i add the Loot Costum item ( Mean /loot " " )<("Metoer" < with id)
-Where
-How
Cuz i start to be lazzy to stop every time when 1 met is dropped

[I know no one wana help each others ( i mean no one wana send me a code wich i can place in bot.cs or no one help me to make it work) , for this i will be glad when someone post some pseudo codes ..]
1.
u need to find in handler.cs the section inside where P4N cheak if ur job char is Warrior or is trojan or is an archer .. then need to create a is a Monk job is around 60 < _ < 70 then y must sniff packet and understood the id of XP skill monk ( OBLIVION ID IS 10390)

i m work on Client.Skills <-- inside here there are all the Skill that ur char can cast or use

pay attention all mods in Packet folder are so delicate and put u in jail !

2. rare items like dagronball and items in general are crypted in itemtype.dat, some pages ago in this post i published a itemtype.dat.txt.. u can donwload frome there
01/08/2011 18:12 pro4never#549
Quote:
Originally Posted by argon69 View Post
Sorry about not being clear :)

Did you anything about detecting end of XP cycle? Somehow, Client.InXp is always true and not gets reset. i should put some debugging point to see if there is any change in server packet.
There is a status update subtype that the server sends controling how much xp time you have left. I thought I had it handled in proxy already but it's possible it changed. Basically you wanna do if it's < something Xp mode = false. As for fatal strike just do if fatal activated is greater than say 58 seconds you turn off fatal strike cause it will stop soon on its own.

Quote:
Originally Posted by argon69 View Post
P4N,
I am trying to find char's max HP. Char info in Handler only gives current HP. Do you know which packet gives that information?

BTW, I think I am done with looting and dropping normal items. Thanks to P4N and gorgone :) I am trying to implement autopot function. If anyone is in this process, let's share basic ideas. I am trying to maintain at least 50% of max HP. If it goes below, use pot. If you run out of pot, start picking up pots (maybe upto 5 in inventory). Let's see how it goes.
for max hp you have to calculate it using your equipped items and your character's stats (job, str, vit, spi, dex and equipped items using an itemtype.dat and the + bonuses file)

It's actually not all that easy to do...

Quote:
Originally Posted by argon69 View Post
As PxN said, NEW ground id is generated by server when item is dropped even with same item. You can't see real UID until the item is in your inventory. I tried to avoid using current method that uses time. I optimized handler routine to check around char to make reasonable guess that the item dropped is yours.

BTW, thanks P4N to confirming this :)

Also, I found something strange about ID and I don't know how it is happening. In my inventory, ID was 136003 and when it was dropped it became 136005. So, LastDroppedID == I.ID checking logic was failing. So, it went into picking up/dropping loop again..... Any explaination? I might change the code to check that item is being dropped by char and that item is around char.
That could be tq and their not allowing itemtype.dat hacks to detect item quality. Is it a non weapon based item? If so it's probably defaulting to the "normal" version of the item where

5 = norm
6 = ref
7 = unique
8 = elite
9 = super

Cause tq doesn't allow you to detect quality on the ground

The problem with that is there are multiple normal versions of most item in which their stats differ slightly... so you have a xxxx3 version of item, drop it and it becomes a xxxx5 version of an item... so when dropping you should be setting the lastdroppedid last digit to 5 or w/e if it's a gear based item (non wep, not generic item)
01/08/2011 18:51 [GM]#550
i got this code from gorgone, here it is

Code:
 private static void RandomJump(Client C)
        {
            Random random = new Random();
            Coord XY = new Coord();
            XY.X = (ushort)(C.X + random.Next(-C.[COLOR="Red"]Step_random_jump[/COLOR], C.[COLOR="red"]Step_random_jump[/COLOR]));
            XY.Y = (ushort)(C.Y + random.Next(-C.[COLOR="red"]Step_random_jump[/COLOR], C.[COLOR="red"]Step_random_jump[/COLOR]));
            if (Calculations.ValidDmap(C.StaticMap, [COLOR="Red"]Z[/COLOR].X, [COLOR="red"]Z[/COLOR].Y))
            {
                Packets.CliJump(XY.X, XY.Y, 156, C);
                Packets.Jump(C, XY.X, XY.Y, 137);
                Packets.CliJump(XY.X, XY.Y, 156, C);
                C.X = XY.X;
                C.Y = XY.Y;
                C.UpdatedX = XY.X;
                C.UpdatedY = XY.Y;
                System.Threading.Thread.Sleep(C.JumpSpeed);
                C.LastJump = DateTime.Now;
            }
        }
but it says that there is a problem with Step_random_jump and the letter "Z" which i marked in red

and about the hunting part i got this code
PHP Code:
        public static bool NewBot(Client C)
        {
            
            if (
C.RunBot)
            {
                
Mob Attack GetClosestMonster(C);
                if (
Attack != null)
                {
                    if (
C.LastJump.AddMilliseconds(C.JumpSpeed) < DateTime.Now)
                    {
                        
Packets.CliJump(Attack.XAttack.Y156C);
                        
Handler.Chat(C" "2008);
                        
C.Attack.X;
                        
C.Attack.Y;
                        
C.UpdatedX C.X;
                        
C.UpdatedY C.Y;
                        
Calculations.UpdateLocal(C);
                        
C.LastJump DateTime.Now;
                    }
                    else if (
C.LastAttack.AddMilliseconds(C.AttackSpeed) < DateTime.Now)
                    {
                        
Calculations.ShiftTarget(Attack);
                        
Packets.AtkServer(CAttack2);
                        
C.Attack.X;
                        
C.Attack.Y;
                        
C.UpdatedX C.X;
                        
C.UpdatedY C.Y;
                        
Calculations.UpdateLocal(C);
                        
Handler.Chat(C" " Attack.Name2008);
                        
C.LastAttack DateTime.Now;
                    }
                }
                
Mob M GetClosestMonster(C);
                if (
== null)
                {
                    
RandomJump(C);
                }
                
int Dist Calculations.Distance(C.XC.YM.XM.Y);
                if (
Dist 2)
                {
                    if (
DateTime.Now C.LastAttack.AddMilliseconds(C.AttackSpeed))
                    {
                        
Packets.AtkServer(CM2);
                    }
                    else
                    {
                        if (
DateTime.Now C.LastJump.AddMilliseconds(C.JumpSpeed))
                            return 
true;
                    }
                }
            }
        } 
it says that not all code paths return a value
and when i type /hunt nothing happens
this is my command of hunting
PHP Code:
case "/hunt":
                        {
                            if (!
C.RunBot)
                                
C.RunBot true;
                            
UpdateStats(C);
                            
C.Hunting = !C.Hunting;
                            
Chat(C"Hunting = " C.Hunting2011);
                            break;
                        } 
thx in advance
01/08/2011 19:20 pro4never#551
well problem is it's a bool. Change that to void unless you are always returning when it's finished.


Z is a coord which you are never assigning (probably pulling the random jump or mob coords)

Step random jump is most likely it pulling a random coord near where the client currently is.
01/08/2011 19:33 gorgone#552
if (Calculations.ValidDmap(C.StaticMap, Z.X, Z.Y))

ValidMap what do ? cheak if is possibile move on this coordinate on determinate map... so change Z with XY and all be fine u can jump ^^
01/08/2011 19:37 [GM]#553
Quote:
Originally Posted by gorgone View Post
if (Calculations.ValidDmap(C.StaticMap, Z.X, Z.Y))

ValidMap what do ? cheak if is possibile move on this coordinate on determinate map... so change Z with XY and all be fine u can jump ^^
ty so much
what about Step_random_jump ?

@P4N i changed it to void and its better now, but still not hunting ;(
01/08/2011 20:56 argon69#554
Quote:
Originally Posted by [GM] View Post
ty so much
what about Step_random_jump ?

@P4N i changed it to void and its better now, but still not hunting ;(
I believe it predefined constant. Try it define as 18. So random number will be generated from -18 to 18.
01/08/2011 20:58 argon69#555
Now. Here is my another quest to get max HP. What about accessing memory address? I will try to see if I can translate existing tools into this.