Notify OnCreatureSee for creatures that do not trigger EVT_THINK.

This commit is contained in:
MobiusDevelopment
2021-06-23 14:24:37 +00:00
parent 39cc9a5ebb
commit e0d8b453a3
22 changed files with 352 additions and 0 deletions

View File

@ -37,6 +37,8 @@ import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureSee;
import org.l2jmobius.gameserver.network.Disconnection;
import org.l2jmobius.gameserver.network.serverpackets.DeleteObject;
@ -355,6 +357,13 @@ public class World
}
}
}
// Notify OnCreatureSee for creatures that do not trigger EVT_THINK.
if (!wo.isAttackable() && wo.isCreature() && object.isCreature())
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee((Creature) wo, (Creature) object), (Creature) wo);
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee((Creature) object, (Creature) wo), (Creature) object);
}
});
}
@ -568,6 +577,13 @@ public class World
}
}
}
// Notify OnCreatureSee for creatures that do not trigger EVT_THINK.
if (!wo.isAttackable() && wo.isCreature() && object.isCreature())
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee((Creature) wo, (Creature) object), (Creature) wo);
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee((Creature) object, (Creature) wo), (Creature) object);
}
}
}
}