Guest User

Untitled

a guest
Feb 17th, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  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.model.actor.appearance;
  16.  
  17. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  18. import net.sf.l2j.Config;
  19.  
  20. import custom.events.DMEvent;
  21. import custom.events.TvTEvent;
  22.  
  23. import net.sf.l2j.gameserver.model.base.Sex;
  24.  
  25. public final class PcAppearance
  26. {
  27. private L2PcInstance _owner;
  28. private byte _face;
  29. private byte _hairColor;
  30. private byte _hairStyle;
  31. private Sex _sex;
  32. private boolean _invisible = false;
  33. private int _nameColor = 0xFFFFFF;
  34. private int _titleColor = 0xFFFF77;
  35.  
  36. public PcAppearance(byte face, byte hColor, byte hStyle, Sex sex)
  37. {
  38. _face = face;
  39. _hairColor = hColor;
  40. _hairStyle = hStyle;
  41. _sex = sex;
  42. }
  43.  
  44. public byte getFace()
  45. {
  46. return _face;
  47. }
  48.  
  49. public void setFace(int value)
  50. {
  51. _face = (byte) value;
  52. }
  53.  
  54. public byte getHairColor()
  55. {
  56. return _hairColor;
  57. }
  58.  
  59. public void setHairColor(int value)
  60. {
  61. _hairColor = (byte) value;
  62. }
  63.  
  64. public byte getHairStyle()
  65. {
  66. return _hairStyle;
  67. }
  68.  
  69. public void setHairStyle(int value)
  70. {
  71. _hairStyle = (byte) value;
  72. }
  73.  
  74. public Sex getSex()
  75. {
  76. return _sex;
  77. }
  78.  
  79. public void setSex(Sex sex)
  80. {
  81. _sex = sex;
  82. }
  83.  
  84. public boolean getInvisible()
  85. {
  86. return _invisible;
  87. }
  88.  
  89. public void setInvisible()
  90. {
  91. _invisible = true;
  92. }
  93.  
  94. public void setVisible()
  95. {
  96. _invisible = false;
  97. }
  98.  
  99. public int getNameColor()
  100. {
  101. try
  102. {
  103. if (TvTEvent.isStarted())
  104. {
  105. if(TvTEvent.getParticipantTeamId(_owner.getObjectId()) == 1)
  106. {
  107. return Integer.decode("0x0000FF").intValue();
  108. }
  109. else
  110. {
  111. return Integer.decode("0xFF0000").intValue();
  112. }
  113. }
  114. else if (DMEvent.isStarted())
  115. {
  116. return Integer.decode("0x"+Config.DM_COLOR_NAME).intValue();
  117. }
  118. }
  119. catch (Exception e)
  120. {
  121. return _nameColor;
  122. }
  123.  
  124. return _nameColor;
  125. }
  126.  
  127. public void setNameColor(int nameColor)
  128. {
  129. _nameColor = nameColor;
  130. }
  131.  
  132. public void setNameColor(int red, int green, int blue)
  133. {
  134. _nameColor = (red & 0xFF) + ((green & 0xFF) << 8) + ((blue & 0xFF) << 16);
  135. }
  136.  
  137. public int getTitleColor()
  138. {
  139. return _titleColor;
  140. }
  141.  
  142. public void setTitleColor(int titleColor)
  143. {
  144. _titleColor = titleColor;
  145. }
  146.  
  147. public void setTitleColor(int red, int green, int blue)
  148. {
  149. _titleColor = (red & 0xFF) + ((green & 0xFF) << 8) + ((blue & 0xFF) << 16);
  150. }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment