Show red icon in map when boss is in combat.

This commit is contained in:
MobiusDevelopment
2022-07-11 03:14:19 +00:00
parent a07d2f03fb
commit f632005ccd
16 changed files with 160 additions and 8 deletions

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{

View File

@@ -561,6 +561,16 @@ public class DBSpawnManager
return _spawns.containsKey(npcId);
}
/**
* Gets a specific NPC by id.
* @param id The id of the NPC.
* @return the Npc
*/
public Npc getNpc(int id)
{
return _npcs.get(id);
}
/**
* Gets the npcs.
* @return the npcs

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.GrandBoss;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -47,7 +48,15 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
final int status = DBSpawnManager.getInstance().getNpcStatusId(bossId).ordinal();
if (status != 3)
{
_statuses.put(bossId, status);
final Npc npc = DBSpawnManager.getInstance().getNpc(bossId);
if ((npc != null) && npc.isInCombat())
{
_statuses.put(bossId, 2);
}
else
{
_statuses.put(bossId, status);
}
}
else
{