Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy

    Red face [Realm Relay] Quest Loot Bag Notifier

    Hey ladies!

    Look at dis beauty :



     

    Code:
    // utnotif.js
    var ID_MOVE = $.findPacketId("MOVE");
    var ID_UPDATE = $.findPacketId("UPDATE");
    var ID_NEW_TICK = $.findPacketId("NEW_TICK");
    var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
    var ID_NOTIFICATION = $.findPacketId("NOTIFICATION");
    var ID_QUESTOBJID = $.findPacketId("QUESTOBJID");
    
    
    var player_id = -1;
    var playerLocation = null;
    var lootbags = {};
    var lootbaglocs = {};
    var send_notif = true;
    
    var tier = 1; // Minimum tier of items to be notifi'ied
    
    var desirables = [
        0xc01, // Demon Blade
        0xa03, // Crystal Sword
        0xc05, // Ancient Stone Sword
        0xcdb, // Pirate King's Cutlass
        0xcdf, // Doctor Swordsworth
        0xc70, // Golden Ankh
        0xc71, // Eye of Osiris
        0xc72, // Pharaoh's Mask
        0xc73, // Golden Cockle
        0xc74, // Golden Conch
        0xc75, // Golden Horn Conch
        0xc78, // Golden Femur
        0xc79, // Golden Ribcage
        0xc7a, // Golden Skull
        0xc7e, // Golden Chalice
        0xc7d, // Pearl Necklace
        0xc7f, // Ruby Gemstone
        0xc7b, // Golden Candelabra
        0xc7c, // Holy Cross
        0xc77, // Golden Bolt
        0xc76, // Golden Nut
        0x722, // Wine Cellar Incantation
        0xc0a, // Dirk of Cronus
        0xc29, // Spirit Dagger
        0xced, // Sunshine Shiv
        0xc02, // Doom Bow
        0xc10, // Coral Bow
        0xcde, // Leaf Bow
        0xcec, // Robobow
        0xc03, // Staff of Extreme Prejudice
        0xcea, // KoalaPOW
        0xc04, // Wand of the Bulwark
        0xb3f, // Crystal Wand
        0xceb, // Spicy Wand of Spice
        0xcdc, // Doku No Ken
        0xcee, // Arbiters Wrath
        0xa5a, // Cloak of the Planewalker
        0xc07, // Quiver of Thunder
        0xc09, // Tome of Purification
        0xc1e, // Tome of Holy Protection
        0xc08, // Helm of the Juggernaut
        0xc0f, // Shield of Ogmur
        0xc06, // Seal of Blasphemous Prayer
        0xc0b, // Orb of Conflict
        0xc2a, // Ghostly Prism
        0xc61, // Candy-Coated Armor
        0xba2, // Ring of the Pyramid
        0xba0, // Ring of the Sphinx
        0xba1, // Ring of the Nile
        0xb3e, // Amulet of Resurrection
        0xbab, // The Forgotten Crown
        0xbad, // Bracer of the Guardian
        0xbac, // The Twilight Gemstone
        0xb41, // Tablet of the King's Avatar
        0xc22, // Bone Dagger
        0xc15, // Staff of the Crystal Serpent
        0xc1d, // St. Abraham's Wand
        0xc33, // Conducting Wand
        0x221c, // Skull-splitter Sword
        0xc18, // Coral Silk Armor
        0xc28, // Spectral Cloth Armor
        0xc1f, // Chasuble of Holy Light
        0xc14, // Robe of the Tlatoani
        0xc32, // Robe of the Mad Scientist
        0xc6e, // Resurrected Warrior's Armor
        0xc6d, // Plague Poison
        0xc16, // Cracked Crystal Skull
        0xc1c, // Coral Venom Trap
        0xc30, // Scepter of Fulmination
        0xc13, // Coral Ring
        0xc20, // Ring of Divine Faith
        0xc27, // Captain's Ring
        0xc31, // Experimental Ring
        0xc5f, // Candy Ring
        //0x709, // Poison Fang Dagger
        //0xa4b, // Sprite Wand
        //0xa3e, // Snake Skin Armor
        //0xa40, // Snake Skin Shield
        //0x708, // Spider's Eye Ring
        //0xa41, // Snake Eye Ring
        //0xc17, // Crystal Bone Ring
    	0xa20, // Def Pot	<
    	0xa1f, // Att Pot	<
    	0xa21, // Spd Pot	<
    	0xa34, // Vit Pot   <<<<<< Thanks 059 <3
    	0xa35, // Wis Pot 	<
    	0xa4c, // Dex Pot	<
    	0xae9, // Life Pot	<
    	0xaea // Mana Pot	<
    ];
    
    function onClientPacket(event) {
        var packet = event.getPacket();
        switch (packet.id()) {
        case ID_MOVE:
            {
                var time = packet.time;
                playerLocation = packet.newPosition;
    
                if (send_notif) {
                    for (var bag in lootbags) {
                        if (lootbaglocs[bag].distanceSquaredTo(playerLocation) <= 200) {
                            var params = {}
                            toNotif = "";
    
                            for (var idx in lootbags[bag]) {
                                if (lootbags[bag][idx] != -1) {
                                    var item = $.findItem(lootbags[bag][idx]);
                                    toNotif += "\\n" + item.id
                                }
                            }
                            if (toNotif == "") {
                                continue;
                            }
                            this.displayNotification(event, bag, 0x00ffff, toNotif);
    						this.quest(event, bag)
    						//$.echo("> Quest set to " + bag);
                        }
                    }
                    send_notif = false;
                    $.scheduleEvent(2, "refresh_notif");
                }
    
                break;
            }
        }
    }
    
    function onServerPacket(event) {
        var packet = event.getPacket();
        switch (packet.id()) {
        case ID_CREATE_SUCCESS:
            {
                player_id = packet.objectId;
                break;
            }
        case ID_UPDATE:
            {
                // New objects
                for (var i = 0; i < packet.newObjs.length; i++) {
                    var objectData = packet.newObjs[i];
                    if (objectData == null)
                        break;
    
                    var type = objectData.objectType;
    
                    if (type == 1280 || type == 1283 || (type >= 1286 && type <= 1296)) {
                        // new loot bag
                        var bagId = objectData.status.objectId;
                        lootbags[bagId] = [-1, -1, -1, -1, -1, -1, -1, -1];
                        lootbaglocs[bagId] = objectData.status.pos;
    
                        for (var j = 0; j < objectData.status.data.length; j++) {
                            var statData = objectData.status.data[j];
                            if (statData.obf0 >= 8 && statData.obf0 <= 15) {
                                if (statData.obf1 != -1) {
                                    var item = $.findItem(statData.obf1);
    
                                    if (item.tier >= tier || item.bagType == 4 || desirables.indexOf(statData.obf1) != -1) {
                                        lootbags[bagId][statData.obf0 - 8] = statData.obf1;
                                    }
                                }
    
                            }
                        }
    
                    }
                }
    
                // Removed objects
                for (var i = 0; i < packet.drops.length; i++) {
                    var droppedObjectId = packet.drops[i];
    
                    if (lootbags[droppedObjectId] != null) {
                        delete lootbags[droppedObjectId];
                        delete lootbaglocs[droppedObjectId];
                    }
                }
    
                break;
            }
        case ID_NEW_TICK:
            {
                for (var i = 0; i < packet.statuses.length; i++) {
                    var status = packet.statuses[i];
    
                    if (lootbags[status.objectId] != null) {
                        for (var j = 0; j < status.data.length; j++) {
                            var statData = status.data[j];
                            if (statData.obf0 >= 8 && statData.obf0 <= 15) {
                                if (statData.obf1 == -1) {
                                    lootbags[status.objectId][statData.obf0 - 8] = statData.obf1;
                                } else {
                                    var item = $.findItem(statData.obf1);
    
                                    if (item.tier >= tier || item.bagType == 4 || desirables.indexOf(statData.obf1) != -1) {
                                        lootbags[status.objectId][statData.obf0 - 8] = statData.obf1;
                                    }
                                }
    
                            }
                        }
                    }
                }
                break;
            }
        }
    }
    
    function displayNotification(event, playerObjectId, color, text) {
        var notificationPacket = event.createPacket(ID_NOTIFICATION);
        notificationPacket.objectId = playerObjectId;
        notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
        notificationPacke*****lor = color;
        event.sendToClient(notificationPacket);
    }
    
    function refresh_notif(event) {
        send_notif = true;
    }
    
    
    
    function quest(event, objectId) {
        var QUESTOBJIDPacket = event.createPacket(ID_QUESTOBJID);
        QUESTOBJIDPacket.objectId = objectId;
        event.sendToClient(QUESTOBJIDPacket);
    }
    
    
    //	int objectId


    Made from the @Nisuxen's loot notifier <3
    Alde is Alde is

  2. The Following 5 Users Say Thank You to Alde. For This Useful Post:

    059 (01-02-2014),Drowlys (01-02-2014),goodboy.rr (08-25-2014),JavaNewb (01-04-2014),moot06 (01-03-2014)

  3. #2
    Roxerbus's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Asleep
    Does it do it for all bags? Or just purp/blue/white bags
    Looks nice though

    Also if you can do this can you maybe make a quest notification for candy gnome? O
    Last edited by Roxerbus; 01-02-2014 at 11:51 AM.

  4. #3
    infern000's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    294
    Reputation
    10
    Thanks
    74
    Quote Originally Posted by Roxerbus View Post
    Also if you can do this can you maybe make a quest notification for candy gnome? O
    i dont think it works the way you think, but id be delighted if i am wrong.
    the script just replaces the questicon with 1 bag on the client's side, we learn from the UPDATE packet where the bag drops. the update packet doesnt contain all enemies of the whole realm, only whats in your vicinity and what gets loaded OR what has been designated by the server as a quest monster.
    i could be wrong about the last part though.

  5. #4
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by infern000 View Post
    i dont think it works the way you think, but id be delighted if i am wrong.
    the script just replaces the questicon with 1 bag on the client's side, we learn from the UPDATE packet where the bag drops. the update packet doesnt contain all enemies of the whole realm, only whats in your vicinity and what gets loaded OR what has been designated by the server as a quest monster.
    i could be wrong about the last part though.
    It's a bit more complicated but it's surely possible!
    Alde is Alde is

  6. #5
    JustAnoobROTMG's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    1,916
    Reputation
    185
    Thanks
    18,230
    Or just send a Questid <lootbag> when you identified a lootbag.
    You can filter by lootbag type or content, like you did.

    Do you know it also works with people?

    The problem is, when you move too far from the bag, its deleted from client memory then you lose the quest marker.
    marinepower was creating dummy bags for that, and moved it according to player position
    Due to a recent DMCA takedown attempt we had to remove Faintmako brain. Please do not paid attention to what he say or do.


  7. #6
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by JustAnoobROTMG View Post
    The problem is, when you move too far from the bag, its deleted from client memory then you lose the quest marker.
    marinepower was creating dummy bags for that, and moved it according to player position
    What about this?
    if (lootbaglocs[bag].distanceSquaredTo(playerLocation) <= 200) {

    Maybe change the <= 200 to something bigger?


    Quote Originally Posted by JustAnoobROTMG View Post
    Or just send a Questid <lootbag> when you identified a lootbag.
    Isnt that what I did? XD

    Code:
    function quest(event, objectId) {
        var QUESTOBJIDPacket = event.createPacket(ID_QUESTOBJID);
        QUESTOBJIDPacket.objectId = objectId;
        event.sendToClient(QUESTOBJIDPacket);
    }
    Last edited by Distraught; 01-04-2014 at 12:08 AM.
    Alde is Alde is

  8. #7
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy


    /me
    Last edited by Alde.; 01-02-2014 at 01:21 PM.
    Alde is Alde is

  9. #8
    Trollaux's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    2,074
    Reputation
    137
    Thanks
    792
    Quote Originally Posted by ZBORNOX View Post


    /me
    Looks very nice.
    d e a d b o y s
    Quote Originally Posted by Dave84311 View Post
    What do you call a troll with shitty jokes?
    Trollaux
    Quote Originally Posted by Kyeran View Post
    Foot job with lots of oil.
    Quote Originally Posted by Kyeran View Post
    If she's 12, I'm 12.

  10. #9
    infern000's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    294
    Reputation
    10
    Thanks
    74
    Quote Originally Posted by JustAnoobROTMG View Post
    The problem is, when you move too far from the bag, its deleted from client memory then you lose the quest marker.
    marinepower was creating dummy bags for that, and moved it according to player position
    that's exactly what ive been 'fearing'

  11. #10
    rocker1988's Avatar
    Join Date
    Sep 2006
    Gender
    male
    Posts
    301
    Reputation
    10
    Thanks
    62
    My Mood
    Doubtful
    Does this actually show bags not on your screen or not?

  12. #11
    moot06's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Posts
    163
    Reputation
    10
    Thanks
    281
    My Mood
    Innocent
    Hehe perfect synergy with poison spam for avatar hunting. Thanks mate.

  13. #12
    JavaNewb's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    1
    This thing is sick, and very easy to edit if you can't be bothered with items under a specific tier. Many thanks man.

  14. The Following User Says Thank You to JavaNewb For This Useful Post:

    Alde. (01-04-2014)

  15. #13
    rocker1988's Avatar
    Join Date
    Sep 2006
    Gender
    male
    Posts
    301
    Reputation
    10
    Thanks
    62
    My Mood
    Doubtful
    Quote Originally Posted by JavaNewb View Post
    This thing is sick, and very easy to edit if you can't be bothered with items under a specific tier. Many thanks man.
    What's the damn point if it only shows loot bags that you can physically see and already know whats in them from Loot Notifier in realm relay that already has an option to see only items above a certain tier that you choose in the script code.

  16. #14
    JustAnoobROTMG's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    1,916
    Reputation
    185
    Thanks
    18,230
    Quote Originally Posted by rocker1988 View Post
    What's the damn point if it only shows loot bags that you can physically see and already know whats in them from Loot Notifier in realm relay that already has an option to see only items above a certain tier that you choose in the script code.
    At least is a good start. Now, we only miss the "dummy lootbag management"
    Due to a recent DMCA takedown attempt we had to remove Faintmako brain. Please do not paid attention to what he say or do.


  17. #15
    rocker1988's Avatar
    Join Date
    Sep 2006
    Gender
    male
    Posts
    301
    Reputation
    10
    Thanks
    62
    My Mood
    Doubtful
    Quote Originally Posted by JustAnoobROTMG View Post
    At least is a good start. Now, we only miss the "dummy lootbag management"
    dummy lootbag management?

Page 1 of 2 12 LastLast

Similar Threads

  1. Realm Relay Loot Notifs
    By Nisuxen in forum Realm of the Mad God Tutorials & Source Code
    Replies: 13
    Last Post: 02-01-2015, 04:25 AM
  2. [HELP] Loot Bag value and spawning + Money for friends
    By LeoMoyses in forum Payday 2 Hacks & Cheats
    Replies: 8
    Last Post: 01-11-2014, 01:18 PM
  3. OUTDATED - [Realm Relay] Event Notifier script
    By IziLife in forum Realm of the Mad God Tutorials & Source Code
    Replies: 20
    Last Post: 10-28-2013, 02:11 PM
  4. [Text Tutorial] Adding Custom Loot Bags To Your Server
    By Lunati in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 2
    Last Post: 08-01-2013, 10:51 AM
  5. ROTMG loot bags!!
    By calebman11 in forum Realm of the Mad God Discussions
    Replies: 7
    Last Post: 10-11-2012, 08:30 PM