Thread: A simple addition to my mini-quest.

Results 1 to 8 of 8
  1. #1 A simple addition to my mini-quest. 
    Registered Member
    Rainaka's Avatar
    Join Date
    Nov 2008
    Age
    29
    Posts
    1,391
    Thanks given
    273
    Thanks received
    89
    Rep Power
    870
    Alright, I'm trying to make the ending boss so, when you kill it, and try to again, you don't teleport, and receive the item given. Here is what I came up with thus far.

    Code:
                                if (npcs[NPCID].npcType == 1172) {
                                    int Player = npcs[NPCID].StartKilling;
                                    client ppl = (client) server.playerHandler.players[Player];
                                    if (killed == 0) {
                                    ppl.teleportToX = 2445;
                                    ppl.teleportToY = 4465;;
                                    ItemHandler.addItem(13665, npcs[NPCID].absX,
                    killed = 1;
                    savemoreinfo();
                    savechar();
                                } else if (killed == 1) {
                    sendMessage("You can't kill him again!");
                                }

    And that doesn't seem to work, well it errors up my client.

    If anyone could make it work how I wanted it, or even you can't attack him again after you killed him once, please.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Iwin's Avatar
    Join Date
    Mar 2008
    Age
    30
    Posts
    677
    Thanks given
    12
    Thanks received
    56
    Rep Power
    245
    try making it see the monster again in the 'else if' part.

    if (npcs[NPCID].npcType == 1172) && (killed == 1){


    idk if it will work, its from scratch, just fix it up a little
    [SPOIL]
    [/SPOIL]
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jul 2008
    Posts
    939
    Thanks given
    0
    Thanks received
    3
    Rep Power
    781
    Make sure the variable, killed is added to the methods that actually save the character file. You need to do more then just declaring it.
    I'm Rog3r, fool.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Dec 2006
    Age
    28
    Posts
    2,196
    Thanks given
    5
    Thanks received
    23
    Rep Power
    0
    ItemHandler.addItem(13665, npcs[NPCID].absX, npcs[NPCID].absY);

    or i'm pretty sure addItem method is like
    ItemHandler.addItem(13665, AMOUNT);

    also make sure 13665 is an item in-game

    and
    ppl.teleportToY = 4465;;

    and make sure your tele coords are okay
    Reply With Quote  
     

  5. #5  
    Registered Member
    Rainaka's Avatar
    Join Date
    Nov 2008
    Age
    29
    Posts
    1,391
    Thanks given
    273
    Thanks received
    89
    Rep Power
    870
    Alright, im having a bad day, and im having trouble comprehending all of you, if someone can make a small step by step tut, from start.. that'd earn a rep ;_;
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Dec 2006
    Age
    28
    Posts
    2,196
    Thanks given
    5
    Thanks received
    23
    Rep Power
    0
    try this:
    Code:
                       if (npcs[NPCID].npcType == 1172) {
                                    int Player = npcs[NPCID].StartKilling;
                                    client ppl = (client) server.playerHandler.players[Player];
                                    if (killed == 0) {
                                    ppl.teleportToX = 2445;
                                    ppl.teleportToY = 4465;
                                    ItemHandler.addItem(13665, 1);
                                    killed = 1;
                                    savemoreinfo();
                                    savechar();
                                } else if (killed == 1) {
                                        sendMessage("You can't kill him again!");
                                }
    Reply With Quote  
     

  7. #7  
    Registered Member
    Rainaka's Avatar
    Join Date
    Nov 2008
    Age
    29
    Posts
    1,391
    Thanks given
    273
    Thanks received
    89
    Rep Power
    870
    Code:
                                ^
    NPCHandler.java:1634: ';' expected
        public static int worldmap[][] = {
                                      ^
    NPCHandler.java:1637: not a statement
                 /* 01 */           3252, 3453, 3252, 3453, 3252, 3253, 3254, 3252,
    3253,
                                    ^
    NPCHandler.java:1637: ';' expected
                 /* 01 */           3252, 3453, 3252, 3453, 3252, 3253, 3254, 3252,
    3253,
                                        ^
    NPCHandler.java:1786: illegal start of expression
            },
             ^
    NPCHandler.java:1789: not a statement
                 /* 01 */           3404, 3404, 3403, 3403, 4302, 4302, 4302, 3401,
    3401,
                                    ^
    NPCHandler.java:1789: ';' expected
                 /* 01 */           3404, 3404, 3403, 3403, 4302, 4302, 4302, 3401,
    3401,
                                        ^
    NPCHandler.java:1937: illegal start of expression
            },
             ^
    NPCHandler.java:1944: illegal start of expression
        public static int worldmap2[][] = {
        ^
    NPCHandler.java:1944: illegal start of expression
        public static int worldmap2[][] = {
               ^
    NPCHandler.java:1944: ';' expected
        public static int worldmap2[][] = {
                     ^
    NPCHandler.java:1944: not a statement
        public static int worldmap2[][] = {
                                   ^
    NPCHandler.java:1944: ';' expected
        public static int worldmap2[][] = {
                                       ^
    NPCHandler.java:1947: not a statement
                /* 01 */            3257, 3258, 3260, 3261, 3261, 3262, 3261, 3262,
    3257, 3258,
                                    ^
    NPCHandler.java:1947: ';' expected
                /* 01 */            3257, 3258, 3260, 3261, 3261, 3262, 3261, 3262,
    3257, 3258,
                                        ^
    NPCHandler.java:1952: illegal start of expression
            },
             ^
    NPCHandler.java:1955: not a statement
                /* 01 */            3256, 3256, 3256, 3256, 3266, 3266, 3267, 3267,
    3270, 3270,
                                    ^
    NPCHandler.java:1955: ';' expected
                /* 01 */            3256, 3256, 3256, 3256, 3266, 3266, 3267, 3267,
    3270, 3270,
                                        ^
    NPCHandler.java:1960: illegal start of expression
            },
             ^
    NPCHandler.java:1963: illegal start of expression
        public int remove = 2; // 1 = removes equipment, 2 = doesn't remove - *****c
    heez
        ^
    NPCHandler.java:1964: illegal start of expression
        public static int removeschaos[] = { 1, 2, 2, 2};
        ^
    NPCHandler.java:1964: illegal start of expression
        public static int removeschaos[] = { 1, 2, 2, 2};
               ^
    NPCHandler.java:1964: ';' expected
        public static int removeschaos[] = { 1, 2, 2, 2};
                     ^
    NPCHandler.java:1964: not a statement
        public static int removeschaos[] = { 1, 2, 2, 2};
                                      ^
    NPCHandler.java:1964: ';' expected
        public static int removeschaos[] = { 1, 2, 2, 2};
                                        ^
    NPCHandler.java:1964: not a statement
        public static int removeschaos[] = { 1, 2, 2, 2};
                                             ^
    NPCHandler.java:1964: ';' expected
        public static int removeschaos[] = { 1, 2, 2, 2};
                                              ^
    NPCHandler.java:1966: illegal start of expression
        public static int randomremoveschaos() {
        ^
    NPCHandler.java:1966: illegal start of expression
        public static int randomremoveschaos() {
               ^
    NPCHandler.java:1966: ';' expected
        public static int randomremoveschaos() {
                     ^
    NPCHandler.java:1966: ';' expected
        public static int randomremoveschaos() {
                                              ^
    NPCHandler.java:1970: illegal start of expression
        public void gfxAll(int id, int Y, int X) {
        ^
    NPCHandler.java:1970: illegal start of expression
        public void gfxAll(int id, int Y, int X) {
               ^
    NPCHandler.java:1970: ';' expected
        public void gfxAll(int id, int Y, int X) {
                          ^
    NPCHandler.java:1970: <identifier> expected
        public void gfxAll(int id, int Y, int X) {
                                  ^
    NPCHandler.java:1970: not a statement
        public void gfxAll(int id, int Y, int X) {
                                       ^
    NPCHandler.java:1970: ';' expected
        public void gfxAll(int id, int Y, int X) {
                                        ^
    NPCHandler.java:1970: ';' expected
        public void gfxAll(int id, int Y, int X) {
                                               ^
    NPCHandler.java:1984: illegal start of expression
        public int GetNPCBlockAnim(int id) {
        ^
    NPCHandler.java:1984: ';' expected
        public int GetNPCBlockAnim(int id) {
                                  ^
    NPCHandler.java:1984: ';' expected
        public int GetNPCBlockAnim(int id) {
                                         ^
    NPCHandler.java:2017: illegal start of expression
        public boolean AttackPlayerRanged(int NPCID) {
        ^
    NPCHandler.java:2017: ';' expected
        public boolean AttackPlayerRanged(int NPCID) {
                                         ^
    NPCHandler.java:2017: ';' expected
        public boolean AttackPlayerRanged(int NPCID) {
                                                   ^
    NPCHandler.java:2142: illegal start of expression
        public boolean AttackPlayer(int NPCID) {
        ^
    NPCHandler.java:2142: ';' expected
        public boolean AttackPlayer(int NPCID) {
                                   ^
    NPCHandler.java:2142: ';' expected
        public boolean AttackPlayer(int NPCID) {
                                             ^
    NPCHandler.java:2317: illegal start of expression
        public boolean AttackPlayerMage(int NPCID) {
        ^
    NPCHandler.java:2317: ';' expected
        public boolean AttackPlayerMage(int NPCID) {
                                       ^
    NPCHandler.java:2317: ';' expected
        public boolean AttackPlayerMage(int NPCID) {
                                                 ^
    NPCHandler.java:2403: illegal start of expression
        public boolean AttackNPCMage(int NPCID) {
        ^
    NPCHandler.java:2403: ';' expected
        public boolean AttackNPCMage(int NPCID) {
                                    ^
    NPCHandler.java:2403: ';' expected
        public boolean AttackNPCMage(int NPCID) {
                                              ^
    NPCHandler.java:2467: illegal start of expression
        public boolean AttackNPC(int NPCID) {
        ^
    NPCHandler.java:2467: ';' expected
        public boolean AttackNPC(int NPCID) {
                                ^
    NPCHandler.java:2467: ';' expected
        public boolean AttackNPC(int NPCID) {
                                          ^
    NPCHandler.java:2514: illegal start of expression
        public boolean ResetAttackNPC(int NPCID) {
        ^
    NPCHandler.java:2514: ';' expected
        public boolean ResetAttackNPC(int NPCID) {
                                     ^
    NPCHandler.java:2514: ';' expected
        public boolean ResetAttackNPC(int NPCID) {
                                               ^
    NPCHandler.java:2525: illegal start of expression
        public int getLevelForXP(int exp) {
        ^
    NPCHandler.java:2525: ';' expected
        public int getLevelForXP(int exp) {
                                ^
    NPCHandler.java:2525: ';' expected
        public int getLevelForXP(int exp) {
                                        ^
    NPCHandler.java:2540: illegal start of expression
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
        ^
    NPCHandler.java:2540: ';' expected
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
                                   ^
    NPCHandler.java:2540: <identifier> expected
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
                                                ^
    NPCHandler.java:2540: not a statement
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
                                                     ^
    NPCHandler.java:2540: ';' expected
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
                                                            ^
    NPCHandler.java:2540: <identifier> expected
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
                                                                          ^
    NPCHandler.java:2540: not a statement
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
                                                                               ^
    NPCHandler.java:2540: ';' expected
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
    
      ^
    NPCHandler.java:2540: ';' expected
        public boolean GoodDistance(int objectX, int objectY, int playerX, int playe
    rY, int distance) {
    
                    ^
    NPCHandler.java:2561: illegal start of expression
        public boolean ResetAttackPlayer(int NPCID) {
        ^
    NPCHandler.java:2561: ';' expected
        public boolean ResetAttackPlayer(int NPCID) {
                                        ^
    NPCHandler.java:2561: ';' expected
        public boolean ResetAttackPlayer(int NPCID) {
                                                  ^
    NPCHandler.java:2571: illegal start of expression
        public boolean loadAutoSpawn(String FileName) {
        ^
    NPCHandler.java:2571: ';' expected
        public boolean loadAutoSpawn(String FileName) {
                                    ^
    NPCHandler.java:2571: ';' expected
        public boolean loadAutoSpawn(String FileName) {
                                                    ^
    NPCHandler.java:2640: illegal start of expression
        public int GetNpcListHP(int NpcID) {
        ^
    NPCHandler.java:2640: ';' expected
        public int GetNpcListHP(int NpcID) {
                               ^
    NPCHandler.java:2640: ';' expected
        public int GetNpcListHP(int NpcID) {
                                         ^
    NPCHandler.java:2651: illegal start of expression
        public boolean loadNPCList(String FileName) {
        ^
    NPCHandler.java:2651: ';' expected
        public boolean loadNPCList(String FileName) {
                                  ^
    NPCHandler.java:2651: ';' expected
        public boolean loadNPCList(String FileName) {
                                                  ^
    NPCHandler.java:2713: illegal start of expression
        public boolean loadNPCDrops(String FileName) {
        ^
    NPCHandler.java:2713: ';' expected
        public boolean loadNPCDrops(String FileName) {
                                   ^
    NPCHandler.java:2713: ';' expected
        public boolean loadNPCDrops(String FileName) {
                                                   ^
    NPCHandler.java:2785: illegal start of expression
        public int GetNPCDropArrayID(int NPCID, int DropType) {
        ^
    NPCHandler.java:2785: ';' expected
        public int GetNPCDropArrayID(int NPCID, int DropType) {
                                    ^
    NPCHandler.java:2785: <identifier> expected
        public int GetNPCDropArrayID(int NPCID, int DropType) {
                                               ^
    NPCHandler.java:2785: not a statement
        public int GetNPCDropArrayID(int NPCID, int DropType) {
                                                    ^
    NPCHandler.java:2785: ';' expected
        public int GetNPCDropArrayID(int NPCID, int DropType) {
                                                            ^
    NPCHandler.java:2797: illegal start of expression
        public void println(String str) {
        ^
    NPCHandler.java:2797: illegal start of expression
        public void println(String str) {
               ^
    Still 100 errors..
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Mar 2009
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    its me eclipsed i got it down to 1 error

    heres code

    if (npcs[NPCID].npcType == 1172) {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    if (killed == 0) {
    ppl.teleportToX = 2445;
    ppl.teleportToY = 4465;
    ItemHandler.addItem(13665,1);
    killed = 1;
    savemoreinfo();
    savechar();
    } else if (killed == 1) {
    sendMessage("You can't kill him again!");
    }
    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
  •