All pastes #743249 Raw Edit

Something

public text v1 · immutable
·published 2007-10-20 08:10 UTC
rendered paste body
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java	(revision 1240)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java	(working copy)
@@ -123,8 +123,6 @@
     private int _castleIndex = -2;
     
     public boolean isEventMob = false;
-    private boolean _isInTown = false;
-
     private int _isSpoiledBy = 0;
 
     protected RandomAnimationTask _rAniTask = null;
@@ -810,21 +808,17 @@
 			if (_castleIndex < 0)
 			{
 				_castleIndex = CastleManager.getInstance().findNearestCastleIndex(this);
+			} else
+			{
 			}
-			else _isInTown = true; // Npc was spawned in town
 		}
 
 		if (_castleIndex < 0) return null;
 
 		return CastleManager.getInstance().getCastles().get(_castleIndex);
     }
+
     
-    public final boolean getIsInTown()
-    {
-        if (_castleIndex < 0) getCastle();
-        return _isInTown;
-    }
-    
     /**
      * Open a quest or chat window on client with the text of the L2NpcInstance in function of the command.<BR><BR>
      * 
@@ -857,38 +851,34 @@
             }
             else if (command.equalsIgnoreCase("TerritoryStatus"))
             {
-                NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-                html.setFile("data/html/territorystatus.htm");
-                html.replace("%objectId%", String.valueOf(getObjectId()));
-                html.replace("%npcname%", getName());
-                
-                if (getIsInTown())
-                {
-                    html.replace("%castlename%", getCastle().getName());
-                    html.replace("%taxpercent%", "" + getCastle().getTaxPercent());
-                    
-                    if (getCastle().getOwnerId() > 0)
-                    {
-                        L2Clan clan = ClanTable.getInstance().getClan(getCastle().getOwnerId());
-                        html.replace("%clanname%", clan.getName());
-                        html.replace("%clanleadername%", clan.getLeaderName());
-                    }
-                    else
-                    {
-                        html.replace("%clanname%", "NPC");
-                        html.replace("%clanleadername%", "NPC");
-                    }
-                }
-                else
-                {
-                    html.replace("%castlename%", "Open");
-                    html.replace("%taxpercent%", "0");
-                    
-                    html.replace("%clanname%", "No");
-                    html.replace("%clanleadername%", getName());
-                }
-                
-                player.sendPacket(html);
+            	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+            	{
+            		if (getCastle().getOwnerId() > 0)
+            		{
+            			html.setFile("data/html/territorystatus.htm");
+            			L2Clan clan = ClanTable.getInstance().getClan(getCastle().getOwnerId());
+            			html.replace("%clanname%", clan.getName());
+            			html.replace("%clanleadername%", clan.getLeaderName());
+            		}
+            		else
+            		{
+            			html.setFile("data/html/territorynoclan.htm");
+            		}
+            	}
+            	html.replace("%castlename%", getCastle().getName());
+            	html.replace("%taxpercent%", "" + getCastle().getTaxPercent());
+            	html.replace("%objectId%", String.valueOf(getObjectId()));
+            	{
+            		if (getCastle().getCastleId() > 6)
+            		{
+            			html.replace("%territory%", "The Kingdom of Elmore");
+            		}
+            		else
+            		{
+            			html.replace("%territory%", "The Kingdom of Aden");
+            		}
+            	}
+            	player.sendPacket(html);
             }
             else if (command.startsWith("Quest"))
             {