Thread: Summoning wierd..

Results 1 to 5 of 5
  1. #1 Summoning wierd.. 
    Catherby Developer
    Mini Slurpee's Avatar
    Join Date
    Apr 2011
    Posts
    747
    Thanks given
    80
    Thanks received
    86
    Rep Power
    31
    Hello, i've been trying to fix this for hours.. and i do not know what's going on..
    when u click the Dismiss my follower it teleports you to edge and dissmisses the NPC And when u click the teleport edge, it teleports you and dismisses the NPC Wth how do i fix this.? i probably did something wrong in the code? REPP ++
    Code:
    			case 9178:
    				if (c.usingGlory)
    					c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, "modern");
    				if (c.dialogueAction == 2)
    					c.getPA().startTeleport(3428, 3538, 0, "modern");
    				if (c.dialogueAction == 3)		
    					c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, "modern");
    				if (c.dialogueAction == 4)
    					c.getPA().startTeleport(3565, 3314, 0, "modern");
    				if (c.dialogueAction == 20) {
    					c.getPA().startTeleport(2897, 3618, 4, "modern");
    				}
    				if(c.dialogueAction == 100) {
    					c.getDH().sendDialogues(25, 946);
    				}
                     if (c.teleAction == 24) { //EDGE TELE
    				c.getPA().spellTeleport(3087,3497,0);
    				}
    
    			if (c.dialogueAction == 94) { // SUMMON DISMISS
    				c.updateRequired = true;
    if(c.lastsummon > 0) {
    c.firstslot();
    for(int i = 0; i < 29; i += 1)
    {
    Server.itemHandler.createGroundItem(c, c.storeditems[i], Server.npcHandler.npcs[c.summoningnpcid].absX, Server.npcHandler.npcs[c.summoningnpcid].absY, 1, c.playerId);
    c.storeditems[i] = -1;
    c.occupied[i] = false;
    }
    c.lastsummon = -1;
    c.totalstored = 0;
    c.summoningnpcid = 0;
    c.summoningslot = 0;
    c.sendMessage("Your BoB items have drop on the floor");
    				c.getPA().closeAllWindows();
    				return;
    } else {
    c.sendMessage("You do not have a npc currently spawned");
    }
    }
    Attached image
    “I have not failed, I've just found 10,000 ways that won't work.”
    “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”
    Reply With Quote  
     

  2. #2  
    Catherby Developer
    Mini Slurpee's Avatar
    Join Date
    Apr 2011
    Posts
    747
    Thanks given
    80
    Thanks received
    86
    Rep Power
    31
    Bump
    Attached image
    “I have not failed, I've just found 10,000 ways that won't work.”
    “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”
    Reply With Quote  
     

  3. #3  
    Donator
    Ed17's Avatar
    Join Date
    Jun 2011
    Posts
    296
    Thanks given
    42
    Thanks received
    14
    Rep Power
    10
    add return or break.
    if (c.teleAction == 24) { //EDGE TELE
    c.getPA().spellTeleport(3087,3497,0);
    return;//for example
    }
    let me know if it works.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Mar 2009
    Posts
    606
    Thanks given
    106
    Thanks received
    29
    Rep Power
    0
    add a return;

    you should use eclipse
    Reply With Quote  
     

  5. #5  
    Community Veteran

    Dexter Morgan's Avatar
    Join Date
    Nov 2008
    Age
    28
    Posts
    4,419
    Thanks given
    1,184
    Thanks received
    757
    Rep Power
    3098
    You don't need to add end statement if the if statement doesn't carry on lmfao.

    You're obviously not calling the correct value and variable.

    Code:
    			case 9178:
    				if (c.usingGlory)
    					c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, "modern");
    				if (c.dialogueAction == 2)
    					c.getPA().startTeleport(3428, 3538, 0, "modern");
    				if (c.dialogueAction == 3)		
    					c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, "modern");
    				if (c.dialogueAction == 4)
    					c.getPA().startTeleport(3565, 3314, 0, "modern");
    				if (c.dialogueAction == 20) {
    					c.getPA().startTeleport(2897, 3618, 4, "modern");
    				}
    				if(c.dialogueAction == 100) {
    					c.getDH().sendDialogues(25, 946);
    				}
                    			if (c.teleAction == 24) { //EDGE TELE
    					c.getPA().spellTeleport(3087,3497,0);
    				}
    				if (c.dialogueAction == 94) { // SUMMON DISMISS
    					c.updateRequired = true;
    					if(c.lastsummon > 0) {
    						c.firstslot();
    						for(int i = 0; i < 29; i++) {
    							Server.itemHandler.createGroundItem(c, c.storeditems[i], Server.npcHandler.npcs[c.summoningnpcid].absX, Server.npcHandler.npcs[c.summoningnpcid].absY, 1, c.playerId);
    							c.storeditems[i] = -1;
    							c.occupied[i] = false;
    						}
    						c.lastsummon = -1;
    						c.totalstored = 0;
    						c.summoningnpcid = 0;
    						c.summoningslot = 0;
    						c.sendMessage("Your BoB items have drop on the floor");
    						c.getPA().closeAllWindows();
    					} else {
    						c.sendMessage("You do not have a npc currently spawned");
    					}
    				}
    				break;
    Use conventions. The code is not fixed you need to call dialogueAction 94.

    If you use if statements like above then what you are doing is going through each one of them checking if the state is correct, unless you want to check for all of them then you're doing it right but I know this is wrong and I also know you didn't make this, Sanity just doesn't know basic Java.

    You should make all the if statements continue as else if. Also braces are a must.

    Code:
    			case 9178:
    				if (c.usingGlory) {
    					c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, "modern");
    				} else if (c.dialogueAction == 2) {
    					c.getPA().startTeleport(3428, 3538, 0, "modern");
    				} else if (c.dialogueAction == 3) {
    					c.getPA().startTeleport(Config.EDGEVILLE_X, Config.EDGEVILLE_Y, 0, "modern");
    				} else if (c.dialogueAction == 4) {
    					c.getPA().startTeleport(3565, 3314, 0, "modern");
    				} else if (c.dialogueAction == 20) {
    					c.getPA().startTeleport(2897, 3618, 4, "modern");
    				} else if(c.dialogueAction == 100) {
    					c.getDH().sendDialogues(25, 946);
    				} else if (c.teleAction == 24) { //EDGE TELE
    					c.getPA().spellTeleport(3087,3497,0);
    				} else if (c.dialogueAction == 94) { // SUMMON DISMISS
    					c.updateRequired = true;
    					if(c.lastsummon > 0) {
    						c.firstslot();
    						for(int i = 0; i < 29; i++) {
    							Server.itemHandler.createGroundItem(c, c.storeditems[i], Server.npcHandler.npcs[c.summoningnpcid].absX, Server.npcHandler.npcs[c.summoningnpcid].absY, 1, c.playerId);
    							c.storeditems[i] = -1;
    							c.occupied[i] = false;
    						}
    						c.lastsummon = -1;
    						c.totalstored = 0;
    						c.summoningnpcid = 0;
    						c.summoningslot = 0;
    						c.sendMessage("Your BoB items have drop on the floor");
    						c.getPA().closeAllWindows();
    					} else {
    						c.sendMessage("You do not have a npc currently spawned");
    					}
    				}
    				break;
    Reply With Quote  
     

  6. Thankful user:



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. Delete this
    By Mini Slurpee in forum Help
    Replies: 0
    Last Post: 07-21-2011, 06:44 AM
  2. wierd...
    By mironic in forum Help
    Replies: 0
    Last Post: 07-12-2009, 12:28 PM
  3. Wierd..
    By Ventrix in forum Help
    Replies: 1
    Last Post: 07-04-2009, 06:19 PM
  4. Wierd..
    By JavaBMX in forum Help
    Replies: 2
    Last Post: 02-05-2009, 05:39 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
  •