RelationChanged.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.serverpackets;
  16. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  17. /**
  18. *
  19. * @author Luca Baldi
  20. */
  21. public final class RelationChanged extends L2GameServerPacket
  22. {
  23. public static final int RELATION_PVP_FLAG = 0x00002; // pvp ???
  24. public static final int RELATION_HAS_KARMA = 0x00004; // karma ???
  25. public static final int RELATION_LEADER = 0x00080; // leader
  26. public static final int RELATION_INSIEGE = 0x00200; // true if in siege
  27. public static final int RELATION_ATTACKER = 0x00400; // true when attacker
  28. public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red
  29. public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue
  30. public static final int RELATION_MUTUAL_WAR = 0x08000; // double fist
  31. public static final int RELATION_1SIDED_WAR = 0x10000; // single fist
  32. private static final String _S__CE_RELATIONCHANGED = "[S] ce RelationChanged";
  33. private int _objId, _relation, _autoAttackable, _karma, _pvpFlag;
  34. public RelationChanged(L2PcInstance cha, int relation, boolean autoattackable)
  35. {
  36. _objId = cha.getObjectId();
  37. _relation = relation;
  38. _autoAttackable = autoattackable ? 1 : 0;
  39. _karma = cha.getKarma();
  40. _pvpFlag = cha.getPvpFlag();
  41. }
  42. /**
  43. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#writeImpl()
  44. */
  45. @Override
  46. protected final void writeImpl()
  47. {
  48. writeC(0xce);
  49. writeD(_objId);
  50. writeD(_relation);
  51. writeD(_autoAttackable);
  52. writeD(_karma);
  53. writeD(_pvpFlag);
  54. }
  55. /**
  56. * @see net.sf.l2j.gameserver.BasePacket#getType()
  57. */
  58. @Override
  59. public String getType()
  60. {
  61. // TODO Auto-generated method stub
  62. return _S__CE_RELATIONCHANGED;
  63. }
  64. }