Set NPC Visible to Player

Horyon

Пляшущий с бубном
Участник
Сообщения
220
Розыгрыши
0
Решения
4
Репутация
53
Реакции
77
Баллы
273
Хроники
  1. Prelude
  2. Harbingers of War
  3. Age of Splendor
  4. Rise of Darkness
  5. Scions of Destiny
  6. Oath of Blood
  7. Interlude
  8. The 1st Throne: The Kamael
  9. The 1st Throne: Hellbound
  10. The 2nd Throne: Gracia
  11. The 2nd Throne: Freya
  12. Chaotic Throne: High Five
  13. Goddess of Destruction Awakening
  14. Goddess of Destruction Harmony
  15. Goddess of Destruction Tauti
  16. Goddess of Destruction Glory Days
  17. Goddess of Destruction Lindvior
  18. Valliance / Epeisodion / Raiders
  19. Ertheia / Dimensional Strangers
  20. Infinite Odyssey
  21. Helios
  22. Grand Cursade
  23. Salvation
  24. Fafurion
  25. Shadow of the Kamael
Исходники
Отсутствуют
Сборка
Mobius Sources
Hey guys, yesterday i make a small modification in my source to be able to show X npc only for Y player. Probably there is better yes but at least work now in mobius.

In WorldObject.java add
Java:
/**
     * Sets this object as invisible or not
     * @param player
     */
    public void setVisibleForPlayerOnly(Player player)
    {
        _isInvisible = false;
        World.getInstance().forEachVisibleObject(this, Player.class, nearPlayers ->
        {
            if ((nearPlayers.getId() == player.getId()) && isVisibleFor(nearPlayers))
            {
                sendInfo(nearPlayers);
            }
        });
    }

Before unhide, remember to use setInvisible true to make npc invisible to all, then use this code with player ref to show the npc only to him.

Hope it helps cya!!
 
Назад
Сверху Снизу