Advertisement
Nik

Untitled

Nik
Oct 24th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: java/com/l2jserver/gameserver/GameServer.java
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/GameServer.java   (revision 5685)
  4. +++ java/com/l2jserver/gameserver/GameServer.java   (working copy)
  5. @@ -49,6 +49,7 @@
  6.  import com.l2jserver.gameserver.datatables.EnchantOptionsData;
  7.  import com.l2jserver.gameserver.datatables.EventDroplist;
  8.  import com.l2jserver.gameserver.datatables.ExperienceTable;
  9. +import com.l2jserver.gameserver.datatables.FencesTable;
  10.  import com.l2jserver.gameserver.datatables.FishData;
  11.  import com.l2jserver.gameserver.datatables.FishingMonstersData;
  12.  import com.l2jserver.gameserver.datatables.FishingRodsData;
  13. @@ -256,7 +257,7 @@
  14.             PathFinding.getInstance();
  15.         }
  16.        
  17. -       printSection("NPCs");
  18. +       printSection("WorldObjects");
  19.         HerbDropTable.getInstance();
  20.         NpcTable.getInstance();
  21.         NpcWalkerRoutesData.getInstance();
  22. @@ -269,6 +270,7 @@
  23.         FortManager.getInstance().loadInstances();
  24.         NpcBufferTable.getInstance();
  25.         SpawnTable.getInstance();
  26. +       FencesTable.getInstance();
  27.         HellboundManager.getInstance();
  28.         RaidBossSpawnManager.getInstance();
  29.         DayNightSpawnManager.getInstance().trim().notifyChangeMode();
  30. Index: java/com/l2jserver/gameserver/datatables/FencesTable.java
  31. ===================================================================
  32. --- java/com/l2jserver/gameserver/datatables/FencesTable.java   (revision 0)
  33. +++ java/com/l2jserver/gameserver/datatables/FencesTable.java   (revision 0)
  34. @@ -0,0 +1,173 @@
  35. +/*
  36. + * This program is free software: you can redistribute it and/or modify it under
  37. + * the terms of the GNU General Public License as published by the Free Software
  38. + * Foundation, either version 3 of the License, or (at your option) any later
  39. + * version.
  40. + *
  41. + * This program is distributed in the hope that it will be useful, but WITHOUT
  42. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  43. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  44. + * details.
  45. + *
  46. + * You should have received a copy of the GNU General Public License along with
  47. + * this program. If not, see <http://www.gnu.org/licenses/>.
  48. + */
  49. +package com.l2jserver.gameserver.datatables;
  50. +
  51. +import java.sql.Connection;
  52. +import java.sql.PreparedStatement;
  53. +import java.sql.ResultSet;
  54. +import java.sql.SQLException;
  55. +import java.util.HashMap;
  56. +import java.util.Map;
  57. +import java.util.logging.Level;
  58. +import java.util.logging.Logger;
  59. +
  60. +import com.l2jserver.L2DatabaseFactory;
  61. +import com.l2jserver.gameserver.model.Location;
  62. +import com.l2jserver.gameserver.model.actor.instance.L2FenceInstance;
  63. +import com.l2jserver.util.StringUtil;
  64. +
  65. +/**
  66. + * @author Nik based on Christian's work.
  67. + */
  68. +public class FencesTable
  69. +{
  70. +   protected static final Logger _log = Logger.getLogger(FencesTable.class.getName());
  71. +  
  72. +   private static final class SingletonHolder
  73. +   {
  74. +       protected static final FencesTable _instance = new FencesTable();
  75. +   }
  76. +  
  77. +   public static FencesTable getInstance()
  78. +   {
  79. +       return SingletonHolder._instance;
  80. +   }
  81. +  
  82. +   private final Map<Integer, L2FenceInstance> _fences = new HashMap<>();
  83. +  
  84. +   protected FencesTable()
  85. +   {
  86. +       load();
  87. +       _log.log(Level.INFO, StringUtil.concat("Loaded ", String.valueOf(_fences.size()), " stored fences."));
  88. +   }
  89. +  
  90. +   private void load()
  91. +   {
  92. +       try (Connection con = L2DatabaseFactory.getInstance().getConnection();
  93. +           PreparedStatement stmt = con.prepareStatement("SELECT * FROM fences"))
  94. +       {
  95. +           ResultSet res = stmt.executeQuery();
  96. +           while (res.next())
  97. +           {
  98. +               L2FenceInstance fence = new L2FenceInstance(res.getInt("object_id"), res.getInt("state"), res.getInt("x"), res.getInt("y"), res.getInt("z"), res.getInt("width"), res.getInt("length"), res.getInt("height"));
  99. +               fence.setStoredToDB(true); // They are loaded from DB, therefore they are stored there.
  100. +               fence.spawnMe();
  101. +           }
  102. +       }
  103. +       catch (SQLException sqle)
  104. +       {
  105. +           _log.log(Level.WARNING, "Exception while loading fences: ", sqle);
  106. +       }
  107. +   }
  108. +  
  109. +   public void reload()
  110. +   {
  111. +       for (L2FenceInstance fence : _fences.values())
  112. +       {
  113. +           // Do not delete temp fences, they aren't stored in DB therefore they won't be reloaded, but deleted.
  114. +           if (!fence.isStoredToDB())
  115. +           {
  116. +               fence.decayMe();
  117. +           }
  118. +       }
  119. +      
  120. +       load();
  121. +   }
  122. +  
  123. +   public void addFence(L2FenceInstance fence)
  124. +   {
  125. +       _fences.put(fence.getObjectId(), fence);
  126. +   }
  127. +  
  128. +   public void getFence(int objectId)
  129. +   {
  130. +       _fences.get(objectId);
  131. +   }
  132. +  
  133. +   public L2FenceInstance removeFence(int objectId)
  134. +   {
  135. +       return _fences.remove(objectId);
  136. +   }
  137. +  
  138. +   public void deleteFence(int objectId, boolean deleteFromDB)
  139. +   {
  140. +       L2FenceInstance fence = removeFence(objectId);
  141. +       if (fence != null)
  142. +       {
  143. +           fence.decayMe();
  144. +       }
  145. +      
  146. +       if (deleteFromDB)
  147. +       {
  148. +           deleteStoredFence(objectId);
  149. +       }
  150. +   }
  151. +  
  152. +   /**
  153. +    * @param fence - Stores the fence to the database.
  154. +    */
  155. +   public void storeFence(L2FenceInstance fence)
  156. +   {
  157. +       try (Connection con = L2DatabaseFactory.getInstance().getConnection();
  158. +           PreparedStatement stmt = con.prepareStatement("INSERT INTO fences (object_id,state,x,y,z,width,length,height) VALUES(?,?,?,?,?,?,?,?)"))
  159. +       {
  160. +           stmt.setInt(1, fence.getObjectId());
  161. +           stmt.setInt(2, fence.getX());
  162. +           stmt.setInt(3, fence.getY());
  163. +           stmt.setInt(4, fence.getZ());
  164. +           stmt.setInt(5, fence.getWidth());
  165. +           stmt.setInt(6, fence.getLength());
  166. +           stmt.setInt(6, fence.getHeight());
  167. +           stmt.executeUpdate();
  168. +       }
  169. +       catch (SQLException sqle)
  170. +       {
  171. +           _log.log(Level.WARNING, "Error while storing fence:", sqle);
  172. +       }
  173. +   }
  174. +  
  175. +   public boolean deleteStoredFence(int objectId)
  176. +   {
  177. +       try (Connection con = L2DatabaseFactory.getInstance().getConnection();
  178. +           PreparedStatement stmt = con.prepareStatement("DELETE FROM fences WHERE object_id=?");)
  179. +       {
  180. +          
  181. +           stmt.setInt(1, objectId);
  182. +           if (stmt.executeUpdate() > 0)
  183. +           {
  184. +               return true;
  185. +           }
  186. +       }
  187. +       catch (SQLException sqle)
  188. +       {
  189. +           _log.log(Level.WARNING, "Error while deleting stored fence:", sqle);
  190. +       }
  191. +      
  192. +       return false;
  193. +   }
  194. +  
  195. +   public boolean checkIfBetweenFences(Location loc1, Location loc2)
  196. +   {
  197. +       for (L2FenceInstance fence : _fences.values())
  198. +       {
  199. +           if (!fence.canSee(loc1, loc2))
  200. +           {
  201. +               return true;
  202. +           }
  203. +       }
  204. +      
  205. +       return true;
  206. +   }
  207. +}
  208. Index: java/com/l2jserver/gameserver/model/L2Object.java
  209. ===================================================================
  210. --- java/com/l2jserver/gameserver/model/L2Object.java   (revision 5685)
  211. +++ java/com/l2jserver/gameserver/model/L2Object.java   (working copy)
  212. @@ -64,6 +64,7 @@
  213.         L2Object(null),
  214.         L2ItemInstance(L2Object),
  215.         L2Character(L2Object),
  216. +       L2FenceInstance(L2Object),
  217.         L2Npc(L2Character),
  218.         L2Playable(L2Character),
  219.         L2Summon(L2Playable),
  220. Index: java/com/l2jserver/gameserver/model/actor/instance/L2FenceInstance.java
  221. ===================================================================
  222. --- java/com/l2jserver/gameserver/model/actor/instance/L2FenceInstance.java (revision 0)
  223. +++ java/com/l2jserver/gameserver/model/actor/instance/L2FenceInstance.java (revision 0)
  224. @@ -0,0 +1,232 @@
  225. +/*
  226. + * This program is free software: you can redistribute it and/or modify it under
  227. + * the terms of the GNU General Public License as published by the Free Software
  228. + * Foundation, either version 3 of the License, or (at your option) any later
  229. + * version.
  230. + *
  231. + * This program is distributed in the hope that it will be useful, but WITHOUT
  232. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  233. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  234. + * details.
  235. + *
  236. + * You should have received a copy of the GNU General Public License along with
  237. + * this program. If not, see <http://www.gnu.org/licenses/>.
  238. + */
  239. +
  240. +package com.l2jserver.gameserver.model.actor.instance;
  241. +
  242. +import java.awt.Rectangle;
  243. +
  244. +import com.l2jserver.gameserver.datatables.FencesTable;
  245. +import com.l2jserver.gameserver.idfactory.IdFactory;
  246. +import com.l2jserver.gameserver.model.L2Object;
  247. +import com.l2jserver.gameserver.model.Location;
  248. +import com.l2jserver.gameserver.model.actor.L2Character;
  249. +import com.l2jserver.gameserver.network.serverpackets.ExColosseumFenceInfo;
  250. +
  251. +/**
  252. + * @author Nik
  253. + */
  254. +public final class L2FenceInstance extends L2Object
  255. +{
  256. +   public static final int HIDDEN = 0;
  257. +   public static final int UNCLOSED = 1;
  258. +   public static final int CLOSED = 2;
  259. +  
  260. +   private int _state;
  261. +   private final int _width;
  262. +   private final int _length;
  263. +   private int _height;
  264. +   private Rectangle _shape;
  265. +   private boolean _storedToDB = false;
  266. +  
  267. +   public L2FenceInstance(int objectId, int state, int x, int y, int z, int width, int length, int height)
  268. +   {
  269. +       super(objectId);
  270. +       setInstanceType(InstanceType.L2FenceInstance);
  271. +       initPosition();
  272. +       setXYZ(x, y, z);
  273. +      
  274. +       if ((state < 0) || (state > 2))
  275. +       {
  276. +           state = 0;
  277. +       }
  278. +       _state = state;
  279. +       _width = width;
  280. +       _length = length;
  281. +       _height = height;
  282. +       _shape = new Rectangle(getX(), getY(), _width, _length);
  283. +   }
  284. +  
  285. +   public L2FenceInstance(int state, int x, int y, int z, int width, int length)
  286. +   {
  287. +       super(IdFactory.getInstance().getNextId());
  288. +       setInstanceType(InstanceType.L2FenceInstance);
  289. +       initPosition();
  290. +       setXYZ(x, y, z);
  291. +      
  292. +       if ((state < 0) || (state > 2))
  293. +       {
  294. +           state = 0;
  295. +       }
  296. +       _state = state;
  297. +       _width = width;
  298. +       _length = length;
  299. +       _height = 50;
  300. +       _shape = new Rectangle(getX(), getY(), _width, _length);
  301. +   }
  302. +  
  303. +   public L2FenceInstance(int x, int y, int z, int width, int length)
  304. +   {
  305. +       super(IdFactory.getInstance().getNextId());
  306. +       setInstanceType(InstanceType.L2FenceInstance);
  307. +       initPosition();
  308. +       setXYZ(x, y, z);
  309. +       _state = CLOSED; // Its a better default than HIDDEN.
  310. +       _width = width;
  311. +       _length = length;
  312. +       _height = 50;
  313. +       _shape = new Rectangle(getX(), getY(), _width, _length);
  314. +   }
  315. +  
  316. +   public boolean isLocInside(Location loc)
  317. +   {
  318. +       boolean isInsideZ = (loc.getZ() >= getZ()) && (loc.getZ() <= (getZ() + _height));
  319. +       return _shape.contains(loc.getX(), loc.getY()) && isInsideZ && (getInstanceId() == loc.getInstanceId());
  320. +   }
  321. +  
  322. +   public boolean isLocOutside(Location loc)
  323. +   {
  324. +       return !isLocInside(loc);
  325. +   }
  326. +  
  327. +   /**
  328. +    * @param x1 - obj1's X loc
  329. +    * @param y1 - obj1's Y loc
  330. +    * @param x2 - obj2's X loc
  331. +    * @param y2 - obj2's Y loc
  332. +    * @return can obj1 see obj2 through this fence (their LOS do not intersect the fence's bounds). <B>No Z</B> checks are done. <B>No Instance</B> checks are done.
  333. +    */
  334. +   public boolean canSee(int x1, int y1, int x2, int y2)
  335. +   {
  336. +       return !_shape.intersectsLine(x1, y1, x2, y2);
  337. +   }
  338. +  
  339. +   /**
  340. +    * @param loc1 - obj1's xyz & instanceId location
  341. +    * @param loc2 - obj2's xyz & instanceId location
  342. +    * @return can obj1 see obj2 through this fence (their LOS do not intersect the fence's bounds). <B>Z</B> checks are done. <B>Instance</B> checks are done.
  343. +    */
  344. +   public boolean canSee(Location loc1, Location loc2)
  345. +   {
  346. +       if ((getState() == CLOSED) && (loc1.getInstanceId() == loc2.getInstanceId()))
  347. +       {
  348. +           // Those Z checks are probably not 100% accurate, rework them if it must.
  349. +           int higherZ = loc1.getZ() >= loc2.getZ() ? loc1.getZ() : loc2.getZ();
  350. +           if ((higherZ >= getZ()) && (higherZ <= (getZ() + _height)))
  351. +           {
  352. +               return canSee(loc1.getX(), loc1.getY(), loc2.getX(), loc2.getY());
  353. +           }
  354. +       }
  355. +      
  356. +       return true;
  357. +   }
  358. +  
  359. +   /**
  360. +    * @param obj1
  361. +    * @param obj2
  362. +    * @return can obj1 see obj2 through this fence (their LOS do not intersect the fence's bounds). <B>Z</B> checks are done. <B>Instance</B> checks are done.
  363. +    */
  364. +   public boolean canSee(L2Object obj1, L2Object obj2)
  365. +   {
  366. +       if ((getState() == CLOSED) && (obj1.getInstanceId() == obj2.getInstanceId()))
  367. +       {
  368. +           // Those Z checks are probably not 100% accurate, rework them if it must.
  369. +           int higherZ = obj1.getZ() >= obj2.getZ() ? obj1.getZ() : obj2.getZ();
  370. +           if ((higherZ >= getZ()) && (higherZ <= (getZ() + _height)))
  371. +           {
  372. +               return canSee(obj1.getX(), obj1.getY(), obj2.getX(), obj2.getY());
  373. +           }
  374. +       }
  375. +      
  376. +       return true;
  377. +   }
  378. +  
  379. +   @Override
  380. +   public void sendInfo(L2PcInstance activeChar)
  381. +   {
  382. +       activeChar.sendPacket(new ExColosseumFenceInfo(this));
  383. +   }
  384. +  
  385. +   @Override
  386. +   public boolean isAutoAttackable(L2Character attacker)
  387. +   {
  388. +       return false;
  389. +   }
  390. +  
  391. +   /**
  392. +    * Also removes the fence from FencesTable, but its not removed from DB
  393. +    */
  394. +   @Override
  395. +   public void decayMe()
  396. +   {
  397. +       FencesTable.getInstance().removeFence(getObjectId());
  398. +   }
  399. +  
  400. +   @Override
  401. +   public void onSpawn()
  402. +   {
  403. +       // Maybe someone for some reason decided to respawn this fence on different XYZ. RESHAPE!!!
  404. +       _shape = new Rectangle(getX(), getY(), _width, _length);
  405. +       FencesTable.getInstance().addFence(this);
  406. +   }
  407. +  
  408. +   /**
  409. +    * @param height - how high the fence is :D :D Although the client height of the fence is ~50, you can set it to as much as you want. <BR>
  410. +    *            Setting it to lower might result in some strange LOS checks. Setting it too high might result in weird LOS checks in all the floors of TOI :P
  411. +    */
  412. +   public void setHeight(int height)
  413. +   {
  414. +       _height = height;
  415. +   }
  416. +  
  417. +   public void setState(int state)
  418. +   {
  419. +       if ((state < 0) || (state > 2))
  420. +       {
  421. +           state = 0;
  422. +       }
  423. +      
  424. +       _state = state;
  425. +   }
  426. +  
  427. +   public int getState()
  428. +   {
  429. +       return _state;
  430. +   }
  431. +  
  432. +   public int getWidth()
  433. +   {
  434. +       return _width;
  435. +   }
  436. +  
  437. +   public int getLength()
  438. +   {
  439. +       return _length;
  440. +   }
  441. +  
  442. +   public int getHeight()
  443. +   {
  444. +       return _height;
  445. +   }
  446. +  
  447. +   public void setStoredToDB(boolean storedToDB)
  448. +   {
  449. +       _storedToDB = storedToDB;
  450. +   }
  451. +  
  452. +   public boolean isStoredToDB()
  453. +   {
  454. +       return _storedToDB;
  455. +   }
  456. +}
  457. \ No newline at end of file
  458. Index: java/com/l2jserver/gameserver/GeoEngine.java
  459. ===================================================================
  460. --- java/com/l2jserver/gameserver/GeoEngine.java    (revision 5685)
  461. +++ java/com/l2jserver/gameserver/GeoEngine.java    (working copy)
  462. @@ -34,6 +34,7 @@
  463.  
  464.  import com.l2jserver.Config;
  465.  import com.l2jserver.gameserver.datatables.DoorTable;
  466. +import com.l2jserver.gameserver.datatables.FencesTable;
  467.  import com.l2jserver.gameserver.model.L2Object;
  468.  import com.l2jserver.gameserver.model.L2Spawn;
  469.  import com.l2jserver.gameserver.model.L2World;
  470. @@ -101,6 +102,12 @@
  471.         {
  472.             return false;
  473.         }
  474. +      
  475. +       if (FencesTable.getInstance().checkIfBetweenFences(new Location(cha), new Location(target.getX(), target.getY(), target.getZ(), 0, cha.getInstanceId())))
  476. +       {
  477. +           return false;
  478. +       }
  479. +      
  480.         if (cha.getZ() >= target.getZ())
  481.         {
  482.             return canSeeTarget(cha.getX(), cha.getY(), cha.getZ(), target.getX(), target.getY(), target.getZ());
  483. @@ -138,6 +145,10 @@
  484.         {
  485.             return true; // door coordinates are hinge coords..
  486.         }
  487. +       if (FencesTable.getInstance().checkIfBetweenFences(new Location(cha), new Location(target)))
  488. +       {
  489. +           return false;
  490. +       }
  491.         if (target instanceof L2DefenderInstance)
  492.         {
  493.             z2 += 30; // well they don't move closer to balcony fence at the moment :(
  494. @@ -189,6 +200,10 @@
  495.         {
  496.             return startpoint;
  497.         }
  498. +       if (FencesTable.getInstance().checkIfBetweenFences(new Location(x, y, z, 0, instanceId), new Location(tx, ty, tz, 0, instanceId)))
  499. +       {
  500. +           return startpoint;
  501. +       }
  502.        
  503.         Location destiny = new Location(tx, ty, tz);
  504.         return moveCheck(startpoint, destiny, (x - L2World.MAP_MIN_X) >> 4, (y - L2World.MAP_MIN_Y) >> 4, z, (tx - L2World.MAP_MIN_X) >> 4, (ty - L2World.MAP_MIN_Y) >> 4, tz);
  505. Index: java/com/l2jserver/gameserver/idfactory/IdFactory.java
  506. ===================================================================
  507. --- java/com/l2jserver/gameserver/idfactory/IdFactory.java  (revision 5685)
  508. +++ java/com/l2jserver/gameserver/idfactory/IdFactory.java  (working copy)
  509. @@ -102,7 +102,8 @@
  510.         "SELECT ally_id     FROM clan_data             WHERE ally_id >= ?     AND ally_id < ?",
  511.         "SELECT leader_id   FROM clan_data             WHERE leader_id >= ?   AND leader_id < ?",
  512.         "SELECT item_obj_id FROM pets                  WHERE item_obj_id >= ? AND item_obj_id < ?",
  513. -       "SELECT object_id   FROM itemsonground        WHERE object_id >= ?   AND object_id < ?"
  514. +       "SELECT object_id   FROM itemsonground        WHERE object_id >= ?   AND object_id < ?",
  515. +       "SELECT object_id   FROM fences        WHERE object_id >= ?   AND object_id < ?"
  516.     };
  517.    
  518.     private static final String[] TIMESTAMPS_CLEAN =
  519. @@ -400,6 +401,20 @@
  520.                     temp.add(rs.getInt(1));
  521.                 }
  522.             }
  523. +          
  524. +           try (ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM fences"))
  525. +           {
  526. +               rs.next();
  527. +               temp.ensureCapacity(temp.size() + rs.getInt(1));
  528. +           }
  529. +          
  530. +           try (ResultSet rs = s.executeQuery("SELECT object_id FROM fences"))
  531. +           {
  532. +               while (rs.next())
  533. +               {
  534. +                   temp.add(rs.getInt(1));
  535. +               }
  536. +           }
  537.             temp.sort();
  538.             return temp.toArray();
  539.         }
  540. Index: java/com/l2jserver/gameserver/network/serverpackets/ExColosseumFenceInfo.java
  541. ===================================================================
  542. --- java/com/l2jserver/gameserver/network/serverpackets/ExColosseumFenceInfo.java   (revision 0)
  543. +++ java/com/l2jserver/gameserver/network/serverpackets/ExColosseumFenceInfo.java   (revision 0)
  544. @@ -0,0 +1,57 @@
  545. +/*
  546. + * This program is free software: you can redistribute it and/or modify it under
  547. + * the terms of the GNU General Public License as published by the Free Software
  548. + * Foundation, either version 3 of the License, or (at your option) any later
  549. + * version.
  550. + *
  551. + * This program is distributed in the hope that it will be useful, but WITHOUT
  552. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  553. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  554. + * details.
  555. + *
  556. + * You should have received a copy of the GNU General Public License along with
  557. + * this program. If not, see <http://www.gnu.org/licenses/>.
  558. + */
  559. +package com.l2jserver.gameserver.network.serverpackets;
  560. +
  561. +import com.l2jserver.gameserver.model.actor.instance.L2FenceInstance;
  562. +
  563. +/**
  564. + * OP: 0xFE<br>
  565. + * OP2: 0x0003<br>
  566. + * Format: ddddddd<br>
  567. + * - d: object id<br>
  568. + * - d: state(0=hidden, 1=unconnected corners, 2=connected corners)<br>
  569. + * - d: x<br>
  570. + * - d: y<br>
  571. + * - d: z<br>
  572. + * - d: a side length<br>
  573. + * - d: b side length<br>
  574. + */
  575. +public class ExColosseumFenceInfo extends L2GameServerPacket
  576. +{
  577. +   private final L2FenceInstance _fence;
  578. +  
  579. +   public ExColosseumFenceInfo(L2FenceInstance fence)
  580. +   {
  581. +       _fence = fence;
  582. +   }
  583. +  
  584. +   /**
  585. +    * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
  586. +    */
  587. +   @Override
  588. +   protected void writeImpl()
  589. +   {
  590. +       writeC(0xfe);
  591. +       writeH(0x0003);
  592. +      
  593. +       writeD(_fence.getObjectId());
  594. +       writeD(_fence.getState());
  595. +       writeD(_fence.getX());
  596. +       writeD(_fence.getY());
  597. +       writeD(_fence.getZ());
  598. +       writeD(_fence.getWidth());
  599. +       writeD(_fence.getLength());
  600. +   }
  601. +}
  602. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement