Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int iKbKamiXRange,iKbKamiYRange;
- bool bKbKami = false;
- void vKbKami();
- void Form1::checkBox67_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
- {
- if(checkBox67->Checked)
- {
- iKbKamiXRange = Convert::ToInt32(textBox19->Text);
- iKbKamiYRange = Convert::ToInt32(textBox20->Text);
- bKbKami = true;
- NewThread(vKbKami);
- }
- else
- bKbKami = false;
- }
- int RepeatNo;
- int sDifX = 0;
- int sDifY = 0;
- DWORD GetMobAtPos(int MobIndex)
- {
- DWORD dwMobStruc = ReadPointer(MobBasePtr,Mob1Offset);
- if(MobIndex == 0)
- {
- dwMobStruc = iGetValue(dwMobStruc,Mob2Offset);
- return dwMobStruc;
- }
- dwMobStruc = iGetValue(dwMobStruc,-12);
- for(int i = 1;i < MobIndex;i++)
- {
- dwMobStruc = iGetValue(dwMobStruc,4);
- }
- dwMobStruc = iGetValue(dwMobStruc,0x14);
- return dwMobStruc;
- }
- POINT GetMobPos(DWORD dwBase)
- {
- POINT p = POINT();
- DWORD dwBuf = iGetValue(dwBase,Mob3Offset);
- dwBuf = iGetValue(dwBuf,Mob4Offset);
- p.x = iGetValue(dwBuf,MobXOffset);
- p.y = iGetValue(dwBuf,MobYOffset);
- return p;
- }
- void ScriptRandomMob(bool bteleport)
- {
- int iRanMobX = 0;
- int iRanMobY = 0;
- for(int iMob = 0;iMob < GetMobCount();iMob++)
- {
- DWORD dwMobStruc = GetMobAtPos(iMob);
- DWORD dwMob = dwMobStruc;
- if(ReadPointer(dwMob,MobDeathOffset))
- {
- msSendDownKey(0x08);
- msSendUpKey(0x08);
- POINT pos = GetMobPos(dwMob);
- iRanMobX = pos.x;
- iRanMobY = pos.y;
- break;
- }
- }
- if(bteleport)
- Teleport(iRanMobX+sDifX,iRanMobY+sDifY);
- if(!bteleport)
- {
- Knockback(true, iRanMobX-iKbKamiXRange > GetX());
- Knockback(false, iRanMobY-iKbKamiYRange > GetY());
- WriteValue((LPDWORD)ReadPointer(CharBasePtr, pID), ulKBOffset, 1);
- }
- }
- void ScriptNearestMob(bool bteleport)
- {
- int nScriptMobX = 0;
- int nScriptMobY = 0;
- int ScriptRange = 0;
- for(int iMob = 0;iMob < GetMobCount();iMob++)
- {
- DWORD dwMobStruc = GetMobAtPos(iMob);
- DWORD dwMob = dwMobStruc;
- if(ReadPointer(dwMob,MobDeathOffset))
- {
- msSendDownKey(0x08);
- msSendUpKey(0x08);
- POINT pos = GetMobPos(dwMob);
- int iTeleX = GetX() - pos.x;
- int iTeleY = GetY() - pos.y;
- if(iTeleX < 0) iTeleX = -iTeleX;
- if(iTeleY < 0) iTeleY = -iTeleY;
- int TeleportRange = iTeleX + iTeleY;
- if((TeleportRange < ScriptRange || ScriptRange == 0) && pos.x != -1 && pos.y != -1)
- {
- ScriptRange = TeleportRange;
- nScriptMobX = pos.x;
- nScriptMobY = pos.y;
- }
- }
- }
- if(bteleport)
- Teleport(nScriptMobX+sDifX,nScriptMobY+sDifY);
- if(!bteleport)
- {
- Knockback(true, nScriptMobX-iKbKamiXRange > GetX());
- Knockback(false, nScriptMobY-iKbKamiYRange > GetY());
- WriteValue((LPDWORD)ReadPointer(CharBasePtr, pID), ulKBOffset, 1);
- }
- }
- bool KamiSwitch = false;
- int iOriginalX = 0, iOriginalY = 0;
- int iRangeX = 25, iRangeY = 0;
- bool bGoodMonster = false;
- unsigned long MobStruct = 0;
- unsigned long ulEBX;
- bool KamiAutoLootSwitch;
- int iItems = 0;
- int iStopLootWhenItems;
- bool bLoot = false;
- long int iItemX = 0,
- iItemY = 0;
- // what's your l?
- void __declspec(naked) _stdcall ItemHook_ASM()
- {
- __asm
- {
- cmp dword ptr [esp],0x00519F82 // <- find this address and you're done okayyyyy. must update also right? o.o yeah, i'll check my sourcesseoke whether i haave this addy ok u go rest. ty <3333
- jne NormalAPICall
- push eax
- mov eax,[esp+0x0C]
- mov [iItemX],eax
- mov eax,[esp+0x10]
- mov [iItemY],eax
- pop eax
- NormalAPICall:
- jmp dword ptr PtInRect
- }
- }
- int DelayInterval = 50; //Identifies lootInterval
- void PerfectKami()
- {
- KamiSwitch = true;
- while(KamiSwitch)
- {
- if(bLoot && GetItemCount() >= iItems)
- {
- for(unsigned char uc = 0; uc <= 200 && GetItemCount() > iStopLootWhenItems; uc++, Sleep(25))
- {
- Teleport1(iItemX, iItemY);
- }
- continue;
- }
- if (!GetMobCount()) continue;
- ulEBX = ReadPointer(MobBasePtr, Mob1Offset);
- if (bGoodMonster)
- {
- ulEBX = GetValue(ulEBX, Mob2Offset);
- }
- else
- {
- ulEBX = GetValue(ulEBX, -12);
- ulEBX = GetValue(ulEBX, 0x14);
- }
- if (!GetValue(ulEBX, MobDeathOffset))
- {
- bGoodMonster ^= true;
- continue;
- }
- ulEBX = GetValue(ulEBX, Mob3Offset);
- ulEBX = GetValue(ulEBX, Mob4Offset);
- Teleport1((int)GetValue(ulEBX, MobXOffset) - iRangeX, (int)GetValue(ulEBX, MobXOffset + 4) - iRangeY);
- Sleep(40);
- }
- if(KamiSwitch == false)
- {
- WritePointer(CharBasePtr, TeleOffset, 0);
- Teleport1(iOriginalX, iOriginalY);
- ExitThread(0);
- }
- }
- void KamiAutoLoot()
- {
- KamiAutoLootSwitch = true;
- HWND MShwnd = FindWindowA("MapleStoryClass", NULL);
- for(;; Sleep(10))
- {
- if(bLoot && GetItemCount() > iStopLootWhenItems)
- {
- PostMessage(MShwnd, WM_KEYDOWN, 0x60, MapVirtualKey(0x60, 0) << 16);
- Sleep(10);
- }
- }
- if(KamiAutoLootSwitch == false)
- {
- ExitThread(0);
- }
- }
- void Form1::checkBox68_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
- {
- if(this->checkBox68->Checked)
- {
- iOriginalX = GetX();
- iOriginalY = GetY();
- NewThread(PerfectKami);
- }
- else
- {
- KamiSwitch = false;
- }
- }
- void Form1::checkBox69_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
- {
- if(this->checkBox69->Checked)
- {
- *(unsigned long*) PtInRectAddy = (unsigned long)ItemHook_ASM;
- bLoot = true;
- NewThread(KamiAutoLoot);
- }
- else
- {
- *(unsigned long*) PtInRectAddy = (unsigned long)PtInRect;
- bLoot = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement