L2Skill.java 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212
  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.skills;
  20. import java.util.ArrayList;
  21. import java.util.List;
  22. import java.util.Map;
  23. import java.util.StringTokenizer;
  24. import java.util.logging.Level;
  25. import java.util.logging.Logger;
  26. import javolution.util.FastMap;
  27. import com.l2jserver.Config;
  28. import com.l2jserver.gameserver.GeoData;
  29. import com.l2jserver.gameserver.datatables.ItemTable;
  30. import com.l2jserver.gameserver.datatables.SkillTable;
  31. import com.l2jserver.gameserver.datatables.SkillTreesData;
  32. import com.l2jserver.gameserver.handler.ITargetTypeHandler;
  33. import com.l2jserver.gameserver.handler.TargetHandler;
  34. import com.l2jserver.gameserver.model.ChanceCondition;
  35. import com.l2jserver.gameserver.model.IChanceSkillTrigger;
  36. import com.l2jserver.gameserver.model.L2ExtractableProductItem;
  37. import com.l2jserver.gameserver.model.L2ExtractableSkill;
  38. import com.l2jserver.gameserver.model.L2Object;
  39. import com.l2jserver.gameserver.model.PcCondOverride;
  40. import com.l2jserver.gameserver.model.StatsSet;
  41. import com.l2jserver.gameserver.model.actor.L2Attackable;
  42. import com.l2jserver.gameserver.model.actor.L2Character;
  43. import com.l2jserver.gameserver.model.actor.L2Playable;
  44. import com.l2jserver.gameserver.model.actor.L2Summon;
  45. import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
  46. import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
  47. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  48. import com.l2jserver.gameserver.model.actor.instance.L2SiegeFlagInstance;
  49. import com.l2jserver.gameserver.model.conditions.Condition;
  50. import com.l2jserver.gameserver.model.effects.EffectTemplate;
  51. import com.l2jserver.gameserver.model.effects.L2Effect;
  52. import com.l2jserver.gameserver.model.entity.TvTEvent;
  53. import com.l2jserver.gameserver.model.holders.ItemHolder;
  54. import com.l2jserver.gameserver.model.items.L2Armor;
  55. import com.l2jserver.gameserver.model.items.type.L2ArmorType;
  56. import com.l2jserver.gameserver.model.skills.funcs.Func;
  57. import com.l2jserver.gameserver.model.skills.funcs.FuncTemplate;
  58. import com.l2jserver.gameserver.model.skills.targets.L2TargetType;
  59. import com.l2jserver.gameserver.model.stats.BaseStats;
  60. import com.l2jserver.gameserver.model.stats.Env;
  61. import com.l2jserver.gameserver.model.stats.Formulas;
  62. import com.l2jserver.gameserver.model.stats.Stats;
  63. import com.l2jserver.gameserver.model.zone.ZoneId;
  64. import com.l2jserver.gameserver.network.SystemMessageId;
  65. import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  66. import com.l2jserver.gameserver.util.Util;
  67. public abstract class L2Skill implements IChanceSkillTrigger
  68. {
  69. protected static final Logger _log = Logger.getLogger(L2Skill.class.getName());
  70. private static final L2Object[] _emptyTargetList = new L2Object[0];
  71. public static final int SKILL_LUCKY = 194;
  72. public static final int SKILL_CREATE_COMMON = 1320;
  73. public static final int SKILL_CREATE_DWARVEN = 172;
  74. public static final int SKILL_CRYSTALLIZE = 248;
  75. public static final int SKILL_DIVINE_INSPIRATION = 1405;
  76. public static final int SKILL_CLAN_LUCK = 390;
  77. public static final int SKILL_NPC_RACE = 4416;
  78. public static final int SKILL_ONYX_BEAST_TRANSFORMATION = 617;
  79. public static final boolean geoEnabled = Config.GEODATA > 0;
  80. // conditional values
  81. public static final int COND_RUNNING = 0x0001;
  82. public static final int COND_WALKING = 0x0002;
  83. public static final int COND_SIT = 0x0004;
  84. public static final int COND_BEHIND = 0x0008;
  85. public static final int COND_CRIT = 0x0010;
  86. public static final int COND_LOWHP = 0x0020;
  87. public static final int COND_ROBES = 0x0040;
  88. public static final int COND_CHARGES = 0x0080;
  89. public static final int COND_SHIELD = 0x0100;
  90. private static final Func[] _emptyFunctionSet = new Func[0];
  91. private static final L2Effect[] _emptyEffectSet = new L2Effect[0];
  92. // these two build the primary key
  93. private final int _id;
  94. private final int _level;
  95. /** Identifier for a skill that client can't display */
  96. private int _displayId;
  97. // not needed, just for easier debug
  98. private final String _name;
  99. private final L2SkillOpType _operateType;
  100. private final int _magic;
  101. private final L2TraitType _traitType;
  102. private final boolean _staticReuse;
  103. private final boolean _staticDamage; // Damage dealing skills do static damage based on the power value.
  104. private final int _mpConsume;
  105. private final int _mpInitialConsume;
  106. private final int _hpConsume;
  107. private final int _cpConsume;
  108. private final int _targetConsume;
  109. private final int _targetConsumeId;
  110. private final int _itemConsume;
  111. private final int _itemConsumeId;
  112. private final int _castRange;
  113. private final int _effectRange;
  114. // Abnormal levels for skills and their canceling, e.g. poison vs negate
  115. private final int _abnormalLvl; // e.g. poison or bleed lvl 2
  116. // Note: see also _effectAbnormalLvl
  117. private final int _negateLvl; // abnormalLvl is negated with negateLvl
  118. private final int[] _negateId; // cancels the effect of skill ID
  119. private final L2SkillType[] _negateStats; // lists the effect types that are canceled
  120. private final Map<String, Byte> _negateAbnormals; // lists the effect abnormal types with order below the presented that are canceled
  121. private final int _maxNegatedEffects; // maximum number of effects to negate
  122. private final boolean _stayAfterDeath; // skill should stay after death
  123. private final boolean _stayOnSubclassChange; // skill should stay on subclass change
  124. // kill by damage over time
  125. private final boolean _killByDOT;
  126. private final int _refId;
  127. // all times in milliseconds
  128. private final int _hitTime;
  129. private final int[] _hitTimings;
  130. // private final int _skillInterruptTime;
  131. private final int _coolTime;
  132. private final int _reuseHashCode;
  133. private final int _reuseDelay;
  134. /** Target type of the skill : SELF, PARTY, CLAN, PET... */
  135. private final L2TargetType _targetType;
  136. private final int _feed;
  137. // base success chance
  138. private final double _power;
  139. private final double _pvpPower;
  140. private final double _pvePower;
  141. private final int _magicLevel;
  142. private final int _levelDepend;
  143. private final boolean _ignoreResists;
  144. private final int _minChance;
  145. private final int _maxChance;
  146. private final int _blowChance;
  147. private final boolean _isNeutral;
  148. // Effecting area of the skill, in radius.
  149. // The radius center varies according to the _targetType:
  150. // "caster" if targetType = AURA/PARTY/CLAN or "target" if targetType = AREA
  151. private final int _skillRadius;
  152. private final L2SkillType _skillType;
  153. private final L2SkillType _effectType; // additional effect has a type
  154. private final int _effectAbnormalLvl; // abnormal level for the additional effect type, e.g. poison lvl 1
  155. private final int _effectId;
  156. private final int _effectLvl; // normal effect level
  157. private final boolean _nextActionIsAttack;
  158. private final boolean _removedOnAnyActionExceptMove;
  159. private final boolean _removedOnDamage;
  160. private final byte _element;
  161. private final int _elementPower;
  162. private final Stats _stat;
  163. private final BaseStats _saveVs;
  164. private final int _condition;
  165. private final int _conditionValue;
  166. private final boolean _overhit;
  167. private final int _weaponsAllowed;
  168. private final int _armorsAllowed;
  169. private final int _minPledgeClass;
  170. private final boolean _isOffensive;
  171. private final int _chargeConsume;
  172. private final int _triggeredId;
  173. private final int _triggeredLevel;
  174. private final String _chanceType;
  175. private final int _soulMaxConsume;
  176. private final int _numSouls;
  177. private final int _expNeeded;
  178. private final int _critChance;
  179. private final boolean _dependOnTargetBuff;
  180. private final int _transformId;
  181. private final int _transformDuration;
  182. private final int _afterEffectId;
  183. private final int _afterEffectLvl;
  184. private final boolean _isHeroSkill; // If true the skill is a Hero Skill
  185. private final boolean _isGMSkill; // True if skill is GM skill
  186. private final int _baseCritRate; // percent of success for skill critical hit (especially for PDAM & BLOW - they're not affected by rCrit values or buffs). Default loads -1 for all other skills but 0 to PDAM & BLOW
  187. private final int _lethalEffect1; // percent of success for lethal 1st effect (hit cp to 1 or if mob hp to 50%) (only for PDAM skills)
  188. private final int _lethalEffect2; // percent of success for lethal 2nd effect (hit cp,hp to 1 or if mob hp to 1) (only for PDAM skills)
  189. private final boolean _directHpDmg; // If true then dmg is being make directly
  190. private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot
  191. private final float _sSBoost; // If true skill will have SoulShot boost (power*2)
  192. private final int _aggroPoints;
  193. protected List<Condition> _preCondition;
  194. protected List<Condition> _itemPreCondition;
  195. protected FuncTemplate[] _funcTemplates;
  196. public EffectTemplate[] _effectTemplates;
  197. protected EffectTemplate[] _effectTemplatesSelf;
  198. protected EffectTemplate[] _effectTemplatesPassive;
  199. protected ChanceCondition _chanceCondition = null;
  200. // Flying support
  201. private final String _flyType;
  202. private final int _flyRadius;
  203. private final float _flyCourse;
  204. private final boolean _isDebuff;
  205. private final String _attribute;
  206. private final boolean _ignoreShield;
  207. private final boolean _isSuicideAttack;
  208. private final boolean _canBeReflected;
  209. private final boolean _canBeDispeled;
  210. private final boolean _isClanSkill;
  211. private final boolean _excludedFromCheck;
  212. private final boolean _simultaneousCast;
  213. private L2ExtractableSkill _extractableItems = null;
  214. private final int _maxTargets;
  215. private final boolean _isStaticHeal;
  216. private int _npcId = 0;
  217. // Appearance
  218. private final int _faceId;
  219. private final int _hairColorId;
  220. private final int _hairStyleId;
  221. protected L2Skill(StatsSet set)
  222. {
  223. _id = set.getInteger("skill_id");
  224. _level = set.getInteger("level");
  225. _refId = set.getInteger("referenceId", 0);
  226. _displayId = set.getInteger("displayId", _id);
  227. _name = set.getString("name");
  228. _operateType = set.getEnum("operateType", L2SkillOpType.class);
  229. _magic = set.getInteger("isMagic", 0);
  230. _traitType = set.getEnum("trait", L2TraitType.class, L2TraitType.NONE);
  231. _staticReuse = set.getBool("staticReuse", false);
  232. _staticDamage = set.getBool("staticDamage", false);
  233. _mpConsume = set.getInteger("mpConsume", 0);
  234. _mpInitialConsume = set.getInteger("mpInitialConsume", 0);
  235. _hpConsume = set.getInteger("hpConsume", 0);
  236. _cpConsume = set.getInteger("cpConsume", 0);
  237. _targetConsume = set.getInteger("targetConsumeCount", 0);
  238. _targetConsumeId = set.getInteger("targetConsumeId", 0);
  239. _itemConsume = set.getInteger("itemConsumeCount", 0);
  240. _itemConsumeId = set.getInteger("itemConsumeId", 0);
  241. _afterEffectId = set.getInteger("afterEffectId", 0);
  242. _afterEffectLvl = set.getInteger("afterEffectLvl", 1);
  243. _castRange = set.getInteger("castRange", -1);
  244. _effectRange = set.getInteger("effectRange", -1);
  245. _abnormalLvl = set.getInteger("abnormalLvl", -1);
  246. _effectAbnormalLvl = set.getInteger("effectAbnormalLvl", -1); // support for a separate effect abnormal lvl, e.g. poison inside a different skill
  247. _negateLvl = set.getInteger("negateLvl", -1);
  248. _attribute = set.getString("attribute", "");
  249. String str = set.getString("negateStats", "");
  250. if (str.isEmpty())
  251. {
  252. _negateStats = new L2SkillType[0];
  253. }
  254. else
  255. {
  256. String[] stats = str.split(" ");
  257. L2SkillType[] array = new L2SkillType[stats.length];
  258. for (int i = 0; i < stats.length; i++)
  259. {
  260. L2SkillType type = null;
  261. try
  262. {
  263. type = Enum.valueOf(L2SkillType.class, stats[i]);
  264. }
  265. catch (Exception e)
  266. {
  267. throw new IllegalArgumentException("SkillId: " + _id + "Enum value of type " + L2SkillType.class.getName() + "required, but found: " + stats[i]);
  268. }
  269. array[i] = type;
  270. }
  271. _negateStats = array;
  272. }
  273. String negateAbnormals = set.getString("negateAbnormals", null);
  274. if ((negateAbnormals != null) && !negateAbnormals.isEmpty())
  275. {
  276. _negateAbnormals = new FastMap<>();
  277. for (String ngtStack : negateAbnormals.split(";"))
  278. {
  279. String[] ngt = ngtStack.split(",");
  280. if (ngt.length == 1) // Only abnormalType is present, without abnormalLvl
  281. {
  282. _negateAbnormals.put(ngt[0], Byte.MAX_VALUE);
  283. }
  284. else if (ngt.length == 2) // Both abnormalType and abnormalLvl are present
  285. {
  286. try
  287. {
  288. _negateAbnormals.put(ngt[0], Byte.parseByte(ngt[1]));
  289. }
  290. catch (Exception e)
  291. {
  292. throw new IllegalArgumentException("SkillId: " + _id + " Byte value required, but found: " + ngt[1]);
  293. }
  294. }
  295. else
  296. {
  297. throw new IllegalArgumentException("SkillId: " + _id + ": Incorrect negate Abnormals for " + ngtStack + ". Lvl: abnormalType1,abnormalLvl1;abnormalType2,abnormalLvl2;abnormalType3,abnormalLvl3... or abnormalType1;abnormalType2;abnormalType3...");
  298. }
  299. }
  300. }
  301. else
  302. {
  303. _negateAbnormals = null;
  304. }
  305. String negateId = set.getString("negateId", null);
  306. if (negateId != null)
  307. {
  308. String[] valuesSplit = negateId.split(",");
  309. _negateId = new int[valuesSplit.length];
  310. for (int i = 0; i < valuesSplit.length; i++)
  311. {
  312. _negateId[i] = Integer.parseInt(valuesSplit[i]);
  313. }
  314. }
  315. else
  316. {
  317. _negateId = new int[0];
  318. }
  319. _maxNegatedEffects = set.getInteger("maxNegated", 0);
  320. _stayAfterDeath = set.getBool("stayAfterDeath", false);
  321. _stayOnSubclassChange = set.getBool("stayOnSubclassChange", true);
  322. _killByDOT = set.getBool("killByDOT", false);
  323. _isNeutral = set.getBool("neutral", false);
  324. _hitTime = set.getInteger("hitTime", 0);
  325. String hitTimings = set.getString("hitTimings", null);
  326. if (hitTimings != null)
  327. {
  328. try
  329. {
  330. String[] valuesSplit = hitTimings.split(",");
  331. _hitTimings = new int[valuesSplit.length];
  332. for (int i = 0; i < valuesSplit.length; i++)
  333. {
  334. _hitTimings[i] = Integer.parseInt(valuesSplit[i]);
  335. }
  336. }
  337. catch (Exception e)
  338. {
  339. throw new IllegalArgumentException("SkillId: " + _id + " invalid hitTimings value: " + hitTimings + ", \"percent,percent,...percent\" required");
  340. }
  341. }
  342. else
  343. {
  344. _hitTimings = new int[0];
  345. }
  346. _coolTime = set.getInteger("coolTime", 0);
  347. _isDebuff = set.getBool("isDebuff", false);
  348. _feed = set.getInteger("feed", 0);
  349. _reuseHashCode = SkillTable.getSkillHashCode(_id, _level);
  350. if (Config.ENABLE_MODIFY_SKILL_REUSE && Config.SKILL_REUSE_LIST.containsKey(_id))
  351. {
  352. if (Config.DEBUG)
  353. {
  354. _log.info("*** Skill " + _name + " (" + _level + ") changed reuse from " + set.getInteger("reuseDelay", 0) + " to " + Config.SKILL_REUSE_LIST.get(_id) + " seconds.");
  355. }
  356. _reuseDelay = Config.SKILL_REUSE_LIST.get(_id);
  357. }
  358. else
  359. {
  360. _reuseDelay = set.getInteger("reuseDelay", 0);
  361. }
  362. _skillRadius = set.getInteger("skillRadius", 0);
  363. _targetType = set.getEnum("target", L2TargetType.class);
  364. _power = set.getFloat("power", 0.f);
  365. _pvpPower = set.getFloat("pvpPower", (float) getPower());
  366. _pvePower = set.getFloat("pvePower", (float) getPower());
  367. _magicLevel = set.getInteger("magicLvl", 0);
  368. _levelDepend = set.getInteger("lvlDepend", 0);
  369. _ignoreResists = set.getBool("ignoreResists", false);
  370. _minChance = set.getInteger("minChance", Config.MIN_ABNORMAL_STATE_SUCCESS_RATE);
  371. _maxChance = set.getInteger("maxChance", Config.MAX_ABNORMAL_STATE_SUCCESS_RATE);
  372. _stat = set.getEnum("stat", Stats.class, null);
  373. _ignoreShield = set.getBool("ignoreShld", false);
  374. _skillType = set.getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY);
  375. _effectType = set.getEnum("effectType", L2SkillType.class, null);
  376. _effectId = set.getInteger("effectId", 0);
  377. _effectLvl = set.getInteger("effectLevel", 0);
  378. _nextActionIsAttack = set.getBool("nextActionAttack", false);
  379. _removedOnAnyActionExceptMove = set.getBool("removedOnAnyActionExceptMove", false);
  380. _removedOnDamage = set.getBool("removedOnDamage", _skillType == L2SkillType.SLEEP);
  381. _element = set.getByte("element", (byte) -1);
  382. _elementPower = set.getInteger("elementPower", 0);
  383. _saveVs = set.getEnum("saveVs", BaseStats.class, BaseStats.NULL);
  384. _condition = set.getInteger("condition", 0);
  385. _conditionValue = set.getInteger("conditionValue", 0);
  386. _overhit = set.getBool("overHit", false);
  387. _isSuicideAttack = set.getBool("isSuicideAttack", false);
  388. String weaponsAllowedString = set.getString("weaponsAllowed", null);
  389. if ((weaponsAllowedString != null) && !weaponsAllowedString.trim().isEmpty())
  390. {
  391. int mask = 0;
  392. StringTokenizer st = new StringTokenizer(weaponsAllowedString, ",");
  393. while (st.hasMoreTokens())
  394. {
  395. int old = mask;
  396. String item = st.nextToken().trim();
  397. if (ItemTable._weaponTypes.containsKey(item))
  398. {
  399. mask |= ItemTable._weaponTypes.get(item).mask();
  400. }
  401. if (ItemTable._armorTypes.containsKey(item))
  402. {
  403. mask |= ItemTable._armorTypes.get(item).mask();
  404. }
  405. if (old == mask)
  406. {
  407. _log.info("[weaponsAllowed] Unknown item type name: " + item);
  408. }
  409. }
  410. _weaponsAllowed = mask;
  411. }
  412. else
  413. {
  414. _weaponsAllowed = 0;
  415. }
  416. _armorsAllowed = set.getInteger("armorsAllowed", 0);
  417. _minPledgeClass = set.getInteger("minPledgeClass", 0);
  418. _isOffensive = set.getBool("offensive", isSkillTypeOffensive());
  419. _chargeConsume = set.getInteger("chargeConsume", 0);
  420. _triggeredId = set.getInteger("triggeredId", 0);
  421. _triggeredLevel = set.getInteger("triggeredLevel", 1);
  422. _chanceType = set.getString("chanceType", "");
  423. if (!_chanceType.isEmpty() && !_chanceType.isEmpty())
  424. {
  425. _chanceCondition = ChanceCondition.parse(set);
  426. }
  427. _numSouls = set.getInteger("num_souls", 0);
  428. _soulMaxConsume = set.getInteger("soulMaxConsumeCount", 0);
  429. _blowChance = set.getInteger("blowChance", 0);
  430. _expNeeded = set.getInteger("expNeeded", 0);
  431. _critChance = set.getInteger("critChance", 0);
  432. _transformId = set.getInteger("transformId", 0);
  433. _transformDuration = set.getInteger("transformDuration", 0);
  434. _isHeroSkill = SkillTreesData.getInstance().isHeroSkill(_id, _level);
  435. _isGMSkill = SkillTreesData.getInstance().isGMSkill(_id, _level);
  436. _baseCritRate = set.getInteger("baseCritRate", ((_skillType == L2SkillType.PDAM) || (_skillType == L2SkillType.BLOW)) ? 0 : -1);
  437. _lethalEffect1 = set.getInteger("lethal1", 0);
  438. _lethalEffect2 = set.getInteger("lethal2", 0);
  439. _directHpDmg = set.getBool("dmgDirectlyToHp", false);
  440. _isTriggeredSkill = set.getBool("isTriggeredSkill", false);
  441. _sSBoost = set.getFloat("SSBoost", 0.f);
  442. _aggroPoints = set.getInteger("aggroPoints", 0);
  443. _flyType = set.getString("flyType", null);
  444. _flyRadius = set.getInteger("flyRadius", 0);
  445. _flyCourse = set.getFloat("flyCourse", 0);
  446. _canBeReflected = set.getBool("canBeReflected", true);
  447. _canBeDispeled = set.getBool("canBeDispeled", true);
  448. _isClanSkill = set.getBool("isClanSkill", false);
  449. _excludedFromCheck = set.getBool("excludedFromCheck", false);
  450. _dependOnTargetBuff = set.getBool("dependOnTargetBuff", false);
  451. _simultaneousCast = set.getBool("simultaneousCast", false);
  452. String capsuled_items = set.getString("capsuled_items_skill", null);
  453. if (capsuled_items != null)
  454. {
  455. if (capsuled_items.isEmpty())
  456. {
  457. _log.warning("Empty Extractable Item Skill data in Skill Id: " + _id);
  458. }
  459. _extractableItems = parseExtractableSkill(_id, _level, capsuled_items);
  460. }
  461. _maxTargets = set.getInteger("maxTargets", -1);
  462. _isStaticHeal = set.getBool("isStaticHeal", false);
  463. _npcId = set.getInteger("npcId", 0);
  464. _faceId = set.getInteger("faceId", -1);
  465. _hairColorId = set.getInteger("hairColorId", -1);
  466. _hairStyleId = set.getInteger("hairStyleId", -1);
  467. }
  468. public abstract void useSkill(L2Character caster, L2Object[] targets);
  469. public final int getArmorsAllowed()
  470. {
  471. return _armorsAllowed;
  472. }
  473. public final int getConditionValue()
  474. {
  475. return _conditionValue;
  476. }
  477. public final L2SkillType getSkillType()
  478. {
  479. return _skillType;
  480. }
  481. public final L2TraitType getTraitType()
  482. {
  483. return _traitType;
  484. }
  485. public final byte getElement()
  486. {
  487. return _element;
  488. }
  489. public final int getElementPower()
  490. {
  491. return _elementPower;
  492. }
  493. /**
  494. * Return the target type of the skill : SELF, PARTY, CLAN, PET...
  495. * @return
  496. */
  497. public final L2TargetType getTargetType()
  498. {
  499. return _targetType;
  500. }
  501. public final int getCondition()
  502. {
  503. return _condition;
  504. }
  505. public final boolean isOverhit()
  506. {
  507. return _overhit;
  508. }
  509. public final boolean killByDOT()
  510. {
  511. return _killByDOT;
  512. }
  513. public final boolean isSuicideAttack()
  514. {
  515. return _isSuicideAttack;
  516. }
  517. public final boolean allowOnTransform()
  518. {
  519. return isPassive();
  520. }
  521. /**
  522. * Return the power of the skill.
  523. * @param activeChar
  524. * @param target
  525. * @param isPvP
  526. * @param isPvE
  527. * @return
  528. */
  529. public final double getPower(L2Character activeChar, L2Character target, boolean isPvP, boolean isPvE)
  530. {
  531. if (activeChar == null)
  532. {
  533. return getPower(isPvP, isPvE);
  534. }
  535. switch (_skillType)
  536. {
  537. case DEATHLINK:
  538. {
  539. return getPower(isPvP, isPvE) * (-((activeChar.getCurrentHp() * 2) / activeChar.getMaxHp()) + 2);
  540. }
  541. case FATAL:
  542. {
  543. return getPower(isPvP, isPvE) * (-((target.getCurrentHp() * 2) / target.getMaxHp()) + 2);
  544. }
  545. default:
  546. {
  547. return getPower(isPvP, isPvE);
  548. }
  549. }
  550. }
  551. public final double getPower()
  552. {
  553. return _power;
  554. }
  555. public final double getPower(boolean isPvP, boolean isPvE)
  556. {
  557. return isPvE ? _pvePower : isPvP ? _pvpPower : _power;
  558. }
  559. public final L2SkillType[] getNegateStats()
  560. {
  561. return _negateStats;
  562. }
  563. public final Map<String, Byte> getNegateAbnormals()
  564. {
  565. return _negateAbnormals;
  566. }
  567. public final int getAbnormalLvl()
  568. {
  569. return _abnormalLvl;
  570. }
  571. public final int getNegateLvl()
  572. {
  573. return _negateLvl;
  574. }
  575. public final int[] getNegateId()
  576. {
  577. return _negateId;
  578. }
  579. public final int getMagicLevel()
  580. {
  581. return _magicLevel;
  582. }
  583. public final int getMaxNegatedEffects()
  584. {
  585. return _maxNegatedEffects;
  586. }
  587. public final int getLevelDepend()
  588. {
  589. return _levelDepend;
  590. }
  591. /**
  592. * Return true if skill should ignore all resistances
  593. * @return
  594. */
  595. public final boolean ignoreResists()
  596. {
  597. return _ignoreResists;
  598. }
  599. /**
  600. * Return custom minimum skill/effect chance.
  601. * @return
  602. */
  603. public final int getMinChance()
  604. {
  605. return _minChance;
  606. }
  607. /**
  608. * Return custom maximum skill/effect chance.
  609. * @return
  610. */
  611. public final int getMaxChance()
  612. {
  613. return _maxChance;
  614. }
  615. /**
  616. * Return true if skill effects should be removed on any action except movement
  617. * @return
  618. */
  619. public final boolean isRemovedOnAnyActionExceptMove()
  620. {
  621. return _removedOnAnyActionExceptMove;
  622. }
  623. /**
  624. * Return true if skill effects should be removed on damage
  625. * @return
  626. */
  627. public final boolean isRemovedOnDamage()
  628. {
  629. return _removedOnDamage;
  630. }
  631. /**
  632. * Return the additional effect Id.
  633. * @return
  634. */
  635. public final int getEffectId()
  636. {
  637. return _effectId;
  638. }
  639. /**
  640. * Return the additional effect level.
  641. * @return
  642. */
  643. public final int getEffectLvl()
  644. {
  645. return _effectLvl;
  646. }
  647. public final int getEffectAbnormalLvl()
  648. {
  649. return _effectAbnormalLvl;
  650. }
  651. /**
  652. * Return the additional effect skill type (ex : STUN, PARALYZE,...).
  653. * @return
  654. */
  655. public final L2SkillType getEffectType()
  656. {
  657. return _effectType;
  658. }
  659. /**
  660. * Return true if character should attack target after skill
  661. * @return
  662. */
  663. public final boolean nextActionIsAttack()
  664. {
  665. return _nextActionIsAttack;
  666. }
  667. /**
  668. * TODO: Zoey76, temp fix until skill reworks is done.
  669. * @return the calculated buff duration used to display buff icons.
  670. */
  671. public final int getBuffDuration()
  672. {
  673. int duration = 0;
  674. final EffectTemplate firstEffect = hasEffects() ? getEffectTemplates()[0] : null;
  675. if (firstEffect != null)
  676. {
  677. duration = firstEffect.abnormalTime * 1000;
  678. if (firstEffect.counter > 1)
  679. {
  680. duration *= firstEffect.counter;
  681. }
  682. }
  683. return duration;
  684. }
  685. /**
  686. * @return Returns the castRange.
  687. */
  688. public final int getCastRange()
  689. {
  690. return _castRange;
  691. }
  692. /**
  693. * @return Returns the cpConsume;
  694. */
  695. public final int getCpConsume()
  696. {
  697. return _cpConsume;
  698. }
  699. /**
  700. * @return Returns the effectRange.
  701. */
  702. public final int getEffectRange()
  703. {
  704. return _effectRange;
  705. }
  706. /**
  707. * @return Returns the hpConsume.
  708. */
  709. public final int getHpConsume()
  710. {
  711. return _hpConsume;
  712. }
  713. /**
  714. * @return Returns the id.
  715. */
  716. public final int getId()
  717. {
  718. return _id;
  719. }
  720. /**
  721. * @return Returns the boolean _isDebuff.
  722. */
  723. public final boolean isDebuff()
  724. {
  725. return _isDebuff;
  726. }
  727. public int getDisplayId()
  728. {
  729. return _displayId;
  730. }
  731. public void setDisplayId(int id)
  732. {
  733. _displayId = id;
  734. }
  735. public int getTriggeredId()
  736. {
  737. return _triggeredId;
  738. }
  739. public int getTriggeredLevel()
  740. {
  741. return _triggeredLevel;
  742. }
  743. public boolean triggerAnotherSkill()
  744. {
  745. return _triggeredId > 1;
  746. }
  747. /**
  748. * Return the skill type (ex : BLEED, SLEEP, WATER...).
  749. * @return
  750. */
  751. public final Stats getStat()
  752. {
  753. return _stat;
  754. }
  755. /**
  756. * Return skill saveVs base stat (STR, INT ...).
  757. * @return
  758. */
  759. public final BaseStats getSaveVs()
  760. {
  761. return _saveVs;
  762. }
  763. /**
  764. * @return Returns the _targetConsumeId.
  765. */
  766. public final int getTargetConsumeId()
  767. {
  768. return _targetConsumeId;
  769. }
  770. /**
  771. * @return Returns the targetConsume.
  772. */
  773. public final int getTargetConsume()
  774. {
  775. return _targetConsume;
  776. }
  777. /**
  778. * @return Returns the itemConsume.
  779. */
  780. public final int getItemConsume()
  781. {
  782. return _itemConsume;
  783. }
  784. /**
  785. * @return Returns the itemConsumeId.
  786. */
  787. public final int getItemConsumeId()
  788. {
  789. return _itemConsumeId;
  790. }
  791. /**
  792. * @return Returns the level.
  793. */
  794. public final int getLevel()
  795. {
  796. return _level;
  797. }
  798. /**
  799. * @return Returns true to set physical skills.
  800. */
  801. public final boolean isPhysical()
  802. {
  803. return _magic == 0;
  804. }
  805. /**
  806. * @return Returns true to set magic skills.
  807. */
  808. public final boolean isMagic()
  809. {
  810. return _magic == 1;
  811. }
  812. /**
  813. * @return Returns true to set static skills.
  814. */
  815. public final boolean isStatic()
  816. {
  817. return _magic == 2;
  818. }
  819. /**
  820. * @return Returns true to set static reuse.
  821. */
  822. public final boolean isStaticReuse()
  823. {
  824. return _staticReuse;
  825. }
  826. public final boolean isStaticDamage()
  827. {
  828. return _staticDamage;
  829. }
  830. /**
  831. * @return Returns the mpConsume.
  832. */
  833. public final int getMpConsume()
  834. {
  835. return _mpConsume;
  836. }
  837. /**
  838. * @return Returns the mpInitialConsume.
  839. */
  840. public final int getMpInitialConsume()
  841. {
  842. return _mpInitialConsume;
  843. }
  844. /**
  845. * @return Returns the name.
  846. */
  847. public final String getName()
  848. {
  849. return _name;
  850. }
  851. /**
  852. * @return Returns the reuseDelay.
  853. */
  854. public final int getReuseDelay()
  855. {
  856. return _reuseDelay;
  857. }
  858. public final int getReuseHashCode()
  859. {
  860. return _reuseHashCode;
  861. }
  862. public final int getHitTime()
  863. {
  864. return _hitTime;
  865. }
  866. public final int getHitCounts()
  867. {
  868. return _hitTimings.length;
  869. }
  870. public final int[] getHitTimings()
  871. {
  872. return _hitTimings;
  873. }
  874. /**
  875. * @return Returns the coolTime.
  876. */
  877. public final int getCoolTime()
  878. {
  879. return _coolTime;
  880. }
  881. public final int getSkillRadius()
  882. {
  883. return _skillRadius;
  884. }
  885. public final boolean isActive()
  886. {
  887. return (_operateType != null) && _operateType.isActive();
  888. }
  889. public final boolean isPassive()
  890. {
  891. return (_operateType != null) && _operateType.isPassive();
  892. }
  893. public final boolean isToggle()
  894. {
  895. return (_operateType != null) && _operateType.isToggle();
  896. }
  897. public final boolean isChance()
  898. {
  899. return (_chanceCondition != null) && isPassive();
  900. }
  901. public final boolean isTriggeredSkill()
  902. {
  903. return _isTriggeredSkill;
  904. }
  905. public final boolean isDance()
  906. {
  907. return _magic == 3;
  908. }
  909. public final float getSSBoost()
  910. {
  911. return _sSBoost;
  912. }
  913. public final int getAggroPoints()
  914. {
  915. return _aggroPoints;
  916. }
  917. public final boolean useSoulShot()
  918. {
  919. switch (getSkillType())
  920. {
  921. case PDAM:
  922. case CHARGEDAM:
  923. case BLOW:
  924. return true;
  925. default:
  926. return false;
  927. }
  928. }
  929. public final boolean useSpiritShot()
  930. {
  931. return _magic == 1;
  932. }
  933. public final boolean useFishShot()
  934. {
  935. return ((getSkillType() == L2SkillType.PUMPING) || (getSkillType() == L2SkillType.REELING));
  936. }
  937. public final int getWeaponsAllowed()
  938. {
  939. return _weaponsAllowed;
  940. }
  941. public int getMinPledgeClass()
  942. {
  943. return _minPledgeClass;
  944. }
  945. public final boolean isOffensive()
  946. {
  947. return _isOffensive;
  948. }
  949. public final boolean isNeutral()
  950. {
  951. return _isNeutral;
  952. }
  953. public final boolean isHeroSkill()
  954. {
  955. return _isHeroSkill;
  956. }
  957. public final boolean isGMSkill()
  958. {
  959. return _isGMSkill;
  960. }
  961. public final int getChargeConsume()
  962. {
  963. return _chargeConsume;
  964. }
  965. public final int getNumSouls()
  966. {
  967. return _numSouls;
  968. }
  969. public final int getMaxSoulConsumeCount()
  970. {
  971. return _soulMaxConsume;
  972. }
  973. public final int getExpNeeded()
  974. {
  975. return _expNeeded;
  976. }
  977. public final int getCritChance()
  978. {
  979. return _critChance;
  980. }
  981. public final int getTransformId()
  982. {
  983. return _transformId;
  984. }
  985. public final int getTransformDuration()
  986. {
  987. return _transformDuration;
  988. }
  989. public final int getBaseCritRate()
  990. {
  991. return _baseCritRate;
  992. }
  993. public final int getLethalChance1()
  994. {
  995. return _lethalEffect1;
  996. }
  997. public final int getLethalChance2()
  998. {
  999. return _lethalEffect2;
  1000. }
  1001. public final boolean getDmgDirectlyToHP()
  1002. {
  1003. return _directHpDmg;
  1004. }
  1005. public final String getFlyType()
  1006. {
  1007. return _flyType;
  1008. }
  1009. public final int getFlyRadius()
  1010. {
  1011. return _flyRadius;
  1012. }
  1013. public final float getFlyCourse()
  1014. {
  1015. return _flyCourse;
  1016. }
  1017. public final boolean isPvpSkill()
  1018. {
  1019. switch (_skillType)
  1020. {
  1021. case DOT:
  1022. case BLEED:
  1023. case CONFUSION:
  1024. case POISON:
  1025. case DEBUFF:
  1026. case AGGDEBUFF:
  1027. case STUN:
  1028. case ROOT:
  1029. case FEAR:
  1030. case SLEEP:
  1031. case MDOT:
  1032. case MUTE:
  1033. case PARALYZE:
  1034. case CANCEL:
  1035. case BETRAY:
  1036. case DISARM:
  1037. case AGGDAMAGE:
  1038. case STEAL_BUFF:
  1039. case AGGREDUCE_CHAR:
  1040. case MANADAM:
  1041. return true;
  1042. default:
  1043. return false;
  1044. }
  1045. }
  1046. public final boolean isSkillTypeOffensive()
  1047. {
  1048. switch (_skillType)
  1049. {
  1050. case PDAM:
  1051. case MDAM:
  1052. case CPDAM:
  1053. case DOT:
  1054. case CPDAMPERCENT:
  1055. case BLEED:
  1056. case POISON:
  1057. case AGGDAMAGE:
  1058. case DEBUFF:
  1059. case AGGDEBUFF:
  1060. case STUN:
  1061. case ROOT:
  1062. case CONFUSION:
  1063. case ERASE:
  1064. case BLOW:
  1065. case FATAL:
  1066. case FEAR:
  1067. case DRAIN:
  1068. case SLEEP:
  1069. case CHARGEDAM:
  1070. case CONFUSE_MOB_ONLY:
  1071. case DEATHLINK:
  1072. case DETECT_WEAKNESS:
  1073. case MANADAM:
  1074. case MDOT:
  1075. case MUTE:
  1076. case SOULSHOT:
  1077. case SPIRITSHOT:
  1078. case SPOIL:
  1079. case SWEEP:
  1080. case PARALYZE:
  1081. case DRAIN_SOUL:
  1082. case AGGREDUCE:
  1083. case CANCEL:
  1084. case AGGREMOVE:
  1085. case AGGREDUCE_CHAR:
  1086. case BETRAY:
  1087. case DELUXE_KEY_UNLOCK:
  1088. case SOW:
  1089. case DISARM:
  1090. case STEAL_BUFF:
  1091. case INSTANT_JUMP:
  1092. return true;
  1093. default:
  1094. return false;
  1095. }
  1096. }
  1097. public final boolean is7Signs()
  1098. {
  1099. if ((_id > 4360) && (_id < 4367))
  1100. {
  1101. return true;
  1102. }
  1103. return false;
  1104. }
  1105. public final boolean isStayAfterDeath()
  1106. {
  1107. return _stayAfterDeath;
  1108. }
  1109. public final boolean isStayOnSubclassChange()
  1110. {
  1111. return _stayOnSubclassChange;
  1112. }
  1113. // int weapons[] = {L2Weapon.WEAPON_TYPE_ETC, L2Weapon.WEAPON_TYPE_BOW,
  1114. // L2Weapon.WEAPON_TYPE_POLE, L2Weapon.WEAPON_TYPE_DUALFIST,
  1115. // L2Weapon.WEAPON_TYPE_DUAL, L2Weapon.WEAPON_TYPE_BLUNT,
  1116. // L2Weapon.WEAPON_TYPE_SWORD, L2Weapon.WEAPON_TYPE_DAGGER};
  1117. public final boolean getWeaponDependancy(L2Character activeChar)
  1118. {
  1119. if (getWeaponDependancy(activeChar, false))
  1120. {
  1121. return true;
  1122. }
  1123. final SystemMessage message = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
  1124. message.addSkillName(this);
  1125. activeChar.sendPacket(message);
  1126. return false;
  1127. }
  1128. public final boolean getWeaponDependancy(L2Character activeChar, boolean chance)
  1129. {
  1130. int weaponsAllowed = getWeaponsAllowed();
  1131. // check to see if skill has a weapon dependency.
  1132. if (weaponsAllowed == 0)
  1133. {
  1134. return true;
  1135. }
  1136. int mask = 0;
  1137. if (activeChar.getActiveWeaponItem() != null)
  1138. {
  1139. mask |= activeChar.getActiveWeaponItem().getItemType().mask();
  1140. }
  1141. if ((activeChar.getSecondaryWeaponItem() != null) && (activeChar.getSecondaryWeaponItem() instanceof L2Armor))
  1142. {
  1143. mask |= ((L2ArmorType) activeChar.getSecondaryWeaponItem().getItemType()).mask();
  1144. }
  1145. if ((mask & weaponsAllowed) != 0)
  1146. {
  1147. return true;
  1148. }
  1149. return false;
  1150. }
  1151. public boolean checkCondition(L2Character activeChar, L2Object target, boolean itemOrWeapon)
  1152. {
  1153. if (activeChar.canOverrideCond(PcCondOverride.SKILL_CONDITIONS) && !Config.GM_SKILL_RESTRICTION)
  1154. {
  1155. return true;
  1156. }
  1157. if ((getCondition() & L2Skill.COND_SHIELD) != 0)
  1158. {
  1159. // L2ItemInstance dummy = activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
  1160. // L2Armor armorPiece = (L2Armor) dummy.getItem();
  1161. // TODO add checks for shield here.
  1162. }
  1163. List<Condition> preCondition = _preCondition;
  1164. if (itemOrWeapon)
  1165. {
  1166. preCondition = _itemPreCondition;
  1167. }
  1168. if ((preCondition == null) || preCondition.isEmpty())
  1169. {
  1170. return true;
  1171. }
  1172. for (Condition cond : preCondition)
  1173. {
  1174. Env env = new Env();
  1175. env.setCharacter(activeChar);
  1176. if (target instanceof L2Character)
  1177. {
  1178. env.setTarget((L2Character) target);
  1179. }
  1180. env.setSkill(this);
  1181. if (!cond.test(env))
  1182. {
  1183. String msg = cond.getMessage();
  1184. int msgId = cond.getMessageId();
  1185. if (msgId != 0)
  1186. {
  1187. SystemMessage sm = SystemMessage.getSystemMessage(msgId);
  1188. if (cond.isAddName())
  1189. {
  1190. sm.addSkillName(_id);
  1191. }
  1192. activeChar.sendPacket(sm);
  1193. }
  1194. else if (msg != null)
  1195. {
  1196. activeChar.sendMessage(msg);
  1197. }
  1198. return false;
  1199. }
  1200. }
  1201. return true;
  1202. }
  1203. public final L2Object[] getTargetList(L2Character activeChar, boolean onlyFirst)
  1204. {
  1205. // Init to null the target of the skill
  1206. L2Character target = null;
  1207. // Get the L2Objcet targeted by the user of the skill at this moment
  1208. L2Object objTarget = activeChar.getTarget();
  1209. // If the L2Object targeted is a L2Character, it becomes the L2Character target
  1210. if (objTarget instanceof L2Character)
  1211. {
  1212. target = (L2Character) objTarget;
  1213. }
  1214. return getTargetList(activeChar, onlyFirst, target);
  1215. }
  1216. /**
  1217. * Return all targets of the skill in a table in function a the skill type.<br>
  1218. * <B><U>Values of skill type</U>:</B>
  1219. * <ul>
  1220. * <li>ONE : The skill can only be used on the L2PcInstance targeted, or on the caster if it's a L2PcInstance and no L2PcInstance targeted</li>
  1221. * <li>SELF</li>
  1222. * <li>HOLY, UNDEAD</li>
  1223. * <li>PET</li>
  1224. * <li>AURA, AURA_CLOSE</li>
  1225. * <li>AREA</li>
  1226. * <li>MULTIFACE</li>
  1227. * <li>PARTY, CLAN</li>
  1228. * <li>CORPSE_PLAYER, CORPSE_MOB, CORPSE_CLAN</li>
  1229. * <li>UNLOCKABLE</li>
  1230. * <li>ITEM</li>
  1231. * <ul>
  1232. * @param activeChar The L2Character who use the skill
  1233. * @param onlyFirst
  1234. * @param target
  1235. * @return
  1236. */
  1237. public final L2Object[] getTargetList(L2Character activeChar, boolean onlyFirst, L2Character target)
  1238. {
  1239. final ITargetTypeHandler handler = TargetHandler.getInstance().getHandler(getTargetType());
  1240. if (handler != null)
  1241. {
  1242. try
  1243. {
  1244. return handler.getTargetList(this, activeChar, onlyFirst, target);
  1245. }
  1246. catch (Exception e)
  1247. {
  1248. _log.log(Level.WARNING, "Exception in L2Skill.getTargetList(): " + e.getMessage(), e);
  1249. }
  1250. }
  1251. activeChar.sendMessage("Target type of skill is not currently handled");
  1252. return _emptyTargetList;
  1253. }
  1254. public final L2Object[] getTargetList(L2Character activeChar)
  1255. {
  1256. return getTargetList(activeChar, false);
  1257. }
  1258. public final L2Object getFirstOfTargetList(L2Character activeChar)
  1259. {
  1260. L2Object[] targets;
  1261. targets = getTargetList(activeChar, true);
  1262. if (targets.length == 0)
  1263. {
  1264. return null;
  1265. }
  1266. return targets[0];
  1267. }
  1268. /**
  1269. * Check if should be target added to the target list false if target is dead, target same as caster,<br>
  1270. * target inside peace zone, target in the same party with caster, caster can see target Additional checks if not in PvP zones (arena, siege):<br>
  1271. * target in not the same clan and alliance with caster, and usual skill PvP check. If TvT event is active - performing additional checks. Caution: distance is not checked.
  1272. * @param caster
  1273. * @param target
  1274. * @param skill
  1275. * @param sourceInArena
  1276. * @return
  1277. */
  1278. public static final boolean checkForAreaOffensiveSkills(L2Character caster, L2Character target, L2Skill skill, boolean sourceInArena)
  1279. {
  1280. if ((target == null) || target.isDead() || (target == caster))
  1281. {
  1282. return false;
  1283. }
  1284. final L2PcInstance player = caster.getActingPlayer();
  1285. final L2PcInstance targetPlayer = target.getActingPlayer();
  1286. if (player != null)
  1287. {
  1288. if (targetPlayer != null)
  1289. {
  1290. if ((targetPlayer == caster) || (targetPlayer == player))
  1291. {
  1292. return false;
  1293. }
  1294. if (targetPlayer.inObserverMode())
  1295. {
  1296. return false;
  1297. }
  1298. if (skill.isOffensive() && (player.getSiegeState() > 0) && player.isInsideZone(ZoneId.SIEGE) && (player.getSiegeState() == targetPlayer.getSiegeState()) && (player.getSiegeSide() == targetPlayer.getSiegeSide()))
  1299. {
  1300. return false;
  1301. }
  1302. if (skill.isOffensive() && target.isInsideZone(ZoneId.PEACE))
  1303. {
  1304. return false;
  1305. }
  1306. if (player.isInParty() && targetPlayer.isInParty())
  1307. {
  1308. // Same party
  1309. if (player.getParty().getLeaderObjectId() == targetPlayer.getParty().getLeaderObjectId())
  1310. {
  1311. return false;
  1312. }
  1313. // Same commandchannel
  1314. if ((player.getParty().getCommandChannel() != null) && (player.getParty().getCommandChannel() == targetPlayer.getParty().getCommandChannel()))
  1315. {
  1316. return false;
  1317. }
  1318. }
  1319. if (!TvTEvent.checkForTvTSkill(player, targetPlayer, skill))
  1320. {
  1321. return false;
  1322. }
  1323. if (!sourceInArena && !(targetPlayer.isInsideZone(ZoneId.PVP) && !targetPlayer.isInsideZone(ZoneId.SIEGE)))
  1324. {
  1325. if ((player.getAllyId() != 0) && (player.getAllyId() == targetPlayer.getAllyId()))
  1326. {
  1327. return false;
  1328. }
  1329. if ((player.getClanId() != 0) && (player.getClanId() == targetPlayer.getClanId()))
  1330. {
  1331. return false;
  1332. }
  1333. if (!player.checkPvpSkill(targetPlayer, skill, (caster instanceof L2Summon)))
  1334. {
  1335. return false;
  1336. }
  1337. }
  1338. }
  1339. }
  1340. else
  1341. {
  1342. // target is mob
  1343. if ((targetPlayer == null) && (target instanceof L2Attackable) && (caster instanceof L2Attackable))
  1344. {
  1345. String casterEnemyClan = ((L2Attackable) caster).getEnemyClan();
  1346. if ((casterEnemyClan == null) || casterEnemyClan.isEmpty())
  1347. {
  1348. return false;
  1349. }
  1350. String targetClan = ((L2Attackable) target).getClan();
  1351. if ((targetClan == null) || targetClan.isEmpty())
  1352. {
  1353. return false;
  1354. }
  1355. if (!casterEnemyClan.equals(targetClan))
  1356. {
  1357. return false;
  1358. }
  1359. }
  1360. }
  1361. if (geoEnabled && !GeoData.getInstance().canSeeTarget(caster, target))
  1362. {
  1363. return false;
  1364. }
  1365. return true;
  1366. }
  1367. public static final boolean addSummon(L2Character caster, L2PcInstance owner, int radius, boolean isDead)
  1368. {
  1369. if (!owner.hasSummon())
  1370. {
  1371. return false;
  1372. }
  1373. return addCharacter(caster, owner.getSummon(), radius, isDead);
  1374. }
  1375. public static final boolean addCharacter(L2Character caster, L2Character target, int radius, boolean isDead)
  1376. {
  1377. if (isDead != target.isDead())
  1378. {
  1379. return false;
  1380. }
  1381. if ((radius > 0) && !Util.checkIfInRange(radius, caster, target, true))
  1382. {
  1383. return false;
  1384. }
  1385. return true;
  1386. }
  1387. public final Func[] getStatFuncs(L2Effect effect, L2Character player)
  1388. {
  1389. if (_funcTemplates == null)
  1390. {
  1391. return _emptyFunctionSet;
  1392. }
  1393. if (!(player instanceof L2Playable) && !(player instanceof L2Attackable))
  1394. {
  1395. return _emptyFunctionSet;
  1396. }
  1397. ArrayList<Func> funcs = new ArrayList<>(_funcTemplates.length);
  1398. Env env = new Env();
  1399. env.setCharacter(player);
  1400. env.setSkill(this);
  1401. Func f;
  1402. for (FuncTemplate t : _funcTemplates)
  1403. {
  1404. f = t.getFunc(env, this); // skill is owner
  1405. if (f != null)
  1406. {
  1407. funcs.add(f);
  1408. }
  1409. }
  1410. if (funcs.isEmpty())
  1411. {
  1412. return _emptyFunctionSet;
  1413. }
  1414. return funcs.toArray(new Func[funcs.size()]);
  1415. }
  1416. public boolean hasEffects()
  1417. {
  1418. return ((_effectTemplates != null) && (_effectTemplates.length > 0));
  1419. }
  1420. public EffectTemplate[] getEffectTemplates()
  1421. {
  1422. return _effectTemplates;
  1423. }
  1424. public EffectTemplate[] getEffectTemplatesPassive()
  1425. {
  1426. return _effectTemplatesPassive;
  1427. }
  1428. public boolean hasSelfEffects()
  1429. {
  1430. return ((_effectTemplatesSelf != null) && (_effectTemplatesSelf.length > 0));
  1431. }
  1432. public boolean hasPassiveEffects()
  1433. {
  1434. return ((_effectTemplatesPassive != null) && (_effectTemplatesPassive.length > 0));
  1435. }
  1436. /**
  1437. * Env is used to pass parameters for secondary effects (shield and ss/bss/bsss)
  1438. * @param effector
  1439. * @param effected
  1440. * @param env
  1441. * @return an array with the effects that have been added to effector
  1442. */
  1443. public final L2Effect[] getEffects(L2Character effector, L2Character effected, Env env)
  1444. {
  1445. if (!hasEffects() || isPassive())
  1446. {
  1447. return _emptyEffectSet;
  1448. }
  1449. // doors and siege flags cannot receive any effects
  1450. if ((effected instanceof L2DoorInstance) || (effected instanceof L2SiegeFlagInstance))
  1451. {
  1452. return _emptyEffectSet;
  1453. }
  1454. if (effector != effected)
  1455. {
  1456. if (isOffensive() || isDebuff())
  1457. {
  1458. if (effected.isInvul())
  1459. {
  1460. return _emptyEffectSet;
  1461. }
  1462. if ((effector instanceof L2PcInstance) && ((L2PcInstance) effector).isGM())
  1463. {
  1464. if (!((L2PcInstance) effector).getAccessLevel().canGiveDamage())
  1465. {
  1466. return _emptyEffectSet;
  1467. }
  1468. }
  1469. }
  1470. }
  1471. ArrayList<L2Effect> effects = new ArrayList<>(_effectTemplates.length);
  1472. if (env == null)
  1473. {
  1474. env = new Env();
  1475. }
  1476. env.setSkillMastery(Formulas.calcSkillMastery(effector, this));
  1477. env.setCharacter(effector);
  1478. env.setTarget(effected);
  1479. env.setSkill(this);
  1480. for (EffectTemplate et : _effectTemplates)
  1481. {
  1482. boolean success = true;
  1483. if (et.effectPower > -1)
  1484. {
  1485. success = Formulas.calcEffectSuccess(effector, effected, et, this, env.getShield(), env.isSoulShot(), env.isSpiritShot(), env.isBlessedSpiritShot());
  1486. }
  1487. if (success)
  1488. {
  1489. L2Effect e = et.getEffect(env);
  1490. if (e != null)
  1491. {
  1492. e.scheduleEffect();
  1493. effects.add(e);
  1494. }
  1495. }
  1496. // display fail message only for effects with icons
  1497. else if (et.icon && (effector instanceof L2PcInstance))
  1498. {
  1499. SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_YOUR_S2);
  1500. sm.addCharName(effected);
  1501. sm.addSkillName(this);
  1502. ((L2PcInstance) effector).sendPacket(sm);
  1503. }
  1504. }
  1505. if (effects.isEmpty())
  1506. {
  1507. return _emptyEffectSet;
  1508. }
  1509. return effects.toArray(new L2Effect[effects.size()]);
  1510. }
  1511. /**
  1512. * Warning: this method doesn't consider modifier (shield, ss, sps, bss) for secondary effects
  1513. * @param effector
  1514. * @param effected
  1515. * @return
  1516. */
  1517. public final L2Effect[] getEffects(L2Character effector, L2Character effected)
  1518. {
  1519. return getEffects(effector, effected, null);
  1520. }
  1521. /**
  1522. * This method has suffered some changes in CT2.2 ->CT2.3<br>
  1523. * Effect engine is now supporting secondary effects with independent success/fail calculus from effect skill.<br>
  1524. * Env parameter has been added to pass parameters like soulshot, spiritshots, blessed spiritshots or shield defense.<br>
  1525. * Some other optimizations have been done<br>
  1526. * This new feature works following next rules:
  1527. * <ul>
  1528. * <li>To enable feature, effectPower must be over -1 (check DocumentSkill#attachEffect for further information)</li>
  1529. * <li>If main skill fails, secondary effect always fail</li>
  1530. * </ul>
  1531. * @param effector
  1532. * @param effected
  1533. * @param env
  1534. * @return
  1535. */
  1536. public final L2Effect[] getEffects(L2CubicInstance effector, L2Character effected, Env env)
  1537. {
  1538. if (!hasEffects() || isPassive())
  1539. {
  1540. return _emptyEffectSet;
  1541. }
  1542. if (effector.getOwner() != effected)
  1543. {
  1544. if (isDebuff() || isOffensive())
  1545. {
  1546. if (effected.isInvul())
  1547. {
  1548. return _emptyEffectSet;
  1549. }
  1550. if (effector.getOwner().isGM() && !effector.getOwner().getAccessLevel().canGiveDamage())
  1551. {
  1552. return _emptyEffectSet;
  1553. }
  1554. }
  1555. }
  1556. ArrayList<L2Effect> effects = new ArrayList<>(_effectTemplates.length);
  1557. if (env == null)
  1558. {
  1559. env = new Env();
  1560. }
  1561. env.setCharacter(effector.getOwner());
  1562. env.setCubic(effector);
  1563. env.setTarget(effected);
  1564. env.setSkill(this);
  1565. for (EffectTemplate et : _effectTemplates)
  1566. {
  1567. boolean success = true;
  1568. if (et.effectPower > -1)
  1569. {
  1570. success = Formulas.calcEffectSuccess(effector.getOwner(), effected, et, this, env.getShield(), env.isSoulShot(), env.isSpiritShot(), env.isBlessedSpiritShot());
  1571. }
  1572. if (success)
  1573. {
  1574. L2Effect e = et.getEffect(env);
  1575. if (e != null)
  1576. {
  1577. e.scheduleEffect();
  1578. effects.add(e);
  1579. }
  1580. }
  1581. }
  1582. if (effects.isEmpty())
  1583. {
  1584. return _emptyEffectSet;
  1585. }
  1586. return effects.toArray(new L2Effect[effects.size()]);
  1587. }
  1588. public final L2Effect[] getEffectsSelf(L2Character effector)
  1589. {
  1590. if (!hasSelfEffects() || isPassive())
  1591. {
  1592. return _emptyEffectSet;
  1593. }
  1594. List<L2Effect> effects = new ArrayList<>(_effectTemplatesSelf.length);
  1595. for (EffectTemplate et : _effectTemplatesSelf)
  1596. {
  1597. Env env = new Env();
  1598. env.setCharacter(effector);
  1599. env.setTarget(effector);
  1600. env.setSkill(this);
  1601. L2Effect e = et.getEffect(env);
  1602. if (e != null)
  1603. {
  1604. e.setSelfEffect();
  1605. e.scheduleEffect();
  1606. effects.add(e);
  1607. }
  1608. }
  1609. if (effects.isEmpty())
  1610. {
  1611. return _emptyEffectSet;
  1612. }
  1613. return effects.toArray(new L2Effect[effects.size()]);
  1614. }
  1615. public final L2Effect[] getEffectsPassive(L2Character effector)
  1616. {
  1617. if (!hasPassiveEffects())
  1618. {
  1619. return _emptyEffectSet;
  1620. }
  1621. List<L2Effect> effects = new ArrayList<>(_effectTemplatesPassive.length);
  1622. for (EffectTemplate et : _effectTemplatesPassive)
  1623. {
  1624. Env env = new Env();
  1625. env.setCharacter(effector);
  1626. env.setTarget(effector);
  1627. env.setSkill(this);
  1628. L2Effect e = et.getEffect(env);
  1629. if (e != null)
  1630. {
  1631. e.setPassiveEffect();
  1632. e.scheduleEffect();
  1633. effects.add(e);
  1634. }
  1635. }
  1636. if (effects.isEmpty())
  1637. {
  1638. return _emptyEffectSet;
  1639. }
  1640. return effects.toArray(new L2Effect[effects.size()]);
  1641. }
  1642. public final void attach(FuncTemplate f)
  1643. {
  1644. if (_funcTemplates == null)
  1645. {
  1646. _funcTemplates = new FuncTemplate[]
  1647. {
  1648. f
  1649. };
  1650. }
  1651. else
  1652. {
  1653. int len = _funcTemplates.length;
  1654. FuncTemplate[] tmp = new FuncTemplate[len + 1];
  1655. System.arraycopy(_funcTemplates, 0, tmp, 0, len);
  1656. tmp[len] = f;
  1657. _funcTemplates = tmp;
  1658. }
  1659. }
  1660. public final void attach(EffectTemplate effect)
  1661. {
  1662. if (_effectTemplates == null)
  1663. {
  1664. _effectTemplates = new EffectTemplate[]
  1665. {
  1666. effect
  1667. };
  1668. }
  1669. else
  1670. {
  1671. int len = _effectTemplates.length;
  1672. EffectTemplate[] tmp = new EffectTemplate[len + 1];
  1673. System.arraycopy(_effectTemplates, 0, tmp, 0, len);
  1674. tmp[len] = effect;
  1675. _effectTemplates = tmp;
  1676. }
  1677. }
  1678. public final void attachSelf(EffectTemplate effect)
  1679. {
  1680. if (_effectTemplatesSelf == null)
  1681. {
  1682. _effectTemplatesSelf = new EffectTemplate[]
  1683. {
  1684. effect
  1685. };
  1686. }
  1687. else
  1688. {
  1689. int len = _effectTemplatesSelf.length;
  1690. EffectTemplate[] tmp = new EffectTemplate[len + 1];
  1691. System.arraycopy(_effectTemplatesSelf, 0, tmp, 0, len);
  1692. tmp[len] = effect;
  1693. _effectTemplatesSelf = tmp;
  1694. }
  1695. }
  1696. public final void attachPassive(EffectTemplate effect)
  1697. {
  1698. if (_effectTemplatesPassive == null)
  1699. {
  1700. _effectTemplatesPassive = new EffectTemplate[]
  1701. {
  1702. effect
  1703. };
  1704. }
  1705. else
  1706. {
  1707. int len = _effectTemplatesPassive.length;
  1708. EffectTemplate[] tmp = new EffectTemplate[len + 1];
  1709. System.arraycopy(_effectTemplatesPassive, 0, tmp, 0, len);
  1710. tmp[len] = effect;
  1711. _effectTemplatesPassive = tmp;
  1712. }
  1713. }
  1714. public final void attach(Condition c, boolean itemOrWeapon)
  1715. {
  1716. if (itemOrWeapon)
  1717. {
  1718. if (_itemPreCondition == null)
  1719. {
  1720. _itemPreCondition = new ArrayList<>();
  1721. }
  1722. _itemPreCondition.add(c);
  1723. }
  1724. else
  1725. {
  1726. if (_preCondition == null)
  1727. {
  1728. _preCondition = new ArrayList<>();
  1729. }
  1730. _preCondition.add(c);
  1731. }
  1732. }
  1733. @Override
  1734. public String toString()
  1735. {
  1736. return "" + _name + "[id=" + _id + ",lvl=" + _level + "]";
  1737. }
  1738. /**
  1739. * @return pet food
  1740. */
  1741. public int getFeed()
  1742. {
  1743. return _feed;
  1744. }
  1745. /**
  1746. * used for tracking item id in case that item consume cannot be used
  1747. * @return reference item id
  1748. */
  1749. public int getReferenceItemId()
  1750. {
  1751. return _refId;
  1752. }
  1753. public int getAfterEffectId()
  1754. {
  1755. return _afterEffectId;
  1756. }
  1757. public int getAfterEffectLvl()
  1758. {
  1759. return _afterEffectLvl;
  1760. }
  1761. @Override
  1762. public boolean triggersChanceSkill()
  1763. {
  1764. return (_triggeredId > 0) && isChance();
  1765. }
  1766. @Override
  1767. public int getTriggeredChanceId()
  1768. {
  1769. return _triggeredId;
  1770. }
  1771. @Override
  1772. public int getTriggeredChanceLevel()
  1773. {
  1774. return _triggeredLevel;
  1775. }
  1776. @Override
  1777. public ChanceCondition getTriggeredChanceCondition()
  1778. {
  1779. return _chanceCondition;
  1780. }
  1781. public String getAttributeName()
  1782. {
  1783. return _attribute;
  1784. }
  1785. /**
  1786. * @return the _blowChance
  1787. */
  1788. public int getBlowChance()
  1789. {
  1790. return _blowChance;
  1791. }
  1792. public boolean ignoreShield()
  1793. {
  1794. return _ignoreShield;
  1795. }
  1796. public boolean canBeReflected()
  1797. {
  1798. return _canBeReflected;
  1799. }
  1800. public boolean canBeDispeled()
  1801. {
  1802. return _canBeDispeled;
  1803. }
  1804. public boolean isClanSkill()
  1805. {
  1806. return _isClanSkill;
  1807. }
  1808. public boolean isExcludedFromCheck()
  1809. {
  1810. return _excludedFromCheck;
  1811. }
  1812. public boolean getDependOnTargetBuff()
  1813. {
  1814. return _dependOnTargetBuff;
  1815. }
  1816. public boolean isSimultaneousCast()
  1817. {
  1818. return _simultaneousCast;
  1819. }
  1820. /**
  1821. * @param skillId
  1822. * @param skillLvl
  1823. * @param values
  1824. * @return L2ExtractableSkill
  1825. * @author Zoey76
  1826. */
  1827. private L2ExtractableSkill parseExtractableSkill(int skillId, int skillLvl, String values)
  1828. {
  1829. final String[] prodLists = values.split(";");
  1830. final List<L2ExtractableProductItem> products = new ArrayList<>();
  1831. String[] prodData;
  1832. for (String prodList : prodLists)
  1833. {
  1834. prodData = prodList.split(",");
  1835. if (prodData.length < 3)
  1836. {
  1837. _log.warning("Extractable skills data: Error in Skill Id: " + skillId + " Level: " + skillLvl + " -> wrong seperator!");
  1838. }
  1839. List<ItemHolder> items = null;
  1840. double chance = 0;
  1841. int prodId = 0;
  1842. int quantity = 0;
  1843. final int lenght = prodData.length - 1;
  1844. try
  1845. {
  1846. items = new ArrayList<>(lenght / 2);
  1847. for (int j = 0; j < lenght; j++)
  1848. {
  1849. prodId = Integer.parseInt(prodData[j]);
  1850. quantity = Integer.parseInt(prodData[j += 1]);
  1851. if ((prodId <= 0) || (quantity <= 0))
  1852. {
  1853. _log.warning("Extractable skills data: Error in Skill Id: " + skillId + " Level: " + skillLvl + " wrong production Id: " + prodId + " or wrond quantity: " + quantity + "!");
  1854. }
  1855. items.add(new ItemHolder(prodId, quantity));
  1856. }
  1857. chance = Double.parseDouble(prodData[lenght]);
  1858. }
  1859. catch (Exception e)
  1860. {
  1861. _log.warning("Extractable skills data: Error in Skill Id: " + skillId + " Level: " + skillLvl + " -> incomplete/invalid production data or wrong seperator!");
  1862. }
  1863. products.add(new L2ExtractableProductItem(items, chance));
  1864. }
  1865. if (products.isEmpty())
  1866. {
  1867. _log.warning("Extractable skills data: Error in Skill Id: " + skillId + " Level: " + skillLvl + " -> There are no production items!");
  1868. }
  1869. return new L2ExtractableSkill(SkillTable.getSkillHashCode(skillId, skillLvl), products);
  1870. }
  1871. public L2ExtractableSkill getExtractableSkill()
  1872. {
  1873. return _extractableItems;
  1874. }
  1875. public int getMaxTargets()
  1876. {
  1877. return _maxTargets;
  1878. }
  1879. public boolean isStaticHeal()
  1880. {
  1881. return _isStaticHeal;
  1882. }
  1883. /**
  1884. * @return the _npcId
  1885. */
  1886. public int getNpcId()
  1887. {
  1888. return _npcId;
  1889. }
  1890. /**
  1891. * @return the _faceId
  1892. */
  1893. public int getFaceId()
  1894. {
  1895. return _faceId;
  1896. }
  1897. /**
  1898. * @return the _hairColorId
  1899. */
  1900. public int getHairColorId()
  1901. {
  1902. return _hairColorId;
  1903. }
  1904. /**
  1905. * @return the _hairStyleId
  1906. */
  1907. public int getHairStyleId()
  1908. {
  1909. return _hairStyleId;
  1910. }
  1911. }