Fixed invisible NPCs spawned by scripts.

This commit is contained in:
MobiusDevelopment
2022-08-19 21:07:49 +00:00
parent 20ed2a6ef9
commit 5d5b9c62c9
28 changed files with 134 additions and 43 deletions

View File

@ -2201,7 +2201,6 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
try
{
final Spawn spawn = new Spawn(npcId);
if ((xValue == 0) && (yValue == 0))
{
LOGGER.severe("addSpawn(): invalid spawn coordinates for NPC #" + npcId + "!");
@ -2226,6 +2225,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
y += offset;
}
final Spawn spawn = new Spawn(npcId);
spawn.setInstanceId(instance);
spawn.setHeading(heading);
spawn.setXYZ(x, y, zValue);
@ -2241,6 +2241,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
summoner.addSummonedNpc(npc);
}
// Fixes invisible NPCs spawned by script.
npc.broadcastInfo();
return npc;
}
catch (Exception e)