Set NPC Visible to Player

Horyon

Пляшущий с бубном
Участник
Сообщения
173
Розыгрыши
0
Решения
4
Репутация
53
Реакции
68
Баллы
273
Хроники
  1. Prelude
  2. Chronicle 1: Harbingers of War
  3. Chronicle 2: Age of Splendor
  4. Chronicle 3: Rise of Darkness
  5. Chronicle 4: Scions of Destiny
  6. Chronicle 5: 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. The Chaotic Throne 3: Goddess of Destruction
  14. Goddess of Destruction Awakening
  15. Goddess of Destruction Harmony
  16. Goddess of Destruction Tauti
  17. Goddess of Destruction Glory Days
  18. Goddess of Destruction Lindvior
  19. Goddess of Destruction Epeisodion / Valiance
  20. Dimensional Strangers
  21. Infinite Odyssey
  22. Helios
  23. Grand Cursade
  24. Salvation
  25. Fafurion
  26. Prologue: Prelude of War
Исходники
Отсутствуют
Сборка
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!!
 
Назад
Сверху Снизу