Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 KB | None | 0 0
  1. int iKbKamiXRange,iKbKamiYRange;
  2. bool bKbKami = false;
  3. void vKbKami();
  4.  
  5. void Form1::checkBox67_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
  6. {
  7. if(checkBox67->Checked)
  8. {
  9. iKbKamiXRange = Convert::ToInt32(textBox19->Text);
  10. iKbKamiYRange = Convert::ToInt32(textBox20->Text);
  11. bKbKami = true;
  12. NewThread(vKbKami);
  13. }
  14. else
  15. bKbKami = false;
  16. }
  17.  
  18. int RepeatNo;
  19.  
  20. int sDifX = 0;
  21. int sDifY = 0;
  22.  
  23. DWORD GetMobAtPos(int MobIndex)
  24. {
  25. DWORD dwMobStruc = ReadPointer(MobBasePtr,Mob1Offset);
  26. if(MobIndex == 0)
  27. {
  28. dwMobStruc = iGetValue(dwMobStruc,Mob2Offset);
  29. return dwMobStruc;
  30. }
  31.  
  32. dwMobStruc = iGetValue(dwMobStruc,-12);
  33. for(int i = 1;i < MobIndex;i++)
  34. {
  35. dwMobStruc = iGetValue(dwMobStruc,4);
  36. }
  37. dwMobStruc = iGetValue(dwMobStruc,0x14);
  38. return dwMobStruc;
  39. }
  40.  
  41. POINT GetMobPos(DWORD dwBase)
  42. {
  43. POINT p = POINT();
  44. DWORD dwBuf = iGetValue(dwBase,Mob3Offset);
  45. dwBuf = iGetValue(dwBuf,Mob4Offset);
  46. p.x = iGetValue(dwBuf,MobXOffset);
  47. p.y = iGetValue(dwBuf,MobYOffset);
  48. return p;
  49. }
  50.  
  51. void ScriptRandomMob(bool bteleport)
  52. {
  53. int iRanMobX = 0;
  54. int iRanMobY = 0;
  55.  
  56. for(int iMob = 0;iMob < GetMobCount();iMob++)
  57. {
  58. DWORD dwMobStruc = GetMobAtPos(iMob);
  59. DWORD dwMob = dwMobStruc;
  60.  
  61. if(ReadPointer(dwMob,MobDeathOffset))
  62. {
  63. msSendDownKey(0x08);
  64. msSendUpKey(0x08);
  65.  
  66. POINT pos = GetMobPos(dwMob);
  67.  
  68. iRanMobX = pos.x;
  69. iRanMobY = pos.y;
  70.  
  71. break;
  72. }
  73. }
  74. if(bteleport)
  75. Teleport(iRanMobX+sDifX,iRanMobY+sDifY);
  76. if(!bteleport)
  77. {
  78. Knockback(true, iRanMobX-iKbKamiXRange > GetX());
  79. Knockback(false, iRanMobY-iKbKamiYRange > GetY());
  80. WriteValue((LPDWORD)ReadPointer(CharBasePtr, pID), ulKBOffset, 1);
  81. }
  82. }
  83.  
  84. void ScriptNearestMob(bool bteleport)
  85. {
  86. int nScriptMobX = 0;
  87. int nScriptMobY = 0;
  88. int ScriptRange = 0;
  89.  
  90. for(int iMob = 0;iMob < GetMobCount();iMob++)
  91. {
  92. DWORD dwMobStruc = GetMobAtPos(iMob);
  93. DWORD dwMob = dwMobStruc;
  94.  
  95. if(ReadPointer(dwMob,MobDeathOffset))
  96. {
  97. msSendDownKey(0x08);
  98. msSendUpKey(0x08);
  99.  
  100. POINT pos = GetMobPos(dwMob);
  101.  
  102. int iTeleX = GetX() - pos.x;
  103. int iTeleY = GetY() - pos.y;
  104.  
  105. if(iTeleX < 0) iTeleX = -iTeleX;
  106. if(iTeleY < 0) iTeleY = -iTeleY;
  107.  
  108. int TeleportRange = iTeleX + iTeleY;
  109.  
  110. if((TeleportRange < ScriptRange || ScriptRange == 0) && pos.x != -1 && pos.y != -1)
  111. {
  112. ScriptRange = TeleportRange;
  113. nScriptMobX = pos.x;
  114. nScriptMobY = pos.y;
  115. }
  116. }
  117. }
  118. if(bteleport)
  119. Teleport(nScriptMobX+sDifX,nScriptMobY+sDifY);
  120. if(!bteleport)
  121. {
  122. Knockback(true, nScriptMobX-iKbKamiXRange > GetX());
  123. Knockback(false, nScriptMobY-iKbKamiYRange > GetY());
  124. WriteValue((LPDWORD)ReadPointer(CharBasePtr, pID), ulKBOffset, 1);
  125. }
  126. }
  127.  
  128. bool KamiSwitch = false;
  129. int iOriginalX = 0, iOriginalY = 0;
  130. int iRangeX = 25, iRangeY = 0;
  131. bool bGoodMonster = false;
  132. unsigned long MobStruct = 0;
  133. unsigned long ulEBX;
  134.  
  135. bool KamiAutoLootSwitch;
  136. int iItems = 0;
  137. int iStopLootWhenItems;
  138. bool bLoot = false;
  139.  
  140. long int iItemX = 0,
  141. iItemY = 0;
  142.  
  143. // what's your l?
  144. void __declspec(naked) _stdcall ItemHook_ASM()
  145. {
  146. __asm
  147. {
  148. 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
  149. jne NormalAPICall
  150. push eax
  151. mov eax,[esp+0x0C]
  152. mov [iItemX],eax
  153. mov eax,[esp+0x10]
  154. mov [iItemY],eax
  155. pop eax
  156.  
  157. NormalAPICall:
  158. jmp dword ptr PtInRect
  159. }
  160. }
  161.  
  162. int DelayInterval = 50; //Identifies lootInterval
  163.  
  164. void PerfectKami()
  165. {
  166. KamiSwitch = true;
  167.  
  168. while(KamiSwitch)
  169. {
  170. if(bLoot && GetItemCount() >= iItems)
  171. {
  172. for(unsigned char uc = 0; uc <= 200 && GetItemCount() > iStopLootWhenItems; uc++, Sleep(25))
  173. {
  174. Teleport1(iItemX, iItemY);
  175. }
  176. continue;
  177. }
  178.  
  179. if (!GetMobCount()) continue;
  180. ulEBX = ReadPointer(MobBasePtr, Mob1Offset);
  181. if (bGoodMonster)
  182. {
  183. ulEBX = GetValue(ulEBX, Mob2Offset);
  184. }
  185. else
  186. {
  187. ulEBX = GetValue(ulEBX, -12);
  188. ulEBX = GetValue(ulEBX, 0x14);
  189. }
  190.  
  191. if (!GetValue(ulEBX, MobDeathOffset))
  192. {
  193. bGoodMonster ^= true;
  194. continue;
  195. }
  196.  
  197. ulEBX = GetValue(ulEBX, Mob3Offset);
  198. ulEBX = GetValue(ulEBX, Mob4Offset);
  199.  
  200. Teleport1((int)GetValue(ulEBX, MobXOffset) - iRangeX, (int)GetValue(ulEBX, MobXOffset + 4) - iRangeY);
  201. Sleep(40);
  202. }
  203.  
  204. if(KamiSwitch == false)
  205. {
  206. WritePointer(CharBasePtr, TeleOffset, 0);
  207. Teleport1(iOriginalX, iOriginalY);
  208. ExitThread(0);
  209. }
  210. }
  211.  
  212. void KamiAutoLoot()
  213. {
  214. KamiAutoLootSwitch = true;
  215. HWND MShwnd = FindWindowA("MapleStoryClass", NULL);
  216. for(;; Sleep(10))
  217. {
  218. if(bLoot && GetItemCount() > iStopLootWhenItems)
  219. {
  220. PostMessage(MShwnd, WM_KEYDOWN, 0x60, MapVirtualKey(0x60, 0) << 16);
  221. Sleep(10);
  222. }
  223. }
  224. if(KamiAutoLootSwitch == false)
  225. {
  226. ExitThread(0);
  227. }
  228. }
  229.  
  230. void Form1::checkBox68_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
  231. {
  232. if(this->checkBox68->Checked)
  233. {
  234. iOriginalX = GetX();
  235. iOriginalY = GetY();
  236. NewThread(PerfectKami);
  237. }
  238. else
  239. {
  240. KamiSwitch = false;
  241. }
  242. }
  243.  
  244. void Form1::checkBox69_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
  245. {
  246. if(this->checkBox69->Checked)
  247. {
  248. *(unsigned long*) PtInRectAddy = (unsigned long)ItemHook_ASM;
  249. bLoot = true;
  250. NewThread(KamiAutoLoot);
  251. }
  252. else
  253. {
  254. *(unsigned long*) PtInRectAddy = (unsigned long)PtInRect;
  255. bLoot = false;
  256. }
  257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement