Thread: SecondClickNpc, ThirdClick, and Fourth click

Results 1 to 5 of 5
  1. #1 SecondClickNpc, ThirdClick, and Fourth click 
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Tried adding a fourth click, i have them reading the same packetId but when i actually click it reads previous click. For example when i right click i have 4 options

    White
    Green
    Blue
    Red

    when i click white it reads correct message, when i click green it doesn't display anything. When i click blue it reads Greens message and when i click Red it reads Blue Message


    any ideas :?

    here is my ClickNPC
    Spoiler for code:

    Code:
    case FOURTH_CLICK:
    				c.npcClickIndex = c.inStream.readUnsignedWordBigEndianA();
    				c.npcType = NPCHandler.npcs[c.npcClickIndex].npcType;
    				if(c.goodDistance(NPCHandler.npcs[c.npcClickIndex].getX(), NPCHandler.npcs[c.npcClickIndex].getY(), c.getX(), c.getY(), 1)) {
    					c.turnPlayerTo(NPCHandler.npcs[c.npcClickIndex].getX(), NPCHandler.npcs[c.npcClickIndex].getY());
    					NPCHandler.npcs[c.npcClickIndex].facePlayer(c.playerId);
    					c.getActions().fourthClickNpc(c.npcType);	
    				} else {
    					c.clickNpcType = 4;
    					CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    					@Override
    					public void execute(CycleEventContainer container) {
    						if((c.clickNpcType == 4) && NPCHandler.npcs[c.npcClickIndex] != null) {			
    							if(c.goodDistance(c.getX(), c.getY(), NPCHandler.npcs[c.npcClickIndex].getX(), NPCHandler.npcs[c.npcClickIndex].getY(), 1)) {
    								c.turnPlayerTo(NPCHandler.npcs[c.npcClickIndex].getX(), NPCHandler.npcs[c.npcClickIndex].getY());
    								NPCHandler.npcs[c.npcClickIndex].facePlayer(c.playerId);
    								c.getActions().fourthClickNpc(c.npcType);
    								container.stop();
    							}
    						}
    						if(c.clickNpcType < 4) 
    							container.stop();
    					}
    					@Override
    					public void stop() {
    						c.clickNpcType = 0;
    					}
    				}, 1);
    				}
    				break;




    EDIT:

    packetTypes in packetHanlder are also already set to what they need to be
    Code:
    packetId[155] = cn;
    		packetId[17] = cn;
    		packetId[21] = cn;
    		packetId[18] = cn;
    		packetId[72] = cn;
    		packetId[131] = cn;
    Attached image

    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member Nissan Nut's Avatar
    Join Date
    Jul 2012
    Age
    28
    Posts
    111
    Thanks given
    0
    Thanks received
    7
    Rep Power
    7
    If I am correct, where you have "Case 1234:" the "1234" would need to be the ID for the object/npc, prior to going into the switch statement you need to determine 1st option, 2nd option, ect. It really is hard to tell the issue you are having, but check your client-side code as well.
    Click the image below to check out my server development thread, "Project Lord of The Rings"
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Nissan Nut View Post
    If I am correct, where you have "Case 1234:" the "1234" would need to be the ID for the object/npc, prior to going into the switch statement you need to determine 1st option, 2nd option, ect. It really is hard to tell the issue you are having, but check your client-side code as well.
    If you are refereing to the actionhandler class i already have it set. It is just reading the wrong npcClick method and i'm not sure why.
    Attached image

    Attached image
    Reply With Quote  
     

  4. #4  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Maybe your client sided actions aren't done properly.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Arithium View Post
    Maybe your client sided actions aren't done properly.

    Yeah it wasn't, but its been fixed for awhile thanks though.
    Attached image

    Attached image
    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

Similar Threads

  1. [PI] Object Fourth Click (228)
    By HolyGhost in forum Help
    Replies: 3
    Last Post: 12-20-2013, 04:39 AM
  2. packets and right click options
    By asteria-X in forum Help
    Replies: 2
    Last Post: 09-19-2012, 06:19 PM
  3. [PI] Fourth click npc
    By zivkovic in forum Snippets
    Replies: 17
    Last Post: 01-13-2012, 04:36 PM
  4. [PI] Fourth Click NPC Packet
    By The Alamo in forum Requests
    Replies: 0
    Last Post: 04-21-2011, 10:33 PM
  5. [508]setString and right click[508]
    By 0wner w0lf in forum Requests
    Replies: 0
    Last Post: 10-23-2009, 01:31 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •