Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var LazInitialID;
- function main() {
- this.block = false;
- var lock_id=false;
- print("Welcome to Hybrid2017.js");
- var NPC_ID=[0x00, 0x00, 0x00, 0x00];
- var item_ID=[0x00, 0x00, 0x00, 0x00];
- //receiving
- addEventListener("gamepacket", function(bytes) {
- var i=0;
- switch(bytes[0]) {
- case 0x9c:
- if (bytes.length>7 && lock_id===false) {
- 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));
- for (i=0; i<4; i++) {
- item_ID[i]=bytes[i+4];
- }
- }
- break;
- case 0x77:
- print("Received 77 0D");
- break;
- }
- });
- //sending
- addEventListener("gamepacketsent", function(bytes) {
- if (bytes[0] == 0x30 && this.block == true) {
- print("0x30 blocked");
- return true;
- }
- if (bytes[0] == 0x30 && this.block == false) {
- print("0x30 unblocked");
- return false;
- }
- return false;
- });
- addEventListener("gamepacket", function(bytes) {
- if(bytes[0] == 0x0E){
- // print("0x0E blocked");
- return true;
- }
- return false;
- });
- addEventListener("gamepacket", function(bytes) {
- if(bytes[0] == 0x51){
- // print("0x51 blocked");
- return true;
- }
- return false;
- });
- addEventListener("keyup", function(key) {
- switch (key) {
- case 0x61:
- 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");
- this.block = true;
- break;
- case 0x62:
- if(!me.itemoncursor) {
- print("Pick an item to cursor then press NUMPAD2 again");
- return;
- }
- var npc = getUnit(1, "Larzuk");
- if (npc) {
- LazInitialID = npc.gid;
- // print(LazInitialID);
- sendPacket(1, 0x44, 4, 0, 4, npc.gid, 4, getUnit(100).gid, 4, 0x03);
- print("Talk to Nick, click on somewhere else in the map, then press NUMPAD3");
- } else {
- print("go near the npc");
- }
- break;
- case 0x63:
- print("After interacting with Nick, move Char A close to Larzuk, then Press NUMPAD4");
- this.block = false;
- break;
- case 0x64:
- var npc2 = getUnit(1, "Larzuk");
- if (npc2) {
- // print(npc2.gid);
- // print(LazInitialID);
- sendPacket(1, 0x30, 4, 0x01, 4, LazInitialID);//Laz's original id in step 4
- 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");
- } else {
- print("go near the npc");
- }
- break;
- case 0x65:
- getPacket(1, 0x77, 1, 0x0C);
- print("Char A EXITS GAME AND MAKES NG IMMEDIATELY!!! In NG, load this script again, trade with Larzuk, and then press NUMPAD6");
- break;
- case 0x66:
- var unit = me.getItem();
- var npc = getInteractedNPC();
- if (npc) {
- if (unit) {
- do {
- if (unit.location == 4) {
- print(unit.name+" sold");
- sendPacket (1, 0x33, 4, npc.gid, 4, unit.gid, 4, unit.mode, 4, 0);
- delay(me.ping*2 + 100);
- }
- } while (unit.getNext());
- }
- }
- // activeAction = false;
- break;
- }
- });
- while (1)
- delay(1000);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement