Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool bGoodMonster = true;
- int iRangeX = 20, iRangeY = 0;
- int iOriginalX = 0, iOriginalY = 0;
- unsigned long ulEBX;
- HANDLE hKami;
- int iItems = 50;
- int iItemX, iItemY;
- bool bLoot = false;
- #define TeleORAddy 0x00889459
- #define CharAddy 0x00B44CFC
- #define TimeAddy 0x00B452DC //a1 ? ? ? 00 8b 40 ? c3
- #define TimeOffset 0x1C //Below TimeAddy
- #define TeleOffset 0x000036DC
- #define NextTeleOffset 0x000036F0 //Main tele + 14
- #define ItemsAddy 0x00B4719C
- #define ItemsOffset 0x00000028
- #define ItemHookCmp 0x005002FF //took forever
- #define PtInRectAddy 0x00B49C84 //Search for PtInRect
- #define MonsterAddy 0x00B44CF8
- #define MobStructOffset1 0x00000028
- #define MobStructOffset2 0x00000004
- #define MobStructOffset3 0x000000F0
- #define MobStructOffset4 0x00000028
- #define MobXOffset 0x00000060
- #define MobDeathOffset 0x00000404
- #define WallAddy 0x00B44CF0
- #define LeftWallOffset 0x00000024
- unsigned long ulPtInRect = (unsigned long)GetProcAddress(GetModuleHandle("user32.dll"), "PtInRect");
- void __declspec(naked) _stdcall ItemHookAsm()
- {
- __asm
- {
- cmp [esp],ItemHookCmp
- jne End
- push eax
- mov eax,[esp+0x0C]
- mov [iItemX],eax
- mov eax,[esp+0x10]
- mov [iItemY],eax
- pop eax
- End:
- jmp dword ptr [ulPtInRect]
- }
- }
- bool LeftWall(int X)
- {
- return ((int)ReadPointer(WallAddy, LeftWallOffset) <= X);
- }
- bool TopWall(int Y)
- {
- return ((int)ReadPointer(WallAddy, LeftWallOffset + 4) <= Y);
- }
- bool RightWall(int X)
- {
- return ((int)ReadPointer(WallAddy, LeftWallOffset + 8) >= X);
- }
- bool BottomWall(int Y)
- {
- return ((int)ReadPointer(WallAddy, LeftWallOffset + 12) >= Y);
- }
- void Teleport(int X, int Y)
- {
- if (LeftWall(X) && RightWall(X) && TopWall(Y) && BottomWall(Y))
- {
- WritePointer(CharAddy, TeleOffset + 8, X);
- WritePointer(CharAddy, TeleOffset + 12, Y);
- WritePointer(CharAddy, TeleOffset, 1);
- }
- }
- int GetTimeStamp()
- {
- return (int)ReadPointer(TimeAddy, TimeOffset);
- }
- int GetAllowedTeleTime()
- {
- return (int)ReadPointer(CharAddy, NextTeleOffset);
- }
- void Kami()
- {
- for (;; Sleep(10))
- {
- if(GetTimeStamp() <= GetAllowedTeleTime() || GetAllowedTeleTime() == 0)
- {
- if (bLoot && (int)ReadPointer(ItemsAddy, ItemsOffset) >= iItems)
- {
- for (unsigned char uc = 0; uc <= 200 && ReadPointer(ItemsAddy, ItemsOffset) >= 1; uc++, Sleep(25)) //loot for 5 seconds
- {
- Teleport(iItemX, iItemY);
- }
- }
- continue;
- }
- ulEBX = ReadPointer(MonsterAddy, MobStructOffset1);
- if (bGoodMonster)
- {
- ulEBX = GetValue(ulEBX, MobStructOffset2);
- }
- else
- {
- ulEBX = GetValue(ulEBX, -12);
- ulEBX = GetValue(ulEBX, 0x14);
- }
- if (!GetValue(ulEBX, MobDeathOffset))
- {
- bGoodMonster ^= true;
- continue;
- }
- ulEBX = GetValue(ulEBX, MobStructOffset3);
- ulEBX = GetValue(ulEBX, MobStructOffset4);
- Teleport((int)GetValue(ulEBX, MobXOffset) - iRangeX, (int)GetValue(ulEBX, MobXOffset + 4) - iRangeY);
- }
- }
- ..
- *(char*)(TeleORAddy + 6) = 0x01;
- hKami = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Kami, NULL, NULL, NULL);
Add Comment
Please, Sign In to add comment