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.



×
×
  • Create New...