Thread: Spawning wrong NPCs please help

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Spawning wrong NPCs please help 
    Registered Member
    Warlock 999's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,407
    Thanks given
    7
    Thanks received
    29
    Rep Power
    927
    My Server is spawning the wrong npcs when it comes to 474 npcs. All of my warrior guild npcs are wrong. I know my client npcs are fine because when i pnpc 4284 I turn into the npc that I want to spawn but when I spawn one it shows up as a chaos mage

    Any ideas please help I can't figure it out

    If anyone needs help with java questions or errors I will try and help with what I can/know
    my discord is Perkaholic feel free to add me with questions or to chat!

    "There is always one more thing you can do to increase your odds of success." -Hal Moore
    Reply With Quote  
     

  2. #2  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Show the spawn method in NPCHandler and your PNPC command as well as the updateNpcs method server sided along with method63 or whatever one handles sending npc information.
    Reply With Quote  
     

  3. #3  
    Registered Member DestriX's Avatar
    Join Date
    Nov 2008
    Posts
    1,323
    Thanks given
    490
    Thanks received
    152
    Rep Power
    257
    Make sure the you have increased the npc-bits client-sided and server sided from 12 to 14.
    Attached image
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by DestriX View Post
    Make sure the you have increased the npc-bits client-sided and server sided from 12 to 14.
    Clearly hes already sending the right information considering he has the ability to morph into the non playable character at will.
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Apr 2012
    Posts
    479
    Thanks given
    36
    Thanks received
    72
    Rep Power
    0
    warlock i thought you were smarter then this honestly... your latest help threads are usually things that've been released or common knowledge ._.

    anyways, match the npcbits client+serversided to be the same number
    and i think it should be 14 for the bits
    Reply With Quote  
     

  6. #6  
    Registered Member
    Warlock 999's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,407
    Thanks given
    7
    Thanks received
    29
    Rep Power
    927
    Spawn method
    Code:
        public void spawnNpc(Client c, int npcType, int x, int y, int heightLevel, int WalkingType, int HP, int maxHit, int attack, int defence, boolean attackPlayer, boolean headIcon) {
            // first, search for a free slot
            int slot = -1;
            for (int i = 1; i < maxNPCs; i++) {
                if (npcs[i] == null) {
                    slot = i;
                    break;
                }
            }
            if(slot == -1) {
                //Misc.println("No Free Slot");
                return;        // no free slot found
            }
            NPC newNPC = new NPC(slot, npcType);
            newNPC.absX = x;
            newNPC.absY = y;
            newNPC.makeX = x;
            newNPC.makeY = y;
            newNPC.heightLevel = heightLevel;
            newNPC.walkingType = WalkingType;
            newNPC.HP = HP;
            newNPC.MaxHP = HP;
            newNPC.maxHit = maxHit;
            newNPC.attack = attack;
            newNPC.defence = defence;
            newNPC.spawnedBy = c.getId();
            newNPC.dagColor = getDagColor(npcType);
            if(headIcon) 
                c.getPA().drawHeadicon(1, slot, 0, 0);
            if(attackPlayer) {
                newNPC.underAttack = true;
                if(c != null) {
                    if(server.game.minigames.barrows.Barrows.COFFIN_AND_BROTHERS[c.randomCoffin][1] != newNPC.npcType) {
                        if(newNPC.npcType == 2025 || newNPC.npcType == 2026 || newNPC.npcType == 2027 || newNPC.npcType == 2028 || newNPC.npcType == 2029 || newNPC.npcType == 2030) {
                            newNPC.forceChat("You dare disturb my rest!");
                        }
                    }
                    if(server.game.minigames.barrows.Barrows.COFFIN_AND_BROTHERS[c.randomCoffin][1] == newNPC.npcType) {
                        newNPC.forceChat("You dare steal from us!");
                    }
                    int[] animatedArmor = {4278, 4279, 4280, 4281, 4282, 4283, 4284};
                    for(int z = 0; z < animatedArmor.length; z++) {
                        if (newNPC.npcType == animatedArmor[z]) {
                            newNPC.forceAnim(4410);
                            newNPC.forceChat("I'M ALIVE!");
                        }
                    }
                    
                    newNPC.killerId = c.playerId;
                }
            }
            npcs[slot] = newNPC;
        }
    If anyone needs help with java questions or errors I will try and help with what I can/know
    my discord is Perkaholic feel free to add me with questions or to chat!

    "There is always one more thing you can do to increase your odds of success." -Hal Moore
    Reply With Quote  
     

  7. #7  
    Registered Member
    Warlock 999's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,407
    Thanks given
    7
    Thanks received
    29
    Rep Power
    927
    Quote Originally Posted by SGPK View Post
    warlock i thought you were smarter then this honestly... your latest help threads are usually things that've been released or common knowledge ._.

    anyways, match the npcbits client+serversided to be the same number
    and i think it should be 14 for the bits
    That's not it, I've already tried that.
    If anyone needs help with java questions or errors I will try and help with what I can/know
    my discord is Perkaholic feel free to add me with questions or to chat!

    "There is always one more thing you can do to increase your odds of success." -Hal Moore
    Reply With Quote  
     

  8. #8  
    Registered Member
    Warlock 999's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,407
    Thanks given
    7
    Thanks received
    29
    Rep Power
    927
    Quote Originally Posted by SGPK View Post
    warlock i thought you were smarter then this honestly... your latest help threads are usually things that've been released or common knowledge ._.

    anyways, match the npcbits client+serversided to be the same number
    and i think it should be 14 for the bits
    I'm not a fucking idiot, I know what the fuck I'm doing also. I just came back from not working on any programming for over a year pretty much. I don't remember everything this quick...
    If anyone needs help with java questions or errors I will try and help with what I can/know
    my discord is Perkaholic feel free to add me with questions or to chat!

    "There is always one more thing you can do to increase your odds of success." -Hal Moore
    Reply With Quote  
     

  9. #9  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by Warlock 999 View Post
    Spawn method
    Code:
        public void spawnNpc(Client c, int npcType, int x, int y, int heightLevel, int WalkingType, int HP, int maxHit, int attack, int defence, boolean attackPlayer, boolean headIcon) {
            // first, search for a free slot
            int slot = -1;
            for (int i = 1; i < maxNPCs; i++) {
                if (npcs[i] == null) {
                    slot = i;
                    break;
                }
            }
            if(slot == -1) {
                //Misc.println("No Free Slot");
                return;        // no free slot found
            }
            NPC newNPC = new NPC(slot, npcType);
            newNPC.absX = x;
            newNPC.absY = y;
            newNPC.makeX = x;
            newNPC.makeY = y;
            newNPC.heightLevel = heightLevel;
            newNPC.walkingType = WalkingType;
            newNPC.HP = HP;
            newNPC.MaxHP = HP;
            newNPC.maxHit = maxHit;
            newNPC.attack = attack;
            newNPC.defence = defence;
            newNPC.spawnedBy = c.getId();
            newNPC.dagColor = getDagColor(npcType);
            if(headIcon) 
                c.getPA().drawHeadicon(1, slot, 0, 0);
            if(attackPlayer) {
                newNPC.underAttack = true;
                if(c != null) {
                    if(server.game.minigames.barrows.Barrows.COFFIN_AND_BROTHERS[c.randomCoffin][1] != newNPC.npcType) {
                        if(newNPC.npcType == 2025 || newNPC.npcType == 2026 || newNPC.npcType == 2027 || newNPC.npcType == 2028 || newNPC.npcType == 2029 || newNPC.npcType == 2030) {
                            newNPC.forceChat("You dare disturb my rest!");
                        }
                    }
                    if(server.game.minigames.barrows.Barrows.COFFIN_AND_BROTHERS[c.randomCoffin][1] == newNPC.npcType) {
                        newNPC.forceChat("You dare steal from us!");
                    }
                    int[] animatedArmor = {4278, 4279, 4280, 4281, 4282, 4283, 4284};
                    for(int z = 0; z < animatedArmor.length; z++) {
                        if (newNPC.npcType == animatedArmor[z]) {
                            newNPC.forceAnim(4410);
                            newNPC.forceChat("I'M ALIVE!");
                        }
                    }
                    
                    newNPC.killerId = c.playerId;
                }
            }
            npcs[slot] = newNPC;
        }
    Nothing wrong with that, pastebin your NPCHandler class and post the PNPC Command.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Warlock 999's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,407
    Thanks given
    7
    Thanks received
    29
    Rep Power
    927
    Quote Originally Posted by Jason View Post
    Nothing wrong with that, pastebin your NPCHandler class and post the PNPC Command.
    Thanks for the help jason, It was something in my entityDef. I knew I wasn't crazy when i was looking in server
    If anyone needs help with java questions or errors I will try and help with what I can/know
    my discord is Perkaholic feel free to add me with questions or to chat!

    "There is always one more thing you can do to increase your odds of success." -Hal Moore
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. [Matrix] Spawning NPCs
    By dragonkk in forum Tutorials
    Replies: 44
    Last Post: 03-11-2014, 09:50 PM
  2. [PI] No NPCs Spawning!
    By Slawth Baws in forum Help
    Replies: 6
    Last Post: 11-18-2011, 10:11 AM
  3. Spawning npcs if under 150hp
    By Purple in forum Help
    Replies: 5
    Last Post: 10-08-2010, 05:11 PM
  4. Help with projectiles and npcs spawning npcs.
    By arr0wtohell in forum Help
    Replies: 7
    Last Post: 03-15-2010, 05:29 PM
  5. spawning npcs
    By massacre561 in forum Help
    Replies: 5
    Last Post: 11-27-2009, 08:04 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •