diff --git a/L2J_DataPack_BETA/dist/game/data/html/admin/npcinfo.htm b/L2J_DataPack_BETA/dist/game/data/html/admin/npcinfo.htm index 73d11d7ca5f19a43ba8ce75ce539782907e3f17c..b8f148ade6f2d7d48b83c0b59d73cb80179c3492 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/admin/npcinfo.htm +++ b/L2J_DataPack_BETA/dist/game/data/html/admin/npcinfo.htm @@ -19,7 +19,9 @@ <tr><td colspan="4"><table width=270 border=0><tr><td width=270><font color="LEVEL">Npc Info</font> : %name% (<font color="LEVEL">%id%</font>) [<font color=00FF00>%lvl%</font> lvl]</td></tr></table></td></tr> <tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">ObjectId</font></td><td align=right width=170>%objid%</td></tr></table></td></tr> <tr><td><table width=270 border=0><tr><td width=100><font color="LEVEL">Type:</font></td><td align=right width=170><font color=999999>%class%</font></td></tr></table></td></tr> -<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">Spawn</font></td><td align=right width=170>%spawn%</td></tr></table></td></tr> +<tr><td><table width=270 border=0><tr><td width=100><font color="LEVEL">Territory:</font></td><td align=right width=170>%territory%</td></tr></table></td></tr> +<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">Spawn type:</font></td><td align=right width=170>%spawntype%</td></tr></table></td></tr> +<tr><td><table width=270 border=0><tr><td width=100><font color="LEVEL">Spawn loc:</font></td><td align=right width=170>%spawn%</td></tr></table></td></tr> <tr><td><table width=270 border=0><tr><td width=100><font color="LEVEL">Location:</font></td><td align=right width=170>%loc%</td></tr></table></td></tr> <tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color="LEVEL">Heading:</font></td><td align=right width=170>%heading%</td></tr></table></td></tr> <tr><td><table width=270 border=0><tr><td width=100><font color="LEVEL">Collision Radius:</font></td><td align=right width=170>%collision_radius%</td></tr></table></td></tr> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/actionhandlers/L2NpcActionShift.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/actionhandlers/L2NpcActionShift.java index 6ea8abc7d646853b9bee7cdcb95e3f8107ab2052..81638d4c9a951f4ef37920cc4264b661d4b98b6b 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/actionhandlers/L2NpcActionShift.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/actionhandlers/L2NpcActionShift.java @@ -114,7 +114,17 @@ public class L2NpcActionShift implements IActionHandler if (((L2Npc) target).getSpawn() != null) { - html.replace("%spawn%", ((L2Npc) target).getSpawn().getX() + " " + ((L2Npc) target).getSpawn().getY() + " " + ((L2Npc) target).getSpawn().getZ()); + html.replace("%territory%", ((L2Npc) target).getSpawn().getSpawnTerritory() == null ? "None" : ((L2Npc) target).getSpawn().getSpawnTerritory().getName()); + if (((L2Npc) target).getSpawn().isTerritoryBased()) + { + html.replace("%spawntype%", "Random"); + html.replace("%spawn%", ((L2Npc) target).getSpawn().getX(target) + " " + ((L2Npc) target).getSpawn().getY(target) + " " + ((L2Npc) target).getSpawn().getZ(target)); + } + else + { + html.replace("%spawntype%", "Fixed"); + html.replace("%spawn%", ((L2Npc) target).getSpawn().getX() + " " + ((L2Npc) target).getSpawn().getY() + " " + ((L2Npc) target).getSpawn().getZ()); + } html.replace("%loc2d%", String.valueOf((int) target.calculateDistance(((L2Npc) target).getSpawn(), false, false))); html.replace("%loc3d%", String.valueOf((int) target.calculateDistance(((L2Npc) target).getSpawn(), true, false))); if (((L2Npc) target).getSpawn().getRespawnMinDelay() == 0) @@ -132,6 +142,8 @@ public class L2NpcActionShift implements IActionHandler } else { + html.replace("%territory%", "<font color=FF0000>--</font>"); + html.replace("%spawntype%", "<font color=FF0000>--</font>"); html.replace("%spawn%", "<font color=FF0000>null</font>"); html.replace("%loc2d%", "<font color=FF0000>--</font>"); html.replace("%loc3d%", "<font color=FF0000>--</font>"); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java index 788e40f232647d7c0a28a823bf884c7706c6ff31..8967c428d15c7b7ce5f2fe181dff43c87e255912 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminZone.java @@ -31,6 +31,7 @@ import com.l2jserver.gameserver.model.TeleportWhereType; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.zone.L2ZoneType; import com.l2jserver.gameserver.model.zone.ZoneId; +import com.l2jserver.gameserver.model.zone.type.NpcSpawnTerritory; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.util.StringUtil; @@ -90,6 +91,10 @@ public class AdminZone implements IAdminCommandHandler { zone.visualizeZone(activeChar.getZ()); } + for (NpcSpawnTerritory territory : ZoneManager.getInstance().getSpawnTerritories(activeChar)) + { + territory.visualizeZone(activeChar.getZ()); + } showHtml(activeChar); } else @@ -148,6 +153,10 @@ public class AdminZone implements IAdminCommandHandler StringUtil.append(zones, " "); } } + for (NpcSpawnTerritory territory : ZoneManager.getInstance().getSpawnTerritories(activeChar)) + { + StringUtil.append(zones, territory.getName() + "<br1>"); + } adminReply.replace("%ZLIST%", zones.toString()); activeChar.sendPacket(adminReply); } diff --git a/L2J_DataPack_BETA/dist/game/data/spawnlist/test.xml b/L2J_DataPack_BETA/dist/game/data/spawnlist/test.xml new file mode 100644 index 0000000000000000000000000000000000000000..79e10fb09a693f3e8f7cb1bee4c977093c853cc6 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/spawnlist/test.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/spawnlist.xsd"> + <spawn zone="spawn_zone_test_01"> + <npc id="20550" count="3" respawnDelay="15" respawnRandom="5" /> + </spawn> +</list> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/xsd/spawnlist.xsd b/L2J_DataPack_BETA/dist/game/data/xsd/spawnlist.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d67593b98065a3060bd3f2bdcf7be00bf6a7d678 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/xsd/spawnlist.xsd @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="list"> + <xs:complexType> + <xs:sequence maxOccurs="1" minOccurs="1"> + <xs:element name="spawn" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence minOccurs="1" maxOccurs="unbounded"> + <xs:element name="npc" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute name="id" type="xs:positiveInteger" use="required" /> + <xs:attribute name="x" type="xs:integer" use="optional" /> + <xs:attribute name="y" type="xs:integer" use="optional" /> + <xs:attribute name="z" type="xs:integer" use="optional" /> + <xs:attribute name="heading" type="xs:integer" use="optional" /> + <xs:attribute name="count" type="xs:positiveInteger" use="optional" /> + <xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" /> + <xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" /> + <xs:attribute name="periodOfDay" use="optional"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="day" /> + <xs:enumeration value="night" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute type="xs:string" name="zone" use="optional"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/xsd/zones.xsd b/L2J_DataPack_BETA/dist/game/data/xsd/zones.xsd index 1fd7543083fc455b9ff4aa4593fe22410c37d1df..c3ebacf65074a70787c56a7eba1e890ae77e3a0a 100644 --- a/L2J_DataPack_BETA/dist/game/data/xsd/zones.xsd +++ b/L2J_DataPack_BETA/dist/game/data/xsd/zones.xsd @@ -132,6 +132,7 @@ <xs:enumeration value="NoRestartZone" /> <xs:enumeration value="NoStoreZone" /> <xs:enumeration value="NoSummonFriendZone" /> + <xs:enumeration value="NpcSpawnTerritory" /> <xs:enumeration value="OlympiadStadiumZone" /> <xs:enumeration value="PeaceZone" /> <xs:enumeration value="ResidenceHallTeleportZone" /> diff --git a/L2J_DataPack_BETA/dist/game/data/zones/npcSpawnTerritories/npc_spawn_zone_test.xml b/L2J_DataPack_BETA/dist/game/data/zones/npcSpawnTerritories/npc_spawn_zone_test.xml new file mode 100644 index 0000000000000000000000000000000000000000..d9af836bee3f96efd524d463457c0c20f5b8e8b7 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/zones/npcSpawnTerritories/npc_spawn_zone_test.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/zones.xsd"> + <zone name="spawn_zone_test_01" type="NpcSpawnTerritory" shape="Cuboid" minZ="-3734" maxZ="-3689"> + <node X="75552" Y="142899" /> + <node X="76887" Y="144333" /> + </zone> +</list> \ No newline at end of file