Advertisement
Guest User

fakepc core

a guest
Oct 31st, 2010
2,533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 18.55 KB | None | 0 0
  1. Index: java/com/l2jserver/gameserver/datatables/FakePcsTable.java
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/datatables/FakePcsTable.java  (revision 0)
  4. +++ java/com/l2jserver/gameserver/datatables/FakePcsTable.java  (revision 0)
  5. @@ -0,0 +1,164 @@
  6. +/*
  7. + * This program is free software: you can redistribute it and/or modify it under
  8. + * the terms of the GNU General Public License as published by the Free Software
  9. + * Foundation, either version 3 of the License, or (at your option) any later
  10. + * version.
  11. + *
  12. + * This program is distributed in the hope that it will be useful, but WITHOUT
  13. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  15. + * details.
  16. + *
  17. + * You should have received a copy of the GNU General Public License along with
  18. + * this program. If not, see <http://www.gnu.org/licenses/>.
  19. + */
  20. +
  21. +package com.l2jserver.gameserver.datatables;
  22. +
  23. +import java.sql.Connection;
  24. +import java.sql.PreparedStatement;
  25. +import java.sql.ResultSet;
  26. +import java.sql.SQLException;
  27. +import java.util.logging.Level;
  28. +import java.util.logging.Logger;
  29. +
  30. +import javolution.util.FastMap;
  31. +
  32. +import com.l2jserver.L2DatabaseFactory;
  33. +import com.l2jserver.gameserver.model.actor.FakePc;
  34. +
  35. +/**
  36. + * Fake pc data table.
  37. + *
  38. + * @author BiTi
  39. + */
  40. +public class FakePcsTable
  41. +{
  42. +   /** The logger<br> */
  43. +   private static Logger _log = Logger.getLogger(FakePcsTable.class.getName());
  44. +  
  45. +   private FastMap<Integer, FakePc> _fakePcs = new FastMap<Integer, FakePc>();
  46. +  
  47. +   private FakePcsTable()
  48. +   {
  49. +       loadData();
  50. +   }
  51. +  
  52. +   private void loadData()
  53. +   {
  54. +       _fakePcs.clear();
  55. +      
  56. +       Connection con = null;
  57. +      
  58. +       try
  59. +       {
  60. +           con = L2DatabaseFactory.getInstance().getConnection();
  61. +          
  62. +           PreparedStatement stmt = con.prepareStatement("SELECT * FROM `fake_pcs`");
  63. +           ResultSet rset = stmt.executeQuery();
  64. +          
  65. +           FakePc fpc = null;
  66. +          
  67. +           while (rset.next())
  68. +           {
  69. +               fpc = new FakePc();
  70. +              
  71. +               int npcId = rset.getInt("npc_id");
  72. +               fpc.race = rset.getInt("race");
  73. +               fpc.sex = rset.getInt("sex");
  74. +               fpc.clazz = rset.getInt("class");
  75. +               fpc.title = rset.getString("title");
  76. +               fpc.titleColor = Integer.decode("0x" + rset.getString("title_color"));
  77. +               fpc.name = rset.getString("name");
  78. +               fpc.nameColor = Integer.decode("0x" + rset.getString("name_color"));
  79. +               fpc.hairStyle = rset.getInt("hair_style");
  80. +               fpc.hairColor = rset.getInt("hair_color");
  81. +               fpc.face = rset.getInt("face");
  82. +               fpc.mount = rset.getByte("mount");
  83. +               fpc.team = rset.getByte("team");
  84. +               fpc.hero = rset.getByte("hero");
  85. +               fpc.pdUnder = rset.getInt("pd_under");
  86. +               fpc.pdUnderAug = rset.getInt("pd_under_aug");
  87. +               fpc.pdHead = rset.getInt("pd_head");
  88. +               fpc.pdHeadAug = rset.getInt("pd_head_aug");
  89. +               fpc.pdRHand = rset.getInt("pd_rhand");
  90. +               fpc.pdRHandAug = rset.getInt("pd_rhand_aug");
  91. +               fpc.pdLHand = rset.getInt("pd_lhand");
  92. +               fpc.pdLHandAug = rset.getInt("pd_lhand_aug");
  93. +               fpc.pdGloves = rset.getInt("pd_gloves");
  94. +               fpc.pdGlovesAug = rset.getInt("pd_gloves_aug");
  95. +               fpc.pdChest = rset.getInt("pd_chest");
  96. +               fpc.pdChestAug = rset.getInt("pd_chest_aug");
  97. +               fpc.pdLegs = rset.getInt("pd_legs");
  98. +               fpc.pdLegsAug = rset.getInt("pd_legs_aug");
  99. +               fpc.pdFeet = rset.getInt("pd_feet");
  100. +               fpc.pdFeetAug = rset.getInt("pd_feet_aug");
  101. +               fpc.pdBack = rset.getInt("pd_back");
  102. +               fpc.pdBackAug = rset.getInt("pd_back_aug");
  103. +               fpc.pdLRHand = rset.getInt("pd_lrhand");
  104. +               fpc.pdLRHandAug = rset.getInt("pd_lrhand_aug");
  105. +               fpc.pdHair = rset.getInt("pd_hair");
  106. +               fpc.pdHairAug = rset.getInt("pd_hair_aug");
  107. +               fpc.pdHair2 = rset.getInt("pd_hair2");
  108. +               fpc.pdHair2Aug = rset.getInt("pd_hair2_aug");
  109. +               fpc.pdRBracelet = rset.getInt("pd_rbracelet");
  110. +               fpc.pdRBraceletAug = rset.getInt("pd_rbracelet_aug");
  111. +               fpc.pdLBracelet = rset.getInt("pd_lbracelet");
  112. +               fpc.pdLBraceletAug = rset.getInt("pd_lbracelet_aug");
  113. +               fpc.pdDeco1 = rset.getInt("pd_deco1");
  114. +               fpc.pdDeco1Aug = rset.getInt("pd_deco1_aug");
  115. +               fpc.pdDeco2 = rset.getInt("pd_deco2");
  116. +               fpc.pdDeco2Aug = rset.getInt("pd_deco2_aug");
  117. +               fpc.pdDeco3 = rset.getInt("pd_deco3");
  118. +               fpc.pdDeco3Aug = rset.getInt("pd_deco3_aug");
  119. +               fpc.pdDeco4 = rset.getInt("pd_deco4");
  120. +               fpc.pdDeco4Aug = rset.getInt("pd_deco4_aug");
  121. +               fpc.pdDeco5 = rset.getInt("pd_deco5");
  122. +               fpc.pdDeco5Aug = rset.getInt("pd_deco5_aug");
  123. +               fpc.pdDeco6 = rset.getInt("pd_deco6");
  124. +               fpc.pdDeco6Aug = rset.getInt("pd_deco6_aug");
  125. +               fpc.enchantEffect = rset.getInt("enchant_effect");
  126. +               fpc.pvpFlag = rset.getInt("pvp_flag");
  127. +               fpc.karma = rset.getInt("karma");
  128. +               fpc.fishing = rset.getByte("fishing");
  129. +               fpc.fishingX = rset.getInt("fishing_x");
  130. +               fpc.fishingY = rset.getInt("fishing_y");
  131. +               fpc.fishingZ = rset.getInt("fishing_z");
  132. +               fpc.invisible = rset.getByte("invisible");
  133. +               _fakePcs.put(npcId, fpc);
  134. +           }
  135. +          
  136. +           rset.close();
  137. +           stmt.close();
  138. +       }
  139. +       catch (SQLException e)
  140. +       {
  141. +           _log.log(Level.SEVERE, "Error while creating fake pc table: " + e.getMessage(), e);
  142. +       }
  143. +       finally
  144. +       {
  145. +           L2DatabaseFactory.close(con);
  146. +       }
  147. +   }
  148. +  
  149. +   public void reloadData()
  150. +   {
  151. +       loadData();
  152. +   }
  153. +  
  154. +   public FakePc getFakePc(int npcId)
  155. +   {
  156. +       return _fakePcs.get(npcId);
  157. +   }
  158. +  
  159. +   public static FakePcsTable getInstance()
  160. +   {
  161. +       return SingletonHolder._instance;
  162. +   }
  163. +  
  164. +   @SuppressWarnings("synthetic-access")
  165. +   private static class SingletonHolder
  166. +   {
  167. +       protected static final FakePcsTable _instance = new FakePcsTable();
  168. +   }
  169. +}
  170. \ No newline at end of file
  171. Index: java/com/l2jserver/gameserver/model/actor/FakePc.java
  172. ===================================================================
  173. --- java/com/l2jserver/gameserver/model/actor/FakePc.java   (revision 0)
  174. +++ java/com/l2jserver/gameserver/model/actor/FakePc.java   (revision 0)
  175. @@ -0,0 +1,86 @@
  176. +/*
  177. + * This program is free software: you can redistribute it and/or modify it under
  178. + * the terms of the GNU General Public License as published by the Free Software
  179. + * Foundation, either version 3 of the License, or (at your option) any later
  180. + * version.
  181. + *
  182. + * This program is distributed in the hope that it will be useful, but WITHOUT
  183. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  184. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  185. + * details.
  186. + *
  187. + * You should have received a copy of the GNU General Public License along with
  188. + * this program. If not, see <http://www.gnu.org/licenses/>.
  189. + */
  190. +
  191. +package com.l2jserver.gameserver.model.actor;
  192. +
  193. +/**
  194. + * Fake pc data model.
  195. + *
  196. + * @author BiTi
  197. + */
  198. +public class FakePc
  199. +{
  200. +   public int race;
  201. +   public int sex;
  202. +   public int clazz;
  203. +   public String title;
  204. +   public int titleColor;
  205. +   public String name;
  206. +   public int nameColor;
  207. +   public int hairStyle;
  208. +   public int hairColor;
  209. +   public int face;
  210. +   public byte mount;
  211. +   public byte team;
  212. +   public byte hero;
  213. +   public int pdUnder;
  214. +   public int pdUnderAug;
  215. +   public int pdHead;
  216. +   public int pdHeadAug;
  217. +   public int pdRHand;
  218. +   public int pdRHandAug;
  219. +   public int pdLHand;
  220. +   public int pdLHandAug;
  221. +   public int pdGloves;
  222. +   public int pdGlovesAug;
  223. +   public int pdChest;
  224. +   public int pdChestAug;
  225. +   public int pdLegs;
  226. +   public int pdLegsAug;
  227. +   public int pdFeet;
  228. +   public int pdFeetAug;
  229. +   public int pdBack;
  230. +   public int pdBackAug;
  231. +   public int pdLRHand;
  232. +   public int pdLRHandAug;
  233. +   public int pdHair;
  234. +   public int pdHairAug;
  235. +   public int pdHair2;
  236. +   public int pdHair2Aug;
  237. +   public int pdRBracelet;
  238. +   public int pdRBraceletAug;
  239. +   public int pdLBracelet;
  240. +   public int pdLBraceletAug;
  241. +   public int pdDeco1;
  242. +   public int pdDeco1Aug;
  243. +   public int pdDeco2;
  244. +   public int pdDeco2Aug;
  245. +   public int pdDeco3;
  246. +   public int pdDeco3Aug;
  247. +   public int pdDeco4;
  248. +   public int pdDeco4Aug;
  249. +   public int pdDeco5;
  250. +   public int pdDeco5Aug;
  251. +   public int pdDeco6;
  252. +   public int pdDeco6Aug;
  253. +   public int enchantEffect;
  254. +   public int pvpFlag;
  255. +   public int karma;
  256. +   public byte fishing;
  257. +   public int fishingX;
  258. +   public int fishingY;
  259. +   public int fishingZ;
  260. +   public byte invisible;
  261. +}
  262. \ No newline at end of file
  263. Index: java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java
  264. ===================================================================
  265. --- java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java    (revision 4422)
  266. +++ java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java    (working copy)
  267. @@ -15,9 +15,12 @@
  268.  package com.l2jserver.gameserver.network.serverpackets;
  269.  
  270.  import com.l2jserver.Config;
  271. +import com.l2jserver.gameserver.datatables.CharTemplateTable;
  272.  import com.l2jserver.gameserver.datatables.ClanTable;
  273. +import com.l2jserver.gameserver.datatables.FakePcsTable;
  274.  import com.l2jserver.gameserver.instancemanager.TownManager;
  275.  import com.l2jserver.gameserver.model.L2Clan;
  276. +import com.l2jserver.gameserver.model.actor.FakePc;
  277.  import com.l2jserver.gameserver.model.actor.L2Character;
  278.  import com.l2jserver.gameserver.model.actor.L2Npc;
  279.  import com.l2jserver.gameserver.model.actor.L2Summon;
  280. @@ -26,6 +29,7 @@
  281.  import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance;
  282.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  283.  import com.l2jserver.gameserver.skills.AbnormalEffect;
  284. +import com.l2jserver.gameserver.templates.chars.L2PcTemplate;
  285.  
  286.  /**
  287.   * This class ...
  288. @@ -105,14 +109,14 @@
  289.             _isAttackable = cha.isAutoAttackable(attacker);
  290.             if (cha.getTemplate().serverSideName)
  291.                 _name = cha.getName();// On every subclass
  292. -          
  293. +              
  294.             if (Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion())
  295.                 _title = (Config.L2JMOD_CHAMP_TITLE); // On every subclass
  296.             else if (cha.getTemplate().serverSideTitle)
  297.                 _title = cha.getTemplate().title; // On every subclass
  298.             else
  299.                 _title = cha.getTitle(); // On every subclass
  300. -          
  301. +              
  302.             if (Config.SHOW_NPC_LVL && _npc instanceof L2MonsterInstance)
  303.             {
  304.                 String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : "");
  305. @@ -142,61 +146,204 @@
  306.         @Override
  307.         protected void writeImpl()
  308.         {
  309. -           writeC(0x0c);
  310. -           writeD(_npc.getObjectId());
  311. -           writeD(_idTemplate + 1000000); // npctype id
  312. -           writeD(_isAttackable ? 1 : 0);
  313. -           writeD(_x);
  314. -           writeD(_y);
  315. -           writeD(_z);
  316. -           writeD(_heading);
  317. -           writeD(0x00);
  318. -           writeD(_mAtkSpd);
  319. -           writeD(_pAtkSpd);
  320. -           writeD(_runSpd);
  321. -           writeD(_walkSpd);
  322. -           writeD(_runSpd); // swim run speed
  323. -           writeD(_walkSpd); // swim walk speed
  324. -           writeD(_runSpd); // swim run speed
  325. -           writeD(_walkSpd); // swim walk speed
  326. -           writeD(_runSpd); // fly run speed
  327. -           writeD(_walkSpd); // fly run speed
  328. -           writeF(_npc.getMovementSpeedMultiplier());
  329. -           writeF(_npc.getAttackSpeedMultiplier());
  330. -           writeF(_collisionRadius);
  331. -           writeF(_collisionHeight);
  332. -           writeD(_rhand); // right hand weapon
  333. -           writeD(_chest);
  334. -           writeD(_lhand); // left hand weapon
  335. -           writeC(1); // name above char 1=true ... ??
  336. -           writeC(_npc.isRunning() ? 1 : 0);
  337. -           writeC(_npc.isInCombat() ? 1 : 0);
  338. -           writeC(_npc.isAlikeDead() ? 1 : 0);
  339. -           writeC(_isSummoned ? 2 : 0); // 0=teleported 1=default 2=summoned
  340. -           writeS(_name);
  341. -           writeS(_title);
  342. -           writeD(0x00); // Title color 0=client default
  343. -           writeD(0x00); //pvp flag
  344. -           writeD(0x00); // karma
  345. -          
  346. -           writeD(_npc.getAbnormalEffect()); // C2
  347. -           writeD(_clanId); //clan id
  348. -           writeD(_clanCrest); //crest id
  349. -           writeD(_allyId); // ally id
  350. -           writeD(_allyCrest); // all crest
  351. -           writeC(_npc.isFlying() ? 2 : 0); // C2
  352. -           writeC(0x00); // title color 0=client
  353. -          
  354. -           writeF(_collisionRadius);
  355. -           writeF(_collisionHeight);
  356. -           writeD(_enchantEffect); // C4
  357. -           writeD(_npc.isFlying() ? 1 : 0); // C6
  358. -           writeD(0x00);
  359. -           writeD(0x00);// CT1.5 Pet form and skills
  360. -           writeC(_npc.isHideName() ? 0x00 : 0x01);
  361. -           writeC(_npc.isHideName() ? 0x00 : 0x01);
  362. -           writeD(_npc.getSpecialEffect());
  363. -           writeD(_displayEffect);
  364. +           FakePc fpc = FakePcsTable.getInstance().getFakePc(_npc.getNpcId());
  365. +           if (fpc != null)
  366. +           {
  367. +               writeC(0x31);
  368. +               writeD(_x);
  369. +               writeD(_y);
  370. +               writeD(_z);
  371. +               writeD(0x00); // vehicle id
  372. +               writeD(_npc.getObjectId());
  373. +               writeS(fpc.name); // visible name
  374. +               writeD(fpc.race);
  375. +               writeD(fpc.sex);
  376. +               writeD(fpc.clazz);
  377. +              
  378. +               writeD(fpc.pdUnder);
  379. +               writeD(fpc.pdHead);
  380. +               writeD(fpc.pdRHand);
  381. +               writeD(fpc.pdLHand);
  382. +               writeD(fpc.pdGloves);
  383. +               writeD(fpc.pdChest);
  384. +               writeD(fpc.pdLegs);
  385. +               writeD(fpc.pdFeet);
  386. +               writeD(fpc.pdBack);
  387. +               writeD(fpc.pdLRHand);
  388. +               writeD(fpc.pdHair);
  389. +               writeD(fpc.pdHair2);
  390. +               writeD(fpc.pdRBracelet);
  391. +               writeD(fpc.pdLBracelet);
  392. +               writeD(fpc.pdDeco1);
  393. +               writeD(fpc.pdDeco2);
  394. +               writeD(fpc.pdDeco3);
  395. +               writeD(fpc.pdDeco4);
  396. +               writeD(fpc.pdDeco5);
  397. +               writeD(fpc.pdDeco6);
  398. +               writeD(0x00); // belt
  399. +              
  400. +               writeD(fpc.pdUnderAug);
  401. +               writeD(fpc.pdHeadAug);
  402. +               writeD(fpc.pdRHandAug);
  403. +               writeD(fpc.pdLHandAug);
  404. +               writeD(fpc.pdGlovesAug);
  405. +               writeD(fpc.pdChestAug);
  406. +               writeD(fpc.pdLegsAug);
  407. +               writeD(fpc.pdFeetAug);
  408. +               writeD(fpc.pdBackAug);
  409. +               writeD(fpc.pdLRHandAug);
  410. +               writeD(fpc.pdHairAug);
  411. +               writeD(fpc.pdHair2Aug);
  412. +               writeD(fpc.pdRBraceletAug);
  413. +               writeD(fpc.pdLBraceletAug);
  414. +               writeD(fpc.pdDeco1Aug);
  415. +               writeD(fpc.pdDeco2Aug);
  416. +               writeD(fpc.pdDeco3Aug);
  417. +               writeD(fpc.pdDeco4Aug);
  418. +               writeD(fpc.pdDeco5Aug);
  419. +               writeD(fpc.pdDeco6Aug);
  420. +               writeD(0x00); // belt aug
  421. +               writeD(0x00);
  422. +               writeD(0x01);
  423. +              
  424. +               writeD(fpc.pvpFlag);
  425. +               writeD(fpc.karma);
  426. +              
  427. +               writeD(_mAtkSpd);
  428. +               writeD(_pAtkSpd);
  429. +              
  430. +               writeD(0x00);
  431. +              
  432. +               writeD(_runSpd);
  433. +               writeD(_walkSpd);
  434. +               writeD(_runSpd); // swim run speed
  435. +               writeD(_walkSpd); // swim walk speed
  436. +               writeD(_runSpd); // fly run speed
  437. +               writeD(_walkSpd); // fly walk speed
  438. +               writeD(_runSpd);
  439. +               writeD(_walkSpd);
  440. +               writeF(_npc.getMovementSpeedMultiplier()); // _activeChar.getProperMultiplier()
  441. +               writeF(_npc.getAttackSpeedMultiplier()); // _activeChar.getAttackSpeedMultiplier()
  442. +              
  443. +               // TODO: add handling of mount collision
  444. +               L2PcTemplate pctmpl = CharTemplateTable.getInstance().getTemplate(fpc.clazz);
  445. +               writeF(fpc.sex == 0 ? pctmpl.fCollisionRadius : pctmpl.fCollisionRadius_female);
  446. +               writeF(fpc.sex == 0 ? pctmpl.fCollisionHeight : pctmpl.fCollisionHeight_female);
  447. +              
  448. +               writeD(fpc.hairStyle);
  449. +               writeD(fpc.hairColor);
  450. +               writeD(fpc.face);
  451. +              
  452. +               writeS(fpc.title); // visible title
  453. +              
  454. +               writeD(0x00); // clan id
  455. +               writeD(0x00); // clan crest id
  456. +               writeD(0x00); // ally id
  457. +               writeD(0x00); // ally crest id
  458. +              
  459. +               writeC(0x01); // standing = 1  sitting = 0
  460. +               writeC(_npc.isRunning() ? 1 : 0); // running = 1   walking = 0
  461. +               writeC(_npc.isInCombat() ? 1 : 0);
  462. +               writeC(_npc.isAlikeDead() ? 1 : 0);
  463. +              
  464. +               writeC(fpc.invisible); // invisible = 1  visible =0
  465. +              
  466. +               writeC(fpc.mount); // 1 on strider   2 on wyvern  3 on Great Wolf  0 no mount
  467. +               writeC(0x00); //  1 - sellshop
  468. +               writeH(0x00); // cubic count
  469. +               //for (int id : allCubics)
  470. +               //    writeH(id);
  471. +               writeC(0x00); // find party members
  472. +               writeD(0x00); // abnormal effect
  473. +               writeC(0x00); // isFlying() ? 2 : 0
  474. +               writeH(0x00); //getRecomHave(): Blue value for name (0 = white, 255 = pure blue)
  475. +               writeD(1000000); // getMountNpcId() + 1000000
  476. +               writeD(fpc.clazz);
  477. +               writeD(0x00); // ?
  478. +               writeC(fpc.enchantEffect);
  479. +               writeC(fpc.team); //team circle around feet 1= Blue, 2 = red
  480. +               writeD(0x00); // getClanCrestLargeId()
  481. +               writeC(0x00); // isNoble(): Symbol on char menu ctrl+I
  482. +               writeC(fpc.hero); // Hero Aura
  483. +               writeC(fpc.fishing); //0x01: Fishing Mode (Cant be undone by setting back to 0)
  484. +               writeD(fpc.fishingX);
  485. +               writeD(fpc.fishingY);
  486. +               writeD(fpc.fishingZ);
  487. +              
  488. +               writeD(fpc.nameColor);
  489. +               writeD(_heading);
  490. +               writeD(0x00); // pledge class
  491. +               writeD(0x00); // pledge type
  492. +               writeD(fpc.titleColor);
  493. +              
  494. +               writeD(0x00); // cursed weapon level
  495. +               writeD(0x00); // reputation score
  496. +               writeD(0x00); // transformation id
  497. +               writeD(0x00); // agathion id
  498. +               writeD(0x01); // T2 ?
  499. +               writeD(0x00); // special effect
  500. +               /*writeD(0x00); // territory Id
  501. +               writeD(0x00); // is Disguised
  502. +               writeD(0x00); // territory Id*/
  503. +           }
  504. +           else
  505. +           {
  506. +               writeC(0x0c);
  507. +               writeD(_npc.getObjectId());
  508. +               writeD(_idTemplate + 1000000); // npctype id
  509. +               writeD(_isAttackable ? 1 : 0);
  510. +               writeD(_x);
  511. +               writeD(_y);
  512. +               writeD(_z);
  513. +               writeD(_heading);
  514. +               writeD(0x00);
  515. +               writeD(_mAtkSpd);
  516. +               writeD(_pAtkSpd);
  517. +               writeD(_runSpd);
  518. +               writeD(_walkSpd);
  519. +               writeD(_runSpd); // swim run speed
  520. +               writeD(_walkSpd); // swim walk speed
  521. +               writeD(_runSpd); // swim run speed
  522. +               writeD(_walkSpd); // swim walk speed
  523. +               writeD(_runSpd); // fly run speed
  524. +               writeD(_walkSpd); // fly run speed
  525. +               writeF(_npc.getMovementSpeedMultiplier());
  526. +               writeF(_npc.getAttackSpeedMultiplier());
  527. +               writeF(_collisionRadius);
  528. +               writeF(_collisionHeight);
  529. +               writeD(_rhand); // right hand weapon
  530. +               writeD(_chest);
  531. +               writeD(_lhand); // left hand weapon
  532. +               writeC(1); // name above char 1=true ... ??
  533. +               writeC(_npc.isRunning() ? 1 : 0);
  534. +               writeC(_npc.isInCombat() ? 1 : 0);
  535. +               writeC(_npc.isAlikeDead() ? 1 : 0);
  536. +               writeC(_isSummoned ? 2 : 0); // 0=teleported 1=default 2=summoned
  537. +               writeS(_name);
  538. +               writeS(_title);
  539. +               writeD(0x00); // Title color 0=client default
  540. +               writeD(0x00); //pvp flag
  541. +               writeD(0x00); // karma
  542. +              
  543. +               writeD(_npc.getAbnormalEffect()); // C2
  544. +               writeD(_clanId); //clan id
  545. +               writeD(_clanCrest); //crest id
  546. +               writeD(_allyId); // ally id
  547. +               writeD(_allyCrest); // all crest
  548. +               writeC(_npc.isFlying() ? 2 : 0); // C2
  549. +               writeC(0x00); // title color 0=client
  550. +              
  551. +               writeF(_collisionRadius);
  552. +               writeF(_collisionHeight);
  553. +               writeD(_enchantEffect); // C4
  554. +               writeD(_npc.isFlying() ? 1 : 0); // C6
  555. +               writeD(0x00);
  556. +               writeD(0x00);// CT1.5 Pet form and skills
  557. +               writeC(_npc.isHideName() ? 0x00 : 0x01);
  558. +               writeC(_npc.isHideName() ? 0x00 : 0x01);
  559. +               writeD(_npc.getSpecialEffect());
  560. +               writeD(_displayEffect);
  561. +           }
  562.         }
  563.     }
  564.    
  565. @@ -300,7 +447,7 @@
  566.             _val = val;
  567.             if (_summon.isShowSummonAnimation())
  568.                 _val = 2; //override for spawn
  569. -          
  570. +              
  571.             int npcId = cha.getTemplate().npcId;
  572.            
  573.             if (npcId == 16041 || npcId == 16042)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement