Advertisement
DraculaxAOE

hybrid2017.js

Jan 2nd, 2017
1,887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. var LazInitialID;
  2.  
  3. function main() {
  4.  
  5. this.block = false;
  6. var lock_id=false;
  7. print("Welcome to Hybrid2017.js");
  8. var NPC_ID=[0x00, 0x00, 0x00, 0x00];
  9. var item_ID=[0x00, 0x00, 0x00, 0x00];
  10.  
  11. //receiving
  12. addEventListener("gamepacket", function(bytes) {
  13. var i=0;
  14. switch(bytes[0]) {
  15. case 0x9c:
  16. if (bytes.length>7 && lock_id===false) {
  17. print("item ID: " + bytes[0].toString(16)+" "+bytes[1].toString(16)+" "+bytes[2].toString(16)+" "+bytes[3].toString(16)+" "+bytes[4].toString(16)+" "+bytes[5].toString(16)+" "+bytes[6].toString(16)+" "+bytes[7].toString(16));
  18. for (i=0; i<4; i++) {
  19. item_ID[i]=bytes[i+4];
  20. }
  21. }
  22. break;
  23. case 0x77:
  24. print("Received 77 0D");
  25. break;
  26. }
  27. });
  28.  
  29. //sending
  30. addEventListener("gamepacketsent", function(bytes) {
  31.  
  32. if (bytes[0] == 0x30 && this.block == true) {
  33. print("0x30 blocked");
  34. return true;
  35. }
  36.  
  37. if (bytes[0] == 0x30 && this.block == false) {
  38. print("0x30 unblocked");
  39. return false;
  40. }
  41.  
  42. return false;
  43.  
  44. });
  45.  
  46. addEventListener("gamepacket", function(bytes) {
  47. if(bytes[0] == 0x0E){
  48. // print("0x0E blocked");
  49. return true;
  50. }
  51. return false;
  52. });
  53.  
  54. addEventListener("gamepacket", function(bytes) {
  55. if(bytes[0] == 0x51){
  56. // print("0x51 blocked");
  57. return true;
  58. }
  59. return false;
  60. });
  61.  
  62. addEventListener("keyup", function(key) {
  63.  
  64. switch (key) {
  65.  
  66. case 0x61:
  67.  
  68. print("After pressing NUMPAD1 for EVERY char in game, Char A TALKS TO LARZUK, PICK UP A RANDOM ITEM ON CURSOR, HOVER OVER LARZUK, then press NUMPAD2");
  69. this.block = true;
  70.  
  71. break;
  72.  
  73.  
  74. case 0x62:
  75.  
  76. if(!me.itemoncursor) {
  77. print("Pick an item to cursor then press NUMPAD2 again");
  78. return;
  79. }
  80.  
  81. var npc = getUnit(1, "Larzuk");
  82. if (npc) {
  83. LazInitialID = npc.gid;
  84. // print(LazInitialID);
  85. sendPacket(1, 0x44, 4, 0, 4, npc.gid, 4, getUnit(100).gid, 4, 0x03);
  86. print("Talk to Nick, click on somewhere else in the map, then press NUMPAD3");
  87. } else {
  88. print("go near the npc");
  89. }
  90.  
  91. break;
  92.  
  93. case 0x63:
  94.  
  95. print("After interacting with Nick, move Char A close to Larzuk, then Press NUMPAD4");
  96. this.block = false;
  97.  
  98. break;
  99.  
  100.  
  101.  
  102. case 0x64:
  103.  
  104. var npc2 = getUnit(1, "Larzuk");
  105. if (npc2) {
  106. // print(npc2.gid);
  107. // print(LazInitialID);
  108. sendPacket(1, 0x30, 4, 0x01, 4, LazInitialID);//Laz's original id in step 4
  109. print("Char A goes into trade with Char B, Char B puts stuff to be duped in trade slots, then Char C takes WP, then Char A presses NUMPAD5");
  110. } else {
  111. print("go near the npc");
  112. }
  113.  
  114. break;
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121. case 0x65:
  122.  
  123. getPacket(1, 0x77, 1, 0x0C);
  124.  
  125. print("Char A EXITS GAME AND MAKES NG IMMEDIATELY!!! In NG, load this script again, trade with Larzuk, and then press NUMPAD6");
  126.  
  127. break;
  128.  
  129. case 0x66:
  130. var unit = me.getItem();
  131. var npc = getInteractedNPC();
  132.  
  133. if (npc) {
  134. if (unit) {
  135. do {
  136. if (unit.location == 4) {
  137. print(unit.name+" sold");
  138. sendPacket (1, 0x33, 4, npc.gid, 4, unit.gid, 4, unit.mode, 4, 0);
  139. delay(me.ping*2 + 100);
  140. }
  141. } while (unit.getNext());
  142. }
  143. }
  144.  
  145. // activeAction = false;
  146. break;
  147.  
  148. }
  149. });
  150.  
  151. while (1)
  152. delay(1000);
  153.  
  154. return true;
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement