L2NpcAIData.java 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. /*
  2. * Copyright (C) 2004-2013 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.model;
  20. import com.l2jserver.gameserver.enums.AIType;
  21. /**
  22. * This Data is for NPC Attributes and AI related stuffs.<br>
  23. * @author ShanSoft
  24. */
  25. public class L2NpcAIData
  26. {
  27. // Basic AI
  28. private int _primarySkillId;
  29. private int _minskillChance;
  30. private int _maxskillChance;
  31. private int _canMove;
  32. private int _soulshot;
  33. private int _spiritshot;
  34. private int _soulshotChance;
  35. private int _spiritshotChance;
  36. private int _isChaos;
  37. private String _clan = null;
  38. private int _clanRange;
  39. private String _enemyClan = null;
  40. private int _enemyRange;
  41. private int _dodge;
  42. private int _longRangeSkill;
  43. private int _shortRangeSkill;
  44. private int _longRangeChance;
  45. private int _shortRangeChance;
  46. private int _switchRangeChance;
  47. private AIType _aiType = AIType.FIGHTER;
  48. private int _aggroRange;
  49. private boolean _showName;
  50. private boolean _targetable;
  51. public void setPrimarySkillId(int primarySkillId)
  52. {
  53. _primarySkillId = primarySkillId;
  54. }
  55. public void setMinSkillChance(int skill_chance)
  56. {
  57. _minskillChance = skill_chance;
  58. }
  59. public void setMaxSkillChance(int skill_chance)
  60. {
  61. _maxskillChance = skill_chance;
  62. }
  63. public void setCanMove(int canMove)
  64. {
  65. _canMove = canMove;
  66. }
  67. public void setSoulShot(int soulshot)
  68. {
  69. _soulshot = soulshot;
  70. }
  71. public void setSpiritShot(int spiritshot)
  72. {
  73. _spiritshot = spiritshot;
  74. }
  75. public void setSoulShotChance(int soulshotchance)
  76. {
  77. _soulshotChance = soulshotchance;
  78. }
  79. public void setSpiritShotChance(int spiritshotchance)
  80. {
  81. _spiritshotChance = spiritshotchance;
  82. }
  83. public void setShortRangeSkill(int shortrangeskill)
  84. {
  85. _shortRangeSkill = shortrangeskill;
  86. }
  87. public void setShortRangeChance(int shortrangechance)
  88. {
  89. _shortRangeChance = shortrangechance;
  90. }
  91. public void setLongRangeSkill(int longrangeskill)
  92. {
  93. _longRangeSkill = longrangeskill;
  94. }
  95. public void setLongRangeChance(int longrangechance)
  96. {
  97. _longRangeChance = longrangechance;
  98. }
  99. public void setSwitchRangeChance(int switchrangechance)
  100. {
  101. _switchRangeChance = switchrangechance;
  102. }
  103. public void setIsChaos(int ischaos)
  104. {
  105. _isChaos = ischaos;
  106. }
  107. public void setClan(String clan)
  108. {
  109. if ((clan != null) && !clan.isEmpty() && !clan.equalsIgnoreCase("null"))
  110. {
  111. _clan = clan.intern();
  112. }
  113. }
  114. public void setClanRange(int clanRange)
  115. {
  116. _clanRange = clanRange;
  117. }
  118. public void setEnemyClan(String enemyClan)
  119. {
  120. if ((enemyClan != null) && !enemyClan.isEmpty() && !enemyClan.equalsIgnoreCase("null"))
  121. {
  122. _enemyClan = enemyClan.intern();
  123. }
  124. }
  125. public void setEnemyRange(int enemyRange)
  126. {
  127. _enemyRange = enemyRange;
  128. }
  129. public void setDodge(int dodge)
  130. {
  131. _dodge = dodge;
  132. }
  133. public void setAi(String ai)
  134. {
  135. if (ai.equalsIgnoreCase("archer"))
  136. {
  137. _aiType = AIType.ARCHER;
  138. }
  139. else if (ai.equalsIgnoreCase("balanced"))
  140. {
  141. _aiType = AIType.BALANCED;
  142. }
  143. else if (ai.equalsIgnoreCase("mage"))
  144. {
  145. _aiType = AIType.MAGE;
  146. }
  147. else if (ai.equalsIgnoreCase("healer"))
  148. {
  149. _aiType = AIType.HEALER;
  150. }
  151. else if (ai.equalsIgnoreCase("corpse"))
  152. {
  153. _aiType = AIType.CORPSE;
  154. }
  155. else
  156. {
  157. _aiType = AIType.FIGHTER;
  158. }
  159. }
  160. public void setAggro(int val)
  161. {
  162. _aggroRange = val;
  163. }
  164. public void setTargetable(boolean val)
  165. {
  166. _targetable = val;
  167. }
  168. public void setShowName(boolean val)
  169. {
  170. _showName = val;
  171. }
  172. public int getPrimarySkillId()
  173. {
  174. return _primarySkillId;
  175. }
  176. public int getMinSkillChance()
  177. {
  178. return _minskillChance;
  179. }
  180. public int getMaxSkillChance()
  181. {
  182. return _maxskillChance;
  183. }
  184. public int getCanMove()
  185. {
  186. return _canMove;
  187. }
  188. public int getSoulShot()
  189. {
  190. return _soulshot;
  191. }
  192. public int getSpiritShot()
  193. {
  194. return _spiritshot;
  195. }
  196. public int getSoulShotChance()
  197. {
  198. return _soulshotChance;
  199. }
  200. public int getSpiritShotChance()
  201. {
  202. return _spiritshotChance;
  203. }
  204. public int getShortRangeSkill()
  205. {
  206. return _shortRangeSkill;
  207. }
  208. public int getShortRangeChance()
  209. {
  210. return _shortRangeChance;
  211. }
  212. public int getLongRangeSkill()
  213. {
  214. return _longRangeSkill;
  215. }
  216. public int getLongRangeChance()
  217. {
  218. return _longRangeChance;
  219. }
  220. public int getSwitchRangeChance()
  221. {
  222. return _switchRangeChance;
  223. }
  224. public int getIsChaos()
  225. {
  226. return _isChaos;
  227. }
  228. public String getClan()
  229. {
  230. return _clan;
  231. }
  232. public int getClanRange()
  233. {
  234. return _clanRange;
  235. }
  236. public String getEnemyClan()
  237. {
  238. return _enemyClan;
  239. }
  240. public int getEnemyRange()
  241. {
  242. return _enemyRange;
  243. }
  244. public int getDodge()
  245. {
  246. return _dodge;
  247. }
  248. public AIType getAiType()
  249. {
  250. return _aiType;
  251. }
  252. public int getAggroRange()
  253. {
  254. return _aggroRange;
  255. }
  256. /**
  257. * @return {@code true} if the NPC name should shows above NPC, {@code false} otherwise.
  258. */
  259. public boolean showName()
  260. {
  261. return _showName;
  262. }
  263. /**
  264. * @return {@code true} if the NPC can be targeted, {@code false} otherwise.
  265. */
  266. public boolean isTargetable()
  267. {
  268. return _targetable;
  269. }
  270. }