Jump to content

Recommended Posts

Posted (edited)

Good afternoon to all of Maxcheaters, I come here to post you the original Statuet Monument, it was removed from L2JDX and do not know who is the credits, make good avail.

 

 

 

Index: config/functions/l2jfrozen.properties
===================================================================
--- config/functions/l2jfrozen.properties	(revisão 1118)
+++ config/functions/l2jfrozen.properties	(cópia de trabalho)
@@ -281,4 +281,22 @@
 ProtectorSkillLevel = 13
 ProtectorSkillTime = 600
 # Npc Protector Message
-ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
\ No newline at end of file
+ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
+
+
+# -----------------------------------------
+# Monument NPC By TOP PvP and PK  -
+# -----------------------------------------
+#Event created
+#Evento monument statuet ativo
+EnableMonumentStatuetEvent = false
+
+#Data para a troca da estatua
+#Default: 12:00
+RateRefreshStatuet = 06:15
+
+#NOTE: Npc id deve estar presente em npc_to_pc_polymorph
+#Npc que para PVP
+TemplatePVP = 77559
+#Npc para PK
+TemplatePK = 77558
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java	(revisão 1118)
+++ head-src/com/l2jfrozen/Config.java	(cópia de trabalho)
@@ -2427,6 +2427,10 @@
 	public static String FARM2_CUSTOM_MESSAGE;
 	public static String PVP1_CUSTOM_MESSAGE;
 	public static String PVP2_CUSTOM_MESSAGE;
+	public static boolean EVENT_MONUMENT_STATUET;
+	public static String RATE_HOUR_STATUET_REFRESH;
+	public static int NPC_TEMPLATE_ID_PK;
+	public static int NPC_TEMPLATE_ID_PVP;
 	
 	// ============================================================
 	public static void loadL2JFrozenConfig()
@@ -2445,6 +2449,11 @@
 			SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(L2JFrozenSettings.getProperty("SaveGmSpawnOnCustom", "True"));
 			DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(L2JFrozenSettings.getProperty("DeleteGmSpawnOnCustom", "True"));
 			
+		    EVENT_MONUMENT_STATUET = Boolean.parseBoolean(L2JFrozenSettings.getProperty("EnableMonumentStatuetEvent", "false"));
+		    RATE_HOUR_STATUET_REFRESH = L2JFrozenSettings.getProperty("RateRefreshStatuet", "12:00");
+		    NPC_TEMPLATE_ID_PVP = Integer.parseInt(L2JFrozenSettings.getProperty("TemplatePVP", "77558"));
+		    NPC_TEMPLATE_ID_PK = Integer.parseInt(L2JFrozenSettings.getProperty("TemplatePK", "77559"));
+			
 			ONLINE_PLAYERS_ON_LOGIN = Boolean.valueOf(L2JFrozenSettings.getProperty("OnlineOnLogin", "False"));
 			SHOW_SERVER_VERSION = Boolean.valueOf(L2JFrozenSettings.getProperty("ShowServerVersion", "False"));
 			
Index: head-src/com/l2jfrozen/gameserver/GameServer.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/GameServer.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/GameServer.java	(cópia de trabalho)
@@ -131,6 +131,7 @@
 import com.l2jfrozen.gameserver.model.entity.siege.clanhalls.FortressOfResistance;
 import com.l2jfrozen.gameserver.model.multisell.L2Multisell;
 import com.l2jfrozen.gameserver.model.spawn.AutoSpawn;
+import com.l2jfrozen.gameserver.monumentstatuet.EventMonumentStatuet;
 import com.l2jfrozen.gameserver.network.L2GameClient;
 import com.l2jfrozen.gameserver.network.L2GamePacketHandler;
 import com.l2jfrozen.gameserver.powerpak.PowerPak;
@@ -574,6 +575,14 @@
 		else
 			LOGGER.info("All events are Disabled.");
 		
+	    if (Config.EVENT_MONUMENT_STATUET)
+	    {
+	      Util.printSection("Monument Statuet Event");
+	      EventMonumentStatuet.getInstance().load();
+	      EventMonumentStatuet.getInstance().ConfiguratePereiod();
+	      EventMonumentStatuet.getInstance().spawnStatuets();
+	    }
+		
 		if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
 			OfflineTradeTable.restoreOfflineTraders();
 		
Index: head-src/com/l2jfrozen/gameserver/managers/CustomNpcInstanceManager.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/managers/CustomNpcInstanceManager.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/managers/CustomNpcInstanceManager.java	(cópia de trabalho)
@@ -1,322 +1,247 @@
+/*
+ * L2jFrozen Project - www.l2jfrozen.com 
+ * 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.managers;
+ 
+import com.l2jfrozen.Config;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.DatabaseUtils;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+import com.l2jfrozen.util.random.Rnd;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import javolution.util.FastMap;
+import org.apache.log4j.Logger;
+ 
+import com.l2jfrozen.Config;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.DatabaseUtils;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * control for Custom Npcs that look like players.
+ * @version 1.00
+ * @author Darki699
+ */
+ public final class CustomNpcInstanceManager
+ {
+  private static final Logger LOGGER = Logger.getLogger(CustomNpcInstanceManager.class);
+  private static CustomNpcInstanceManager _instance;
+  private FastMap<Integer, customInfo> spawns;
+  private FastMap<Integer, customInfo> templates;
+  
+  public final class customInfo
+  {
+    public String[] stringData = new String[2];
+    public int[] integerData = new int[27];
+    public boolean[] booleanData = new boolean[8];
+    
+    public customInfo() {}
+  }
+  
+  CustomNpcInstanceManager()
+  {
+    load();
+  }
+  
+  public static final CustomNpcInstanceManager getInstance()
+  {
+    if (_instance == null) {
+      _instance = new CustomNpcInstanceManager();
+    }
+    return _instance;
+  }
+  
+  public final void reload()
+  {
+    if (spawns != null) {
+      spawns.clear();
+    }
+    if (templates != null) {
+      templates.clear();
+    }
+    spawns = null;
+    templates = null;
+    
+    load();
+  }
+  
+  private final void load()
+  {
+    if ((spawns == null) || (templates == null))
+    {
+      spawns = new FastMap();
+      templates = new FastMap();
+    }
+    String[] SQL_ITEM_SELECTS = { "SELECT spawn,template,name,title,class_id,female,hair_style,hair_color,face,name_color,title_color, noble,hero,pvp,karma,wpn_enchant,right_hand,left_hand,gloves,chest,legs,feet,hair,hair2, pledge,cw_level,clan_id,ally_id,clan_crest,ally_crest,rnd_class,rnd_appearance,rnd_weapon,rnd_armor,max_rnd_enchant FROM npc_to_pc_polymorph" };
+    
+
+
+
+    Connection con = null;
+    try
+    {
+      int count = 0;
+      con = L2DatabaseFactory.getInstance().getConnection(false);
+      for (String selectQuery : SQL_ITEM_SELECTS)
+      {
+        PreparedStatement statement = con.prepareStatement(selectQuery);
+        ResultSet rset = statement.executeQuery();
+        while (rset.next())
+        {
+          count++;
+          customInfo ci = new customInfo();
+          ci.integerData[26] = rset.getInt("spawn");
+          ci.integerData[25] = rset.getInt("template");
+          try
+          {
+            ci.stringData[0] = rset.getString("name");
+            ci.stringData[1] = rset.getString("title");
+            ci.integerData[7] = rset.getInt("class_id");
+            
+            int PcSex = rset.getInt("female");
+            switch (PcSex)
+            {
+            case 0: 
+              ci.booleanData[3] = false;
+              break;
+            case 1: 
+              ci.booleanData[3] = true;
+              break;
+            default: 
+				ci.booleanData[3] = Rnd.get(100) > 50 ? true : false;
+            }
+            ci.integerData[19] = rset.getInt("hair_style");
+            ci.integerData[20] = rset.getInt("hair_color");
+            ci.integerData[21] = rset.getInt("face");
+            ci.integerData[22] = rset.getInt("name_color");
+            ci.integerData[23] = rset.getInt("title_color");
+            ci.booleanData[1] = rset.getInt("noble") > 0 ? true : false;
+            ci.booleanData[2] = rset.getInt("hero") > 0 ? true : false;
+            ci.booleanData[0] = rset.getInt("pvp") > 0 ? true : false;
+            ci.integerData[1] = rset.getInt("karma");
+            ci.integerData[8] = rset.getInt("wpn_enchant");
+            ci.integerData[11] = rset.getInt("right_hand");
+            ci.integerData[12] = rset.getInt("left_hand");
+            ci.integerData[13] = rset.getInt("gloves");
+            ci.integerData[14] = rset.getInt("chest");
+            ci.integerData[15] = rset.getInt("legs");
+            ci.integerData[16] = rset.getInt("feet");
+            ci.integerData[17] = rset.getInt("hair");
+            ci.integerData[18] = rset.getInt("hair2");
+            ci.integerData[9] = rset.getInt("pledge");
+            ci.integerData[10] = rset.getInt("cw_level");
+            ci.integerData[2] = rset.getInt("clan_id");
+            ci.integerData[3] = rset.getInt("ally_id");
+            ci.integerData[4] = rset.getInt("clan_crest");
+            ci.integerData[5] = rset.getInt("ally_crest");
+            ci.booleanData[4] = rset.getInt("rnd_class") > 0 ? true : false;
+            ci.booleanData[5] = rset.getInt("rnd_appearance") > 0 ? true : false;
+            ci.booleanData[6] = rset.getInt("rnd_weapon") > 0 ? true : false;
+            ci.booleanData[7] = rset.getInt("rnd_armor") > 0 ? true : false;
+            ci.integerData[24] = rset.getInt("max_rnd_enchant");
+            if ((ci.integerData[25] != 0) && (!templates.containsKey(Integer.valueOf(ci.integerData[25])))) {
+              templates.put(Integer.valueOf(ci.integerData[25]), ci);
+            }
+            if ((ci.integerData[25] == 0) && (!spawns.containsKey(Integer.valueOf(ci.integerData[26])))) {
+              spawns.put(Integer.valueOf(ci.integerData[26]), ci);
+            }
+          }
+          catch (Throwable t)
+          {
+            if (Config.ENABLE_ALL_EXCEPTIONS) {
+              t.printStackTrace();
+            }
+            LOGGER.warn("Failed to load Npc Morph data for Object Id: " + ci.integerData[26] + " template: " + ci.integerData[25]);
+          }
+          ci = null;
+        }
+        DatabaseUtils.close(statement);
+        statement = null;
+        DatabaseUtils.close(rset);
+        rset = null;
+      }
+      LOGGER.info("CustomNpcInstanceManager: loaded " + count + " NPC to PC polymorphs.");
+    }
+    catch (Exception e)
+    {
+      if (Config.ENABLE_ALL_EXCEPTIONS) {
+        e.printStackTrace();
+      }
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+  
+  public final boolean isThisL2CustomNpcInstance(int spwnId, int npcId)
+  {
+    if ((spwnId == 0) || (npcId == 0)) {
+      return false;
+    }
+    if (spawns.containsKey(Integer.valueOf(spwnId))) {
+      return true;
+    }
+    if (templates.containsKey(Integer.valueOf(npcId))) {
+      return true;
+    }
+    return false;
+  }
+  
+  public final customInfo getCustomData(int spwnId, int npcId)
+  {
+    if ((spwnId == 0) || (npcId == 0)) {
+      return null;
+    }
+    for (customInfo ci : spawns.values()) {
+      if ((ci != null) && (ci.integerData[26] == spwnId)) {
+        return ci;
+      }
+    }
+    for (customInfo ci : templates.values()) {
+      if ((ci != null) && (ci.integerData[25] == npcId)) {
+        return ci;
+      }
+    }
+    return null;
+  }
+  
+  public final FastMap<Integer, customInfo> getAllTemplates()
+  {
+    return templates;
+  }
+  
+  public final FastMap<Integer, customInfo> getAllSpawns()
+  {
+    return spawns;
+  }
+  
+  public final void updateRemoveInDB(customInfo ciToRemove) {}
+  
+  public final void AddInDB(customInfo ciToAdd)
+  {
+    String Query = "REPLACE INTO npc_to_pc_polymorph VALUES spawn,template,name,title,class_id,female,hair_style,hair_color,face,name_color,title_color, noble,hero,pvp,karma,wpn_enchant,right_hand,left_hand,gloves,chest,legs,feet,hair,hair2, pledge,cw_level,clan_id,ally_id,clan_crest,ally_crest,rnd_class,rnd_appearance,rnd_weapon,rnd_armor,max_rnd_enchant FROM npc_to_pc_polymorph";
+    
+    Connection con = null;
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection(false);
+      PreparedStatement statement = con.prepareStatement(Query);
+      ResultSet rset = statement.executeQuery();
+      
+      DatabaseUtils.close(statement);
+      statement = null;
+      while (rset.next())
+      {
+        customInfo ci = new customInfo();
+        ci.integerData[26] = rset.getInt("spawn");
+        ci.integerData[25] = rset.getInt("template");
+      }
+      DatabaseUtils.close(rset);
+      rset = null;
+      Query = null;
+    }
+    catch (Throwable t)
+    {
+      if (Config.ENABLE_ALL_EXCEPTIONS) {
+        t.printStackTrace();
+      }
+      LOGGER.warn("Could not add Npc Morph info into the DB: ");
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2CustomNpcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2CustomNpcInstance.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2CustomNpcInstance.java	(cópia de trabalho)
@@ -1,527 +1,347 @@
+/*
+ * L2jFrozen Project - www.l2jfrozen.com 
+ * 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.model.actor.instance;
+
+import com.l2jfrozen.gameserver.managers.CustomNpcInstanceManager;
+import com.l2jfrozen.gameserver.managers.CustomNpcInstanceManager.customInfo;
+import com.l2jfrozen.gameserver.model.base.ClassId;
+import com.l2jfrozen.gameserver.model.base.Race;
+import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
+import com.l2jfrozen.gameserver.templates.L2WeaponType;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * This class manages Npc Polymorph into player instances, they look like regular players. This effect will show up on all clients.
+ * @author Darki699
+ */
+ public final class L2CustomNpcInstance
+ {
+  private boolean _allowRandomWeapons = true;
+  private boolean _allowRandomClass = true;
+  private boolean _allowRandomAppearance = true;
+  private String _name;
+  private String _title;
+  private int[] _int;
+  private boolean[] _boolean;
+  private L2NpcInstance _NpcInstance;
+  private ClassId _classId;
+  
+  public L2CustomNpcInstance(L2NpcInstance myNpc)
+  {
+    _NpcInstance = myNpc;
+    if (_NpcInstance == null) {
+      return;
+    }
+    if (_NpcInstance.getSpawn() == null) {
+      return;
+    }
+    initialize();
+  }
+  
+  private final void initialize()
+  {
+    _int = new int[25];
+    
+
+
+
+
+
+    _boolean = new boolean[4];
+    
+
+
+    CustomNpcInstanceManager.customInfo ci = CustomNpcInstanceManager.getInstance().getCustomData(_NpcInstance.getSpawn().getId(), _NpcInstance.getNpcId());
+    if (ci == null)
+    {
+      _NpcInstance.setCustomNpcInstance(null);
+      _NpcInstance = null;
+      return;
+    }
+    _NpcInstance.setCustomNpcInstance(this);
+    
+    setPcInstanceData(ci);
+    if (_allowRandomClass) {
+      chooseRandomClass();
+    }
+    if (_allowRandomAppearance) {
+      chooseRandomAppearance();
+    }
+    if (_allowRandomWeapons) {
+      chooseRandomWeapon();
+    }
+    ci = null;
+  }
+  
+  public final String getName()
+  {
+    return _name == null ? _NpcInstance.getName() : _name;
+  }
+  
+  public final String getTitle()
+  {
+    return _NpcInstance.isChampion() ? "The Champion" + _title : _title == null ? _NpcInstance.getTitle() : _title;
+  }
+  
+  public final int getKarma()
+  {
+    return _int[1] > 0 ? _int[1] : _NpcInstance.getAggroRange();
+  }
+  
+  public final int getClanId()
+  {
+    return _int[2];
+  }
+  
+  public final int getAllyId()
+  {
+    return _int[3];
+  }
+  
+  public final int getClanCrestId()
+  {
+    return _int[4];
+  }
+  
+  public final int getAllyCrestId()
+  {
+    return _int[5];
+  }
+  
+  public final int getRace()
+  {
+    return _int[6];
+  }
+  
+  public final int getClassId()
+  {
+    return _int[7];
+  }
+  
+  public final int getEnchantWeapon()
+  {
+    return _int[8] > 127 ? 127 : (PAPERDOLL_RHAND() == 0) || (getCursedWeaponLevel() != 0) ? 0 : _int[8];
+  }
+  
+  public final int getPledgeClass()
+  {
+    return _NpcInstance.isChampion() ? 8 : _int[9];
+  }
+  
+  public final int getCursedWeaponLevel()
+  {
+    return (PAPERDOLL_RHAND() == 0) || (_int[8] > 0) ? 0 : _int[10];
+  }
+  
+  public final int PAPERDOLL_RHAND()
+  {
+    return _int[11] != 0 ? _int[11] : _NpcInstance.getRightHandItem();
+  }
+  
+  public final int PAPERDOLL_LHAND()
+  {
+    return _int[12] == 0 ? _NpcInstance.getLeftHandItem() : _int[12] > 0 ? _int[12] : 0;
+  }
+  
+  public final int PAPERDOLL_GLOVES()
+  {
+    return _int[13];
+  }
+  
+  public final int PAPERDOLL_CHEST()
+  {
+    return _int[14];
+  }
+  
+  public final int PAPERDOLL_LEGS()
+  {
+    return _int[15];
+  }
+  
+  public final int PAPERDOLL_FEET()
+  {
+    return _int[16];
+  }
+  
+  public final int PAPERDOLL_HAIR()
+  {
+    return _int[17];
+  }
+  
+  public final int PAPERDOLL_HAIR2()
+  {
+    return _int[18];
+  }
+  
+  public final int getHairStyle()
+  {
+    return _int[19];
+  }
+  
+  public final int getHairColor()
+  {
+    return _int[20];
+  }
+  
+  public final int getFace()
+  {
+    return _int[21];
+  }
+  
+  public final int nameColor()
+  {
+    return _int[22] == 0 ? 16777215 : _int[22];
+  }
+  
+  public final int titleColor()
+  {
+    return _int[23] == 0 ? 16777079 : _int[23];
+  }
+  
+  public final boolean getPvpFlag()
+  {
+    return _boolean[0];
+  }
+  
+  public final int getHeading()
+  {
+    return _NpcInstance.getHeading();
+  }
+  
+  public final boolean isNoble()
+  {
+    return _boolean[1];
+  }
+  
+  public final boolean isHero()
+  {
+    return _boolean[2];
+  }
+  
+  public final boolean isFemaleSex()
+  {
+    return _boolean[3];
+  }
+  
+  private final void chooseRandomWeapon()
+  {
+    L2WeaponType wpnType = null;
+    
+    wpnType = Rnd.get(100) > 40 ? L2WeaponType.BOW : L2WeaponType.BOW;
+    
+    wpnType = L2WeaponType.BOW;
+    do
+    {
+      wpnType = L2WeaponType.values()[Rnd.get(L2WeaponType.values().length)];
+    } while ((wpnType == null) || 
+    
+
+
+      (wpnType == L2WeaponType.BOW) || (wpnType == L2WeaponType.BOW));
+    if ((_classId.getRace() == Race.human) || 
+    
+
+
+
+
+      (Rnd.get(100) < 10)) {}
+  }
+  
+  private final void chooseRandomClass()
+  {
+    for (;;)
+    {
+      _classId = ClassId.values()[Rnd.get(ClassId.values().length)];
+      if ((_classId != null) && 
+      
+
+
+        (_classId.getRace() != null) && (_classId.getParent() != null)) {
+        break;
+      }
+    }
+    _int[6] = _classId.getRace().ordinal();
+    _int[7] = _classId.getId();
+  }
+  
+  private final void chooseRandomAppearance()
+  {
+	  _boolean[1] = Rnd.get(100) < 15 ? true : false;
+	  _boolean[3] = Rnd.get(100) < 50 ? true : false;
+	  _int[22] = (_int[23] = 0);
+	  if (Rnd.get(100) < 5) {
+		  _int[22] = 255;
+	  } 
+	  else if (Rnd.get(100) < 5)
+	  {
+		  _int[22] = 65280;
+	  }
+	  if (Rnd.get(100) < 5) {
+		  _int[23] = 255;
+	  }
+	  else if (Rnd.get(100) < 5)
+	  {
+		  _int[23] = 65280;
+	  }
+	  _int[1] = (Rnd.get(100) > 10 ? 50 : Rnd.get(100) > 95 ? 0 : 1000);
+	  _int[19] = (Rnd.get(100) < 34 ? 1 : Rnd.get(100) < 34 ? 0 : 2);
+	  _int[20] = (Rnd.get(100) < 34 ? 1 : Rnd.get(100) < 34 ? 0 : 2);
+	  _int[21] = (Rnd.get(100) < 34 ? 1 : Rnd.get(100) < 34 ? 0 : 2);
+    
+    int pledgeLevel = Rnd.get(100);
+    if (pledgeLevel > 30) {
+      _int[9] = 1;
+    }
+    if (pledgeLevel > 50) {
+      _int[9] = 2;
+    }
+    if (pledgeLevel > 60) {
+      _int[9] = 3;
+    }
+    if (pledgeLevel > 80) {
+      _int[9] = 4;
+    }
+    if (pledgeLevel > 90) {
+      _int[9] = 5;
+    }
+    if (pledgeLevel > 95) {
+      _int[9] = 6;
+    }
+    if (pledgeLevel > 98) {
+      _int[9] = 7;
+    }
+  }
+  
+  public void setPcInstanceData(CustomNpcInstanceManager.customInfo ci)
+  {
+    if (ci == null) {
+      return;
+    }
+    for (int i = 0; i < 25; i++) {
+      _int[i] = ci.integerData[i];
+    }
+    for (int i = 0; i < 4; i++) {
+      _boolean[i] = ci.booleanData[i];
+    }
+    _allowRandomClass = ci.booleanData[4];
+    _allowRandomAppearance = ci.booleanData[5];
+    _allowRandomWeapons = ci.booleanData[6];
+    
+
+    _name = ci.stringData[0];
+    _title = ci.stringData[1];
+    if ((_name != null) && (_name.equals(""))) {
+      _name = null;
+    }
+    if ((_title != null) && (_title.equals(""))) {
+      _title = null;
+    }
+    ClassId[] ids = ClassId.values();
+    if (ids != null) {
+      for (ClassId id : ids) {
+        if (id != null) {
+          if (id.getId() == _int[7])
+          {
+            _classId = id;
+            _int[6] = id.getRace().ordinal();
+            break;
+          }
+        }
+      }
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java	(cópia de trabalho)
@@ -76,6 +76,7 @@
 import com.l2jfrozen.gameserver.model.scripts.L2RBManager;
 import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
 import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
+import com.l2jfrozen.gameserver.monumentstatuet.EventMonumentStatuet;
 import com.l2jfrozen.gameserver.network.L2GameClient;
 import com.l2jfrozen.gameserver.network.SystemMessageId;
 import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
@@ -116,6 +117,10 @@
 	
 	/** The interaction distance of the L2NpcInstance(is used as offset in MovetoLocation method). */
 	public static final int INTERACTION_DISTANCE = 150;
+
+	public boolean Monument_Npc_PVP = false;
+
+	public boolean Monument_Npc_PK = false;
 	
 	/** The Polymorph object that manage this L2NpcInstance's morph to a PcInstance... I wrote this line too =P Darki699 */
 	private L2CustomNpcInstance _customNpcInstance;
@@ -870,6 +875,14 @@
 					{
 						VIP.showEndHTML(player, String.valueOf(getObjectId()));
 					}
+			        else if (Monument_Npc_PK)
+			        {
+			            EventMonumentStatuet.getInstance().htmlPKnpc(player);
+			        }
+			        else if (Monument_Npc_PVP)
+			        {
+			            EventMonumentStatuet.getInstance().htmlPVPnpc(player);
+			        }
 					else
 					{
 						// Open a chat window on client with the text of the L2NpcInstance
Index: head-src/com/l2jfrozen/gameserver/monumentstatuet/EventMonumentStatuet.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/monumentstatuet/EventMonumentStatuet.java	(revisão 0)
+++ head-src/com/l2jfrozen/gameserver/monumentstatuet/EventMonumentStatuet.java	(cópia de trabalho)
@@ -0,0 +1,594 @@
+package com.l2jfrozen.gameserver.monumentstatuet;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Calendar;
+import java.util.Map;
+
+import javolution.util.FastMap;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
+import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+import com.l2jfrozen.gameserver.datatables.sql.SpawnTable;
+import com.l2jfrozen.gameserver.managers.CustomNpcInstanceManager;
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
+import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
+import com.l2jfrozen.gameserver.templates.L2Item;
+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+
+public class EventMonumentStatuet
+{
+  public static EventMonumentStatuet _instance;
+  public static L2Spawn PK_SPAWN;
+  public static L2Spawn PVP_SPAWN;
+  public boolean inPeriodOk = true;
+  private Map<Integer, int[]> startup_players;
+  private PreparedStatement statement;
+  
+  public EventMonumentStatuet()
+  {
+    startup_players = new FastMap();
+  }
+  
+  public static EventMonumentStatuet getInstance()
+  {
+    if (_instance == null) {
+      _instance = new EventMonumentStatuet();
+    }
+    return _instance;
+  }
+  
+  public void htmlPKnpc(L2PcInstance pl) {}
+  
+  public void htmlPVPnpc(L2PcInstance pl) {}
+  
+  public void spawnStatuets()
+  {
+    spawnNpcPVP();
+    spawnNpcPK();
+  }
+  
+  private static void spawnNpcPVP()
+  {
+    L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.NPC_TEMPLATE_ID_PVP);
+    try
+    {
+      PVP_SPAWN = new L2Spawn(tmpl);
+      PVP_SPAWN.setLocx(83215);
+      PVP_SPAWN.setLocy(148393);
+      PVP_SPAWN.setLocz(-3373);
+      PVP_SPAWN.setAmount(1);
+      PVP_SPAWN.setRespawnDelay(1);
+      SpawnTable.getInstance().addNewSpawn(PVP_SPAWN, false);
+      PVP_SPAWN.init();
+      PVP_SPAWN.getLastSpawn().getStatus().setCurrentHp(999999999.0D);
+      PVP_SPAWN.getLastSpawn().isAggressive();
+      PVP_SPAWN.getLastSpawn().Monument_Npc_PVP = true;
+      PVP_SPAWN.getLastSpawn().decayMe();
+      PVP_SPAWN.getLastSpawn().spawnMe(PVP_SPAWN.getLastSpawn().getX(), PVP_SPAWN.getLastSpawn().getY(), PVP_SPAWN.getLastSpawn().getZ());
+      
+      PVP_SPAWN.getLastSpawn().broadcastPacket(new MagicSkillUser(PVP_SPAWN.getLastSpawn(), PVP_SPAWN.getLastSpawn(), 1034, 1, 1, 1));
+      
+      System.out.println("[EventMonumentStatuet]:Statue pvp spawned.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]:Fail to spawn statue pvp.");
+    }
+  }
+  
+  private static void spawnNpcPK()
+  {
+    L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.NPC_TEMPLATE_ID_PK);
+    try
+    {
+      PK_SPAWN = new L2Spawn(tmpl);
+      PK_SPAWN.setLocx(83220);
+      PK_SPAWN.setLocy(147909);
+      PK_SPAWN.setLocz(-3373);
+      PK_SPAWN.setAmount(1);
+      PK_SPAWN.setRespawnDelay(1);
+      SpawnTable.getInstance().addNewSpawn(PK_SPAWN, false);
+      PK_SPAWN.init();
+      PK_SPAWN.getLastSpawn().getStatus().setCurrentHp(999999999.0D);
+      PK_SPAWN.getLastSpawn().isAggressive();
+      PK_SPAWN.getLastSpawn().Monument_Npc_PK = true;
+      PK_SPAWN.getLastSpawn().decayMe();
+      PK_SPAWN.getLastSpawn().spawnMe(PK_SPAWN.getLastSpawn().getX(), PK_SPAWN.getLastSpawn().getY(), PK_SPAWN.getLastSpawn().getZ());
+      
+      PK_SPAWN.getLastSpawn().broadcastPacket(new MagicSkillUser(PK_SPAWN.getLastSpawn(), PK_SPAWN.getLastSpawn(), 1034, 1, 1, 1));
+      
+      System.out.println("[EventMonumentStatuet]:Statue pk spawned.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]:Fail to spawn statue pk.");
+    }
+    finally
+    {
+      tmpl = null;
+    }
+  }
+  
+  public void reloadAllNpc()
+  {
+    unspawnNpcPK();
+    unspawnNpcPVP();
+    
+    PK_SPAWN = null;
+    PVP_SPAWN = null;
+    
+    spawnNpcPK();
+    spawnNpcPVP();
+  }
+  
+  private static void unspawnNpcPK()
+  {
+    if ((PK_SPAWN == null) || (PK_SPAWN.getLastSpawn() == null)) {
+      return;
+    }
+    PK_SPAWN.getLastSpawn().deleteMe();
+    PK_SPAWN.stopRespawn();
+    SpawnTable.getInstance().deleteSpawn(PK_SPAWN, true);
+  }
+  
+  private static void unspawnNpcPVP()
+  {
+    if ((PVP_SPAWN == null) || (PVP_SPAWN.getLastSpawn() == null)) {
+      return;
+    }
+    PVP_SPAWN.getLastSpawn().deleteMe();
+    PVP_SPAWN.stopRespawn();
+    SpawnTable.getInstance().deleteSpawn(PVP_SPAWN, true);
+  }
+  
+  public void onEnterPlayer(L2PcInstance pl)
+  {
+    if ((inPeriodOk) && (startup_players.get(Integer.valueOf(pl.getObjectId())) == null))
+    {
+      int[] stats = { pl.getObjectId(), pl.getPvpKills(), pl.getPkKills() };
+      startup_players.put(Integer.valueOf(pl.getObjectId()), stats);
+      storeInDataInfo(pl);
+    }
+  }
+  
+  public void ConfiguratePereiod()
+  {
+    String hour = Config.RATE_HOUR_STATUET_REFRESH.split(":")[0];
+    String minutes = Config.RATE_HOUR_STATUET_REFRESH.split(":")[1];
+    
+    int h = 0;int m = 0;
+    long timeL = 0L;
+    try
+    {
+      h = Integer.valueOf(hour).intValue();
+      m = Integer.valueOf(minutes).intValue();
+      Calendar currentTime = Calendar.getInstance();
+      Calendar testStartTime = Calendar.getInstance();
+      testStartTime.setLenient(true);
+      
+      testStartTime.set(11, h);
+      testStartTime.set(12, m);
+      testStartTime.set(13, 0);
+      if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis()) {
+        testStartTime.add(5, 1);
+      }
+      timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
+      
+      ThreadPoolManager.getInstance().scheduleGeneral(new refreshStatuet(), timeL);
+      
+      System.out.println("[EventMonumentStatuet]Periodo to refresh statuet: " + testStartTime.getTime());
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]:ConfiguratePereiod()]Fail to load period");
+      e.printStackTrace();
+    }
+  }
+  
+  private void storeInDataInfo(L2PcInstance pl)
+  {
+    Connection con = null;
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement("INSERT INTO monuments_startup (obj_id, pvp, pk) VALUES (?, ? , ?)");
+      statement.setInt(1, pl.getObjectId());
+      statement.setInt(2, pl.getPvpKills());
+      statement.setInt(3, pl.getPkKills());
+      statement.execute();
+      statement.close();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in store!");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+  
+  public void load()
+  {
+    Connection con = null;
+    String SQL = "SELECT obj_id, pvp, pk FROM monuments_startup ORDER BY obj_id";
+    if (startup_players.isEmpty()) {
+      startup_players.clear();
+    }
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement(SQL);
+      
+      ResultSet rs = statement.executeQuery();
+      while (rs.next())
+      {
+        int obj_id = rs.getInt("obj_id");
+        int pvp = rs.getInt("pvp");
+        int pk = rs.getInt("pk");
+        
+        int[] stats = { obj_id, pvp, pk };
+        startup_players.put(Integer.valueOf(obj_id), stats);
+      }
+      statement.close();
+      rs.close();
+      
+      System.out.println("[EventMonumentStatuet]Loaded " + startup_players.size() + " competitors.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in load competitors!");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+  
+  public void StartNewPeriod()
+  {
+    String monuments_startup_del = "TRUNCATE TABLE monuments_startup";
+    
+
+    Connection con = null;
+    statement = null;
+    try
+    {
+      System.out.println("[EventMonumentStatuet]Delete all elements from table monuments_startup.");
+      con = L2DatabaseFactory.getInstance().getConnection();
+      statement = con.prepareStatement(monuments_startup_del);
+      statement.execute();
+      try
+      {
+        statement.close();
+        
+        CloseUtil.close(con);
+        con = null;
+        
+        statement = null;
+        monuments_startup_del = null;
+      }
+      catch (Exception e) {}
+      startup_players.clear();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in delete all elements from table monuments_startup.");
+      e.printStackTrace();
+    }
+    finally
+    {
+      try
+      {
+        statement.close();
+        
+        CloseUtil.close(con);
+        con = null;
+        
+        statement = null;
+        monuments_startup_del = null;
+      }
+      catch (Exception e) {}
+    }
+    System.out.println("[EventMonumentStatuet]Adding all objects online.");
+    int[] stats = new int[3];
+    for (L2PcInstance pl : L2World.getInstance().getAllPlayers())
+    {
+      stats[0] = pl.getObjectId();
+      stats[1] = pl.getPvpKills();
+      stats[2] = pl.getPkKills();
+      
+      startup_players.put(Integer.valueOf(pl.getObjectId()), stats);
+      
+      storeInDataInfo(pl);
+    }
+    System.out.println("[EventMonumentStatuet]Added " + startup_players.size() + " objects online.");
+  }
+  
+  private class refreshStatuet
+    implements Runnable
+  {
+    public refreshStatuet() {}
+    
+    public void run()
+    {
+      EventMonumentStatuet.this.inPeriodOk = false;
+      EventMonumentStatuet.this.CalculateWins();
+      EventMonumentStatuet.this.StartNewPeriod();
+      EventMonumentStatuet.this.inPeriodOk = true;
+    }
+  }
+  
+  public void CalculateWins()
+  {
+    if (startup_players.size() <= 1)
+    {
+      System.out.println("[EventMonumentStatuet]:No participants in event, no statue formed.");
+      return;
+    }
+    Connection con = null;
+    String SQL = "SELECT obj_Id, pvpkills, pkkills FROM characters WHERE";
+    
+    int count = 0;
+    for (int[] a : startup_players.values())
+    {
+      SQL = SQL + (count == 0 ? " obj_Id=" + a[0] : new StringBuilder().append(" or obj_Id=").append(a[0]).toString());
+      
+      count++;
+    }
+    int pvp_maior = 0;int pk_maior = 0;
+    int[] obj_pvp = { 0, 0 };int[] obj_pk = { 0, 0 };
+    System.out.println("[EventMonumentStatuet]:Calculando player wins.");
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement(SQL);
+      
+      ResultSet rs = statement.executeQuery();
+      while (rs.next())
+      {
+        int obj_id = rs.getInt("obj_id");
+        int pvp = rs.getInt("pvpkills");
+        int pk = rs.getInt("pkkills");
+        
+        int[] dados = (int[])startup_players.get(Integer.valueOf(obj_id));
+        
+        int diference_pvp = pvp - dados[1];
+        int diference_pk = pk - dados[2];
+        if (diference_pvp > pvp_maior)
+        {
+          pvp_maior = diference_pvp;
+          obj_pvp[0] = obj_id;
+          obj_pvp[1] = diference_pvp;
+        }
+        if (diference_pk > pk_maior)
+        {
+          pk_maior = diference_pk;
+          obj_pk[0] = obj_id;
+          obj_pk[1] = diference_pk;
+        }
+      }
+      statement.close();
+      rs.close();
+      System.out.println("[EventMonumentStatuet]:Wins a pvp player:" + obj_pvp[0] + " with " + obj_pvp[1] + " differ.");
+      System.out.println("[EventMonumentStatuet]:Wins a pk player:" + obj_pk[0] + " with " + obj_pk[1] + " differ.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in createPvpStatuet!");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+    createStatuet(obj_pvp, obj_pk);
+  }
+  
+  private void createStatuet(int[] dados_pvp, int[] dados_pk)
+  {
+    Connection con = null;
+    
+    Map<Integer, Items> items_mp_pvp = null;
+    Map<Integer, Items> items_mp_pk = null;
+    
+
+
+
+    L2Item item = null;
+    
+    System.out.println("[EventMonumentStatuet]: Creating map items for: " + dados_pvp[0] + " and " + dados_pk[0]);
+    if (dados_pvp[0] != 0)
+    {
+      String SQL = "SELECT item_id, enchant_level FROM items WHERE owner_id=" + dados_pvp[0] + " AND loc='PAPERDOLL'";
+      items_mp_pvp = new FastMap();
+      try
+      {
+        con = L2DatabaseFactory.getInstance().getConnection();
+        PreparedStatement st = con.prepareStatement(SQL);
+        ResultSet rs = st.executeQuery();
+        while (rs.next())
+        {
+          int item_id = rs.getInt("item_id");
+          int enchant_level = rs.getInt("enchant_level");
+          
+          item = ItemTable.getInstance().getTemplate(item_id);
+          if (item != null) {
+            if (item.getType2() == 0) {
+              items_mp_pvp.put(Integer.valueOf(items_mp_pvp.size() + 1), new Weapon(item_id, enchant_level, item.getBodyPart()));
+            } else if (item.getType2() == 2) {
+              items_mp_pvp.put(Integer.valueOf(items_mp_pvp.size() + 1), new Acessory(item_id, item.getBodyPart()));
+            } else if (item.getType2() == 1) {
+              items_mp_pvp.put(Integer.valueOf(items_mp_pvp.size() + 1), new ArmororShield(item_id, item.getBodyPart()));
+            }
+          }
+        }
+        st.close();
+        st = null;
+        rs.close();
+        rs = null;
+        
+        System.out.println("[EventMonumentStatuet]:Map Items pvp created with " + items_mp_pvp.size() + " items.");
+      }
+      catch (Exception e)
+      {
+    	  System.out.println("[EventMonumentStatuet]: Error in createStatuet 1:");
+        e.printStackTrace();
+      }
+      finally
+      {
+        CloseUtil.close(con);
+        con = null;
+      }
+    }
+    if (dados_pk[0] != 0)
+    {
+      items_mp_pk = new FastMap();
+      String SQL = "SELECT item_id, enchant_level FROM items WHERE owner_id=" + dados_pk[0] + " AND loc='PAPERDOLL'";
+      try
+      {
+        con = L2DatabaseFactory.getInstance().getConnection();
+        PreparedStatement st = con.prepareStatement(SQL);
+        ResultSet rs = st.executeQuery();
+        while (rs.next())
+        {
+          int item_id = rs.getInt("item_id");
+          int enchant_level = rs.getInt("enchant_level");
+          
+          item = ItemTable.getInstance().getTemplate(item_id);
+          if (item != null) {
+            if (item.getType2() == 0) {
+              items_mp_pk.put(Integer.valueOf(items_mp_pk.size() + 1), new Weapon(item_id, enchant_level, item.getBodyPart()));
+            } else if (item.getType2() == 2) {
+              items_mp_pk.put(Integer.valueOf(items_mp_pk.size() + 1), new Acessory(item_id, item.getBodyPart()));
+            } else if (item.getType2() == 1) {
+              items_mp_pk.put(Integer.valueOf(items_mp_pk.size() + 1), new ArmororShield(item_id, item.getBodyPart()));
+            }
+          }
+        }
+        st.close();
+        st = null;
+        rs.close();
+        rs = null;
+        
+        System.out.println("[EventMonumentStatuet]:Map Items pk created with " + items_mp_pk.size() + " items.");
+      }
+      catch (Exception e)
+      {
+    	  System.out.println("[EventMonumentStatuet]: Error in createStatuet 2:");
+        e.printStackTrace();
+      }
+      finally
+      {
+        CloseUtil.close(con);
+        con = null;
+      }
+    }
+    if ((items_mp_pvp != null) && (items_mp_pk != null))
+    {
+      System.out.println("[EventMonumentStatuet]:Calling data from the statue new MonumentCreator()");
+      MonumentCreator alpha = new MonumentCreator();
+      if (dados_pvp[0] != 0)
+      {
+        int[] dados_pvp_int = new int[3];
+        dados_pvp_int[0] = dados_pvp[0];
+        dados_pvp_int[1] = 1;
+        dados_pvp_int[2] = dados_pvp[1];
+        
+        alpha.create(dados_pvp_int, items_mp_pvp);
+        
+        alpha = null;
+      }
+      if (dados_pk[0] != 0)
+      {
+        int[] dados_pk_int = new int[3];
+        alpha = new MonumentCreator();
+        dados_pk_int[0] = dados_pk[0];
+        dados_pk_int[1] = 2;
+        dados_pk_int[2] = dados_pk[1];
+        
+        alpha.create(dados_pk_int, items_mp_pk);
+        
+        alpha = null;
+      }
+      CustomNpcInstanceManager.getInstance().reload();
+      
+      reloadAllNpc();
+    }
+  }
+  
+  public class Items
+  {
+    int _item_id;
+    int _slot;
+    
+    public Items(int item_id, int slot)
+    {
+      _item_id = item_id;
+      _slot = slot;
+    }
+    
+    public int getItemId()
+    {
+      return _item_id;
+    }
+    
+    public int getItemSlot()
+    {
+      return _slot;
+    }
+  }
+  
+  public class Weapon
+    extends EventMonumentStatuet.Items
+  {
+    int _enchant;
+    
+    public Weapon(int item_id, int enchant, int slot)
+    {
+      super(item_id, slot);
+      
+      System.out.println("Added weapon slot:" + slot);
+      _enchant = enchant;
+    }
+    
+    public int getItemEnchant()
+    {
+      return _enchant;
+    }
+  }
+  
+  public class ArmororShield
+    extends EventMonumentStatuet.Items
+  {
+    public ArmororShield(int item_id, int slot)
+    {
+      super(item_id, slot);
+    }
+  }
+  
+  public class Acessory
+    extends EventMonumentStatuet.Items
+  {
+    public Acessory(int item_id, int slot)
+    {
+      super(item_id, slot);
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/monumentstatuet/MonumentCreator.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/monumentstatuet/MonumentCreator.java	(revisão 0)
+++ head-src/com/l2jfrozen/gameserver/monumentstatuet/MonumentCreator.java	(cópia de trabalho)
@@ -0,0 +1,170 @@
+package com.l2jfrozen.gameserver.monumentstatuet;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Map;
+import javolution.util.FastMap;
+
+public class MonumentCreator
+{
+  int _right_hand = 0;
+  int _female = 0;
+  int _hair2 = 0;
+  int[] dados = new int[3];
+  int _class_id = 0;
+  int _hair_style = 0;
+  int _hair_color = 0;
+  int _face = 0;
+  int _hero = 0;
+  int _wpn_enchant = 0;
+  int _feet = 0;
+  int _left_hand = 0;
+  int _gloves = 0;
+  int _chest = 0;
+  int _legs = 0;
+  int _hair = 0;
+  String _name;
+  String _title;
+  FastMap<Integer, EventMonumentStatuet.Items> _items;
+  
+  public void create(int[] obj_id, Map<Integer, EventMonumentStatuet.Items> items)
+  {
+    dados = obj_id;
+    
+    _items = ((FastMap)items);
+    
+    load();
+  }
+  
+  private void load()
+  {
+    Connection con = null;
+    String SQL = "SELECT char_name,face,hairStyle,hairColor,sex,classid FROM characters WHERE obj_Id=" + dados[0];
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      PreparedStatement st = con.prepareStatement(SQL);
+      ResultSet rs = st.executeQuery();
+      while (rs.next())
+      {
+        _name = rs.getString("char_name");
+        _face = rs.getInt("face");
+        _hair_style = rs.getInt("hairStyle");
+        _hair_color = rs.getInt("hairColor");
+        _female = rs.getInt("sex");
+        _class_id = rs.getInt("classid");
+      }
+      st.close();
+      rs.close();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[MonumentCreator]: Error in load SQL FROM characters...");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+    System.out.println("[Form Monument]: Load info char ok...");
+    
+    _title = (dados[2] + " pk's in 24h");
+    for (EventMonumentStatuet.Items item : _items.values())
+    {
+      switch (item.getItemSlot())
+      {
+      case 16384: 
+        _left_hand = item.getItemId();
+        _right_hand = item.getItemId();
+        break;
+      case 128: 
+        _right_hand = item.getItemId();
+        break;
+      case 262144: 
+        _hair = item.getItemId();
+        break;
+      case 65536: 
+        _hair2 = item.getItemId();
+        break;
+      case 1024: 
+        _chest = item.getItemId();
+        break;
+      case 512: 
+        _gloves = item.getItemId();
+        break;
+      case 4096: 
+        _feet = item.getItemId();
+        break;
+      case 64: 
+        _hair = item.getItemId();
+        break;
+      case 32768: 
+        _chest = item.getItemId();
+        break;
+      case 2048: 
+        _legs = item.getItemId();
+      }
+      if ((item instanceof EventMonumentStatuet.Weapon)) {
+        _wpn_enchant = ((EventMonumentStatuet.Weapon)item).getItemEnchant();
+      }
+    }
+    System.out.println("[Form Monument]: Aparence information OK...");
+    
+    putIntoDb();
+    
+    System.out.println("[Form Monument]: Data Saved...");
+  }
+  
+  public void putIntoDb()
+  {
+    Connection con = null;
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement("UPDATE npc_to_pc_polymorph SET name=?,title=?,class_id=?,female=?,hair_style=?,hair_color=?,face=?,hero=?,wpn_enchant=?,right_hand=?,left_hand=?,gloves=?,chest=?,legs=?,feet=?,hair=?,hair2=? WHERE template=" + (dados[1] == 1 ? Config.NPC_TEMPLATE_ID_PVP : Config.NPC_TEMPLATE_ID_PK));
+      
+
+
+
+
+      statement.setString(1, _name);
+      statement.setString(2, _title);
+      statement.setInt(3, _class_id);
+      statement.setInt(4, _female);
+      statement.setInt(5, _hair_style);
+      statement.setInt(6, _hair_color);
+      statement.setInt(7, _face);
+      statement.setInt(8, _hero);
+      statement.setInt(9, _wpn_enchant);
+      statement.setInt(10, _right_hand);
+      statement.setInt(11, _left_hand);
+      
+      statement.setInt(12, _gloves);
+      statement.setInt(13, _chest);
+      statement.setInt(14, _legs);
+      statement.setInt(15, _feet);
+      
+      statement.setInt(16, _hair);
+      statement.setInt(17, _hair2);
+      
+      statement.execute();
+      statement.close();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[MonumentCreator]: Failt to putIntoDb...");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(cópia de trabalho)
@@ -71,6 +71,7 @@
 import com.l2jfrozen.gameserver.model.entity.siege.Siege;
 import com.l2jfrozen.gameserver.model.quest.Quest;
 import com.l2jfrozen.gameserver.model.quest.QuestState;
+import com.l2jfrozen.gameserver.monumentstatuet.EventMonumentStatuet;
 import com.l2jfrozen.gameserver.network.Disconnection;
 import com.l2jfrozen.gameserver.network.SystemMessageId;
 import com.l2jfrozen.gameserver.network.serverpackets.ClientSetTime;
@@ -417,6 +418,9 @@
 		if (DM._savePlayers.contains(activeChar.getName()))
 			DM.addDisconnectedPlayer(activeChar);
 		
+	    if (Config.EVENT_MONUMENT_STATUET) {
+	        EventMonumentStatuet.getInstance().onEnterPlayer(activeChar);
+	      }
 		// Means that it's not ok multiBox situation, so logout
 		if (!activeChar.checkMultiBox())
 		{
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/CustomNpcInfo.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/CustomNpcInfo.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/CustomNpcInfo.java	(cópia de trabalho)
@@ -1,153 +1,124 @@
+/*
+ * L2jFrozen Project - www.l2jfrozen.com 
+ * 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.network.serverpackets;
+ 
+import com.l2jfrozen.gameserver.datatables.sql.CharTemplateTable;
+import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
+
+ public class CustomNpcInfo extends L2GameServerPacket
+  {
+  private static final String _S__03_CUSTOMNPCINFO = "[S] 03 CustomNpcInfo [dddddsddd dddddddddddd dddddddd hhhh d hhhhhhhhhhhh d hhhh hhhhhhhhhhhhhhhh dddddd dddddddd ffff ddd s ddddd ccccccc h c d c h ddd cc d ccc ddddddddddd]";
+  private final L2NpcInstance _activeChar;
+  
+  public CustomNpcInfo(L2NpcInstance cha)
+  {
+    _activeChar = cha;
+    _activeChar.setClientX(_activeChar.getPosition().getX());
+    _activeChar.setClientY(_activeChar.getPosition().getY());
+    _activeChar.setClientZ(_activeChar.getPosition().getZ());
+  }
+  
+  protected final void writeImpl()
+  {
+    writeC(3);
+    writeD(_activeChar.getX());
+    writeD(_activeChar.getY());
+    writeD(_activeChar.getZ());
+    writeD(_activeChar.getHeading());
+    writeD(_activeChar.getObjectId());
+    writeS(_activeChar.getCustomNpcInstance().getName());
+    writeD(_activeChar.getCustomNpcInstance().getRace());
+    writeD(_activeChar.getCustomNpcInstance().isFemaleSex() ? 1 : 0);
+    writeD(_activeChar.getCustomNpcInstance().getClassId());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR());
+    writeD(0);
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_RHAND());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_LHAND());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_GLOVES());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_CHEST());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_LEGS());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_FEET());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_RHAND());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR2());
+    write('H', 0, 24);
+    writeD(_activeChar.getCustomNpcInstance().getPvpFlag() ? 1 : 0);
+    writeD(_activeChar.getCustomNpcInstance().getKarma());
+    writeD(_activeChar.getMAtkSpd());
+    writeD(_activeChar.getPAtkSpd());
+    writeD(_activeChar.getCustomNpcInstance().getPvpFlag() ? 1 : 0);
+    writeD(_activeChar.getCustomNpcInstance().getKarma());
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed() / 2);
+    writeD(_activeChar.getRunSpeed() / 3);
+    writeD(_activeChar.getRunSpeed() / 3);
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed());
+    writeF(_activeChar.getStat().getMovementSpeedMultiplier());
+    writeF(_activeChar.getStat().getAttackSpeedMultiplier());
+    writeF(CharTemplateTable.getInstance().getTemplate(_activeChar.getCustomNpcInstance().getClassId()).getCollisionRadius());
+    writeF(CharTemplateTable.getInstance().getTemplate(_activeChar.getCustomNpcInstance().getClassId()).getCollisionHeight());
+    writeD(_activeChar.getCustomNpcInstance().getHairStyle());
+    writeD(_activeChar.getCustomNpcInstance().getHairColor());
+    writeD(_activeChar.getCustomNpcInstance().getFace());
+    writeS(_activeChar.getCustomNpcInstance().getTitle());
+    writeD(_activeChar.getCustomNpcInstance().getClanId());
+    writeD(_activeChar.getCustomNpcInstance().getClanCrestId());
+    writeD(_activeChar.getCustomNpcInstance().getAllyId());
+    writeD(_activeChar.getCustomNpcInstance().getAllyCrestId());
+    writeD(0);
+    writeC(1);
+    writeC(_activeChar.isRunning() ? 1 : 0);
+    writeC(_activeChar.isInCombat() ? 1 : 0);
+    writeC(_activeChar.isAlikeDead() ? 1 : 0);
+    write('C', 0, 3);
+    writeH(0);
+    writeC(0);
+    writeD(_activeChar.getAbnormalEffect());
+    writeC(0);
+    writeH(0);
+    writeD(_activeChar.getCustomNpcInstance().getClassId());
+    writeD(_activeChar.getMaxCp());
+    writeD((int)_activeChar.getStatus().getCurrentCp());
+    writeC(_activeChar.getCustomNpcInstance().getEnchantWeapon());
+    writeC(0);
+    writeD(0);
+    writeC(_activeChar.getCustomNpcInstance().isNoble() ? 1 : 0);
+    writeC(_activeChar.getCustomNpcInstance().isHero() ? 1 : 0);
+    writeC(0);
+    write('D', 0, 3);
+    writeD(_activeChar.getCustomNpcInstance().nameColor());
+    writeD(0);
+    writeD(_activeChar.getCustomNpcInstance().getPledgeClass());
+    writeD(0);
+    writeD(_activeChar.getCustomNpcInstance().titleColor());
+    writeD(0);
+  }
+  
+  public String getType()
+  {
+    return "[S] 03 CustomNpcInfo [dddddsddd dddddddddddd dddddddd hhhh d hhhhhhhhhhhh d hhhh hhhhhhhhhhhhhhhh dddddd dddddddd ffff ddd s ddddd ccccccc h c d c h ddd cc d ccc ddddddddddd]";
+  }
+  
+  private final void write(char type, int value, int times)
+  {
+    for (int i = 0; i < times; i++) {
+      switch (type)
+      {
+      case 'C': 
+        writeC(value);
+        break;
+      case 'D': 
+        writeD(value);
+        break;
+      case 'F': 
+        writeF(value);
+        break;
+      case 'H': 
+        writeH(value);
+      }
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfoPoly.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfoPoly.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfoPoly.java	(cópia de trabalho)
+package com.l2jfrozen.gameserver.network.serverpackets;
+
+import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.L2Object;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+
+public class NpcInfoPoly extends L2GameServerPacket
+{
+  private static final String _S__22_NPCINFO = "[S] 16 NpcInfo";
+  private L2Character _activeChar;
+  private final L2Object _obj;
+  private int _x;
+  private int _y;
+  private int _z;
+  private int _heading;
+  private final int _npcId;
+  private boolean _isAttackable;
+  private final boolean _isSummoned;
+  private boolean _isRunning;
+  private boolean _isInCombat;
+  private boolean _isAlikeDead;
+  private int _mAtkSpd;
+  private int _pAtkSpd;
+  private int _runSpd;
+  private int _walkSpd;
+  private int _swimRunSpd;
+  private int _swimWalkSpd;
+  private int _flRunSpd;
+  private int _flWalkSpd;
+  private int _flyRunSpd;
+  private int _flyWalkSpd;
+ private int _rhand;
+  private int _lhand;
+  private String _name;
+  private String _title;
+  private int _abnormalEffect;
+  L2NpcTemplate _template;
+  private final int _collisionRadius;
+  private final int _collisionHeight;
+ 
+  public NpcInfoPoly(L2Object obj, L2Character attacker)
+  {
+    _obj = obj;
+    _npcId = obj.getPoly().getPolyId();
+    _template = NpcTable.getInstance().getTemplate(_npcId);
+    _isAttackable = true;
+    _rhand = 0;
+    _lhand = 0;
+    _isSummoned = false;
+    _collisionRadius = _template.collisionRadius;
+    _collisionHeight = _template.collisionHeight;
+    if ((_obj instanceof L2Character))
+    {
+      _activeChar = ((L2Character)obj);
+      _isAttackable = obj.isAutoAttackable(attacker);
+      _rhand = _template.rhand;
+      _lhand = _template.lhand;
+    }
+    if ((_obj instanceof L2ItemInstance))
+    {
+      _x = _obj.getX();
+      _y = _obj.getY();
+      _z = _obj.getZ();
+      _heading = 0;
+      _mAtkSpd = 100;
+      _pAtkSpd = 100;
+      _runSpd = 120;
+      _walkSpd = 80;
+      _swimRunSpd = (_flRunSpd = _flyRunSpd = _runSpd);
+      _swimWalkSpd = (_flWalkSpd = _flyWalkSpd = _walkSpd);
+      _isRunning = (_isInCombat = _isAlikeDead = false);
+     _name = "item";
+      _title = "polymorphed";
+      _abnormalEffect = 0;
+    }
+    else
+    {
+      _x = _activeChar.getX();
+      _y = _activeChar.getY();
+      _z = _activeChar.getZ();
+      _heading = _activeChar.getHeading();
+      _mAtkSpd = _activeChar.getMAtkSpd();
+      _pAtkSpd = _activeChar.getPAtkSpd();
+      _runSpd = _activeChar.getRunSpeed();
+      _walkSpd = _activeChar.getWalkSpeed();
+      _swimRunSpd = (_flRunSpd = _flyRunSpd = _runSpd);
+      _swimWalkSpd = (_flWalkSpd = _flyWalkSpd = _walkSpd);
+      _isRunning = _activeChar.isRunning();
+      _isInCombat = _activeChar.isInCombat();
+      _isAlikeDead = _activeChar.isAlikeDead();
+      _name = _activeChar.getName();
+      _title = _activeChar.getTitle();
+      _abnormalEffect = _activeChar.getAbnormalEffect();
+    }
+  }
+  
+  protected final void writeImpl()
+  {
+    writeC(22);
+    writeD(_obj.getObjectId());
+    writeD(_npcId + 1000000);
+    writeD(_isAttackable ? 1 : 0);
+    writeD(_x);
+    writeD(_y);
+    writeD(_z);
+    writeD(_heading);
+    writeD(0);
+    writeD(_mAtkSpd);
+    writeD(_pAtkSpd);
+    writeD(_runSpd);
+    writeD(_walkSpd);
+    writeD(_swimRunSpd);
+    writeD(_swimWalkSpd);
+    writeD(_flRunSpd);
+    writeD(_flWalkSpd);
+    writeD(_flyRunSpd);
+    writeD(_flyWalkSpd);
+    writeF(1.0D);
+    writeF(1.0D);
+    writeF(_collisionRadius);
+    writeF(_collisionHeight);
+    writeD(_rhand);
+    writeD(0);
+    writeD(_lhand);
+    writeC(1);
+    writeC(_isRunning ? 1 : 0);
+    writeC(_isInCombat ? 1 : 0);
+    writeC(_isAlikeDead ? 1 : 0);
+    writeC(_isSummoned ? 2 : 0);
+    writeS(_name);
+    writeS(_title);
+    writeD(0);
+    writeD(0);
+    writeD(0);
+    
+    writeH(_abnormalEffect);
+    writeH(0);
+    writeD(0);
+    writeD(0);
+    writeD(0);
+    writeD(0);
+    writeC(0);
+  }
+  
+  public String getType()
+  {
+    return "[S] 16 NpcInfo";
+  }
+}

 

 

 

 

RW5oPX7.jpg

 

Thanks for providing the rev: Screenshot
Credit removal and adaptation: Tayran.Cannabis
Removing Source: L2JDX

Edited by le memer master
  • 3 months later...
Posted
+    System.out.println("[Form Monument]: Load info char ok...");
+    
+    _title = (dados[2] + " pk's in 24h");
+    for (EventMonumentStatuet.Items item : _items.values())
+    {
+      switch (item.getItemSlot())
+      {
+      case 16384: 

there is a problem with the npc PvP, because only appears PK. If I'm right here lacks a line TITLE PVP?It is someone who can fix this error?

  • 9 months later...
Posted

Great. Any similar for example for heros, best players...?? I search also for Gracia Final and HI5.

 

Regards!!

You have a base here with a little knowledge can be done..
  • 4 months later...
Posted (edited)

Good afternoon to all of Maxcheaters, I come here to post you the original Statuet Monument, it was removed from L2JDX and do not know who is the credits, make good avail.

 

 

 

Index: config/functions/l2jfrozen.properties
===================================================================
--- config/functions/l2jfrozen.properties	(revisão 1118)
+++ config/functions/l2jfrozen.properties	(cópia de trabalho)
@@ -281,4 +281,22 @@
 ProtectorSkillLevel = 13
 ProtectorSkillTime = 600
 # Npc Protector Message
-ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
\ No newline at end of file
+ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
+
+
+# -----------------------------------------
+# Monument NPC By TOP PvP and PK  -
+# -----------------------------------------
+#Event created
+#Evento monument statuet ativo
+EnableMonumentStatuetEvent = false
+
+#Data para a troca da estatua
+#Default: 12:00
+RateRefreshStatuet = 06:15
+
+#NOTE: Npc id deve estar presente em npc_to_pc_polymorph
+#Npc que para PVP
+TemplatePVP = 77559
+#Npc para PK
+TemplatePK = 77558
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java	(revisão 1118)
+++ head-src/com/l2jfrozen/Config.java	(cópia de trabalho)
@@ -2427,6 +2427,10 @@
 	public static String FARM2_CUSTOM_MESSAGE;
 	public static String PVP1_CUSTOM_MESSAGE;
 	public static String PVP2_CUSTOM_MESSAGE;
+	public static boolean EVENT_MONUMENT_STATUET;
+	public static String RATE_HOUR_STATUET_REFRESH;
+	public static int NPC_TEMPLATE_ID_PK;
+	public static int NPC_TEMPLATE_ID_PVP;
 	
 	// ============================================================
 	public static void loadL2JFrozenConfig()
@@ -2445,6 +2449,11 @@
 			SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(L2JFrozenSettings.getProperty("SaveGmSpawnOnCustom", "True"));
 			DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(L2JFrozenSettings.getProperty("DeleteGmSpawnOnCustom", "True"));
 			
+		    EVENT_MONUMENT_STATUET = Boolean.parseBoolean(L2JFrozenSettings.getProperty("EnableMonumentStatuetEvent", "false"));
+		    RATE_HOUR_STATUET_REFRESH = L2JFrozenSettings.getProperty("RateRefreshStatuet", "12:00");
+		    NPC_TEMPLATE_ID_PVP = Integer.parseInt(L2JFrozenSettings.getProperty("TemplatePVP", "77558"));
+		    NPC_TEMPLATE_ID_PK = Integer.parseInt(L2JFrozenSettings.getProperty("TemplatePK", "77559"));
+			
 			ONLINE_PLAYERS_ON_LOGIN = Boolean.valueOf(L2JFrozenSettings.getProperty("OnlineOnLogin", "False"));
 			SHOW_SERVER_VERSION = Boolean.valueOf(L2JFrozenSettings.getProperty("ShowServerVersion", "False"));
 			
Index: head-src/com/l2jfrozen/gameserver/GameServer.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/GameServer.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/GameServer.java	(cópia de trabalho)
@@ -131,6 +131,7 @@
 import com.l2jfrozen.gameserver.model.entity.siege.clanhalls.FortressOfResistance;
 import com.l2jfrozen.gameserver.model.multisell.L2Multisell;
 import com.l2jfrozen.gameserver.model.spawn.AutoSpawn;
+import com.l2jfrozen.gameserver.monumentstatuet.EventMonumentStatuet;
 import com.l2jfrozen.gameserver.network.L2GameClient;
 import com.l2jfrozen.gameserver.network.L2GamePacketHandler;
 import com.l2jfrozen.gameserver.powerpak.PowerPak;
@@ -574,6 +575,14 @@
 		else
 			LOGGER.info("All events are Disabled.");
 		
+	    if (Config.EVENT_MONUMENT_STATUET)
+	    {
+	      Util.printSection("Monument Statuet Event");
+	      EventMonumentStatuet.getInstance().load();
+	      EventMonumentStatuet.getInstance().ConfiguratePereiod();
+	      EventMonumentStatuet.getInstance().spawnStatuets();
+	    }
+		
 		if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
 			OfflineTradeTable.restoreOfflineTraders();
 		
Index: head-src/com/l2jfrozen/gameserver/managers/CustomNpcInstanceManager.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/managers/CustomNpcInstanceManager.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/managers/CustomNpcInstanceManager.java	(cópia de trabalho)
@@ -1,322 +1,247 @@
+/*
+ * L2jFrozen Project - www.l2jfrozen.com 
+ * 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.managers;
+ 
+import com.l2jfrozen.Config;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.DatabaseUtils;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+import com.l2jfrozen.util.random.Rnd;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import javolution.util.FastMap;
+import org.apache.log4j.Logger;
+ 
+import com.l2jfrozen.Config;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.DatabaseUtils;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * control for Custom Npcs that look like players.
+ * @version 1.00
+ * @author Darki699
+ */
+ public final class CustomNpcInstanceManager
+ {
+  private static final Logger LOGGER = Logger.getLogger(CustomNpcInstanceManager.class);
+  private static CustomNpcInstanceManager _instance;
+  private FastMap<Integer, customInfo> spawns;
+  private FastMap<Integer, customInfo> templates;
+  
+  public final class customInfo
+  {
+    public String[] stringData = new String[2];
+    public int[] integerData = new int[27];
+    public boolean[] booleanData = new boolean[8];
+    
+    public customInfo() {}
+  }
+  
+  CustomNpcInstanceManager()
+  {
+    load();
+  }
+  
+  public static final CustomNpcInstanceManager getInstance()
+  {
+    if (_instance == null) {
+      _instance = new CustomNpcInstanceManager();
+    }
+    return _instance;
+  }
+  
+  public final void reload()
+  {
+    if (spawns != null) {
+      spawns.clear();
+    }
+    if (templates != null) {
+      templates.clear();
+    }
+    spawns = null;
+    templates = null;
+    
+    load();
+  }
+  
+  private final void load()
+  {
+    if ((spawns == null) || (templates == null))
+    {
+      spawns = new FastMap();
+      templates = new FastMap();
+    }
+    String[] SQL_ITEM_SELECTS = { "SELECT spawn,template,name,title,class_id,female,hair_style,hair_color,face,name_color,title_color, noble,hero,pvp,karma,wpn_enchant,right_hand,left_hand,gloves,chest,legs,feet,hair,hair2, pledge,cw_level,clan_id,ally_id,clan_crest,ally_crest,rnd_class,rnd_appearance,rnd_weapon,rnd_armor,max_rnd_enchant FROM npc_to_pc_polymorph" };
+    
+
+
+
+    Connection con = null;
+    try
+    {
+      int count = 0;
+      con = L2DatabaseFactory.getInstance().getConnection(false);
+      for (String selectQuery : SQL_ITEM_SELECTS)
+      {
+        PreparedStatement statement = con.prepareStatement(selectQuery);
+        ResultSet rset = statement.executeQuery();
+        while (rset.next())
+        {
+          count++;
+          customInfo ci = new customInfo();
+          ci.integerData[26] = rset.getInt("spawn");
+          ci.integerData[25] = rset.getInt("template");
+          try
+          {
+            ci.stringData[0] = rset.getString("name");
+            ci.stringData[1] = rset.getString("title");
+            ci.integerData[7] = rset.getInt("class_id");
+            
+            int PcSex = rset.getInt("female");
+            switch (PcSex)
+            {
+            case 0: 
+              ci.booleanData[3] = false;
+              break;
+            case 1: 
+              ci.booleanData[3] = true;
+              break;
+            default: 
+				ci.booleanData[3] = Rnd.get(100) > 50 ? true : false;
+            }
+            ci.integerData[19] = rset.getInt("hair_style");
+            ci.integerData[20] = rset.getInt("hair_color");
+            ci.integerData[21] = rset.getInt("face");
+            ci.integerData[22] = rset.getInt("name_color");
+            ci.integerData[23] = rset.getInt("title_color");
+            ci.booleanData[1] = rset.getInt("noble") > 0 ? true : false;
+            ci.booleanData[2] = rset.getInt("hero") > 0 ? true : false;
+            ci.booleanData[0] = rset.getInt("pvp") > 0 ? true : false;
+            ci.integerData[1] = rset.getInt("karma");
+            ci.integerData[8] = rset.getInt("wpn_enchant");
+            ci.integerData[11] = rset.getInt("right_hand");
+            ci.integerData[12] = rset.getInt("left_hand");
+            ci.integerData[13] = rset.getInt("gloves");
+            ci.integerData[14] = rset.getInt("chest");
+            ci.integerData[15] = rset.getInt("legs");
+            ci.integerData[16] = rset.getInt("feet");
+            ci.integerData[17] = rset.getInt("hair");
+            ci.integerData[18] = rset.getInt("hair2");
+            ci.integerData[9] = rset.getInt("pledge");
+            ci.integerData[10] = rset.getInt("cw_level");
+            ci.integerData[2] = rset.getInt("clan_id");
+            ci.integerData[3] = rset.getInt("ally_id");
+            ci.integerData[4] = rset.getInt("clan_crest");
+            ci.integerData[5] = rset.getInt("ally_crest");
+            ci.booleanData[4] = rset.getInt("rnd_class") > 0 ? true : false;
+            ci.booleanData[5] = rset.getInt("rnd_appearance") > 0 ? true : false;
+            ci.booleanData[6] = rset.getInt("rnd_weapon") > 0 ? true : false;
+            ci.booleanData[7] = rset.getInt("rnd_armor") > 0 ? true : false;
+            ci.integerData[24] = rset.getInt("max_rnd_enchant");
+            if ((ci.integerData[25] != 0) && (!templates.containsKey(Integer.valueOf(ci.integerData[25])))) {
+              templates.put(Integer.valueOf(ci.integerData[25]), ci);
+            }
+            if ((ci.integerData[25] == 0) && (!spawns.containsKey(Integer.valueOf(ci.integerData[26])))) {
+              spawns.put(Integer.valueOf(ci.integerData[26]), ci);
+            }
+          }
+          catch (Throwable t)
+          {
+            if (Config.ENABLE_ALL_EXCEPTIONS) {
+              t.printStackTrace();
+            }
+            LOGGER.warn("Failed to load Npc Morph data for Object Id: " + ci.integerData[26] + " template: " + ci.integerData[25]);
+          }
+          ci = null;
+        }
+        DatabaseUtils.close(statement);
+        statement = null;
+        DatabaseUtils.close(rset);
+        rset = null;
+      }
+      LOGGER.info("CustomNpcInstanceManager: loaded " + count + " NPC to PC polymorphs.");
+    }
+    catch (Exception e)
+    {
+      if (Config.ENABLE_ALL_EXCEPTIONS) {
+        e.printStackTrace();
+      }
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+  
+  public final boolean isThisL2CustomNpcInstance(int spwnId, int npcId)
+  {
+    if ((spwnId == 0) || (npcId == 0)) {
+      return false;
+    }
+    if (spawns.containsKey(Integer.valueOf(spwnId))) {
+      return true;
+    }
+    if (templates.containsKey(Integer.valueOf(npcId))) {
+      return true;
+    }
+    return false;
+  }
+  
+  public final customInfo getCustomData(int spwnId, int npcId)
+  {
+    if ((spwnId == 0) || (npcId == 0)) {
+      return null;
+    }
+    for (customInfo ci : spawns.values()) {
+      if ((ci != null) && (ci.integerData[26] == spwnId)) {
+        return ci;
+      }
+    }
+    for (customInfo ci : templates.values()) {
+      if ((ci != null) && (ci.integerData[25] == npcId)) {
+        return ci;
+      }
+    }
+    return null;
+  }
+  
+  public final FastMap<Integer, customInfo> getAllTemplates()
+  {
+    return templates;
+  }
+  
+  public final FastMap<Integer, customInfo> getAllSpawns()
+  {
+    return spawns;
+  }
+  
+  public final void updateRemoveInDB(customInfo ciToRemove) {}
+  
+  public final void AddInDB(customInfo ciToAdd)
+  {
+    String Query = "REPLACE INTO npc_to_pc_polymorph VALUES spawn,template,name,title,class_id,female,hair_style,hair_color,face,name_color,title_color, noble,hero,pvp,karma,wpn_enchant,right_hand,left_hand,gloves,chest,legs,feet,hair,hair2, pledge,cw_level,clan_id,ally_id,clan_crest,ally_crest,rnd_class,rnd_appearance,rnd_weapon,rnd_armor,max_rnd_enchant FROM npc_to_pc_polymorph";
+    
+    Connection con = null;
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection(false);
+      PreparedStatement statement = con.prepareStatement(Query);
+      ResultSet rset = statement.executeQuery();
+      
+      DatabaseUtils.close(statement);
+      statement = null;
+      while (rset.next())
+      {
+        customInfo ci = new customInfo();
+        ci.integerData[26] = rset.getInt("spawn");
+        ci.integerData[25] = rset.getInt("template");
+      }
+      DatabaseUtils.close(rset);
+      rset = null;
+      Query = null;
+    }
+    catch (Throwable t)
+    {
+      if (Config.ENABLE_ALL_EXCEPTIONS) {
+        t.printStackTrace();
+      }
+      LOGGER.warn("Could not add Npc Morph info into the DB: ");
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2CustomNpcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2CustomNpcInstance.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2CustomNpcInstance.java	(cópia de trabalho)
@@ -1,527 +1,347 @@
+/*
+ * L2jFrozen Project - www.l2jfrozen.com 
+ * 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.model.actor.instance;
+
+import com.l2jfrozen.gameserver.managers.CustomNpcInstanceManager;
+import com.l2jfrozen.gameserver.managers.CustomNpcInstanceManager.customInfo;
+import com.l2jfrozen.gameserver.model.base.ClassId;
+import com.l2jfrozen.gameserver.model.base.Race;
+import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
+import com.l2jfrozen.gameserver.templates.L2WeaponType;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * This class manages Npc Polymorph into player instances, they look like regular players. This effect will show up on all clients.
+ * @author Darki699
+ */
+ public final class L2CustomNpcInstance
+ {
+  private boolean _allowRandomWeapons = true;
+  private boolean _allowRandomClass = true;
+  private boolean _allowRandomAppearance = true;
+  private String _name;
+  private String _title;
+  private int[] _int;
+  private boolean[] _boolean;
+  private L2NpcInstance _NpcInstance;
+  private ClassId _classId;
+  
+  public L2CustomNpcInstance(L2NpcInstance myNpc)
+  {
+    _NpcInstance = myNpc;
+    if (_NpcInstance == null) {
+      return;
+    }
+    if (_NpcInstance.getSpawn() == null) {
+      return;
+    }
+    initialize();
+  }
+  
+  private final void initialize()
+  {
+    _int = new int[25];
+    
+
+
+
+
+
+    _boolean = new boolean[4];
+    
+
+
+    CustomNpcInstanceManager.customInfo ci = CustomNpcInstanceManager.getInstance().getCustomData(_NpcInstance.getSpawn().getId(), _NpcInstance.getNpcId());
+    if (ci == null)
+    {
+      _NpcInstance.setCustomNpcInstance(null);
+      _NpcInstance = null;
+      return;
+    }
+    _NpcInstance.setCustomNpcInstance(this);
+    
+    setPcInstanceData(ci);
+    if (_allowRandomClass) {
+      chooseRandomClass();
+    }
+    if (_allowRandomAppearance) {
+      chooseRandomAppearance();
+    }
+    if (_allowRandomWeapons) {
+      chooseRandomWeapon();
+    }
+    ci = null;
+  }
+  
+  public final String getName()
+  {
+    return _name == null ? _NpcInstance.getName() : _name;
+  }
+  
+  public final String getTitle()
+  {
+    return _NpcInstance.isChampion() ? "The Champion" + _title : _title == null ? _NpcInstance.getTitle() : _title;
+  }
+  
+  public final int getKarma()
+  {
+    return _int[1] > 0 ? _int[1] : _NpcInstance.getAggroRange();
+  }
+  
+  public final int getClanId()
+  {
+    return _int[2];
+  }
+  
+  public final int getAllyId()
+  {
+    return _int[3];
+  }
+  
+  public final int getClanCrestId()
+  {
+    return _int[4];
+  }
+  
+  public final int getAllyCrestId()
+  {
+    return _int[5];
+  }
+  
+  public final int getRace()
+  {
+    return _int[6];
+  }
+  
+  public final int getClassId()
+  {
+    return _int[7];
+  }
+  
+  public final int getEnchantWeapon()
+  {
+    return _int[8] > 127 ? 127 : (PAPERDOLL_RHAND() == 0) || (getCursedWeaponLevel() != 0) ? 0 : _int[8];
+  }
+  
+  public final int getPledgeClass()
+  {
+    return _NpcInstance.isChampion() ? 8 : _int[9];
+  }
+  
+  public final int getCursedWeaponLevel()
+  {
+    return (PAPERDOLL_RHAND() == 0) || (_int[8] > 0) ? 0 : _int[10];
+  }
+  
+  public final int PAPERDOLL_RHAND()
+  {
+    return _int[11] != 0 ? _int[11] : _NpcInstance.getRightHandItem();
+  }
+  
+  public final int PAPERDOLL_LHAND()
+  {
+    return _int[12] == 0 ? _NpcInstance.getLeftHandItem() : _int[12] > 0 ? _int[12] : 0;
+  }
+  
+  public final int PAPERDOLL_GLOVES()
+  {
+    return _int[13];
+  }
+  
+  public final int PAPERDOLL_CHEST()
+  {
+    return _int[14];
+  }
+  
+  public final int PAPERDOLL_LEGS()
+  {
+    return _int[15];
+  }
+  
+  public final int PAPERDOLL_FEET()
+  {
+    return _int[16];
+  }
+  
+  public final int PAPERDOLL_HAIR()
+  {
+    return _int[17];
+  }
+  
+  public final int PAPERDOLL_HAIR2()
+  {
+    return _int[18];
+  }
+  
+  public final int getHairStyle()
+  {
+    return _int[19];
+  }
+  
+  public final int getHairColor()
+  {
+    return _int[20];
+  }
+  
+  public final int getFace()
+  {
+    return _int[21];
+  }
+  
+  public final int nameColor()
+  {
+    return _int[22] == 0 ? 16777215 : _int[22];
+  }
+  
+  public final int titleColor()
+  {
+    return _int[23] == 0 ? 16777079 : _int[23];
+  }
+  
+  public final boolean getPvpFlag()
+  {
+    return _boolean[0];
+  }
+  
+  public final int getHeading()
+  {
+    return _NpcInstance.getHeading();
+  }
+  
+  public final boolean isNoble()
+  {
+    return _boolean[1];
+  }
+  
+  public final boolean isHero()
+  {
+    return _boolean[2];
+  }
+  
+  public final boolean isFemaleSex()
+  {
+    return _boolean[3];
+  }
+  
+  private final void chooseRandomWeapon()
+  {
+    L2WeaponType wpnType = null;
+    
+    wpnType = Rnd.get(100) > 40 ? L2WeaponType.BOW : L2WeaponType.BOW;
+    
+    wpnType = L2WeaponType.BOW;
+    do
+    {
+      wpnType = L2WeaponType.values()[Rnd.get(L2WeaponType.values().length)];
+    } while ((wpnType == null) || 
+    
+
+
+      (wpnType == L2WeaponType.BOW) || (wpnType == L2WeaponType.BOW));
+    if ((_classId.getRace() == Race.human) || 
+    
+
+
+
+
+      (Rnd.get(100) < 10)) {}
+  }
+  
+  private final void chooseRandomClass()
+  {
+    for (;;)
+    {
+      _classId = ClassId.values()[Rnd.get(ClassId.values().length)];
+      if ((_classId != null) && 
+      
+
+
+        (_classId.getRace() != null) && (_classId.getParent() != null)) {
+        break;
+      }
+    }
+    _int[6] = _classId.getRace().ordinal();
+    _int[7] = _classId.getId();
+  }
+  
+  private final void chooseRandomAppearance()
+  {
+	  _boolean[1] = Rnd.get(100) < 15 ? true : false;
+	  _boolean[3] = Rnd.get(100) < 50 ? true : false;
+	  _int[22] = (_int[23] = 0);
+	  if (Rnd.get(100) < 5) {
+		  _int[22] = 255;
+	  } 
+	  else if (Rnd.get(100) < 5)
+	  {
+		  _int[22] = 65280;
+	  }
+	  if (Rnd.get(100) < 5) {
+		  _int[23] = 255;
+	  }
+	  else if (Rnd.get(100) < 5)
+	  {
+		  _int[23] = 65280;
+	  }
+	  _int[1] = (Rnd.get(100) > 10 ? 50 : Rnd.get(100) > 95 ? 0 : 1000);
+	  _int[19] = (Rnd.get(100) < 34 ? 1 : Rnd.get(100) < 34 ? 0 : 2);
+	  _int[20] = (Rnd.get(100) < 34 ? 1 : Rnd.get(100) < 34 ? 0 : 2);
+	  _int[21] = (Rnd.get(100) < 34 ? 1 : Rnd.get(100) < 34 ? 0 : 2);
+    
+    int pledgeLevel = Rnd.get(100);
+    if (pledgeLevel > 30) {
+      _int[9] = 1;
+    }
+    if (pledgeLevel > 50) {
+      _int[9] = 2;
+    }
+    if (pledgeLevel > 60) {
+      _int[9] = 3;
+    }
+    if (pledgeLevel > 80) {
+      _int[9] = 4;
+    }
+    if (pledgeLevel > 90) {
+      _int[9] = 5;
+    }
+    if (pledgeLevel > 95) {
+      _int[9] = 6;
+    }
+    if (pledgeLevel > 98) {
+      _int[9] = 7;
+    }
+  }
+  
+  public void setPcInstanceData(CustomNpcInstanceManager.customInfo ci)
+  {
+    if (ci == null) {
+      return;
+    }
+    for (int i = 0; i < 25; i++) {
+      _int[i] = ci.integerData[i];
+    }
+    for (int i = 0; i < 4; i++) {
+      _boolean[i] = ci.booleanData[i];
+    }
+    _allowRandomClass = ci.booleanData[4];
+    _allowRandomAppearance = ci.booleanData[5];
+    _allowRandomWeapons = ci.booleanData[6];
+    
+
+    _name = ci.stringData[0];
+    _title = ci.stringData[1];
+    if ((_name != null) && (_name.equals(""))) {
+      _name = null;
+    }
+    if ((_title != null) && (_title.equals(""))) {
+      _title = null;
+    }
+    ClassId[] ids = ClassId.values();
+    if (ids != null) {
+      for (ClassId id : ids) {
+        if (id != null) {
+          if (id.getId() == _int[7])
+          {
+            _classId = id;
+            _int[6] = id.getRace().ordinal();
+            break;
+          }
+        }
+      }
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java	(cópia de trabalho)
@@ -76,6 +76,7 @@
 import com.l2jfrozen.gameserver.model.scripts.L2RBManager;
 import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
 import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
+import com.l2jfrozen.gameserver.monumentstatuet.EventMonumentStatuet;
 import com.l2jfrozen.gameserver.network.L2GameClient;
 import com.l2jfrozen.gameserver.network.SystemMessageId;
 import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
@@ -116,6 +117,10 @@
 	
 	/** The interaction distance of the L2NpcInstance(is used as offset in MovetoLocation method). */
 	public static final int INTERACTION_DISTANCE = 150;
+
+	public boolean Monument_Npc_PVP = false;
+
+	public boolean Monument_Npc_PK = false;
 	
 	/** The Polymorph object that manage this L2NpcInstance's morph to a PcInstance... I wrote this line too =P Darki699 */
 	private L2CustomNpcInstance _customNpcInstance;
@@ -870,6 +875,14 @@
 					{
 						VIP.showEndHTML(player, String.valueOf(getObjectId()));
 					}
+			        else if (Monument_Npc_PK)
+			        {
+			            EventMonumentStatuet.getInstance().htmlPKnpc(player);
+			        }
+			        else if (Monument_Npc_PVP)
+			        {
+			            EventMonumentStatuet.getInstance().htmlPVPnpc(player);
+			        }
 					else
 					{
 						// Open a chat window on client with the text of the L2NpcInstance
Index: head-src/com/l2jfrozen/gameserver/monumentstatuet/EventMonumentStatuet.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/monumentstatuet/EventMonumentStatuet.java	(revisão 0)
+++ head-src/com/l2jfrozen/gameserver/monumentstatuet/EventMonumentStatuet.java	(cópia de trabalho)
@@ -0,0 +1,594 @@
+package com.l2jfrozen.gameserver.monumentstatuet;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Calendar;
+import java.util.Map;
+
+import javolution.util.FastMap;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
+import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+import com.l2jfrozen.gameserver.datatables.sql.SpawnTable;
+import com.l2jfrozen.gameserver.managers.CustomNpcInstanceManager;
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
+import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
+import com.l2jfrozen.gameserver.templates.L2Item;
+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+
+public class EventMonumentStatuet
+{
+  public static EventMonumentStatuet _instance;
+  public static L2Spawn PK_SPAWN;
+  public static L2Spawn PVP_SPAWN;
+  public boolean inPeriodOk = true;
+  private Map<Integer, int[]> startup_players;
+  private PreparedStatement statement;
+  
+  public EventMonumentStatuet()
+  {
+    startup_players = new FastMap();
+  }
+  
+  public static EventMonumentStatuet getInstance()
+  {
+    if (_instance == null) {
+      _instance = new EventMonumentStatuet();
+    }
+    return _instance;
+  }
+  
+  public void htmlPKnpc(L2PcInstance pl) {}
+  
+  public void htmlPVPnpc(L2PcInstance pl) {}
+  
+  public void spawnStatuets()
+  {
+    spawnNpcPVP();
+    spawnNpcPK();
+  }
+  
+  private static void spawnNpcPVP()
+  {
+    L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.NPC_TEMPLATE_ID_PVP);
+    try
+    {
+      PVP_SPAWN = new L2Spawn(tmpl);
+      PVP_SPAWN.setLocx(83215);
+      PVP_SPAWN.setLocy(148393);
+      PVP_SPAWN.setLocz(-3373);
+      PVP_SPAWN.setAmount(1);
+      PVP_SPAWN.setRespawnDelay(1);
+      SpawnTable.getInstance().addNewSpawn(PVP_SPAWN, false);
+      PVP_SPAWN.init();
+      PVP_SPAWN.getLastSpawn().getStatus().setCurrentHp(999999999.0D);
+      PVP_SPAWN.getLastSpawn().isAggressive();
+      PVP_SPAWN.getLastSpawn().Monument_Npc_PVP = true;
+      PVP_SPAWN.getLastSpawn().decayMe();
+      PVP_SPAWN.getLastSpawn().spawnMe(PVP_SPAWN.getLastSpawn().getX(), PVP_SPAWN.getLastSpawn().getY(), PVP_SPAWN.getLastSpawn().getZ());
+      
+      PVP_SPAWN.getLastSpawn().broadcastPacket(new MagicSkillUser(PVP_SPAWN.getLastSpawn(), PVP_SPAWN.getLastSpawn(), 1034, 1, 1, 1));
+      
+      System.out.println("[EventMonumentStatuet]:Statue pvp spawned.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]:Fail to spawn statue pvp.");
+    }
+  }
+  
+  private static void spawnNpcPK()
+  {
+    L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.NPC_TEMPLATE_ID_PK);
+    try
+    {
+      PK_SPAWN = new L2Spawn(tmpl);
+      PK_SPAWN.setLocx(83220);
+      PK_SPAWN.setLocy(147909);
+      PK_SPAWN.setLocz(-3373);
+      PK_SPAWN.setAmount(1);
+      PK_SPAWN.setRespawnDelay(1);
+      SpawnTable.getInstance().addNewSpawn(PK_SPAWN, false);
+      PK_SPAWN.init();
+      PK_SPAWN.getLastSpawn().getStatus().setCurrentHp(999999999.0D);
+      PK_SPAWN.getLastSpawn().isAggressive();
+      PK_SPAWN.getLastSpawn().Monument_Npc_PK = true;
+      PK_SPAWN.getLastSpawn().decayMe();
+      PK_SPAWN.getLastSpawn().spawnMe(PK_SPAWN.getLastSpawn().getX(), PK_SPAWN.getLastSpawn().getY(), PK_SPAWN.getLastSpawn().getZ());
+      
+      PK_SPAWN.getLastSpawn().broadcastPacket(new MagicSkillUser(PK_SPAWN.getLastSpawn(), PK_SPAWN.getLastSpawn(), 1034, 1, 1, 1));
+      
+      System.out.println("[EventMonumentStatuet]:Statue pk spawned.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]:Fail to spawn statue pk.");
+    }
+    finally
+    {
+      tmpl = null;
+    }
+  }
+  
+  public void reloadAllNpc()
+  {
+    unspawnNpcPK();
+    unspawnNpcPVP();
+    
+    PK_SPAWN = null;
+    PVP_SPAWN = null;
+    
+    spawnNpcPK();
+    spawnNpcPVP();
+  }
+  
+  private static void unspawnNpcPK()
+  {
+    if ((PK_SPAWN == null) || (PK_SPAWN.getLastSpawn() == null)) {
+      return;
+    }
+    PK_SPAWN.getLastSpawn().deleteMe();
+    PK_SPAWN.stopRespawn();
+    SpawnTable.getInstance().deleteSpawn(PK_SPAWN, true);
+  }
+  
+  private static void unspawnNpcPVP()
+  {
+    if ((PVP_SPAWN == null) || (PVP_SPAWN.getLastSpawn() == null)) {
+      return;
+    }
+    PVP_SPAWN.getLastSpawn().deleteMe();
+    PVP_SPAWN.stopRespawn();
+    SpawnTable.getInstance().deleteSpawn(PVP_SPAWN, true);
+  }
+  
+  public void onEnterPlayer(L2PcInstance pl)
+  {
+    if ((inPeriodOk) && (startup_players.get(Integer.valueOf(pl.getObjectId())) == null))
+    {
+      int[] stats = { pl.getObjectId(), pl.getPvpKills(), pl.getPkKills() };
+      startup_players.put(Integer.valueOf(pl.getObjectId()), stats);
+      storeInDataInfo(pl);
+    }
+  }
+  
+  public void ConfiguratePereiod()
+  {
+    String hour = Config.RATE_HOUR_STATUET_REFRESH.split(":")[0];
+    String minutes = Config.RATE_HOUR_STATUET_REFRESH.split(":")[1];
+    
+    int h = 0;int m = 0;
+    long timeL = 0L;
+    try
+    {
+      h = Integer.valueOf(hour).intValue();
+      m = Integer.valueOf(minutes).intValue();
+      Calendar currentTime = Calendar.getInstance();
+      Calendar testStartTime = Calendar.getInstance();
+      testStartTime.setLenient(true);
+      
+      testStartTime.set(11, h);
+      testStartTime.set(12, m);
+      testStartTime.set(13, 0);
+      if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis()) {
+        testStartTime.add(5, 1);
+      }
+      timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
+      
+      ThreadPoolManager.getInstance().scheduleGeneral(new refreshStatuet(), timeL);
+      
+      System.out.println("[EventMonumentStatuet]Periodo to refresh statuet: " + testStartTime.getTime());
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]:ConfiguratePereiod()]Fail to load period");
+      e.printStackTrace();
+    }
+  }
+  
+  private void storeInDataInfo(L2PcInstance pl)
+  {
+    Connection con = null;
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement("INSERT INTO monuments_startup (obj_id, pvp, pk) VALUES (?, ? , ?)");
+      statement.setInt(1, pl.getObjectId());
+      statement.setInt(2, pl.getPvpKills());
+      statement.setInt(3, pl.getPkKills());
+      statement.execute();
+      statement.close();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in store!");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+  
+  public void load()
+  {
+    Connection con = null;
+    String SQL = "SELECT obj_id, pvp, pk FROM monuments_startup ORDER BY obj_id";
+    if (startup_players.isEmpty()) {
+      startup_players.clear();
+    }
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement(SQL);
+      
+      ResultSet rs = statement.executeQuery();
+      while (rs.next())
+      {
+        int obj_id = rs.getInt("obj_id");
+        int pvp = rs.getInt("pvp");
+        int pk = rs.getInt("pk");
+        
+        int[] stats = { obj_id, pvp, pk };
+        startup_players.put(Integer.valueOf(obj_id), stats);
+      }
+      statement.close();
+      rs.close();
+      
+      System.out.println("[EventMonumentStatuet]Loaded " + startup_players.size() + " competitors.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in load competitors!");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+  
+  public void StartNewPeriod()
+  {
+    String monuments_startup_del = "TRUNCATE TABLE monuments_startup";
+    
+
+    Connection con = null;
+    statement = null;
+    try
+    {
+      System.out.println("[EventMonumentStatuet]Delete all elements from table monuments_startup.");
+      con = L2DatabaseFactory.getInstance().getConnection();
+      statement = con.prepareStatement(monuments_startup_del);
+      statement.execute();
+      try
+      {
+        statement.close();
+        
+        CloseUtil.close(con);
+        con = null;
+        
+        statement = null;
+        monuments_startup_del = null;
+      }
+      catch (Exception e) {}
+      startup_players.clear();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in delete all elements from table monuments_startup.");
+      e.printStackTrace();
+    }
+    finally
+    {
+      try
+      {
+        statement.close();
+        
+        CloseUtil.close(con);
+        con = null;
+        
+        statement = null;
+        monuments_startup_del = null;
+      }
+      catch (Exception e) {}
+    }
+    System.out.println("[EventMonumentStatuet]Adding all objects online.");
+    int[] stats = new int[3];
+    for (L2PcInstance pl : L2World.getInstance().getAllPlayers())
+    {
+      stats[0] = pl.getObjectId();
+      stats[1] = pl.getPvpKills();
+      stats[2] = pl.getPkKills();
+      
+      startup_players.put(Integer.valueOf(pl.getObjectId()), stats);
+      
+      storeInDataInfo(pl);
+    }
+    System.out.println("[EventMonumentStatuet]Added " + startup_players.size() + " objects online.");
+  }
+  
+  private class refreshStatuet
+    implements Runnable
+  {
+    public refreshStatuet() {}
+    
+    public void run()
+    {
+      EventMonumentStatuet.this.inPeriodOk = false;
+      EventMonumentStatuet.this.CalculateWins();
+      EventMonumentStatuet.this.StartNewPeriod();
+      EventMonumentStatuet.this.inPeriodOk = true;
+    }
+  }
+  
+  public void CalculateWins()
+  {
+    if (startup_players.size() <= 1)
+    {
+      System.out.println("[EventMonumentStatuet]:No participants in event, no statue formed.");
+      return;
+    }
+    Connection con = null;
+    String SQL = "SELECT obj_Id, pvpkills, pkkills FROM characters WHERE";
+    
+    int count = 0;
+    for (int[] a : startup_players.values())
+    {
+      SQL = SQL + (count == 0 ? " obj_Id=" + a[0] : new StringBuilder().append(" or obj_Id=").append(a[0]).toString());
+      
+      count++;
+    }
+    int pvp_maior = 0;int pk_maior = 0;
+    int[] obj_pvp = { 0, 0 };int[] obj_pk = { 0, 0 };
+    System.out.println("[EventMonumentStatuet]:Calculando player wins.");
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement(SQL);
+      
+      ResultSet rs = statement.executeQuery();
+      while (rs.next())
+      {
+        int obj_id = rs.getInt("obj_id");
+        int pvp = rs.getInt("pvpkills");
+        int pk = rs.getInt("pkkills");
+        
+        int[] dados = (int[])startup_players.get(Integer.valueOf(obj_id));
+        
+        int diference_pvp = pvp - dados[1];
+        int diference_pk = pk - dados[2];
+        if (diference_pvp > pvp_maior)
+        {
+          pvp_maior = diference_pvp;
+          obj_pvp[0] = obj_id;
+          obj_pvp[1] = diference_pvp;
+        }
+        if (diference_pk > pk_maior)
+        {
+          pk_maior = diference_pk;
+          obj_pk[0] = obj_id;
+          obj_pk[1] = diference_pk;
+        }
+      }
+      statement.close();
+      rs.close();
+      System.out.println("[EventMonumentStatuet]:Wins a pvp player:" + obj_pvp[0] + " with " + obj_pvp[1] + " differ.");
+      System.out.println("[EventMonumentStatuet]:Wins a pk player:" + obj_pk[0] + " with " + obj_pk[1] + " differ.");
+    }
+    catch (Exception e)
+    {
+      System.out.println("[EventMonumentStatuet]Error in createPvpStatuet!");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+    createStatuet(obj_pvp, obj_pk);
+  }
+  
+  private void createStatuet(int[] dados_pvp, int[] dados_pk)
+  {
+    Connection con = null;
+    
+    Map<Integer, Items> items_mp_pvp = null;
+    Map<Integer, Items> items_mp_pk = null;
+    
+
+
+
+    L2Item item = null;
+    
+    System.out.println("[EventMonumentStatuet]: Creating map items for: " + dados_pvp[0] + " and " + dados_pk[0]);
+    if (dados_pvp[0] != 0)
+    {
+      String SQL = "SELECT item_id, enchant_level FROM items WHERE owner_id=" + dados_pvp[0] + " AND loc='PAPERDOLL'";
+      items_mp_pvp = new FastMap();
+      try
+      {
+        con = L2DatabaseFactory.getInstance().getConnection();
+        PreparedStatement st = con.prepareStatement(SQL);
+        ResultSet rs = st.executeQuery();
+        while (rs.next())
+        {
+          int item_id = rs.getInt("item_id");
+          int enchant_level = rs.getInt("enchant_level");
+          
+          item = ItemTable.getInstance().getTemplate(item_id);
+          if (item != null) {
+            if (item.getType2() == 0) {
+              items_mp_pvp.put(Integer.valueOf(items_mp_pvp.size() + 1), new Weapon(item_id, enchant_level, item.getBodyPart()));
+            } else if (item.getType2() == 2) {
+              items_mp_pvp.put(Integer.valueOf(items_mp_pvp.size() + 1), new Acessory(item_id, item.getBodyPart()));
+            } else if (item.getType2() == 1) {
+              items_mp_pvp.put(Integer.valueOf(items_mp_pvp.size() + 1), new ArmororShield(item_id, item.getBodyPart()));
+            }
+          }
+        }
+        st.close();
+        st = null;
+        rs.close();
+        rs = null;
+        
+        System.out.println("[EventMonumentStatuet]:Map Items pvp created with " + items_mp_pvp.size() + " items.");
+      }
+      catch (Exception e)
+      {
+    	  System.out.println("[EventMonumentStatuet]: Error in createStatuet 1:");
+        e.printStackTrace();
+      }
+      finally
+      {
+        CloseUtil.close(con);
+        con = null;
+      }
+    }
+    if (dados_pk[0] != 0)
+    {
+      items_mp_pk = new FastMap();
+      String SQL = "SELECT item_id, enchant_level FROM items WHERE owner_id=" + dados_pk[0] + " AND loc='PAPERDOLL'";
+      try
+      {
+        con = L2DatabaseFactory.getInstance().getConnection();
+        PreparedStatement st = con.prepareStatement(SQL);
+        ResultSet rs = st.executeQuery();
+        while (rs.next())
+        {
+          int item_id = rs.getInt("item_id");
+          int enchant_level = rs.getInt("enchant_level");
+          
+          item = ItemTable.getInstance().getTemplate(item_id);
+          if (item != null) {
+            if (item.getType2() == 0) {
+              items_mp_pk.put(Integer.valueOf(items_mp_pk.size() + 1), new Weapon(item_id, enchant_level, item.getBodyPart()));
+            } else if (item.getType2() == 2) {
+              items_mp_pk.put(Integer.valueOf(items_mp_pk.size() + 1), new Acessory(item_id, item.getBodyPart()));
+            } else if (item.getType2() == 1) {
+              items_mp_pk.put(Integer.valueOf(items_mp_pk.size() + 1), new ArmororShield(item_id, item.getBodyPart()));
+            }
+          }
+        }
+        st.close();
+        st = null;
+        rs.close();
+        rs = null;
+        
+        System.out.println("[EventMonumentStatuet]:Map Items pk created with " + items_mp_pk.size() + " items.");
+      }
+      catch (Exception e)
+      {
+    	  System.out.println("[EventMonumentStatuet]: Error in createStatuet 2:");
+        e.printStackTrace();
+      }
+      finally
+      {
+        CloseUtil.close(con);
+        con = null;
+      }
+    }
+    if ((items_mp_pvp != null) && (items_mp_pk != null))
+    {
+      System.out.println("[EventMonumentStatuet]:Calling data from the statue new MonumentCreator()");
+      MonumentCreator alpha = new MonumentCreator();
+      if (dados_pvp[0] != 0)
+      {
+        int[] dados_pvp_int = new int[3];
+        dados_pvp_int[0] = dados_pvp[0];
+        dados_pvp_int[1] = 1;
+        dados_pvp_int[2] = dados_pvp[1];
+        
+        alpha.create(dados_pvp_int, items_mp_pvp);
+        
+        alpha = null;
+      }
+      if (dados_pk[0] != 0)
+      {
+        int[] dados_pk_int = new int[3];
+        alpha = new MonumentCreator();
+        dados_pk_int[0] = dados_pk[0];
+        dados_pk_int[1] = 2;
+        dados_pk_int[2] = dados_pk[1];
+        
+        alpha.create(dados_pk_int, items_mp_pk);
+        
+        alpha = null;
+      }
+      CustomNpcInstanceManager.getInstance().reload();
+      
+      reloadAllNpc();
+    }
+  }
+  
+  public class Items
+  {
+    int _item_id;
+    int _slot;
+    
+    public Items(int item_id, int slot)
+    {
+      _item_id = item_id;
+      _slot = slot;
+    }
+    
+    public int getItemId()
+    {
+      return _item_id;
+    }
+    
+    public int getItemSlot()
+    {
+      return _slot;
+    }
+  }
+  
+  public class Weapon
+    extends EventMonumentStatuet.Items
+  {
+    int _enchant;
+    
+    public Weapon(int item_id, int enchant, int slot)
+    {
+      super(item_id, slot);
+      
+      System.out.println("Added weapon slot:" + slot);
+      _enchant = enchant;
+    }
+    
+    public int getItemEnchant()
+    {
+      return _enchant;
+    }
+  }
+  
+  public class ArmororShield
+    extends EventMonumentStatuet.Items
+  {
+    public ArmororShield(int item_id, int slot)
+    {
+      super(item_id, slot);
+    }
+  }
+  
+  public class Acessory
+    extends EventMonumentStatuet.Items
+  {
+    public Acessory(int item_id, int slot)
+    {
+      super(item_id, slot);
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/monumentstatuet/MonumentCreator.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/monumentstatuet/MonumentCreator.java	(revisão 0)
+++ head-src/com/l2jfrozen/gameserver/monumentstatuet/MonumentCreator.java	(cópia de trabalho)
@@ -0,0 +1,170 @@
+package com.l2jfrozen.gameserver.monumentstatuet;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.util.CloseUtil;
+import com.l2jfrozen.util.database.L2DatabaseFactory;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Map;
+import javolution.util.FastMap;
+
+public class MonumentCreator
+{
+  int _right_hand = 0;
+  int _female = 0;
+  int _hair2 = 0;
+  int[] dados = new int[3];
+  int _class_id = 0;
+  int _hair_style = 0;
+  int _hair_color = 0;
+  int _face = 0;
+  int _hero = 0;
+  int _wpn_enchant = 0;
+  int _feet = 0;
+  int _left_hand = 0;
+  int _gloves = 0;
+  int _chest = 0;
+  int _legs = 0;
+  int _hair = 0;
+  String _name;
+  String _title;
+  FastMap<Integer, EventMonumentStatuet.Items> _items;
+  
+  public void create(int[] obj_id, Map<Integer, EventMonumentStatuet.Items> items)
+  {
+    dados = obj_id;
+    
+    _items = ((FastMap)items);
+    
+    load();
+  }
+  
+  private void load()
+  {
+    Connection con = null;
+    String SQL = "SELECT char_name,face,hairStyle,hairColor,sex,classid FROM characters WHERE obj_Id=" + dados[0];
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      PreparedStatement st = con.prepareStatement(SQL);
+      ResultSet rs = st.executeQuery();
+      while (rs.next())
+      {
+        _name = rs.getString("char_name");
+        _face = rs.getInt("face");
+        _hair_style = rs.getInt("hairStyle");
+        _hair_color = rs.getInt("hairColor");
+        _female = rs.getInt("sex");
+        _class_id = rs.getInt("classid");
+      }
+      st.close();
+      rs.close();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[MonumentCreator]: Error in load SQL FROM characters...");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+    System.out.println("[Form Monument]: Load info char ok...");
+    
+    _title = (dados[2] + " pk's in 24h");
+    for (EventMonumentStatuet.Items item : _items.values())
+    {
+      switch (item.getItemSlot())
+      {
+      case 16384: 
+        _left_hand = item.getItemId();
+        _right_hand = item.getItemId();
+        break;
+      case 128: 
+        _right_hand = item.getItemId();
+        break;
+      case 262144: 
+        _hair = item.getItemId();
+        break;
+      case 65536: 
+        _hair2 = item.getItemId();
+        break;
+      case 1024: 
+        _chest = item.getItemId();
+        break;
+      case 512: 
+        _gloves = item.getItemId();
+        break;
+      case 4096: 
+        _feet = item.getItemId();
+        break;
+      case 64: 
+        _hair = item.getItemId();
+        break;
+      case 32768: 
+        _chest = item.getItemId();
+        break;
+      case 2048: 
+        _legs = item.getItemId();
+      }
+      if ((item instanceof EventMonumentStatuet.Weapon)) {
+        _wpn_enchant = ((EventMonumentStatuet.Weapon)item).getItemEnchant();
+      }
+    }
+    System.out.println("[Form Monument]: Aparence information OK...");
+    
+    putIntoDb();
+    
+    System.out.println("[Form Monument]: Data Saved...");
+  }
+  
+  public void putIntoDb()
+  {
+    Connection con = null;
+    try
+    {
+      con = L2DatabaseFactory.getInstance().getConnection();
+      
+      PreparedStatement statement = con.prepareStatement("UPDATE npc_to_pc_polymorph SET name=?,title=?,class_id=?,female=?,hair_style=?,hair_color=?,face=?,hero=?,wpn_enchant=?,right_hand=?,left_hand=?,gloves=?,chest=?,legs=?,feet=?,hair=?,hair2=? WHERE template=" + (dados[1] == 1 ? Config.NPC_TEMPLATE_ID_PVP : Config.NPC_TEMPLATE_ID_PK));
+      
+
+
+
+
+      statement.setString(1, _name);
+      statement.setString(2, _title);
+      statement.setInt(3, _class_id);
+      statement.setInt(4, _female);
+      statement.setInt(5, _hair_style);
+      statement.setInt(6, _hair_color);
+      statement.setInt(7, _face);
+      statement.setInt(8, _hero);
+      statement.setInt(9, _wpn_enchant);
+      statement.setInt(10, _right_hand);
+      statement.setInt(11, _left_hand);
+      
+      statement.setInt(12, _gloves);
+      statement.setInt(13, _chest);
+      statement.setInt(14, _legs);
+      statement.setInt(15, _feet);
+      
+      statement.setInt(16, _hair);
+      statement.setInt(17, _hair2);
+      
+      statement.execute();
+      statement.close();
+    }
+    catch (Exception e)
+    {
+      System.out.println("[MonumentCreator]: Failt to putIntoDb...");
+      e.printStackTrace();
+    }
+    finally
+    {
+      CloseUtil.close(con);
+      con = null;
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(cópia de trabalho)
@@ -71,6 +71,7 @@
 import com.l2jfrozen.gameserver.model.entity.siege.Siege;
 import com.l2jfrozen.gameserver.model.quest.Quest;
 import com.l2jfrozen.gameserver.model.quest.QuestState;
+import com.l2jfrozen.gameserver.monumentstatuet.EventMonumentStatuet;
 import com.l2jfrozen.gameserver.network.Disconnection;
 import com.l2jfrozen.gameserver.network.SystemMessageId;
 import com.l2jfrozen.gameserver.network.serverpackets.ClientSetTime;
@@ -417,6 +418,9 @@
 		if (DM._savePlayers.contains(activeChar.getName()))
 			DM.addDisconnectedPlayer(activeChar);
 		
+	    if (Config.EVENT_MONUMENT_STATUET) {
+	        EventMonumentStatuet.getInstance().onEnterPlayer(activeChar);
+	      }
 		// Means that it's not ok multiBox situation, so logout
 		if (!activeChar.checkMultiBox())
 		{
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/CustomNpcInfo.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/CustomNpcInfo.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/CustomNpcInfo.java	(cópia de trabalho)
@@ -1,153 +1,124 @@
+/*
+ * L2jFrozen Project - www.l2jfrozen.com 
+ * 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.network.serverpackets;
+ 
+import com.l2jfrozen.gameserver.datatables.sql.CharTemplateTable;
+import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
+
+ public class CustomNpcInfo extends L2GameServerPacket
+  {
+  private static final String _S__03_CUSTOMNPCINFO = "[S] 03 CustomNpcInfo [dddddsddd dddddddddddd dddddddd hhhh d hhhhhhhhhhhh d hhhh hhhhhhhhhhhhhhhh dddddd dddddddd ffff ddd s ddddd ccccccc h c d c h ddd cc d ccc ddddddddddd]";
+  private final L2NpcInstance _activeChar;
+  
+  public CustomNpcInfo(L2NpcInstance cha)
+  {
+    _activeChar = cha;
+    _activeChar.setClientX(_activeChar.getPosition().getX());
+    _activeChar.setClientY(_activeChar.getPosition().getY());
+    _activeChar.setClientZ(_activeChar.getPosition().getZ());
+  }
+  
+  protected final void writeImpl()
+  {
+    writeC(3);
+    writeD(_activeChar.getX());
+    writeD(_activeChar.getY());
+    writeD(_activeChar.getZ());
+    writeD(_activeChar.getHeading());
+    writeD(_activeChar.getObjectId());
+    writeS(_activeChar.getCustomNpcInstance().getName());
+    writeD(_activeChar.getCustomNpcInstance().getRace());
+    writeD(_activeChar.getCustomNpcInstance().isFemaleSex() ? 1 : 0);
+    writeD(_activeChar.getCustomNpcInstance().getClassId());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR());
+    writeD(0);
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_RHAND());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_LHAND());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_GLOVES());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_CHEST());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_LEGS());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_FEET());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_RHAND());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR());
+    writeD(_activeChar.getCustomNpcInstance().PAPERDOLL_HAIR2());
+    write('H', 0, 24);
+    writeD(_activeChar.getCustomNpcInstance().getPvpFlag() ? 1 : 0);
+    writeD(_activeChar.getCustomNpcInstance().getKarma());
+    writeD(_activeChar.getMAtkSpd());
+    writeD(_activeChar.getPAtkSpd());
+    writeD(_activeChar.getCustomNpcInstance().getPvpFlag() ? 1 : 0);
+    writeD(_activeChar.getCustomNpcInstance().getKarma());
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed() / 2);
+    writeD(_activeChar.getRunSpeed() / 3);
+    writeD(_activeChar.getRunSpeed() / 3);
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed());
+    writeD(_activeChar.getRunSpeed());
+    writeF(_activeChar.getStat().getMovementSpeedMultiplier());
+    writeF(_activeChar.getStat().getAttackSpeedMultiplier());
+    writeF(CharTemplateTable.getInstance().getTemplate(_activeChar.getCustomNpcInstance().getClassId()).getCollisionRadius());
+    writeF(CharTemplateTable.getInstance().getTemplate(_activeChar.getCustomNpcInstance().getClassId()).getCollisionHeight());
+    writeD(_activeChar.getCustomNpcInstance().getHairStyle());
+    writeD(_activeChar.getCustomNpcInstance().getHairColor());
+    writeD(_activeChar.getCustomNpcInstance().getFace());
+    writeS(_activeChar.getCustomNpcInstance().getTitle());
+    writeD(_activeChar.getCustomNpcInstance().getClanId());
+    writeD(_activeChar.getCustomNpcInstance().getClanCrestId());
+    writeD(_activeChar.getCustomNpcInstance().getAllyId());
+    writeD(_activeChar.getCustomNpcInstance().getAllyCrestId());
+    writeD(0);
+    writeC(1);
+    writeC(_activeChar.isRunning() ? 1 : 0);
+    writeC(_activeChar.isInCombat() ? 1 : 0);
+    writeC(_activeChar.isAlikeDead() ? 1 : 0);
+    write('C', 0, 3);
+    writeH(0);
+    writeC(0);
+    writeD(_activeChar.getAbnormalEffect());
+    writeC(0);
+    writeH(0);
+    writeD(_activeChar.getCustomNpcInstance().getClassId());
+    writeD(_activeChar.getMaxCp());
+    writeD((int)_activeChar.getStatus().getCurrentCp());
+    writeC(_activeChar.getCustomNpcInstance().getEnchantWeapon());
+    writeC(0);
+    writeD(0);
+    writeC(_activeChar.getCustomNpcInstance().isNoble() ? 1 : 0);
+    writeC(_activeChar.getCustomNpcInstance().isHero() ? 1 : 0);
+    writeC(0);
+    write('D', 0, 3);
+    writeD(_activeChar.getCustomNpcInstance().nameColor());
+    writeD(0);
+    writeD(_activeChar.getCustomNpcInstance().getPledgeClass());
+    writeD(0);
+    writeD(_activeChar.getCustomNpcInstance().titleColor());
+    writeD(0);
+  }
+  
+  public String getType()
+  {
+    return "[S] 03 CustomNpcInfo [dddddsddd dddddddddddd dddddddd hhhh d hhhhhhhhhhhh d hhhh hhhhhhhhhhhhhhhh dddddd dddddddd ffff ddd s ddddd ccccccc h c d c h ddd cc d ccc ddddddddddd]";
+  }
+  
+  private final void write(char type, int value, int times)
+  {
+    for (int i = 0; i < times; i++) {
+      switch (type)
+      {
+      case 'C': 
+        writeC(value);
+        break;
+      case 'D': 
+        writeD(value);
+        break;
+      case 'F': 
+        writeF(value);
+        break;
+      case 'H': 
+        writeH(value);
+      }
+    }
+  }
+}
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfoPoly.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfoPoly.java	(revisão 1118)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfoPoly.java	(cópia de trabalho)
+package com.l2jfrozen.gameserver.network.serverpackets;
+
+import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.L2Object;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+
+public class NpcInfoPoly extends L2GameServerPacket
+{
+  private static final String _S__22_NPCINFO = "[S] 16 NpcInfo";
+  private L2Character _activeChar;
+  private final L2Object _obj;
+  private int _x;
+  private int _y;
+  private int _z;
+  private int _heading;
+  private final int _npcId;
+  private boolean _isAttackable;
+  private final boolean _isSummoned;
+  private boolean _isRunning;
+  private boolean _isInCombat;
+  private boolean _isAlikeDead;
+  private int _mAtkSpd;
+  private int _pAtkSpd;
+  private int _runSpd;
+  private int _walkSpd;
+  private int _swimRunSpd;
+  private int _swimWalkSpd;
+  private int _flRunSpd;
+  private int _flWalkSpd;
+  private int _flyRunSpd;
+  private int _flyWalkSpd;
+ private int _rhand;
+  private int _lhand;
+  private String _name;
+  private String _title;
+  private int _abnormalEffect;
+  L2NpcTemplate _template;
+  private final int _collisionRadius;
+  private final int _collisionHeight;
+ 
+  public NpcInfoPoly(L2Object obj, L2Character attacker)
+  {
+    _obj = obj;
+    _npcId = obj.getPoly().getPolyId();
+    _template = NpcTable.getInstance().getTemplate(_npcId);
+    _isAttackable = true;
+    _rhand = 0;
+    _lhand = 0;
+    _isSummoned = false;
+    _collisionRadius = _template.collisionRadius;
+    _collisionHeight = _template.collisionHeight;
+    if ((_obj instanceof L2Character))
+    {
+      _activeChar = ((L2Character)obj);
+      _isAttackable = obj.isAutoAttackable(attacker);
+      _rhand = _template.rhand;
+      _lhand = _template.lhand;
+    }
+    if ((_obj instanceof L2ItemInstance))
+    {
+      _x = _obj.getX();
+      _y = _obj.getY();
+      _z = _obj.getZ();
+      _heading = 0;
+      _mAtkSpd = 100;
+      _pAtkSpd = 100;
+      _runSpd = 120;
+      _walkSpd = 80;
+      _swimRunSpd = (_flRunSpd = _flyRunSpd = _runSpd);
+      _swimWalkSpd = (_flWalkSpd = _flyWalkSpd = _walkSpd);
+      _isRunning = (_isInCombat = _isAlikeDead = false);
+     _name = "item";
+      _title = "polymorphed";
+      _abnormalEffect = 0;
+    }
+    else
+    {
+      _x = _activeChar.getX();
+      _y = _activeChar.getY();
+      _z = _activeChar.getZ();
+      _heading = _activeChar.getHeading();
+      _mAtkSpd = _activeChar.getMAtkSpd();
+      _pAtkSpd = _activeChar.getPAtkSpd();
+      _runSpd = _activeChar.getRunSpeed();
+      _walkSpd = _activeChar.getWalkSpeed();
+      _swimRunSpd = (_flRunSpd = _flyRunSpd = _runSpd);
+      _swimWalkSpd = (_flWalkSpd = _flyWalkSpd = _walkSpd);
+      _isRunning = _activeChar.isRunning();
+      _isInCombat = _activeChar.isInCombat();
+      _isAlikeDead = _activeChar.isAlikeDead();
+      _name = _activeChar.getName();
+      _title = _activeChar.getTitle();
+      _abnormalEffect = _activeChar.getAbnormalEffect();
+    }
+  }
+  
+  protected final void writeImpl()
+  {
+    writeC(22);
+    writeD(_obj.getObjectId());
+    writeD(_npcId + 1000000);
+    writeD(_isAttackable ? 1 : 0);
+    writeD(_x);
+    writeD(_y);
+    writeD(_z);
+    writeD(_heading);
+    writeD(0);
+    writeD(_mAtkSpd);
+    writeD(_pAtkSpd);
+    writeD(_runSpd);
+    writeD(_walkSpd);
+    writeD(_swimRunSpd);
+    writeD(_swimWalkSpd);
+    writeD(_flRunSpd);
+    writeD(_flWalkSpd);
+    writeD(_flyRunSpd);
+    writeD(_flyWalkSpd);
+    writeF(1.0D);
+    writeF(1.0D);
+    writeF(_collisionRadius);
+    writeF(_collisionHeight);
+    writeD(_rhand);
+    writeD(0);
+    writeD(_lhand);
+    writeC(1);
+    writeC(_isRunning ? 1 : 0);
+    writeC(_isInCombat ? 1 : 0);
+    writeC(_isAlikeDead ? 1 : 0);
+    writeC(_isSummoned ? 2 : 0);
+    writeS(_name);
+    writeS(_title);
+    writeD(0);
+    writeD(0);
+    writeD(0);
+    
+    writeH(_abnormalEffect);
+    writeH(0);
+    writeD(0);
+    writeD(0);
+    writeD(0);
+    writeD(0);
+    writeC(0);
+  }
+  
+  public String getType()
+  {
+    return "[S] 16 NpcInfo";
+  }
+}

 

 

 

 

RW5oPX7.jpg

 

Thanks for providing the rev: Screenshot

Credit removal and adaptation: Tayran.Cannabis

Removing Source: L2JDX

 

i have got spawn error with caracters its working normaly good but only erro its spawn caraters...someone help me ???

Edited by kingmert
  • 2 weeks later...
  • 7 months later...
Posted
1 hour ago, PaRaNoiC* said:

copy paste one sql

change name npc id and tempalte id + type

Not npc SQL :facepalm: coded misses tables code related. 

  • 2 weeks later...
  • 3 years later...
Posted (edited)
7 minutes ago, KERB said:

Alguien pudp solucionar lo de los pjs desnudos?

Do you realise you're in a forum in EU and you need to write ENGLISH?

You latino have no respect at all.

 

PS. Congratulations for undig an almost 4 years old topic.

Edited by L2-Evanthe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • 🔥 L2Gold.co x15 Interlude Server 2025 – Grand Opening! 🔥 Join us today and be part of the legendary L2Gold community! 🎉 Grand Opening: 14 March 2025 🎉 ⏰ Time: 21:00 GMT +2 🌍 Server Type: EURO PTS/L2OFF 🌟 Why Play on L2Gold.co? 🌟 ✅ No Wipes – Keep Your Progress Forever! Your characters and progress are permanent. No resets! ✅ Balanced & Fun Gameplay! Experience x15 rates for a smooth and enjoyable progression. ✅ Solo or Party Play Use MP potions and NPC buffers for a great solo experience or team up with friends. ✅ Long-Term Stability Our server is built to last with no interruptions! 📊 Server Rates & Details 📊 Category Rate EXP/SP x15 (Official rate without rune or VIP) Adena x10 (Official rate without rune or VIP) Drop x10 (Official rate without rune or VIP) Spoil x10 (Official rate without rune or VIP) Raid Boss Drop x10 (Official rate without rune or VIP) 🚀 Exciting New Features! 🚀 🎟️ 💰 Weekly Lottery System! – Win rare items, in-game currency, and exclusive rewards! 🎁 More Events & Rewards! – Special in-game activities with exclusive items! 📈 Real-Time Stats! – Track your progress, achievements, and rankings live! ⚔️ New Items Weekly! – Discover rare gear and unique items every week! 🌍 A Growing Global Community 🌍 Players from Greece 🇬🇷, Brazil 🇧🇷, Spain 🇪🇸, and beyond! 🔗 Stay Connected 🔗 Follow us on social media to stay updated! 🌎 Website: L2Gold.co 🎙️ Discord: Server 📘 Facebook: Page | Group 🎥 YouTube:   Watch Videos 🎵 TikTok: Follow Us 🔥 Prepare for Battle! 🔥 📅 The adventure begins on 14 March 2025! Join L2Gold.co and Experience an Unforgettable Adventure! 🎮✨
    • y girate unos archivitos del powerclass dale..... sin encrypt
    • Hi, im looking for cardinal pvp script for auto cleanse/rez/nobles etc etc and guide on how to setup as well as what programms do i need to run such scripts as i have never used any helper or something before,
    • [Release] Solo PvP Zone System 🔹 Compatible with: aCis 401+ 📜 Features: ✅ Automatic Exit on Restart: Players are removed from the zone if a restart occurs or logout. ✅ Custom Exit Command: Players can exit the Solo Zone with the voice command .exit. ✅ Teleport NPC Command: new bypass solopvp for gatekeeper. ✅ Random Name Generator: Generates random names. ✅ PvP Flag: The players are flagged within this zone.   xml preview & java code backup code -> https://pastebin.com/974V2p2p   SoloZone.xml <?xml version="1.0" encoding="UTF-8"?> <list> <zone shape="NPoly" minZ="-5200" maxZ="-4680"><!-- Frintezza Solo Zone --> <stat name="name" val="Solo PvP Zone" /> <stat name="locs" val="174244,-89089,-5112;174260,-86881,-5112;173184,-88090,-5112;175309,-88018,-5112;174231,-88019,-5112;175136,-88828,-5104;174962,-87025,-5104;173149,-87142,-5104;173470,-88908,-5112" /> <stat name="restrictedClasses" val="15,16,97" /> <node x="172031" y="-90127"/> <node x="176428" y="-90089"/> <node x="176428" y="-74051"/> <node x="172057" y="-74108"/> </zone> </list> SoloZone Code: diff --git a/java/net/sf/l2j/gameserver/taskmanager/SoloZoneTaskManager.java b/java/net/sf/l2j/gameserver/taskmanager/SoloZoneTaskManager.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/taskmanager/SoloZoneTaskManager.java @@ -0,0 +1,98 @@ +package net.sf.l2j.gameserver.taskmanager; + +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.logging.Logger; + +import net.sf.l2j.commons.random.Rnd; + +import net.sf.l2j.gameserver.data.manager.ZoneManager; +import net.sf.l2j.gameserver.enums.ZoneId; +import net.sf.l2j.gameserver.handler.voicecommandhandlers.VoiceExitSoloZone; +import net.sf.l2j.gameserver.model.World; +import net.sf.l2j.gameserver.model.actor.Player; +import net.sf.l2j.gameserver.model.location.Location; +import net.sf.l2j.gameserver.model.zone.type.SoloZone; + + +/** + * @author MarGaZeaS + */ +public class SoloZoneTaskManager implements Runnable { + + private static final Location EXIT_LOCATION = VoiceExitSoloZone.getExitLocation(); // Λαμβάνουμε την έξοδο από το VoiceExitSoloZone + + @Override + public void run() + { + // Διασχίζουμε όλους τους παίκτες του κόσμου + for (Player player : World.getInstance().getPlayers()) + { + // Ελέγχουμε αν ο παίκτης είναι στο SoloZone + if (player.isInsideZone(ZoneId.SOLO)) + { + // Μεταφέρουμε τον παίκτη στην έξοδο + player.teleportTo(EXIT_LOCATION.getX(), EXIT_LOCATION.getY(), EXIT_LOCATION.getZ(), 0); + player.sendMessage("The server is restarting, you have been moved out of the Solo Zone."); + } + } + } + + private int _id; + + private static final Logger _log = Logger.getLogger(SoloZoneTaskManager.class.getName()); + private static final ArrayList<String> _rndNames = new ArrayList<>(); + private static final int RANDOM_NAMES = 500; + private static final String CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + private int _playersInSoloZone = 0; + + public int getPlayersInside() { + return _playersInSoloZone; + } + + public void setPlayersInside(int val) { + _playersInSoloZone = val; + } + + public SoloZoneTaskManager() { + _log.info("Solo Zone System: Loading..."); + for (int i = 0; i < RANDOM_NAMES; i++) { + String name = generateName(); + _rndNames.add(name); + _log.info("Generated name: " + name); + } + _log.info("Solo Zone System: Loaded " + _rndNames.size() + " names."); + } + + public String getAName() { + if (_rndNames.isEmpty()) { + _log.warning("SoloZoneManager: No random names available."); + return "Unknown"; + } + return _rndNames.get(Rnd.get(5, RANDOM_NAMES - 5)); + } + + private static String generateName() { + SecureRandom rnd = new SecureRandom(); + StringBuilder sb = new StringBuilder(15); + for (int i = 0; i < 15; i++) { + sb.append(CHARS.charAt(rnd.nextInt(CHARS.length()))); + } + return sb.toString(); + } + + public int getZoneId() + { + return _id; + } + + public final static SoloZone getCurrentZone() { + return ZoneManager.getInstance().getAllZones(SoloZone.class) + .stream() + .findFirst() // Επιστρέφει την πρώτη SoloZone (αν υπάρχει μόνο μία) + .orElse(null); + } + + public static SoloZoneTaskManager getInstance() { + return SingletonHolder._instance; + } + + private static class SingletonHolder { + private static final SoloZoneTaskManager _instance = new SoloZoneTaskManager(); + } +} diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java b/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java index a707ce5..d247e2e 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java final Player player = entry.getKey(); final long timeLeft = entry.getValue(); + if(player.isInsideZone(ZoneId.SOLO)) + continue; if(player.isInsideZone(ZoneId.BOSS)) continue; // Time is running out, clear PvP flag and remove from list. if (currentTime > timeLeft) diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java index a707ce5..d247e2e 100644 +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java if (Config.ALLOW_FISH_CHAMPIONSHIP) FishingChampionshipManager.getInstance(); + if (Config.ENABLE_STARTUP) + StartupManager.getInstance(); diff --git a/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMaintenance.java b/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMaintenance.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminMaintenance.java if (!st.hasMoreTokens()) { sendHtmlForm(player); return; } try { switch (st.nextToken()) { case "shutdown": + SoloZoneTaskManager exitTask = new SoloZoneTaskManager(); + ThreadPool.schedule(exitTask, 0); Shutdown.getInstance().startShutdown(player, null, Integer.parseInt(st.nextToken()), false); break; case "restart": + exitTask = new SoloZoneTaskManager(); + ThreadPool.schedule(exitTask, 0); Shutdown.getInstance().startShutdown(player, null, Integer.parseInt(st.nextToken()), true); break; case "abort": Shutdown.getInstance().abort(player); break; diff --git a/java/net/sf/l2j/gameserver/handler/voicecommandhandlers/VoiceExitSoloZone.java b/java/net/sf/l2j/gameserver/handler/voicecommandhandlers/VoiceExitSoloZone.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/handler/voicecommandhandlers/VoiceExitSoloZone.java +package net.sf.l2j.gameserver.handler.voicecommandhandlers; + +import net.sf.l2j.commons.pool.ThreadPool; + +import net.sf.l2j.gameserver.enums.ZoneId; +import net.sf.l2j.gameserver.handler.IVoiceCommandHandler; +import net.sf.l2j.gameserver.model.actor.Player; +import net.sf.l2j.gameserver.model.location.Location; +import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse; + +/** + * Handles the voice command for exiting the Solo Zone with delay and effects. + * + * @author MarGaZeaS + */ +public class VoiceExitSoloZone implements IVoiceCommandHandler +{ + private static final String[] VOICE_COMMANDS = + { + "exit" + }; + + // Default location to teleport players when exiting the Solo Zone + private static final Location EXIT_LOCATION = new Location(81318, 148064, -3464); // Replace with your desired coordinates + + // Προσθήκη της μεθόδου για να πάρουμε την τοποθεσία εξόδου + public static Location getExitLocation() { + return EXIT_LOCATION; + } + + @Override + public void useVoiceCommand(Player player, String command) + { + if (command.equalsIgnoreCase("exit")) + { + if (!player.isInsideZone(ZoneId.SOLO)) + { + player.sendMessage("You are not inside the Solo Zone."); + return; + } + + // Notify the player about the delay + player.sendMessage("You will be teleported out of the Solo Zone in 2 seconds."); + + // Cast skill effect (Skill ID: 2100, Level: 1) + player.broadcastPacket(new MagicSkillUse(player, player, 2100, 1, 2000, 0)); + + // Schedule the teleportation after a 2-second delay + ThreadPool.schedule(() -> { + // Teleport the player to the designated exit location + player.teleportTo(EXIT_LOCATION.getX(), EXIT_LOCATION.getY(), EXIT_LOCATION.getZ(), 0); + + // Inform the player + player.sendMessage("You have exited the Solo Zone."); + }, 2000); // Delay in milliseconds (2000ms = 2 seconds) + } + } + + @Override + public String[] getVoiceCommandList() + { + return VOICE_COMMANDS; + } +} diff --git a/java/net/sf/l2j/gameserver/handler/VoiceCommandHandler.java b/java/net/sf/l2j/gameserver/handler/VoiceCommandHandler.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/handler/VoiceCommandHandler.java public class VoiceCommandHandler { private final Map<String, IVoiceCommandHandler> _entries = new HashMap<>(); protected VoiceCommandHandler() { ............ ............ + registerHandler(new VoiceExitSoloZone()); } public void registerHandler(IVoiceCommandHandler handler) { for (String command : handler.getVoiceCommandList()) _entries.put(command, handler); } diff --git a/java/net/sf/l2j/gameserver/model/actor/Npc.java b/java/net/sf/l2j/gameserver/model/actor/Npc.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/model/actor/Npc.java else if (command.startsWith("Chat")) { int val = 0; try { val = Integer.parseInt(command.substring(5)); } catch (final IndexOutOfBoundsException ioobe) { } catch (final NumberFormatException nfe) { } showChatWindow(player, val); + ) + else if (command.startsWith("solopvp")) + { + SoloZoneTaskManager.getInstance(); + player.teleportTo(SoloZoneTaskManager.getCurrentZone().getLoc(), 25); + } else if (command.startsWith("Link")) { final String path = command.substring(5).trim(); if (path.indexOf("..") != -1) return; final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile("data/html/" + path); html.replace("%objectId%", getObjectId()); player.sendPacket(html); } diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java b/java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java // Fixed. - else if (_requestType == 4) - { - if (!player.isGM() && !player.isFestivalParticipant()) - return; - - loc = player.getPosition(); - } + if (_requestType == 4) + { + // Έλεγχος αν ο παίκτης δεν είναι GM, δεν είναι μέρος του φεστιβάλ και δεν είναι στην Solo Zone + if (!player.isGM() && !player.isFestivalParticipant() && !player.isInsideZone(ZoneId.SOLO)) + { + return; + } + + SoloZoneTaskManager.getInstance(); + SoloZone currentZone = SoloZoneTaskManager.getCurrentZone(); + if (currentZone != null && currentZone.getLoc() != null) + { + // Αν υπάρχει ζώνη και οι τοποθεσίες δεν είναι κενές, χρησιμοποιούμε τυχαία τοποθεσία από την ζώνη + loc = currentZone.getLoc(); + } else + { + // Διαφορετικά, κάνουμε respawn στην τρέχουσα θέση του παίκτη + loc = player.getPosition(); + } + } diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java b/java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java if (player.isFestivalParticipant() && FestivalOfDarknessManager.getInstance().isFestivalInitialized()) { player.sendPacket(SystemMessageId.NO_RESTART_HERE); sendPacket(RestartResponse.valueOf(false)); return; } + if (player.isInsideZone(ZoneId.SOLO)) + { + player.sendMessage("You cannot restart your character while in Solo Zone. Use .exit to leave"); + player.setFakeName(null); + sendPacket(RestartResponse.valueOf(false)); + return; + } player.removeFromBossZone(); diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java b/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java player.removeFromBossZone(); player.logout(true); } } + + if (player.isInsideZone(ZoneId.SOLO)) + { + player.sendMessage("You cannot logout or restart your character while in Solo Zone. Use .exit to leave"); + player.setFakeName(null); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + player.removeFromBossZone(); player.logout(true); } } diff --git a/java/net/sf/l2j/gameserver/model/zone/type/SoloZone.java b/java/net/sf/l2j/gameserver/model/zone/type/SoloZone.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/model/zone/type/SoloZone.java +package net.sf.l2j.gameserver.model.zone.type; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.sf.l2j.commons.random.Rnd; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.enums.MessageType; +import net.sf.l2j.gameserver.enums.ZoneId; +import net.sf.l2j.gameserver.handler.voicecommandhandlers.VoiceExitSoloZone; +import net.sf.l2j.gameserver.model.World; +import net.sf.l2j.gameserver.model.actor.Creature; +import net.sf.l2j.gameserver.model.actor.Player; +import net.sf.l2j.gameserver.model.location.Location; +import net.sf.l2j.gameserver.model.zone.type.subtype.ZoneType; +import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate; +import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager; +import net.sf.l2j.gameserver.taskmanager.SoloZoneTaskManager; + +/** + * @author MarGaZeaS + * + */ +public class SoloZone extends ZoneType +{ + private String _name; + private List<Location> _locations = new ArrayList<>(); + + public SoloZone(int id) + { + super(id); + } + + @Override + public void setParameter(String name, String value) + { + if (name.equals("name")) + _name = value; + else if (name.equals("locs")) + { + for (String locs : value.split(";")) + { + String[] coordinates = locs.split(","); + if (coordinates.length == 3) + { + int x = Integer.parseInt(coordinates[0]); + int y = Integer.parseInt(coordinates[1]); + int z = Integer.parseInt(coordinates[2]); + _locations.add(new Location(x, y, z)); + } + else + { + LOGGER.warn("Invalid location format: " + locs); + } + } + } + } + + + @Override + protected void onEnter(Creature character) + { + if (character instanceof Player) + { + final Player player = (Player) character; + + if ((player.getClassId().getId() == 15 || player.getClassId().getId() == 16 || player.getClassId().getId() == 97)) + { + Location respawnLocation = VoiceExitSoloZone.getExitLocation(); + player.instantTeleportTo(respawnLocation, 20); + player.sendMessage("Your class is not allowed in this zone."); + return; + } + + String randomName = SoloZoneTaskManager.getInstance().getAName(); + if (randomName == null || randomName.isEmpty() || !isValidName(randomName)) + { + randomName = generateRandomName(); + } + if (isNameAlreadyTaken(randomName)) + { + randomName = generateRandomName(); + } + player.setFakeName(randomName); + player.sendMessage("Welcome to the Solo Zone, your random name is: " + randomName); + player.sendPacket(SystemMessageId.ENTERED_COMBAT_ZONE); + character.setInsideZone(ZoneId.SOLO, true); + character.setInsideZone(ZoneId.NO_STORE, true); + character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true); + + if (player.getParty() != null) + { + player.getParty().removePartyMember(player, MessageType.DISCONNECTED); + } + + if (player.getPvpFlag() > 0) + PvpFlagTaskManager.getInstance().remove(player, true); + + player.updatePvPStatus(); + player.broadcastUserInfo(); + } + } + + private static boolean isValidName(String name) { + return name.matches("[a-zA-Z0-9_]+"); + } + + private static String generateRandomName() { + Random rand = new Random(); + int nameLength = rand.nextInt(12) + 4; + StringBuilder nameBuilder = new StringBuilder(); + + for (int i = 0; i < nameLength; i++) { + char randomChar = (char) (rand.nextInt(26) + 'a'); + nameBuilder.append(randomChar); + } + + return nameBuilder.toString(); + } + + private static boolean isNameAlreadyTaken(String name) { + return World.getInstance().getPlayers().stream().anyMatch(player -> player.getFakeName().equals(name)); + } + + @Override + protected void onExit(Creature character) + { + character.setInsideZone(ZoneId.SOLO, false); // Solo zone + character.setInsideZone(ZoneId.NO_STORE, false); // Allow making a store + character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false); // Allow summon + + if (character instanceof Player) + { + final Player player = (Player) character; + + if (player.getFakeName() != null) + { + player.setFakeName(null); + } + + player.sendPacket(SystemMessageId.LEFT_COMBAT_ZONE); + { + if(!player.isInObserverMode() && player.getPvpFlag() > 0) + PvpFlagTaskManager.getInstance().add(player, Config.PVP_NORMAL_TIME); + + player.sendPacket(new EtcStatusUpdate(player)); + player.broadcastUserInfo(); + } + } + } + + public String getName() + { + return _name; + } + + public Location getLoc() + { + if (_locations.isEmpty()) + { + return null; // Αν η λίστα είναι κενή, επιστρέφουμε null + } + return _locations.get(Rnd.get(0, _locations.size() - 1)); // Επιλέγουμε τυχαία τοποθεσία + } +} diff --git a/java/net/sf/l2j/gameserver/GameServer.java b/java/net/sf/l2j/gameserver/GameServer.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/GameServer.java if (Config.ALLOW_FISH_CHAMPIONSHIP) FishingChampionshipManager.getInstance(); + StringUtil.printSection("Custom Features"); + SoloZoneTaskManager.getInstance(); StringUtil.printSection("Handlers"); LOGGER.info("Loaded {} admin command handlers.", AdminCommandHandler.getInstance().size()); diff --git a/java/net/sf/l2j/gameserver/GameServer.java b/java/net/sf/l2j/gameserver/Shutdown.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/Shutdown.java // disconnect players try { disconnectAllPlayers(); LOGGER.info("All players have been disconnected."); } catch (Exception e) { // Silent catch. } + // Restore real names for players in SoloZone + restoreRealNamesInSoloZone(); // stop all threadpolls ThreadPool.shutdown(); try { LoginServerThread.getInstance().interrupt(); } catch (Exception e) { // Silent catch. } // avoids new players from logging in if (_secondsShut <= 60 && LoginServerThread.getInstance().getServerType() != ServerType.DOWN) LoginServerThread.getInstance().setServerType(ServerType.DOWN); _secondsShut--; Thread.sleep(1000); } } catch (InterruptedException e) { } } + // This method restores the real names of players in SoloZone + private static void restoreRealNamesInSoloZone() + { + for (Player player : World.getInstance().getPlayers()) + { + // Check if player is inside the SoloZone + if (player.isInsideZone(ZoneId.SOLO)) + { + // Restore the real name by removing the fake name + if (player.getFakeName() != null) + { + player.setFakeName(null); // Restore the real name + LOGGER.info("Player {}'s fake name has been removed and real name restored.", player.getName()); + } + } + } + } private static void sendServerQuit(int seconds) { World.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECONDS).addNumber(seconds)); } diff --git a/java/net/sf/l2j/gameserver/enums/ZoneId.java b/java/net/sf/l2j/gameserver/enums/ZoneId.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/enums/ZoneId.java public enum ZoneId { PVP(0), PEACE(1), SIEGE(2), MOTHER_TREE(3), CLAN_HALL(4), NO_LANDING(5), WATER(6), JAIL(7), MONSTER_TRACK(8), CASTLE(9), SWAMP(10), NO_SUMMON_FRIEND(11), NO_STORE(12), TOWN(13), HQ(14), DANGER_AREA(15), CAST_ON_ARTIFACT(16), NO_RESTART(17), SCRIPT(18), - BOSS(19), + BOSS(19), + SOLO(20); private final int _id; private ZoneId(int id) { _id = id; } diff --git a/java/net/sf/l2j/gameserver/network/serverpackets/Die.java b/java/net/sf/l2j/gameserver/network/serverpackets/Die.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/network/serverpackets/Die.java if (creature instanceof Player) { Player player = (Player) creature; - _allowFixedRes = player.getAccessLevel().allowFixedRes(); + _allowFixedRes = player.getAccessLevel().allowFixedRes() || player.isInsideZone(ZoneId.SOLO); _clan = player.getClan(); } diff --git a/java/net/sf/l2j/gameserver/model/actor/Player.java b/java/net/sf/l2j/gameserver//model/actor/Player.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java // Attacker or spectator logging into a siege zone will be ported at town. if (player.isInsideZone(ZoneId.SIEGE) && player.getSiegeState() < 2) player.teleportTo(TeleportType.TOWN); + if (player.isInsideZone(ZoneId.SOLO)) + { + ThreadPool.schedule(() -> { + Location exitLocation = VoiceExitSoloZone.getExitLocation(); + + if (exitLocation != null) + { + player.teleportTo(exitLocation.getX(), exitLocation.getY(), exitLocation.getZ(), 0); + player.sendMessage("You have been moved to the exit of the SoloZone."); + } + }, 5000); // 5000 milliseconds (5sec) + } diff --git a/java/net/sf/l2j/gameserver/model/actor/Player.java b/java/net/sf/l2j/gameserver/model/actor/Player.java new file mode 100644 index 0000000..6b7ef6f --- /dev/null +++ a/java/net/sf/l2j/gameserver/model/actor/Player.java @Override public void doRevive() { super.doRevive(); stopEffects(EffectType.CHARM_OF_COURAGE); sendPacket(new EtcStatusUpdate(this)); getStatus().setCpHpMp(getStatus().getMaxCp(), getStatus().getMaxHp(), getStatus().getMaxMp()); _reviveRequested = 0; _revivePower = 0; if (isMounted()) startFeed(_mountNpcId); + if (isInsideZone(ZoneId.SOLO)) + { + // Give Nobless (1323 ID) + L2Skill no = SkillTable.getInstance().getInfo(1323, 1); + no.getEffects(this, this); + sendMessage("You have received the Nobless status in the Solo Zone."); + } + }   If anyone thinks the code is wrong, please make an update and upload it here so I can update the post. A part was edited with chatgpt
    • Always remember, when you buy files, just compare with my files that I publish for free. and you will know that you are being ripped off. Greetings to all community!!! 🙂
  • Topics

×
×
  • Create New...