Advertisement
WallisTeer

L2JAcis - FakePCFinal

Aug 13th, 2016
1,797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.00 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2UFS
  3. Index: java/net/sf/l2j/gameserver/model/actor/FakePc.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/model/actor/FakePc.java (nonexistent)
  6. +++ java/net/sf/l2j/gameserver/model/actor/FakePc.java (working copy)
  7. @@ -0,0 +1,49 @@
  8. +/*
  9. + * This program is free software: you can redistribute it and/or modify it under
  10. + * the terms of the GNU General Public License as published by the Free Software
  11. + * Foundation, either version 3 of the License, or (at your option) any later
  12. + * version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful, but WITHOUT
  15. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  17. + * details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License along with
  20. + * this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +
  23. +package net.sf.l2j.gameserver.model.actor;
  24. +
  25. +public class FakePc
  26. +{
  27. + public String name;
  28. + public int nameColor;
  29. + public String title;
  30. + public int titleColor;
  31. + public double radius;
  32. + public double height;
  33. + public int race;
  34. + public int sex;
  35. + public int classId;
  36. + public int hairStyle;
  37. + public int hairColor;
  38. + public int face;
  39. + public byte hero;
  40. + public int enchant;
  41. +
  42. + public int rightHand;
  43. + public int leftHand;
  44. + public int chest;
  45. + public int legs;
  46. + public int gloves;
  47. + public int feet;
  48. + public int hair;
  49. + public int hair2;
  50. +
  51. + public int clanId;
  52. + public int clanCrest;
  53. + public int allyId;
  54. + public int allyCrest;
  55. + public int pledge;
  56. +}
  57. \ No newline at end of file
  58. Index: java/net/sf/l2j/gameserver/GameServer.java
  59. ===================================================================
  60. --- java/net/sf/l2j/gameserver/GameServer.java (revision 178)
  61. +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
  62. @@ -46,6 +46,7 @@
  63. import net.sf.l2j.gameserver.datatables.ClanTable;
  64. import net.sf.l2j.gameserver.datatables.DoorTable;
  65. import net.sf.l2j.gameserver.datatables.EnchantTable;
  66. +import net.sf.l2j.gameserver.datatables.FakePcsTable;
  67. import net.sf.l2j.gameserver.datatables.FenceTable;
  68. import net.sf.l2j.gameserver.datatables.FishTable;
  69. import net.sf.l2j.gameserver.datatables.GmListTable;
  70. @@ -264,6 +265,7 @@
  71. BufferTable.getInstance();
  72. HerbDropTable.getInstance();
  73. NpcTable.getInstance();
  74. + FakePcsTable.getInstance();
  75. NpcWalkerRoutesTable.getInstance();
  76. DoorTable.getInstance();
  77. StaticObjects.load();
  78. Index: java/net/sf/l2j/gameserver/model/actor/status/AttackableStatus.java
  79. ===================================================================
  80. --- java/net/sf/l2j/gameserver/model/actor/status/AttackableStatus.java (revision 178)
  81. +++ java/net/sf/l2j/gameserver/model/actor/status/AttackableStatus.java (working copy)
  82. @@ -14,8 +14,11 @@
  83. */
  84. package net.sf.l2j.gameserver.model.actor.status;
  85.  
  86. +import java.util.Collection;
  87. import net.sf.l2j.gameserver.model.actor.L2Attackable;
  88. import net.sf.l2j.gameserver.model.actor.L2Character;
  89. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  90. +import net.sf.l2j.gameserver.network.serverpackets.AbstractNpcInfo;
  91.  
  92. public class AttackableStatus extends NpcStatus
  93. {
  94. @@ -58,6 +61,22 @@
  95. }
  96.  
  97. @Override
  98. + public void setCurrentHp(double newHp, boolean broadcastPacket)
  99. + {
  100. + super.setCurrentHp(newHp, broadcastPacket);
  101. +
  102. + if (getActiveChar().getFakePc() != null)
  103. + {
  104. + Collection<L2PcInstance> plrs = getActiveChar().getKnownList().getKnownType(L2PcInstance.class);
  105. + for (L2PcInstance player : plrs)
  106. + {
  107. + if (player != null)
  108. + player.sendPacket(new AbstractNpcInfo.NpcInfo(getActiveChar(), player));
  109. + }
  110. + }
  111. + }
  112. +
  113. + @Override
  114. public L2Attackable getActiveChar()
  115. {
  116. return (L2Attackable) super.getActiveChar();
  117. Index: dist/data/xml/fake_pcs.xml
  118. ===================================================================
  119. --- dist/data/xml/fake_pcs.xml (nonexistent)
  120. +++ dist/data/xml/fake_pcs.xml (working copy)
  121. @@ -0,0 +1,8 @@
  122. +<?xml version="1.0" encoding="UTF-8"?>
  123. +<list>
  124. + <npc id="31688">
  125. + <appearance name="Zeus" name_color="FFFFFF" title="Olympiad Manager" title_color="FF9900" radius="9" height="22" race="0" sex="0" class="10" hair_style="0" hair_color="3" face="0" hero="1" enchant="21" />
  126. + <items right_hand="6579" left_hand="6377" chest="2407" legs="0" gloves="5767" feet="5779" hair="8563" hair2="0" />
  127. + <clan clan_id="0" clan_crest="0" ally_id="0" ally_crest="0" pledge="0" />
  128. + </npc>
  129. +</list>
  130. \ No newline at end of file
  131. Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java
  132. ===================================================================
  133. --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 178)
  134. +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (working copy)
  135. @@ -23,6 +23,7 @@
  136. import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
  137. import net.sf.l2j.gameserver.datatables.AnnouncementTable;
  138. import net.sf.l2j.gameserver.datatables.DoorTable;
  139. +import net.sf.l2j.gameserver.datatables.FakePcsTable;
  140. import net.sf.l2j.gameserver.datatables.GmListTable;
  141. import net.sf.l2j.gameserver.datatables.ItemTable;
  142. import net.sf.l2j.gameserver.datatables.MultisellData;
  143. @@ -216,6 +217,11 @@
  144. DoorTable.getInstance().reload();
  145. activeChar.sendMessage("Doors instance has been reloaded.");
  146. }
  147. + else if (type.startsWith("fpc"))
  148. + {
  149. + FakePcsTable.getInstance().reload();
  150. + activeChar.sendMessage("Fake PC templates have been reloaded.");
  151. + }
  152. else if (type.startsWith("htm"))
  153. {
  154. HtmCache.getInstance().reload();
  155. @@ -263,7 +269,7 @@
  156. }
  157. else
  158. {
  159. - activeChar.sendMessage("Usage : //reload <acar|announcement|config|crest|door>");
  160. + activeChar.sendMessage("Usage : //reload <acar|announcement|config|crest|door|fpc|>");
  161. activeChar.sendMessage("Usage : //reload <htm|item|multisell|npc|npcwalker>");
  162. activeChar.sendMessage("Usage : //reload <pvp|skill|teleport|zone>");
  163. }
  164. @@ -272,7 +278,7 @@
  165. }
  166. catch (Exception e)
  167. {
  168. - activeChar.sendMessage("Usage : //reload <acar|announcement|config|crest|door>");
  169. + activeChar.sendMessage("Usage : //reload <acar|announcement|config|crest|door|fpc|>");
  170. activeChar.sendMessage("Usage : //reload <htm|item|multisell|npc|npcwalker>");
  171. activeChar.sendMessage("Usage : //reload <pvp|skill|teleport|zone>");
  172. }
  173. Index: java/net/sf/l2j/gameserver/datatables/FakePcsTable.java
  174. ===================================================================
  175. --- java/net/sf/l2j/gameserver/datatables/FakePcsTable.java (nonexistent)
  176. +++ java/net/sf/l2j/gameserver/datatables/FakePcsTable.java (working copy)
  177. @@ -0,0 +1,130 @@
  178. +/*
  179. + * This program is free software: you can redistribute it and/or modify it under
  180. + * the terms of the GNU General Public License as published by the Free Software
  181. + * Foundation, either version 3 of the License, or (at your option) any later
  182. + * version.
  183. + *
  184. + * This program is distributed in the hope that it will be useful, but WITHOUT
  185. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  186. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  187. + * details.
  188. + *
  189. + * You should have received a copy of the GNU General Public License along with
  190. + * this program. If not, see <http://www.gnu.org/licenses/>.
  191. + */
  192. +
  193. +package net.sf.l2j.gameserver.datatables;
  194. +
  195. +import java.io.File;
  196. +import java.util.HashMap;
  197. +import java.util.Map;
  198. +import java.util.logging.Level;
  199. +import java.util.logging.Logger;
  200. +
  201. +import net.sf.l2j.gameserver.model.actor.FakePc;
  202. +import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory;
  203. +
  204. +import org.w3c.dom.Document;
  205. +import org.w3c.dom.Node;
  206. +
  207. +public class FakePcsTable
  208. +{
  209. + private static Logger _log = Logger.getLogger(FakePcsTable.class.getName());
  210. + private Map<Integer, FakePc> _fakePcs;
  211. +
  212. + public static FakePcsTable getInstance()
  213. + {
  214. + return SingletonHolder._instance;
  215. + }
  216. +
  217. + protected FakePcsTable()
  218. + {
  219. + _fakePcs = new HashMap<>();
  220. + load();
  221. + }
  222. +
  223. + public void reload()
  224. + {
  225. + _fakePcs.clear();
  226. + load();
  227. + }
  228. +
  229. + private void load()
  230. + {
  231. + try
  232. + {
  233. + File f = new File("./data/xml/fake_pcs.xml");
  234. + Document doc = XMLDocumentFactory.getInstance().loadDocument(f);
  235. +
  236. + Node n = doc.getFirstChild();
  237. + for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  238. + {
  239. + if (d.getNodeName().equalsIgnoreCase("npc"))
  240. + {
  241. + FakePc fpc = new FakePc();
  242. +
  243. + int npcId = Integer.valueOf(d.getAttributes().getNamedItem("id").getNodeValue());
  244. +
  245. + for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
  246. + {
  247. + if ("appearance".equalsIgnoreCase(cd.getNodeName()))
  248. + {
  249. + fpc.name = cd.getAttributes().getNamedItem("name").getNodeValue();
  250. + fpc.nameColor = Integer.decode("0x" + cd.getAttributes().getNamedItem("name_color").getNodeValue());
  251. + fpc.title = cd.getAttributes().getNamedItem("title").getNodeValue();
  252. + fpc.titleColor = Integer.decode("0x" + cd.getAttributes().getNamedItem("title_color").getNodeValue());
  253. + fpc.radius = Integer.valueOf(cd.getAttributes().getNamedItem("radius").getNodeValue());
  254. + fpc.height = Integer.valueOf(cd.getAttributes().getNamedItem("height").getNodeValue());
  255. + fpc.race = Integer.valueOf(cd.getAttributes().getNamedItem("race").getNodeValue());
  256. + fpc.sex = Integer.valueOf(cd.getAttributes().getNamedItem("sex").getNodeValue());
  257. + fpc.classId = Integer.valueOf(cd.getAttributes().getNamedItem("class").getNodeValue());
  258. + fpc.hairStyle = Integer.valueOf(cd.getAttributes().getNamedItem("hair_style").getNodeValue());
  259. + fpc.hairColor = Integer.valueOf(cd.getAttributes().getNamedItem("hair_color").getNodeValue());
  260. + fpc.face = Integer.valueOf(cd.getAttributes().getNamedItem("face").getNodeValue());
  261. + fpc.hero = Byte.parseByte(cd.getAttributes().getNamedItem("hero").getNodeValue());
  262. + fpc.enchant = Integer.valueOf(cd.getAttributes().getNamedItem("enchant").getNodeValue());
  263. + }
  264. + else if ("items".equalsIgnoreCase(cd.getNodeName()))
  265. + {
  266. + fpc.rightHand = Integer.valueOf(cd.getAttributes().getNamedItem("right_hand").getNodeValue());
  267. + fpc.leftHand = Integer.valueOf(cd.getAttributes().getNamedItem("left_hand").getNodeValue());
  268. + fpc.chest = Integer.valueOf(cd.getAttributes().getNamedItem("chest").getNodeValue());
  269. + fpc.legs = Integer.valueOf(cd.getAttributes().getNamedItem("legs").getNodeValue());
  270. + fpc.gloves = Integer.valueOf(cd.getAttributes().getNamedItem("gloves").getNodeValue());
  271. + fpc.feet = Integer.valueOf(cd.getAttributes().getNamedItem("feet").getNodeValue());
  272. + fpc.hair = Integer.valueOf(cd.getAttributes().getNamedItem("hair").getNodeValue());
  273. + fpc.hair2 = Integer.valueOf(cd.getAttributes().getNamedItem("hair2").getNodeValue());
  274. + }
  275. + else if ("clan".equalsIgnoreCase(cd.getNodeName()))
  276. + {
  277. + fpc.clanId = Integer.valueOf(cd.getAttributes().getNamedItem("clan_id").getNodeValue());
  278. + fpc.clanCrest = Integer.valueOf(cd.getAttributes().getNamedItem("clan_crest").getNodeValue());
  279. + fpc.allyId = Integer.valueOf(cd.getAttributes().getNamedItem("ally_id").getNodeValue());
  280. + fpc.allyCrest = Integer.valueOf(cd.getAttributes().getNamedItem("ally_crest").getNodeValue());
  281. + fpc.pledge = Integer.valueOf(cd.getAttributes().getNamedItem("pledge").getNodeValue());
  282. + }
  283. +
  284. + }
  285. +
  286. + _fakePcs.put(npcId, fpc);
  287. + }
  288. + }
  289. + }
  290. + catch (Exception e)
  291. + {
  292. + _log.log(Level.WARNING, "FakePcsTable: Error loading from database:" + e.getMessage(), e);
  293. + }
  294. +
  295. + _log.info("FakePcsTable: Loaded " + _fakePcs.size() + " NPC to PC templates.");
  296. + }
  297. +
  298. + public FakePc getFakePc(int npcId)
  299. + {
  300. + return _fakePcs.get(npcId);
  301. + }
  302. +
  303. + private static class SingletonHolder
  304. + {
  305. + protected static final FakePcsTable _instance = new FakePcsTable();
  306. + }
  307. +}
  308. \ No newline at end of file
  309. Index: java/net/sf/l2j/gameserver/model/actor/L2Npc.java
  310. ===================================================================
  311. --- java/net/sf/l2j/gameserver/model/actor/L2Npc.java (revision 178)
  312. +++ java/net/sf/l2j/gameserver/model/actor/L2Npc.java (working copy)
  313. @@ -28,6 +28,7 @@
  314. import net.sf.l2j.gameserver.ai.CtrlIntention;
  315. import net.sf.l2j.gameserver.cache.HtmCache;
  316. import net.sf.l2j.gameserver.datatables.ClanTable;
  317. +import net.sf.l2j.gameserver.datatables.FakePcsTable;
  318. import net.sf.l2j.gameserver.datatables.HelperBuffTable;
  319. import net.sf.l2j.gameserver.datatables.ItemTable;
  320. import net.sf.l2j.gameserver.datatables.MapRegionTable;
  321. @@ -120,6 +121,7 @@
  322. private double _currentCollisionHeight; // used for npc grow effect skills
  323. private double _currentCollisionRadius; // used for npc grow effect skills
  324.  
  325. + private FakePc _fakePc = null;
  326. private GlobalEvent _globEvent = null;
  327.  
  328. private int _currentSsCount = 0;
  329. @@ -191,6 +193,8 @@
  330. _currentCollisionHeight = template.getCollisionHeight();
  331. _currentCollisionRadius = template.getCollisionRadius();
  332.  
  333. + _fakePc = FakePcsTable.getInstance().getFakePc(template.getNpcId());
  334. +
  335. // Set the name of the L2Character
  336. setName(template.getName());
  337. }
  338. @@ -1529,6 +1533,11 @@
  339. return _currentCollisionRadius;
  340. }
  341.  
  342. + public FakePc getFakePc()
  343. + {
  344. + return _fakePc;
  345. + }
  346. +
  347. public void setGlobalEvent(GlobalEvent globEvent)
  348. {
  349. _globEvent = globEvent;
  350. @@ -1667,4 +1676,14 @@
  351. {
  352. return getTemplate().getSkills();
  353. }
  354. +
  355. + public double getMovementSpeedMultiplier()
  356. + {
  357. + return 0;
  358. + }
  359. +
  360. + public double getAttackSpeedMultiplier()
  361. + {
  362. + return 0;
  363. + }
  364. }
  365. \ No newline at end of file
  366. Index: java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
  367. ===================================================================
  368. --- java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java (revision 178)
  369. +++ java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java (working copy)
  370. @@ -14,10 +14,13 @@
  371. */
  372. package net.sf.l2j.gameserver.network.serverpackets;
  373.  
  374. +import java.text.DecimalFormat;
  375. +
  376. import net.sf.l2j.Config;
  377. import net.sf.l2j.gameserver.datatables.ClanTable;
  378. import net.sf.l2j.gameserver.model.L2Clan;
  379. import net.sf.l2j.gameserver.model.L2Object.PolyType;
  380. +import net.sf.l2j.gameserver.model.actor.FakePc;
  381. import net.sf.l2j.gameserver.model.actor.L2Character;
  382. import net.sf.l2j.gameserver.model.actor.L2Npc;
  383. import net.sf.l2j.gameserver.model.actor.L2Summon;
  384. @@ -120,69 +123,197 @@
  385. @Override
  386. protected void writeImpl()
  387. {
  388. - writeC(0x16);
  389. -
  390. - writeD(_npc.getObjectId());
  391. - writeD(_idTemplate + 1000000);
  392. - writeD(_isAttackable ? 1 : 0);
  393. -
  394. - writeD(_x);
  395. - writeD(_y);
  396. - writeD(_z);
  397. - writeD(_heading);
  398. -
  399. - writeD(0x00);
  400. -
  401. - writeD(_mAtkSpd);
  402. - writeD(_pAtkSpd);
  403. - writeD(_runSpd);
  404. - writeD(_walkSpd);
  405. - writeD(_runSpd);
  406. - writeD(_walkSpd);
  407. - writeD(_runSpd);
  408. - writeD(_walkSpd);
  409. - writeD(_runSpd);
  410. - writeD(_walkSpd);
  411. -
  412. - writeF(_npc.getStat().getMovementSpeedMultiplier());
  413. - writeF(_npc.getStat().getAttackSpeedMultiplier());
  414. -
  415. - writeF(_collisionRadius);
  416. - writeF(_collisionHeight);
  417. -
  418. - writeD(_rhand);
  419. - writeD(_chest);
  420. - writeD(_lhand);
  421. -
  422. - writeC(1); // name above char
  423. - writeC(_npc.isRunning() ? 1 : 0);
  424. - writeC(_npc.isInCombat() ? 1 : 0);
  425. - writeC(_npc.isAlikeDead() ? 1 : 0);
  426. - writeC(_isSummoned ? 2 : 0);
  427. -
  428. - writeS(_name);
  429. - writeS(_title);
  430. -
  431. - writeD(0x00);
  432. - writeD(0x00);
  433. - writeD(0x00);
  434. -
  435. - writeD(_npc.getAbnormalEffect());
  436. -
  437. - writeD(_clanId);
  438. - writeD(_clanCrest);
  439. - writeD(_allyId);
  440. - writeD(_allyCrest);
  441. -
  442. - writeC(_npc.isFlying() ? 2 : 0);
  443. - writeC(0x00);
  444. -
  445. - writeF(_collisionRadius);
  446. - writeF(_collisionHeight);
  447. -
  448. - writeD(_enchantEffect);
  449. - writeD(_npc.isFlying() ? 1 : 0);
  450. + FakePc fpc = _npc.getFakePc();
  451. + if (fpc != null)
  452. + {
  453. + writeC(0x03);
  454. + writeD(_x);
  455. + writeD(_y);
  456. + writeD(_z);
  457. + writeD(_heading);
  458. + writeD(_npc.getObjectId());
  459. + writeS(fpc.name); // visible name
  460. + writeD(fpc.race);
  461. + writeD(fpc.sex);
  462. + writeD(fpc.classId);
  463. +
  464. + writeD(0x00); // PAPERDOLL_HAIR
  465. + writeD(0x00); //
  466. + writeD(fpc.rightHand); // PAPERDOLL_RHAND
  467. + writeD(fpc.leftHand); // PAPERDOLL_LHAND
  468. + writeD(fpc.gloves); // PAPERDOLL_GLOVES
  469. + writeD(fpc.chest); // PAPERDOLL_CHEST
  470. + writeD(fpc.legs); // PAPERDOLL_LEGS
  471. + writeD(fpc.feet); // PAPERDOLL_FEET
  472. + writeD(fpc.hair); // PAPERDOLL_HAIR
  473. + writeD(fpc.rightHand); // PAPERDOLL_RHAND
  474. + writeD(fpc.hair); // PAPERDOLL_HAIR
  475. + writeD(fpc.hair2); // PAPERDOLL_HAIR2
  476. +
  477. + write('H', 0, 24);
  478. +
  479. + writeD(0x00);
  480. + writeD(0x00);
  481. +
  482. + writeD(_mAtkSpd);
  483. + writeD(_pAtkSpd);
  484. +
  485. + writeD(0x00);
  486. + writeD(0x00);
  487. +
  488. + writeD(_runSpd);
  489. + writeD(_walkSpd);
  490. + writeD(_runSpd); // swim run speed
  491. + writeD(_walkSpd); // swim walk speed
  492. + writeD(_runSpd); // fly run speed
  493. + writeD(_walkSpd); // fly walk speed
  494. + writeD(_runSpd);
  495. + writeD(_walkSpd);
  496. + writeF(_npc.getMovementSpeedMultiplier()); // _activeChar.getProperMultiplier()
  497. + writeF(_npc.getAttackSpeedMultiplier()); // _activeChar.getAttackSpeedMultiplier()
  498. +
  499. + writeF(fpc.radius);
  500. + writeF(fpc.height);
  501. +
  502. + writeD(fpc.hairStyle);
  503. + writeD(fpc.hairColor);
  504. + writeD(fpc.face);
  505. +
  506. + if (_npc instanceof L2MonsterInstance)
  507. + writeS(fpc.title + " - HP " + new DecimalFormat("#.##").format(100.0 * _npc.getCurrentHp() / _npc.getMaxHp()) + "%"); // visible title
  508. + else
  509. + writeS(fpc.title);
  510. +
  511. + writeD(fpc.clanId); // clan id
  512. + writeD(fpc.clanCrest); // clan crest id
  513. + writeD(fpc.allyId); // ally id
  514. + writeD(fpc.allyCrest); // ally crest id
  515. +
  516. + writeD(0x00);
  517. + writeC(0x01); // standing = 1 sitting = 0
  518. +
  519. + writeC(_npc.isRunning() ? 1 : 0); // running = 1 walking = 0
  520. + writeC(_npc.isInCombat() ? 1 : 0);
  521. + writeC(_npc.isAlikeDead() ? 1 : 0);
  522. +
  523. + write('C', 0, 3);
  524. +
  525. + writeH(0x00); // cubic count
  526. +
  527. + writeC(0x00); // invisible = 1 visible =0
  528. + writeD(0x00); // abnormal effect
  529. + writeC(0x00); // isFlying() ? 2 : 0
  530. + writeH(0x00); // getRecomHave(): Blue value for name (0 = white, 255 = pure blue)
  531. +
  532. + writeD(fpc.classId);
  533. + writeD(0x00); // ?
  534. + writeD(0x00); // ?
  535. + writeC(fpc.enchant);
  536. + writeC(0x00); // team circle around feet 1= Blue, 2 = red
  537. +
  538. + writeD(0x00); // getClanCrestLargeId()
  539. +
  540. + writeC(0x00); // isNoble(): Symbol on char menu ctrl+I
  541. + writeC(fpc.hero); // Hero Aura
  542. +
  543. + writeC(0x00); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
  544. + write('D', 0, 3);
  545. +
  546. + writeD(fpc.nameColor);
  547. + writeD(_heading);
  548. + writeD(0x00); // pledge class
  549. + writeD(0x00); // pledge type
  550. + writeD(fpc.titleColor);
  551. + writeD(0x00); // cursed weapon level
  552. + }
  553. + else
  554. + {
  555. + writeC(0x16);
  556. +
  557. + writeD(_npc.getObjectId());
  558. + writeD(_idTemplate + 1000000);
  559. + writeD(_isAttackable ? 1 : 0);
  560. +
  561. + writeD(_x);
  562. + writeD(_y);
  563. + writeD(_z);
  564. + writeD(_heading);
  565. +
  566. + writeD(0x00);
  567. +
  568. + writeD(_mAtkSpd);
  569. + writeD(_pAtkSpd);
  570. + writeD(_runSpd);
  571. + writeD(_walkSpd);
  572. + writeD(_runSpd);
  573. + writeD(_walkSpd);
  574. + writeD(_runSpd);
  575. + writeD(_walkSpd);
  576. + writeD(_runSpd);
  577. + writeD(_walkSpd);
  578. +
  579. + writeF(_npc.getStat().getMovementSpeedMultiplier());
  580. + writeF(_npc.getStat().getAttackSpeedMultiplier());
  581. +
  582. + writeF(_collisionRadius);
  583. + writeF(_collisionHeight);
  584. +
  585. + writeD(_rhand);
  586. + writeD(_chest);
  587. + writeD(_lhand);
  588. +
  589. + writeC(1); // name above char
  590. + writeC(_npc.isRunning() ? 1 : 0);
  591. + writeC(_npc.isInCombat() ? 1 : 0);
  592. + writeC(_npc.isAlikeDead() ? 1 : 0);
  593. + writeC(_isSummoned ? 2 : 0);
  594. +
  595. + writeS(_name);
  596. + writeS(_title);
  597. +
  598. + writeD(0x00);
  599. + writeD(0x00);
  600. + writeD(0x00);
  601. +
  602. + writeD(_npc.getAbnormalEffect());
  603. +
  604. + writeD(_clanId);
  605. + writeD(_clanCrest);
  606. + writeD(_allyId);
  607. + writeD(_allyCrest);
  608. +
  609. + writeC(_npc.isFlying() ? 2 : 0);
  610. + writeC(0x00);
  611. +
  612. + writeF(_collisionRadius);
  613. + writeF(_collisionHeight);
  614. +
  615. + writeD(_enchantEffect);
  616. + writeD(_npc.isFlying() ? 1 : 0);
  617. + }
  618. }
  619. +
  620. + private void write(char type, int value, int times)
  621. + {
  622. + for (int i = 0; i < times; i++)
  623. + {
  624. + switch (type)
  625. + {
  626. + case 'C':
  627. + writeC(value);
  628. + break;
  629. + case 'D':
  630. + writeD(value);
  631. + break;
  632. + case 'F':
  633. + writeF(value);
  634. + break;
  635. + case 'H':
  636. + writeH(value);
  637. + break;
  638. + }
  639. + }
  640. + }
  641. }
  642.  
  643. /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement