L2NpcAIData.java 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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 com.l2jserver.gameserver.model;
  16. import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate.AIType;
  17. /**
  18. * This Data is for NPC Attributes and AI related stuffs.<br>
  19. * @author ShanSoft
  20. */
  21. public class L2NpcAIData
  22. {
  23. // Basic AI
  24. private int _primarySkillId;
  25. private int _minskillChance;
  26. private int _maxskillChance;
  27. private int _canMove;
  28. private int _soulshot;
  29. private int _spiritshot;
  30. private int _soulshotChance;
  31. private int _spiritshotChance;
  32. private int _isChaos;
  33. private String _clan = null;
  34. private int _clanRange;
  35. private String _enemyClan = null;
  36. private int _enemyRange;
  37. private int _dodge;
  38. private int _longRangeSkill;
  39. private int _shortRangeSkill;
  40. private int _longRangeChance;
  41. private int _shortRangeChance;
  42. private int _switchRangeChance;
  43. private AIType _aiType = AIType.FIGHTER;
  44. private int _aggroRange;
  45. private boolean _showName;
  46. private boolean _targetable;
  47. public void setPrimarySkillId(int primarySkillId)
  48. {
  49. _primarySkillId = primarySkillId;
  50. }
  51. public void setMinSkillChance(int skill_chance)
  52. {
  53. _minskillChance = skill_chance;
  54. }
  55. public void setMaxSkillChance(int skill_chance)
  56. {
  57. _maxskillChance = skill_chance;
  58. }
  59. public void setCanMove(int canMove)
  60. {
  61. _canMove = canMove;
  62. }
  63. public void setSoulShot(int soulshot)
  64. {
  65. _soulshot = soulshot;
  66. }
  67. public void setSpiritShot(int spiritshot)
  68. {
  69. _spiritshot = spiritshot;
  70. }
  71. public void setSoulShotChance(int soulshotchance)
  72. {
  73. _soulshotChance = soulshotchance;
  74. }
  75. public void setSpiritShotChance(int spiritshotchance)
  76. {
  77. _spiritshotChance = spiritshotchance;
  78. }
  79. public void setShortRangeSkill(int shortrangeskill)
  80. {
  81. _shortRangeSkill = shortrangeskill;
  82. }
  83. public void setShortRangeChance(int shortrangechance)
  84. {
  85. _shortRangeChance = shortrangechance;
  86. }
  87. public void setLongRangeSkill(int longrangeskill)
  88. {
  89. _longRangeSkill = longrangeskill;
  90. }
  91. public void setLongRangeChance(int longrangechance)
  92. {
  93. _shortRangeChance = longrangechance;
  94. }
  95. public void setSwitchRangeChance(int switchrangechance)
  96. {
  97. _switchRangeChance = switchrangechance;
  98. }
  99. public void setIsChaos(int ischaos)
  100. {
  101. _isChaos = ischaos;
  102. }
  103. public void setClan(String clan)
  104. {
  105. if ((clan != null) && !clan.equals("") && !clan.equalsIgnoreCase("null"))
  106. {
  107. _clan = clan.intern();
  108. }
  109. }
  110. public void setClanRange(int clanRange)
  111. {
  112. _clanRange = clanRange;
  113. }
  114. public void setEnemyClan(String enemyClan)
  115. {
  116. if ((enemyClan != null) && !enemyClan.equals("") && !enemyClan.equalsIgnoreCase("null"))
  117. {
  118. _enemyClan = enemyClan.intern();
  119. }
  120. }
  121. public void setEnemyRange(int enemyRange)
  122. {
  123. _enemyRange = enemyRange;
  124. }
  125. public void setDodge(int dodge)
  126. {
  127. _dodge = dodge;
  128. }
  129. public void setAi(String ai)
  130. {
  131. if (ai.equalsIgnoreCase("archer"))
  132. {
  133. _aiType = AIType.ARCHER;
  134. }
  135. else if (ai.equalsIgnoreCase("balanced"))
  136. {
  137. _aiType = AIType.BALANCED;
  138. }
  139. else if (ai.equalsIgnoreCase("mage"))
  140. {
  141. _aiType = AIType.MAGE;
  142. }
  143. else if (ai.equalsIgnoreCase("healer"))
  144. {
  145. _aiType = AIType.HEALER;
  146. }
  147. else if (ai.equalsIgnoreCase("corpse"))
  148. {
  149. _aiType = AIType.CORPSE;
  150. }
  151. else
  152. {
  153. _aiType = AIType.FIGHTER;
  154. }
  155. }
  156. public void setAggro(int val)
  157. {
  158. _aggroRange = val;
  159. }
  160. public void setTargetable(boolean val)
  161. {
  162. _targetable = val;
  163. }
  164. public void setShowName(boolean val)
  165. {
  166. _showName = val;
  167. }
  168. public int getPrimarySkillId()
  169. {
  170. return _primarySkillId;
  171. }
  172. public int getMinSkillChance()
  173. {
  174. return _minskillChance;
  175. }
  176. public int getMaxSkillChance()
  177. {
  178. return _maxskillChance;
  179. }
  180. public int getCanMove()
  181. {
  182. return _canMove;
  183. }
  184. public int getSoulShot()
  185. {
  186. return _soulshot;
  187. }
  188. public int getSpiritShot()
  189. {
  190. return _spiritshot;
  191. }
  192. public int getSoulShotChance()
  193. {
  194. return _soulshotChance;
  195. }
  196. public int getSpiritShotChance()
  197. {
  198. return _spiritshotChance;
  199. }
  200. public int getShortRangeSkill()
  201. {
  202. return _shortRangeSkill;
  203. }
  204. public int getShortRangeChance()
  205. {
  206. return _shortRangeChance;
  207. }
  208. public int getLongRangeSkill()
  209. {
  210. return _longRangeSkill;
  211. }
  212. public int getLongRangeChance()
  213. {
  214. return _longRangeChance;
  215. }
  216. public int getSwitchRangeChance()
  217. {
  218. return _switchRangeChance;
  219. }
  220. public int getIsChaos()
  221. {
  222. return _isChaos;
  223. }
  224. public String getClan()
  225. {
  226. return _clan;
  227. }
  228. public int getClanRange()
  229. {
  230. return _clanRange;
  231. }
  232. public String getEnemyClan()
  233. {
  234. return _enemyClan;
  235. }
  236. public int getEnemyRange()
  237. {
  238. return _enemyRange;
  239. }
  240. public int getDodge()
  241. {
  242. return _dodge;
  243. }
  244. public AIType getAiType()
  245. {
  246. return _aiType;
  247. }
  248. public int getAggroRange()
  249. {
  250. return _aggroRange;
  251. }
  252. /**
  253. * @return {@code true} if the NPC name should shows above NPC, {@code false} otherwise.
  254. */
  255. public boolean showName()
  256. {
  257. return _showName;
  258. }
  259. /**
  260. * @return {@code true} if the NPC can be targeted, {@code false} otherwise.
  261. */
  262. public boolean isTargetable()
  263. {
  264. return _targetable;
  265. }
  266. }