Advertisement
CostyKiller

homunculus server packets update

Jun 3rd, 2021
1,192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 45.14 KB | None | 0 0
  1. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExActivateHomunculusResult.java
  2. ===================================================================
  3. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExActivateHomunculusResult.java  (nonexistent)
  4. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExActivateHomunculusResult.java  (working copy)
  5. @@ -0,0 +1,55 @@
  6. +/*
  7. + * This file is part of the L2J Mobius project.
  8. + *
  9. + * This program is free software: you can redistribute it and/or modify
  10. + * it under the terms of the GNU General Public License as published by
  11. + * the Free Software Foundation, either version 3 of the License, or
  12. + * (at your option) any later version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful,
  15. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. + * General Public License for more details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License
  20. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  23. +
  24. +import org.l2jmobius.commons.network.PacketWriter;
  25. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  26. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  27. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  28. +
  29. +/**
  30. + * @author Mobius
  31. + */
  32. +public class ExActivateHomunculusResult implements IClientOutgoingPacket
  33. +{
  34. +   private final boolean _activate;
  35. +  
  36. +   public ExActivateHomunculusResult(boolean activate)
  37. +   {
  38. +       _activate = activate;
  39. +   }
  40. +  
  41. +   @Override
  42. +   public boolean write(PacketWriter packet)
  43. +   {
  44. +       OutgoingPackets.EX_ACTIVATE_HOMUNCULUS_RESULT.writeId(packet);
  45. +      
  46. +       if (!_activate)
  47. +       {
  48. +           packet.writeD(1); // success
  49. +           packet.writeC(0); // activate
  50. +           packet.writeD(SystemMessage.THE_RELATIONS_ARE_BROKEN);
  51. +       }
  52. +       else
  53. +       {
  54. +           packet.writeD(1);
  55. +           packet.writeC(1);
  56. +           packet.writeD(SystemMessage.THE_RELATIONS_ARE_BEING_ESTABLISHED);
  57. +       }
  58. +       return true;
  59. +   }
  60. +}
  61. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExDeleteHomunculusDataResult.java
  62. ===================================================================
  63. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExDeleteHomunculusDataResult.java    (nonexistent)
  64. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExDeleteHomunculusDataResult.java    (working copy)
  65. @@ -0,0 +1,29 @@
  66. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  67. +
  68. +import org.l2jmobius.commons.network.PacketWriter;
  69. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  70. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  71. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  72. +
  73. +/**
  74. + * @author nexvill
  75. + */
  76. +public class ExDeleteHomunculusDataResult implements IClientOutgoingPacket
  77. +{
  78. +  
  79. +   public ExDeleteHomunculusDataResult()
  80. +   {
  81. +      
  82. +   }
  83. +  
  84. +   @Override
  85. +   public boolean write(PacketWriter packet)
  86. +   {
  87. +       OutgoingPackets.EX_ACTIVATE_HOMUNCULUS_RESULT.writeId(packet);
  88. +       {
  89. +           packet.writeD(1); // 1 - success
  90. +           packet.writeD(SystemMessage.THE_HOMUNCULUS_IS_DESTROYED); // SystemMessageId
  91. +       }
  92. +       return true;
  93. +   }
  94. +}
  95. \ No newline at end of file
  96. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExEnchantHomunculusSkillResult.java
  97. ===================================================================
  98. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExEnchantHomunculusSkillResult.java  (nonexistent)
  99. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExEnchantHomunculusSkillResult.java  (working copy)
  100. @@ -0,0 +1,87 @@
  101. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  102. +
  103. +import org.l2jmobius.commons.network.PacketWriter;
  104. +import org.l2jmobius.commons.util.Rnd;
  105. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  106. +import org.l2jmobius.gameserver.model.homunculus.Homunculus;
  107. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  108. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  109. +
  110. +/**
  111. + * @author nexvill
  112. + */
  113. +public class ExEnchantHomunculusSkillResult implements IClientOutgoingPacket
  114. +{
  115. +   private final PlayerInstance _player;
  116. +   private final int _slot, _skillNumber;
  117. +  
  118. +   public ExEnchantHomunculusSkillResult(PlayerInstance player, int slot, int skillNumber)
  119. +   {
  120. +       _player = player;
  121. +       _slot = slot;
  122. +       _skillNumber = skillNumber;
  123. +   }
  124. +  
  125. +   @Override
  126. +   public boolean write(PacketWriter packet)
  127. +   {
  128. +       OutgoingPackets.EX_ENCHANT_HOMUNCULUS_SKILL_RESULT.writeId(packet);
  129. +       {
  130. +           int playerNumber = Rnd.get(6) + 1;
  131. +           int homunculusNumber = Rnd.get(6) + 1;
  132. +           int systemNumber = Rnd.get(6) + 1;
  133. +          
  134. +           Homunculus homunculus = _player.getHomunculusList().get(_slot);
  135. +           int boundLevel = 1;
  136. +           if ((playerNumber == homunculusNumber) && (playerNumber == systemNumber))
  137. +           {
  138. +               boundLevel = 3;
  139. +           }
  140. +           else if ((playerNumber == homunculusNumber) || (playerNumber == systemNumber)//
  141. +               || (homunculusNumber == systemNumber))
  142. +           {
  143. +               boundLevel = 2;
  144. +           }
  145. +          
  146. +           switch (_skillNumber)
  147. +           {
  148. +               case 1:
  149. +               {
  150. +                   homunculus.setSkill1Level(boundLevel);
  151. +                   break;
  152. +               }
  153. +               case 2:
  154. +               {
  155. +                   homunculus.setSkill2Level(boundLevel);
  156. +                   break;
  157. +               }
  158. +               case 3:
  159. +               {
  160. +                   homunculus.setSkill3Level(boundLevel);
  161. +                   break;
  162. +               }
  163. +               case 4:
  164. +               {
  165. +                   homunculus.setSkill4Level(boundLevel);
  166. +                   break;
  167. +               }
  168. +               case 5:
  169. +               {
  170. +                   homunculus.setSkill5Level(boundLevel);
  171. +                   break;
  172. +               }
  173. +           }
  174. +           _player.getHomunculusList().update(homunculus);
  175. +           _player.getHomunculusList().refreshStats(true);
  176. +          
  177. +           packet.writeD(boundLevel); // skill bound level result
  178. +           packet.writeD(homunculus.getId()); // homunculus id? random value on JP
  179. +           packet.writeD(_slot); // slot
  180. +           packet.writeD(_skillNumber); // skill number
  181. +           packet.writeD(playerNumber); // player number
  182. +           packet.writeD(homunculusNumber); // homunculus number
  183. +           packet.writeD(systemNumber); // system number
  184. +       }
  185. +       return true;
  186. +   }
  187. +}
  188. \ No newline at end of file
  189. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusActivateResult.java
  190. ===================================================================
  191. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusActivateResult.java  (revision 8811)
  192. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusActivateResult.java  (nonexistent)
  193. @@ -1,53 +0,0 @@
  194. -/*
  195. - * This file is part of the L2J Mobius project.
  196. - *
  197. - * This program is free software: you can redistribute it and/or modify
  198. - * it under the terms of the GNU General Public License as published by
  199. - * the Free Software Foundation, either version 3 of the License, or
  200. - * (at your option) any later version.
  201. - *
  202. - * This program is distributed in the hope that it will be useful,
  203. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  204. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  205. - * General Public License for more details.
  206. - *
  207. - * You should have received a copy of the GNU General Public License
  208. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  209. - */
  210. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  211. -
  212. -import org.l2jmobius.commons.network.PacketWriter;
  213. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  214. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  215. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  216. -
  217. -/**
  218. - * @author Mobius
  219. - */
  220. -public class ExHomonculusActivateResult implements IClientOutgoingPacket
  221. -{
  222. -   @SuppressWarnings("unused")
  223. -   private final PlayerInstance _player;
  224. -  
  225. -   public ExHomonculusActivateResult(PlayerInstance player)
  226. -   {
  227. -       _player = player;
  228. -   }
  229. -  
  230. -   @Override
  231. -   public boolean write(PacketWriter packet)
  232. -   {
  233. -       OutgoingPackets.EX_ACTIVATE_HOMUNCULUS_RESULT.writeId(packet);
  234. -      
  235. -       // struct _C_EX_REQUEST_ACTIVATE_HOMUNCULUS
  236. -       // {
  237. -       // var int nIdx;
  238. -       // var byte bActivate;
  239. -       // };
  240. -      
  241. -       packet.writeD(0x01);
  242. -       packet.writeC(0x01);
  243. -      
  244. -       return true;
  245. -   }
  246. -}
  247. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusBirthInfo.java
  248. ===================================================================
  249. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusBirthInfo.java   (revision 8811)
  250. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusBirthInfo.java   (nonexistent)
  251. @@ -1,58 +0,0 @@
  252. -/*
  253. - * This file is part of the L2J Mobius project.
  254. - *
  255. - * This program is free software: you can redistribute it and/or modify
  256. - * it under the terms of the GNU General Public License as published by
  257. - * the Free Software Foundation, either version 3 of the License, or
  258. - * (at your option) any later version.
  259. - *
  260. - * This program is distributed in the hope that it will be useful,
  261. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  262. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  263. - * General Public License for more details.
  264. - *
  265. - * You should have received a copy of the GNU General Public License
  266. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  267. - */
  268. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  269. -
  270. -import org.l2jmobius.commons.network.PacketWriter;
  271. -import org.l2jmobius.commons.util.Chronos;
  272. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  273. -import org.l2jmobius.gameserver.model.variables.PlayerVariables;
  274. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  275. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  276. -
  277. -/**
  278. - * @author Mobius
  279. - */
  280. -public class ExHomonculusBirthInfo implements IClientOutgoingPacket
  281. -{
  282. -   private final PlayerInstance _player;
  283. -  
  284. -   public ExHomonculusBirthInfo(PlayerInstance player)
  285. -   {
  286. -       _player = player;
  287. -   }
  288. -  
  289. -   @Override
  290. -   public boolean write(PacketWriter packet)
  291. -   {
  292. -       OutgoingPackets.EX_SHOW_BIRTH_INFO.writeId(packet);
  293. -      
  294. -       final int status = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_STATUS, 0);
  295. -       final int hp = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_HP, 0);
  296. -       final int sp = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_SP, 0);
  297. -       final int vp = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP, 0);
  298. -       final int time = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_TIME, 0);
  299. -       final long currentTime = Chronos.currentTimeMillis();
  300. -      
  301. -       packet.writeD(status); // 0 = time idle, 1 = time updating, 2 = summon enabled
  302. -       packet.writeD(hp); // hp 100
  303. -       packet.writeD(sp); // sp 10
  304. -       packet.writeD(vp); // vitality 5
  305. -       packet.writeQ((currentTime / 1000) + (86400 - Math.min(86400, (currentTime / 1000) - time)));
  306. -      
  307. -       return true;
  308. -   }
  309. -}
  310. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusCreateStartResult.java
  311. ===================================================================
  312. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusCreateStartResult.java   (revision 8811)
  313. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusCreateStartResult.java   (nonexistent)
  314. @@ -1,47 +0,0 @@
  315. -/*
  316. - * This file is part of the L2J Mobius project.
  317. - *
  318. - * This program is free software: you can redistribute it and/or modify
  319. - * it under the terms of the GNU General Public License as published by
  320. - * the Free Software Foundation, either version 3 of the License, or
  321. - * (at your option) any later version.
  322. - *
  323. - * This program is distributed in the hope that it will be useful,
  324. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  325. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  326. - * General Public License for more details.
  327. - *
  328. - * You should have received a copy of the GNU General Public License
  329. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  330. - */
  331. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  332. -
  333. -import org.l2jmobius.commons.network.PacketWriter;
  334. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  335. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  336. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  337. -
  338. -/**
  339. - * @author Mobius
  340. - */
  341. -public class ExHomonculusCreateStartResult implements IClientOutgoingPacket
  342. -{
  343. -   @SuppressWarnings("unused")
  344. -   private final PlayerInstance _player;
  345. -  
  346. -   public ExHomonculusCreateStartResult(PlayerInstance player)
  347. -   {
  348. -       _player = player;
  349. -   }
  350. -  
  351. -   @Override
  352. -   public boolean write(PacketWriter packet)
  353. -   {
  354. -       OutgoingPackets.EX_HOMUNCULUS_CREATE_START_RESULT.writeId(packet);
  355. -      
  356. -       packet.writeD(0x00);
  357. -       packet.writeD(0x00);
  358. -      
  359. -       return true;
  360. -   }
  361. -}
  362. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusInsertResult.java
  363. ===================================================================
  364. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusInsertResult.java    (revision 8811)
  365. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusInsertResult.java    (nonexistent)
  366. @@ -1,49 +0,0 @@
  367. -/*
  368. - * This file is part of the L2J Mobius project.
  369. - *
  370. - * This program is free software: you can redistribute it and/or modify
  371. - * it under the terms of the GNU General Public License as published by
  372. - * the Free Software Foundation, either version 3 of the License, or
  373. - * (at your option) any later version.
  374. - *
  375. - * This program is distributed in the hope that it will be useful,
  376. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  377. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  378. - * General Public License for more details.
  379. - *
  380. - * You should have received a copy of the GNU General Public License
  381. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  382. - */
  383. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  384. -
  385. -import org.l2jmobius.commons.network.PacketWriter;
  386. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  387. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  388. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  389. -
  390. -/**
  391. - * @author Mobius
  392. - */
  393. -public class ExHomonculusInsertResult implements IClientOutgoingPacket
  394. -{
  395. -   @SuppressWarnings("unused")
  396. -   private final PlayerInstance _player;
  397. -   private final int _type;
  398. -  
  399. -   public ExHomonculusInsertResult(PlayerInstance player, int type)
  400. -   {
  401. -       _player = player;
  402. -       _type = type;
  403. -   }
  404. -  
  405. -   @Override
  406. -   public boolean write(PacketWriter packet)
  407. -   {
  408. -       OutgoingPackets.EX_HOMUNCULUS_INSERT_RESULT.writeId(packet);
  409. -      
  410. -       packet.writeD(0x01);
  411. -       packet.writeD(_type);
  412. -      
  413. -       return true;
  414. -   }
  415. -}
  416. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusList.java
  417. ===================================================================
  418. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusList.java    (revision 8811)
  419. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusList.java    (nonexistent)
  420. @@ -1,82 +0,0 @@
  421. -/*
  422. - * This file is part of the L2J Mobius project.
  423. - *
  424. - * This program is free software: you can redistribute it and/or modify
  425. - * it under the terms of the GNU General Public License as published by
  426. - * the Free Software Foundation, either version 3 of the License, or
  427. - * (at your option) any later version.
  428. - *
  429. - * This program is distributed in the hope that it will be useful,
  430. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  431. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  432. - * General Public License for more details.
  433. - *
  434. - * You should have received a copy of the GNU General Public License
  435. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  436. - */
  437. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  438. -
  439. -import org.l2jmobius.commons.network.PacketWriter;
  440. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  441. -import org.l2jmobius.gameserver.model.variables.PlayerVariables;
  442. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  443. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  444. -
  445. -/**
  446. - * @author Mobius
  447. - */
  448. -public class ExHomonculusList implements IClientOutgoingPacket
  449. -{
  450. -   private final PlayerInstance _player;
  451. -  
  452. -   public ExHomonculusList(PlayerInstance player)
  453. -   {
  454. -       _player = player;
  455. -   }
  456. -  
  457. -   @Override
  458. -   public boolean write(PacketWriter packet)
  459. -   {
  460. -       OutgoingPackets.EX_SHOW_HOMUNCULUS_LIST.writeId(packet);
  461. -      
  462. -       final int homunculus = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_ID, 0);
  463. -       if (homunculus > 0)
  464. -       {
  465. -           final int quality = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_QUALITY, 0);
  466. -          
  467. -           packet.writeD(0x01); // Size.
  468. -          
  469. -           packet.writeD(0x00); // nIdx
  470. -           packet.writeD(homunculus); // nID
  471. -           packet.writeD(quality); // eType
  472. -           packet.writeC(0x01); // bActivate
  473. -          
  474. -           packet.writeD(0x00); // m_nSkillID 0
  475. -           packet.writeD(0x00); // m_nSkillID 1
  476. -           packet.writeD(0x00); // m_nSkillID 2
  477. -           packet.writeD(0x00); // m_nSkillID 3
  478. -           packet.writeD(0x00); // m_nSkillID 4
  479. -           packet.writeD(0x00); // m_nSkillID 5
  480. -          
  481. -           packet.writeD(0x00); // m_nSkillLevel 0
  482. -           packet.writeD(0x00); // m_nSkillLevel 1
  483. -           packet.writeD(0x00); // m_nSkillLevel 2
  484. -           packet.writeD(0x00); // m_nSkillLevel 3
  485. -           packet.writeD(0x00); // m_nSkillLevel 4
  486. -           packet.writeD(0x00); // m_nSkillLevel 5
  487. -          
  488. -           packet.writeD(0x01); // m_nLevel
  489. -           packet.writeD(0x00); // m_nExp
  490. -           packet.writeD(_player.getHomunculusHpBonus()); // m_nHP
  491. -           packet.writeD(_player.getHomunculusAtkBonus()); // m_nAttack
  492. -           packet.writeD(_player.getHomunculusDefBonus()); // m_nDefence
  493. -           packet.writeD((int) (_player.getHomunculusCritBonus() * 100)); // m_nCritical
  494. -       }
  495. -       else
  496. -       {
  497. -           packet.writeD(0); // Size.
  498. -       }
  499. -      
  500. -       return true;
  501. -   }
  502. -}
  503. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusSummonResult.java
  504. ===================================================================
  505. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusSummonResult.java    (revision 8811)
  506. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomonculusSummonResult.java    (nonexistent)
  507. @@ -1,45 +0,0 @@
  508. -/*
  509. - * This file is part of the L2J Mobius project.
  510. - *
  511. - * This program is free software: you can redistribute it and/or modify
  512. - * it under the terms of the GNU General Public License as published by
  513. - * the Free Software Foundation, either version 3 of the License, or
  514. - * (at your option) any later version.
  515. - *
  516. - * This program is distributed in the hope that it will be useful,
  517. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  518. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  519. - * General Public License for more details.
  520. - *
  521. - * You should have received a copy of the GNU General Public License
  522. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  523. - */
  524. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  525. -
  526. -import org.l2jmobius.commons.network.PacketWriter;
  527. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  528. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  529. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  530. -
  531. -public class ExHomonculusSummonResult implements IClientOutgoingPacket
  532. -{
  533. -   @SuppressWarnings("unused")
  534. -   private final PlayerInstance _player;
  535. -  
  536. -   public ExHomonculusSummonResult(PlayerInstance player)
  537. -   {
  538. -       _player = player;
  539. -   }
  540. -  
  541. -   @Override
  542. -   public boolean write(PacketWriter packet)
  543. -   {
  544. -       OutgoingPackets.EX_SHOW_HOMUNCULUS_LIST.writeId(packet);
  545. -      
  546. -       packet.writeD(1);
  547. -       packet.writeD(2);
  548. -       packet.writeD(1); // Homunculus client id?
  549. -      
  550. -       return true;
  551. -   }
  552. -}
  553. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusCreateStartResult.java
  554. ===================================================================
  555. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusCreateStartResult.java   (nonexistent)
  556. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusCreateStartResult.java   (working copy)
  557. @@ -0,0 +1,46 @@
  558. +/*
  559. + * This file is part of the L2J Mobius project.
  560. + *
  561. + * This program is free software: you can redistribute it and/or modify
  562. + * it under the terms of the GNU General Public License as published by
  563. + * the Free Software Foundation, either version 3 of the License, or
  564. + * (at your option) any later version.
  565. + *
  566. + * This program is distributed in the hope that it will be useful,
  567. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  568. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  569. + * General Public License for more details.
  570. + *
  571. + * You should have received a copy of the GNU General Public License
  572. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  573. + */
  574. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  575. +
  576. +import org.l2jmobius.commons.network.PacketWriter;
  577. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  578. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  579. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  580. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  581. +
  582. +/**
  583. + * @author Mobius
  584. + */
  585. +public class ExHomunculusCreateStartResult implements IClientOutgoingPacket
  586. +{
  587. +  
  588. +   public ExHomunculusCreateStartResult(PlayerInstance player)
  589. +   {
  590. +      
  591. +   }
  592. +  
  593. +   @Override
  594. +   public boolean write(PacketWriter packet)
  595. +   {
  596. +       OutgoingPackets.EX_HOMUNCULUS_CREATE_START_RESULT.writeId(packet);
  597. +      
  598. +       packet.writeD(1); // 1 - success
  599. +       packet.writeD(SystemMessage.YOUVE_SEALED_A_HOMUNCULUS_HEART_IN_ORDER_TO_CREATE_IT_YOUR_BLOOD_SPIRIT_AND_TEARS_ARE_REQUIRED); // SystemMessageId
  600. +      
  601. +       return true;
  602. +   }
  603. +}
  604. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusEnchantEXPResult.java
  605. ===================================================================
  606. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusEnchantEXPResult.java    (nonexistent)
  607. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusEnchantEXPResult.java    (working copy)
  608. @@ -0,0 +1,42 @@
  609. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  610. +
  611. +import org.l2jmobius.commons.network.PacketWriter;
  612. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  613. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  614. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  615. +
  616. +/**
  617. + * @author nexvill
  618. + */
  619. +public class ExHomunculusEnchantEXPResult implements IClientOutgoingPacket
  620. +{
  621. +   private final boolean _success, _newLevel;
  622. +  
  623. +   public ExHomunculusEnchantEXPResult(boolean success, boolean newLevel)
  624. +   {
  625. +       _success = success;
  626. +       _newLevel = newLevel;
  627. +   }
  628. +  
  629. +   @Override
  630. +   public boolean write(PacketWriter packet)
  631. +   {
  632. +       OutgoingPackets.EX_HOMUNCULUS_ENCHANT_EXP_RESULT.writeId(packet);
  633. +       if (!_success)
  634. +       {
  635. +           packet.writeD(0);
  636. +           packet.writeD(SystemMessage.NOT_ENOUGH_UPGRADE_POINTS);
  637. +       }
  638. +       else if (!_newLevel)
  639. +       {
  640. +           packet.writeD(1); // success
  641. +           packet.writeD(0); // SystemMessageId
  642. +       }
  643. +       else
  644. +       {
  645. +           packet.writeD(1);
  646. +           packet.writeD(SystemMessage.THE_HOMUNCULUS_LEVEL_IS_INCREASED);
  647. +       }
  648. +       return true;
  649. +   }
  650. +}
  651. \ No newline at end of file
  652. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusGetEnchantPointResult.java
  653. ===================================================================
  654. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusGetEnchantPointResult.java   (nonexistent)
  655. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusGetEnchantPointResult.java   (working copy)
  656. @@ -0,0 +1,38 @@
  657. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  658. +
  659. +import org.l2jmobius.commons.network.PacketWriter;
  660. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  661. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  662. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  663. +
  664. +/**
  665. + * @author nexvill
  666. + */
  667. +public class ExHomunculusGetEnchantPointResult implements IClientOutgoingPacket
  668. +{
  669. +   private final int _enchantType;
  670. +  
  671. +   public ExHomunculusGetEnchantPointResult(int enchantType)
  672. +   {
  673. +       _enchantType = enchantType;
  674. +   }
  675. +  
  676. +   @Override
  677. +   public boolean write(PacketWriter packet)
  678. +   {
  679. +       OutgoingPackets.EX_HOMUNCULUS_GET_ENCHANT_POINT_RESULT.writeId(packet);
  680. +       if (_enchantType != 2)
  681. +       {
  682. +           packet.writeD(1); // success
  683. +           packet.writeD(_enchantType);
  684. +           packet.writeD(SystemMessage.YOUVE_OBTAINED_UPGRADE_POINTS);
  685. +       }
  686. +       else
  687. +       {
  688. +           packet.writeD(1);
  689. +           packet.writeD(_enchantType);
  690. +           packet.writeD(SystemMessage.VP_ADDED);
  691. +       }
  692. +       return true;
  693. +   }
  694. +}
  695. \ No newline at end of file
  696. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusHPSPVP.java
  697. ===================================================================
  698. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusHPSPVP.java  (nonexistent)
  699. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusHPSPVP.java  (working copy)
  700. @@ -0,0 +1,51 @@
  701. +/*
  702. + * This file is part of the L2J Mobius project.
  703. + *
  704. + * This program is free software: you can redistribute it and/or modify
  705. + * it under the terms of the GNU General Public License as published by
  706. + * the Free Software Foundation, either version 3 of the License, or
  707. + * (at your option) any later version.
  708. + *
  709. + * This program is distributed in the hope that it will be useful,
  710. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  711. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  712. + * General Public License for more details.
  713. + *
  714. + * You should have received a copy of the GNU General Public License
  715. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  716. + */
  717. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  718. +
  719. +import org.l2jmobius.commons.network.PacketWriter;
  720. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  721. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  722. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  723. +
  724. +/**
  725. + * @author Mobius
  726. + */
  727. +public class ExHomunculusHPSPVP implements IClientOutgoingPacket
  728. +{
  729. +   private final int _hp;
  730. +   private final long _sp;
  731. +   private final int _vp;
  732. +  
  733. +   public ExHomunculusHPSPVP(PlayerInstance player)
  734. +   {
  735. +       _hp = (int) player.getCurrentHp();
  736. +       _sp = player.getSp();
  737. +       _vp = player.getVitalityPoints();
  738. +   }
  739. +  
  740. +   @Override
  741. +   public boolean write(PacketWriter packet)
  742. +   {
  743. +       OutgoingPackets.EX_HOMUNCULUS_HPSPVP.writeId(packet);
  744. +      
  745. +       packet.writeD(_hp);
  746. +       packet.writeQ(_sp);
  747. +       packet.writeD(_vp);
  748. +      
  749. +       return true;
  750. +   }
  751. +}
  752. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInitPointResult.java
  753. ===================================================================
  754. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInitPointResult.java (nonexistent)
  755. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInitPointResult.java (working copy)
  756. @@ -0,0 +1,40 @@
  757. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  758. +
  759. +import org.l2jmobius.commons.network.PacketWriter;
  760. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  761. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  762. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  763. +
  764. +/**
  765. + * @author nexvill
  766. + */
  767. +public class ExHomunculusInitPointResult implements IClientOutgoingPacket
  768. +{
  769. +   private final boolean _success;
  770. +   private final int _type;
  771. +  
  772. +   public ExHomunculusInitPointResult(boolean success, int type)
  773. +   {
  774. +       _success = success;
  775. +       _type = type;
  776. +   }
  777. +  
  778. +   @Override
  779. +   public boolean write(PacketWriter packet)
  780. +   {
  781. +       OutgoingPackets.EX_HOMUNCULUS_INIT_POINT_RESULT.writeId(packet);
  782. +       if (_success)
  783. +       {
  784. +           packet.writeD(1); // success
  785. +           packet.writeD(_type); // init type
  786. +           packet.writeD(SystemMessage.THE_RECEIVED_UPGRADE_POINTS_ARE_RESET); // SystemMessageId
  787. +       }
  788. +       else
  789. +       {
  790. +           packet.writeD(0);
  791. +           packet.writeD(_type);
  792. +           packet.writeD(SystemMessage.NOT_ENOUGH_ITEMS_FOR_RESETTING);
  793. +       }
  794. +       return true;
  795. +   }
  796. +}
  797. \ No newline at end of file
  798. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInsertHpSpVp.java
  799. ===================================================================
  800. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInsertHpSpVp.java    (revision 8809)
  801. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInsertHpSpVp.java    (nonexistent)
  802. @@ -1,47 +0,0 @@
  803. -/*
  804. - * This file is part of the L2J Mobius project.
  805. - *
  806. - * This program is free software: you can redistribute it and/or modify
  807. - * it under the terms of the GNU General Public License as published by
  808. - * the Free Software Foundation, either version 3 of the License, or
  809. - * (at your option) any later version.
  810. - *
  811. - * This program is distributed in the hope that it will be useful,
  812. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  813. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  814. - * General Public License for more details.
  815. - *
  816. - * You should have received a copy of the GNU General Public License
  817. - * along with this program. If not, see <http://www.gnu.org/licenses/>.
  818. - */
  819. -package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  820. -
  821. -import org.l2jmobius.commons.network.PacketWriter;
  822. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  823. -import org.l2jmobius.gameserver.network.OutgoingPackets;
  824. -import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  825. -
  826. -/**
  827. - * @author Mobius
  828. - */
  829. -public class ExHomunculusInsertHpSpVp implements IClientOutgoingPacket
  830. -{
  831. -   private final PlayerInstance _player;
  832. -  
  833. -   public ExHomunculusInsertHpSpVp(PlayerInstance player)
  834. -   {
  835. -       _player = player;
  836. -   }
  837. -  
  838. -   @Override
  839. -   public boolean write(PacketWriter packet)
  840. -   {
  841. -       OutgoingPackets.EX_HOMUNCULUS_HPSPVP.writeId(packet);
  842. -      
  843. -       packet.writeD((int) _player.getCurrentHp());
  844. -       packet.writeQ(_player.getSp());
  845. -       packet.writeD(_player.getVitalityPoints());
  846. -      
  847. -       return true;
  848. -   }
  849. -}
  850. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInsertResult.java
  851. ===================================================================
  852. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInsertResult.java    (nonexistent)
  853. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusInsertResult.java    (working copy)
  854. @@ -0,0 +1,57 @@
  855. +/*
  856. + * This file is part of the L2J Mobius project.
  857. + *
  858. + * This program is free software: you can redistribute it and/or modify
  859. + * it under the terms of the GNU General Public License as published by
  860. + * the Free Software Foundation, either version 3 of the License, or
  861. + * (at your option) any later version.
  862. + *
  863. + * This program is distributed in the hope that it will be useful,
  864. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  865. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  866. + * General Public License for more details.
  867. + *
  868. + * You should have received a copy of the GNU General Public License
  869. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  870. + */
  871. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  872. +
  873. +import org.l2jmobius.commons.network.PacketWriter;
  874. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  875. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  876. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  877. +
  878. +/**
  879. + * @author Mobius
  880. + */
  881. +public class ExHomunculusInsertResult implements IClientOutgoingPacket
  882. +{
  883. +   private final int _type;
  884. +  
  885. +   public ExHomunculusInsertResult(int type)
  886. +   {
  887. +       _type = type;
  888. +   }
  889. +  
  890. +   @Override
  891. +   public boolean write(PacketWriter packet)
  892. +   {
  893. +       OutgoingPackets.EX_HOMUNCULUS_INSERT_RESULT.writeId(packet);
  894. +      
  895. +       packet.writeD(1); // 1 - success
  896. +       if (_type == 0)
  897. +       {
  898. +           packet.writeD(SystemMessage.THE_HOMUNCULUS_TAKES_YOUR_BLOOD_HP); // SystemMessageId
  899. +       }
  900. +       else if (_type == 1)
  901. +       {
  902. +           packet.writeD(SystemMessage.THE_HOMUNCULUS_TAKES_YOUR_SPIRIT_SP);
  903. +       }
  904. +       else
  905. +       {
  906. +           packet.writeD(SystemMessage.THE_HOMUNCULUS_TAKES_YOUR_TEARS_VP);
  907. +       }
  908. +      
  909. +       return true;
  910. +   }
  911. +}
  912. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java
  913. ===================================================================
  914. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java   (revision 8811)
  915. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java   (working copy)
  916. @@ -18,6 +18,7 @@
  917.  
  918.  import org.l2jmobius.commons.network.PacketWriter;
  919.  import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  920. +import org.l2jmobius.gameserver.model.variables.PlayerVariables;
  921.  import org.l2jmobius.gameserver.network.OutgoingPackets;
  922.  import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  923.  
  924. @@ -26,7 +27,6 @@
  925.   */
  926.  public class ExHomunculusPointInfo implements IClientOutgoingPacket
  927.  {
  928. -   @SuppressWarnings("unused")
  929.     private final PlayerInstance _player;
  930.    
  931.     public ExHomunculusPointInfo(PlayerInstance player)
  932. @@ -39,13 +39,20 @@
  933.     {
  934.         OutgoingPackets.EX_HOMUNCULUS_POINT_INFO.writeId(packet);
  935.        
  936. -       packet.writeD(0); // enchant points
  937. -       packet.writeD(0); // hunted monster points
  938. -       packet.writeD(0); // points obtained
  939. -       packet.writeD(0); // reset time
  940. -       packet.writeD(0); // vitality points?
  941. -       packet.writeD(0); // vitality points obtained?
  942. -       packet.writeD(0); // vitality points reset time?
  943. +       int upgradePoints = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0);
  944. +       int killedMobs = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_KILLED_MOBS, 0);
  945. +       int usedKillConverts = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_KILL_CONVERT, 0);
  946. +       int usedResetConverts = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_RESET_KILLS, 0);
  947. +       int usedVpPoints = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_VP_POINTS, 0);
  948. +       int usedVpConverts = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_VP_CONVERT, 0);
  949. +       int usedResetVp = _player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_RESET_VP, 0);
  950. +       packet.writeD(upgradePoints); // points
  951. +       packet.writeD(killedMobs); // killed mobs
  952. +       packet.writeD(usedKillConverts); // consumed basic kill points
  953. +       packet.writeD(usedResetConverts); // consumed reset kill points?
  954. +       packet.writeD(usedVpPoints); // vp points
  955. +       packet.writeD(usedVpConverts); // consumed basic vp points
  956. +       packet.writeD(usedResetVp); // consumed reset vp points
  957.        
  958.         return true;
  959.     }
  960. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusReady.java
  961. ===================================================================
  962. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusReady.java   (revision 8811)
  963. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusReady.java   (working copy)
  964. @@ -17,7 +17,6 @@
  965.  package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  966.  
  967.  import org.l2jmobius.commons.network.PacketWriter;
  968. -import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  969.  import org.l2jmobius.gameserver.network.OutgoingPackets;
  970.  import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  971.  
  972. @@ -26,12 +25,18 @@
  973.   */
  974.  public class ExHomunculusReady implements IClientOutgoingPacket
  975.  {
  976. -   @SuppressWarnings("unused")
  977. -   private final PlayerInstance _player;
  978. +   // private boolean _enabled;
  979. +   //
  980. +   // public ExHomunculusReady(boolean enabled)
  981. +   // {
  982. +   // _enabled = enabled;
  983. +   // }
  984.    
  985. -   public ExHomunculusReady(PlayerInstance player)
  986. +   private final int _enabled;
  987. +  
  988. +   public ExHomunculusReady(int enabled)
  989.     {
  990. -       _player = player;
  991. +       _enabled = enabled;
  992.     }
  993.    
  994.     @Override
  995. @@ -38,7 +43,7 @@
  996.     public boolean write(PacketWriter packet)
  997.     {
  998.         OutgoingPackets.EX_HOMUNCULUS_READY.writeId(packet);
  999. -       packet.writeC(0x01); // 1 = enabled, 0 = disabled
  1000. +       packet.writeC(_enabled);
  1001.         return true;
  1002.     }
  1003.  }
  1004. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusSummonResult.java
  1005. ===================================================================
  1006. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusSummonResult.java    (nonexistent)
  1007. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusSummonResult.java    (working copy)
  1008. @@ -0,0 +1,42 @@
  1009. +/*
  1010. + * This file is part of the L2J Mobius project.
  1011. + *
  1012. + * This program is free software: you can redistribute it and/or modify
  1013. + * it under the terms of the GNU General Public License as published by
  1014. + * the Free Software Foundation, either version 3 of the License, or
  1015. + * (at your option) any later version.
  1016. + *
  1017. + * This program is distributed in the hope that it will be useful,
  1018. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1019. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1020. + * General Public License for more details.
  1021. + *
  1022. + * You should have received a copy of the GNU General Public License
  1023. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1024. + */
  1025. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  1026. +
  1027. +import org.l2jmobius.commons.network.PacketWriter;
  1028. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1029. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1030. +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
  1031. +
  1032. +public class ExHomunculusSummonResult implements IClientOutgoingPacket
  1033. +{
  1034. +  
  1035. +   public ExHomunculusSummonResult()
  1036. +   {
  1037. +      
  1038. +   }
  1039. +  
  1040. +   @Override
  1041. +   public boolean write(PacketWriter packet)
  1042. +   {
  1043. +       OutgoingPackets.EX_HOMUNCULUS_SUMMON_RESULT.writeId(packet);
  1044. +      
  1045. +       packet.writeD(1); // 1 - success
  1046. +       packet.writeD(SystemMessage.A_NEW_HOMUNCULUS_IS_CREATED); // SystemMessageId
  1047. +      
  1048. +       return true;
  1049. +   }
  1050. +}
  1051. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusBirthInfo.java
  1052. ===================================================================
  1053. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusBirthInfo.java   (nonexistent)
  1054. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusBirthInfo.java   (working copy)
  1055. @@ -0,0 +1,67 @@
  1056. +/*
  1057. + * This file is part of the L2J Mobius project.
  1058. + *
  1059. + * This program is free software: you can redistribute it and/or modify
  1060. + * it under the terms of the GNU General Public License as published by
  1061. + * the Free Software Foundation, either version 3 of the License, or
  1062. + * (at your option) any later version.
  1063. + *
  1064. + * This program is distributed in the hope that it will be useful,
  1065. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1066. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1067. + * General Public License for more details.
  1068. + *
  1069. + * You should have received a copy of the GNU General Public License
  1070. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1071. + */
  1072. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  1073. +
  1074. +import org.l2jmobius.commons.network.PacketWriter;
  1075. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  1076. +import org.l2jmobius.gameserver.model.variables.PlayerVariables;
  1077. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1078. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1079. +
  1080. +/**
  1081. + * @author Mobius
  1082. + */
  1083. +public class ExShowHomunculusBirthInfo implements IClientOutgoingPacket
  1084. +{
  1085. +   private static int _hpPoints, _spPoints, _vpPoints, _homunculusCreateTime;
  1086. +  
  1087. +   public ExShowHomunculusBirthInfo(PlayerInstance player)
  1088. +   {
  1089. +       _hpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_HP_POINTS, 0);
  1090. +       _spPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_SP_POINTS, 0);
  1091. +       _vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
  1092. +       _homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000);
  1093. +   }
  1094. +  
  1095. +   @Override
  1096. +   public boolean write(PacketWriter packet)
  1097. +   {
  1098. +       OutgoingPackets.EX_SHOW_HOMUNCULUS_BIRTH_INFO.writeId(packet);
  1099. +      
  1100. +       int creationStage = 0;
  1101. +       if (_homunculusCreateTime > 0)
  1102. +       {
  1103. +           if (((System.currentTimeMillis() / 1000) >= _homunculusCreateTime) //
  1104. +               && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5))
  1105. +           {
  1106. +               creationStage = 2;
  1107. +           }
  1108. +           else
  1109. +           {
  1110. +               creationStage = 1;
  1111. +           }
  1112. +       }
  1113. +       packet.writeD(creationStage); // in creation process (0: can create, 1: in process, 2: can awake
  1114. +       packet.writeD(_hpPoints); // hp points
  1115. +       packet.writeD(_spPoints); // sp points
  1116. +       packet.writeD(_vpPoints); // vp points
  1117. +       packet.writeD(_homunculusCreateTime); // finish time
  1118. +       packet.writeD(0); // JP = 0. ?
  1119. +      
  1120. +       return true;
  1121. +   }
  1122. +}
  1123. Index: java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java
  1124. ===================================================================
  1125. --- java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java    (nonexistent)
  1126. +++ java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java    (working copy)
  1127. @@ -0,0 +1,81 @@
  1128. +/*
  1129. + * This file is part of the L2J Mobius project.
  1130. + *
  1131. + * This program is free software: you can redistribute it and/or modify
  1132. + * it under the terms of the GNU General Public License as published by
  1133. + * the Free Software Foundation, either version 3 of the License, or
  1134. + * (at your option) any later version.
  1135. + *
  1136. + * This program is distributed in the hope that it will be useful,
  1137. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1138. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1139. + * General Public License for more details.
  1140. + *
  1141. + * You should have received a copy of the GNU General Public License
  1142. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  1143. + */
  1144. +package org.l2jmobius.gameserver.network.serverpackets.homunculus;
  1145. +
  1146. +import org.l2jmobius.commons.network.PacketWriter;
  1147. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  1148. +import org.l2jmobius.gameserver.model.homunculus.Homunculus;
  1149. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  1150. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  1151. +
  1152. +/**
  1153. + * @author Mobius
  1154. + */
  1155. +public class ExShowHomunculusList implements IClientOutgoingPacket
  1156. +{
  1157. +   private final PlayerInstance _player;
  1158. +  
  1159. +   public ExShowHomunculusList(PlayerInstance player)
  1160. +   {
  1161. +       _player = player;
  1162. +   }
  1163. +  
  1164. +   @Override
  1165. +   public boolean write(PacketWriter packet)
  1166. +   {
  1167. +       OutgoingPackets.EX_SHOW_HOMUNCULUS_LIST.writeId(packet);
  1168. +      
  1169. +       if (_player.getHomunculusList().size() > 0)
  1170. +       {
  1171. +           packet.writeD(_player.getHomunculusList().size()); // homunculus count
  1172. +           for (int i = 0; i < _player.getHomunculusList().size(); i++)
  1173. +           {
  1174. +               packet.writeD(i); // slot
  1175. +              
  1176. +               Homunculus homunculus = _player.getHomunculusList().get(i);
  1177. +              
  1178. +               packet.writeD(homunculus.getId()); // homunculus id
  1179. +               packet.writeD(homunculus.getType());
  1180. +               packet.writeC(homunculus.isActive() ? 1 : 0);
  1181. +               packet.writeD(homunculus.getTemplate().getBasicSkillId());
  1182. +               packet.writeD(homunculus.getSkill1Level() > 0 ? homunculus.getTemplate().getSkill1Id() : 0);
  1183. +               packet.writeD(homunculus.getSkill2Level() > 0 ? homunculus.getTemplate().getSkill2Id() : 0);
  1184. +               packet.writeD(homunculus.getSkill3Level() > 0 ? homunculus.getTemplate().getSkill3Id() : 0);
  1185. +               packet.writeD(homunculus.getSkill4Level() > 0 ? homunculus.getTemplate().getSkill4Id() : 0);
  1186. +               packet.writeD(homunculus.getSkill5Level() > 0 ? homunculus.getTemplate().getSkill5Id() : 0);
  1187. +               packet.writeD(homunculus.getTemplate().getBasicSkillLevel());
  1188. +               packet.writeD(homunculus.getSkill1Level());
  1189. +               packet.writeD(homunculus.getSkill2Level());
  1190. +               packet.writeD(homunculus.getSkill3Level());
  1191. +               packet.writeD(homunculus.getSkill4Level());
  1192. +               packet.writeD(homunculus.getSkill5Level());
  1193. +               packet.writeD(homunculus.getLevel());
  1194. +               packet.writeD(homunculus.getExp());
  1195. +               packet.writeD(homunculus.getHp());
  1196. +               packet.writeD(homunculus.getAtk());
  1197. +               packet.writeD(homunculus.getDef());
  1198. +               packet.writeD(homunculus.getCritRate());
  1199. +           }
  1200. +       }
  1201. +       else
  1202. +       {
  1203. +           packet.writeD(0);
  1204. +       }
  1205. +      
  1206. +       return true;
  1207. +   }
  1208. +}
  1209.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement