handle all NPC, even when no player has is proximity menu

User Tag List

Results 1 to 5 of 5
  1. #1
    illift's Avatar Private
    Reputation
    1
    Join Date
    May 2011
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    handle all NPC, even when no player has is proximity

    Hi,
    I am currently developing a custom battleground in mangos.
    In this battleground, I have a script with scriptdev2 creature that has spawn interval regulate other NPC.

    The problem I have is that when are too far away from the NPC, the server uses the "pause" in some way and so he stopped to invoke.

    I tried to increase visibility in the configuration file but it is still too little.

    Anyone know what part of it I can modify the source code for the server to handle all NPC in the battleground, even when no player has is proximity?

    Sorry for my bad English.

    Thank you for reading.
    Last edited by illift; 06-07-2012 at 10:13 AM.

    handle all NPC, even when no player has is proximity
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The problem is npc's are only loaded when players go near them.

    You have to manually change the load distance (static spawns) by rewriting how it is handled in the core, or handle events not from a npc.

  3. #3
    illift's Avatar Private
    Reputation
    1
    Join Date
    May 2011
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your response,
    That's what I thought, I already try to change several different location in the core but I can not found the piece of code that handles this.

    I thought the following code, tell me if I'm wrong:

    In map.cpp line 1120 (in my core)
    void Map::AddToActive( WorldObject* obj )
    {
    m_activeNonPlayers.insert(obj);
    Cell cell = Cell(MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()));
    EnsureGridLoaded(cell);

    // also not allow unloading spawn grid to prevent creating creature clone at load
    if (obj->GetTypeId() == TYPEID_UNIT)
    {
    Creature* c= (Creature*)obj;

    if (!c->IsPet() && c->HasStaticDBSpawnData())
    {
    float x,y,z;
    c->GetRespawnCoord(x,y,z);
    GridPair p = MaNGOS::ComputeGridPair(x, y);
    if(getNGrid(p.x_coord, p.y_coord))
    getNGrid(p.x_coord, p.y_coord)->incUnloadActiveLock();
    else
    {
    GridPair p2 = MaNGOS::ComputeGridPair(c->GetPositionX(), c->GetPositionY());
    sLog.outError("Active creature (GUID: %u Entry: %u) added to grid[%u,%u] but spawn grid[%u,%u] not loaded.",
    c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord);
    }
    }
    }
    }

    void Map::RemoveFromActive( WorldObject* obj )
    {
    // Map::Update for active object in proccess
    if(m_activeNonPlayersIter != m_activeNonPlayers.end())
    {
    ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj);
    if(itr==m_activeNonPlayersIter)
    ++m_activeNonPlayersIter;
    m_activeNonPlayers.erase(itr);
    }
    else
    m_activeNonPlayers.erase(obj);

    // also allow unloading spawn grid
    if (obj->GetTypeId()==TYPEID_UNIT)
    {
    Creature* c= (Creature*)obj;

    if(!c->IsPet() && c->HasStaticDBSpawnData())
    {
    float x,y,z;
    c->GetRespawnCoord(x,y,z);
    GridPair p = MaNGOS::ComputeGridPair(x, y);
    if(getNGrid(p.x_coord, p.y_coord))
    getNGrid(p.x_coord, p.y_coord)->decUnloadActiveLock();
    else
    {
    GridPair p2 = MaNGOS::ComputeGridPair(c->GetPositionX(), c->GetPositionY());
    sLog.outError("Active creature (GUID: %u Entry: %u) removed from grid[%u,%u] but spawn grid[%u,%u] not loaded.",
    c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord);
    }
    }
    }
    }

  4. #4
    LilleCarl's Avatar Active Member
    Reputation
    65
    Join Date
    Feb 2008
    Posts
    132
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    The problem is npc's are only loaded when players go near them.

    You have to manually change the load distance (static spawns) by rewriting how it is handled in the core, or handle events not from a npc.
    I think this is called "grid"? And grud unload timer could be increased i guess
    Violence doesn't solve shit, but everything else.

  5. #5
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I honestly have no idea how it is handled, nor where. Your best bet would be to ask the developers of the core.

Similar Threads

  1. [Trinity] Making npcs spawn at the same time every time even when they die at different time
    By Badcobra10 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 06-03-2011, 12:15 PM
  2. Replies: 6
    Last Post: 09-13-2010, 06:48 AM
  3. Do race changes change all npcs and other players as well?
    By ImRightHere in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 03-17-2010, 09:37 AM
  4. Replies: 80
    Last Post: 02-01-2008, 02:15 PM
  5. PICTURE Tutorial: Extract a list of all NPCS/ITEMS with ID and Display ID!
    By selulancie in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 09-26-2007, 08:26 AM
All times are GMT -5. The time now is 01:28 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search