Thread: [508] How to make certain objects useable! [508]

Results 1 to 5 of 5
  1. #1 [508] How to make certain objects useable! [508] 
    Pandemic Scape
    Guest
    Hello everyone, as you may know, most thieving bases (not mine ) do not have stalls due to their oddness for some reason... So, I did some searching and found out that some objects can't be used by ObjectOption1.java because of some odd reason. Anyways, here is what you do:

    Step 1: Open ObjectOption2.java with this:
    Code:
    package Pandemic.io.packets;
    
    import Pandemic.Engine;
    import Pandemic.players.Player;
    import Pandemic.util.Misc;
    import Pandemic.Skills.*;
    
    
    public class ObjectOption2 implements Packet {
    	/**
         * Handles the second option on objects (sometimes first).
         * @param p The Player which the frame should be handled for.
         * @param packetId The packet id this belongs to.
         * @param packetSize The amount of bytes being recieved for this packet.
         * Re-done correctly by Pandemic
         */
        public void handlePacket(Player p, int packetId, int packetSize) {
    		
            if (!p.objectOption2) {
                p.clickX = p.stream.readUnsignedWordBigEndian();
                p.clickId = p.stream.readUnsignedWord();
                p.clickY = p.stream.readUnsignedWordBigEndianA();
                p.objectOption2 = true;
            }
            int distance = 0;
    		if (p.walkDir != -1 || p.runDir != -1
                    || distance > objectSize(p.clickId)) {
                return;
            }
            p.objectOption2 = false;
            switch (p.clickId) {			
    	}
            } 
    	
    	private int objectSize(int id) {
            switch (id) {
            case 23271:
                return 2;
            default:
                return 1;
            }
        }
    	
    }
    Step 2: Get your object Id by putting:
    Code:
    Misc.println("Object Option 2: ObjectId: "+p.clickId);
    at the top after it declares p.clickX and p.clickY.

    Step 3: Go in the server and click on that object! Then hopefully in the server log you will see
    Code:
    Object Option 2: ObjectId: 23423
    and then you do the next step with that id.

    Step 4: Go into your freshly redone ObjectOption2.java and find this:
    Code:
    switch (p.clickId) {
    Then put this:
    Code:
    switch (p.clickId) {
        case whateveridyougot:
            p.frames.sendMessage(p, "Hi, thank you Pandemic for finding out this awesome thing!");
            //Here is where you put everything about this object if clicked :)
        break;
    }
    There you go,

    Pandemic
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2008
    Posts
    1,778
    Thanks given
    0
    Thanks received
    7
    Rep Power
    0
    What is odd about objects not being able to be used by object opt 1? This just means they have a second option also :O?

    To basic..
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jan 2009
    Posts
    4,023
    Thanks given
    494
    Thanks received
    446
    Rep Power
    4269
    [): Didnt Knowed that rofl xD
    Attached image
    Reply With Quote  
     

  4. #4  
    Pandemic Scape
    Guest
    Quote Originally Posted by Callled Enzo View Post
    What is odd about objects not being able to be used by object opt 1? This just means they have a second option also :O?

    To basic..
    But stalls only have one option, but the packet reads as it is ObjectOption2...
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Aug 2008
    Posts
    1,171
    Thanks given
    21
    Thanks received
    44
    Rep Power
    0
    Quote Originally Posted by Pandemic Scape View Post
    But stalls only have one option, but the packet reads as it is ObjectOption2...
    the packet doesnt read anything, its called objectOption2 because we call it like that because it is on the second spot on most objects, but just because we call it like that doesnt mean its right
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •