Thread: NPC Respawn Fix

Results 1 to 9 of 9
  1. #1 NPC Respawn Fix 
    Banned

    Join Date
    Sep 2006
    Age
    31
    Posts
    3,019
    Thanks given
    22
    Thanks received
    420
    Rep Power
    0
    This is for the nio based 508 in the downloads section.

    In palidino76.server.model.NPCManager, add:
    Code:
        private List<NPC> npcsToAdd = new ArrayList<NPC>();
        private List<NPC> npcsToRemove = new ArrayList<NPC>();
    
        public List<NPC> getNPCsToRemove() {
            return npcsToRemove;
        }
    
        public List<NPC> getNPCsToAdd() {
            return npcsToAdd;
        }
    at the bottom of globalNPCUpdate() add:
    Code:
            if (!npcsToRemove.isEmpty()) {
                npcs.removeAll(npcsToRemove);
                npcsToRemove.clear();
            }
            if (!npcsToAdd.isEmpty()) {
                npcs.addAll(npcsToAdd);
                npcsToAdd.clear();
            }
    Now go the palidino76.server.model.npcs.NPC, and in the process method, replace the remove(this) line with:
    Code:
                        Engine.npcManager.getNPCsToRemove().add(this);
    For the respawning in the process method change the line to:
    Code:
                            Engine.npcManager.getNPCsToAdd().add(new NPC(getId(), getType(), makeX, makeY, getHeight(), rangeX1, rangeY1, rangeX2, rangeY2, true));
    Reply With Quote  
     

  2. #2  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    22
    Posts
    16,478
    Thanks given
    3,385
    Thanks received
    7,727
    Rep Power
    5000
    ty pali will try and when will your 508 be out beta testing
    Attached image
    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  3. #3  
    ̿ ̿̿ ̿̿ ̿̿̿'̿'\̵͇̿̿\=(•̪

    Dragonking's Avatar
    Join Date
    May 2008
    Posts
    2,011
    Thanks given
    16
    Thanks received
    31
    Rep Power
    567
    what about esperon or what ever its called lol can you fix that?
    Reply With Quote  
     

  4. #4  
    Jet Blue Lover!

    Lumby's Avatar
    Join Date
    Dec 2006
    Age
    29
    Posts
    564
    Thanks given
    16
    Thanks received
    45
    Rep Power
    165
    Bug found by Lumby :O Thanks Pali for fixing!

    ~Lumby
    May jetBlue be with you. Remember lowercase j capital B!



    Former Global Moderator
    Reply With Quote  
     

  5. #5  
    Registered Member
    Itz Matthew ♥'s Avatar
    Join Date
    Oct 2007
    Posts
    399
    Thanks given
    1
    Thanks received
    4
    Rep Power
    82
    Lol i was wondering why the server always stops responding when you kill an npc
    Reply With Quote  
     

  6. #6  
    Encouragin
    Guest
    Quote Originally Posted by dragonking View Post
    what about esperon or what ever its called lol can you fix that?
    I don't think palidino will fix an server which isnt his.
    Reply With Quote  
     

  7. #7  
    Registered Member druidje's Avatar
    Join Date
    Jan 2007
    Posts
    375
    Thanks given
    1
    Thanks received
    0
    Rep Power
    28
    Thanks for this Will use.

    Quote Originally Posted by zee_best View Post
    Get sarah101 to sleep with kevin?
    Quote Originally Posted by ject View Post
    but try ::noclit or whatever
    Developing 508!
    Reply With Quote  
     

  8. #8  
    ̿ ̿̿ ̿̿ ̿̿̿'̿'\̵͇̿̿\=(•̪

    Dragonking's Avatar
    Join Date
    May 2008
    Posts
    2,011
    Thanks given
    16
    Thanks received
    31
    Rep Power
    567
    Quote Originally Posted by Encouragin View Post
    I don't think palidino will fix an server which isnt his.
    your right lol
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Sep 2006
    Age
    31
    Posts
    3,019
    Thanks given
    22
    Thanks received
    420
    Rep Power
    0
    Rofl
    Code:
            if (!npcsToAdd.isEmpty()) {
                npcs.addAll(npcsToAdd);
            }
    to:
    Code:
            if (!npcsToAdd.isEmpty()) {
                npcs.addAll(npcsToAdd);
                npcsToAdd.clear();
            }
    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
  •