L2Effect.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  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.effects;
  20. import java.util.ArrayList;
  21. import java.util.concurrent.ScheduledFuture;
  22. import java.util.concurrent.TimeUnit;
  23. import java.util.logging.Level;
  24. import java.util.logging.Logger;
  25. import com.l2jserver.gameserver.GameTimeController;
  26. import com.l2jserver.gameserver.ThreadPoolManager;
  27. import com.l2jserver.gameserver.datatables.SkillTable;
  28. import com.l2jserver.gameserver.model.ChanceCondition;
  29. import com.l2jserver.gameserver.model.actor.L2Character;
  30. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  31. import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
  32. import com.l2jserver.gameserver.model.interfaces.IChanceSkillTrigger;
  33. import com.l2jserver.gameserver.model.skills.L2Skill;
  34. import com.l2jserver.gameserver.model.skills.L2SkillType;
  35. import com.l2jserver.gameserver.model.skills.funcs.Func;
  36. import com.l2jserver.gameserver.model.skills.funcs.FuncTemplate;
  37. import com.l2jserver.gameserver.model.skills.funcs.Lambda;
  38. import com.l2jserver.gameserver.model.stats.Env;
  39. import com.l2jserver.gameserver.network.SystemMessageId;
  40. import com.l2jserver.gameserver.network.serverpackets.AbnormalStatusUpdate;
  41. import com.l2jserver.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
  42. import com.l2jserver.gameserver.network.serverpackets.MagicSkillLaunched;
  43. import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
  44. import com.l2jserver.gameserver.network.serverpackets.PartySpelled;
  45. import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  46. public abstract class L2Effect implements IChanceSkillTrigger
  47. {
  48. protected static final Logger _log = Logger.getLogger(L2Effect.class.getName());
  49. private static final Func[] _emptyFunctionSet = new Func[0];
  50. // member _effector is the instance of L2Character that cast/used the spell/skill that is
  51. // causing this effect. Do not confuse with the instance of L2Character that
  52. // is being affected by this effect.
  53. private final L2Character _effector;
  54. // member _effected is the instance of L2Character that was affected
  55. // by this effect. Do not confuse with the instance of L2Character that
  56. // casted/used this effect.
  57. private final L2Character _effected;
  58. // the skill that was used.
  59. private final L2Skill _skill;
  60. // the value of an update
  61. private final Lambda _lambda;
  62. // the current state
  63. private EffectState _state;
  64. // period, seconds
  65. private final int _abnormalTime;
  66. protected int _periodStartTicks;
  67. protected int _periodFirstTime;
  68. private final EffectTemplate _template;
  69. // function templates
  70. private final FuncTemplate[] _funcTemplates;
  71. // initial count
  72. private final int _totalCount;
  73. // counter
  74. private int _count;
  75. // abnormal effect mask
  76. private final AbnormalEffect _abnormalEffect;
  77. // special effect mask
  78. private final AbnormalEffect[] _specialEffect;
  79. // event effect mask
  80. private final AbnormalEffect _eventEffect;
  81. // show icon
  82. private final boolean _icon;
  83. // is self effect?
  84. private boolean _isSelfEffect = false;
  85. // is passive effect?
  86. private boolean _isPassiveEffect = false;
  87. public boolean preventExitUpdate;
  88. protected final class EffectTask implements Runnable
  89. {
  90. @Override
  91. public void run()
  92. {
  93. try
  94. {
  95. _periodFirstTime = 0;
  96. _periodStartTicks = GameTimeController.getGameTicks();
  97. scheduleEffect();
  98. }
  99. catch (Exception e)
  100. {
  101. _log.log(Level.SEVERE, "", e);
  102. }
  103. }
  104. }
  105. private ScheduledFuture<?> _currentFuture;
  106. /** The Identifier of the stack group */
  107. private final String _abnormalType;
  108. /** The position of the effect in the stack group */
  109. private final byte _abnormalLvl;
  110. private boolean _inUse = false;
  111. private boolean _startConditionsCorrect = true;
  112. /**
  113. * For special behavior. See Formulas.calcEffectSuccess
  114. */
  115. private double _effectPower;
  116. private L2SkillType _effectSkillType;
  117. /**
  118. * <font color="FF0000"><b>WARNING: scheduleEffect no longer inside constructor</b></font><br>
  119. * So you must call it explicitly
  120. * @param env
  121. * @param template
  122. */
  123. protected L2Effect(Env env, EffectTemplate template)
  124. {
  125. _state = EffectState.CREATED;
  126. _skill = env.getSkill();
  127. // _item = env._item == null ? null : env._item.getItem();
  128. _template = template;
  129. _effected = env.getTarget();
  130. _effector = env.getCharacter();
  131. _lambda = template.lambda;
  132. _funcTemplates = template.funcTemplates;
  133. _count = template.counter;
  134. _totalCount = _count;
  135. // Support for retail herbs duration when _effected has a Summon
  136. int temp = template.abnormalTime;
  137. if (((_skill.getId() > 2277) && (_skill.getId() < 2286)) || ((_skill.getId() >= 2512) && (_skill.getId() <= 2514)))
  138. {
  139. if ((_effected instanceof L2ServitorInstance) || ((_effected instanceof L2PcInstance) && (((L2PcInstance) _effected).getSummon() instanceof L2ServitorInstance)))
  140. {
  141. temp /= 2;
  142. }
  143. }
  144. if (env.isSkillMastery())
  145. {
  146. temp *= 2;
  147. }
  148. _abnormalTime = temp;
  149. _abnormalEffect = template.abnormalEffect;
  150. _specialEffect = template.specialEffect;
  151. _eventEffect = template.eventEffect;
  152. _abnormalType = template.abnormalType;
  153. _abnormalLvl = template.abnormalLvl;
  154. _periodStartTicks = GameTimeController.getGameTicks();
  155. _periodFirstTime = 0;
  156. _icon = template.icon;
  157. _effectPower = template.effectPower;
  158. _effectSkillType = template.effectType;
  159. // Commented out by DrHouse:
  160. // scheduleEffect can call onStart before effect is completely initialized on constructor (child classes constructor)
  161. // scheduleEffect();
  162. }
  163. /**
  164. * Special constructor to "steal" buffs. Must be implemented on every child class that can be stolen.<br>
  165. * <font color="FF0000"><b>WARNING: scheduleEffect no longer inside constructor</b></font><br>
  166. * So you must call it explicitly.
  167. * @param env
  168. * @param effect
  169. */
  170. protected L2Effect(Env env, L2Effect effect)
  171. {
  172. _template = effect._template;
  173. _state = EffectState.CREATED;
  174. _skill = env.getSkill();
  175. _effected = env.getTarget();
  176. _effector = env.getCharacter();
  177. _lambda = _template.lambda;
  178. _funcTemplates = _template.funcTemplates;
  179. _count = effect.getCount();
  180. _totalCount = _template.counter;
  181. _abnormalTime = _template.abnormalTime;
  182. _abnormalEffect = _template.abnormalEffect;
  183. _specialEffect = _template.specialEffect;
  184. _eventEffect = _template.eventEffect;
  185. _abnormalType = _template.abnormalType;
  186. _abnormalLvl = _template.abnormalLvl;
  187. _periodStartTicks = effect.getPeriodStartTicks();
  188. _periodFirstTime = effect.getTime();
  189. _icon = _template.icon;
  190. // Commented out by DrHouse:
  191. // scheduleEffect can call onStart before effect is completly initialized on constructor (child classes constructor)
  192. // scheduleEffect();
  193. }
  194. public int getCount()
  195. {
  196. return _count;
  197. }
  198. public int getTotalCount()
  199. {
  200. return _totalCount;
  201. }
  202. public void setCount(int newcount)
  203. {
  204. _count = Math.min(newcount, _totalCount); // sanity check
  205. }
  206. public void setFirstTime(int newFirstTime)
  207. {
  208. _periodFirstTime = Math.min(newFirstTime, _abnormalTime);
  209. _periodStartTicks -= _periodFirstTime * GameTimeController.TICKS_PER_SECOND;
  210. }
  211. public boolean getShowIcon()
  212. {
  213. return _icon;
  214. }
  215. public int getAbnormalTime()
  216. {
  217. return _abnormalTime;
  218. }
  219. public int getTime()
  220. {
  221. return (GameTimeController.getGameTicks() - _periodStartTicks) / GameTimeController.TICKS_PER_SECOND;
  222. }
  223. /**
  224. * Returns the elapsed time of the task.
  225. * @return Time in seconds.
  226. */
  227. public int getTaskTime()
  228. {
  229. if (_count == _totalCount)
  230. {
  231. return 0;
  232. }
  233. return (Math.abs((_count - _totalCount) + 1) * _abnormalTime) + getTime() + 1;
  234. }
  235. public boolean getInUse()
  236. {
  237. return _inUse;
  238. }
  239. public boolean setInUse(boolean inUse)
  240. {
  241. _inUse = inUse;
  242. if (_inUse)
  243. {
  244. _startConditionsCorrect = onStart();
  245. }
  246. else
  247. {
  248. onExit();
  249. }
  250. return _startConditionsCorrect;
  251. }
  252. public String getAbnormalType()
  253. {
  254. return _abnormalType;
  255. }
  256. public byte getAbnormalLvl()
  257. {
  258. return _abnormalLvl;
  259. }
  260. public final L2Skill getSkill()
  261. {
  262. return _skill;
  263. }
  264. public final L2Character getEffector()
  265. {
  266. return _effector;
  267. }
  268. public final L2Character getEffected()
  269. {
  270. return _effected;
  271. }
  272. public boolean isSelfEffect()
  273. {
  274. return _isSelfEffect;
  275. }
  276. public void setSelfEffect()
  277. {
  278. _isSelfEffect = true;
  279. }
  280. public boolean isPassiveEffect()
  281. {
  282. return _isPassiveEffect;
  283. }
  284. public void setPassiveEffect()
  285. {
  286. _isPassiveEffect = true;
  287. }
  288. public final double calc()
  289. {
  290. Env env = new Env();
  291. env.setCharacter(_effector);
  292. env.setTarget(_effected);
  293. env.setSkill(_skill);
  294. return _lambda.calc(env);
  295. }
  296. private final synchronized void startEffectTask()
  297. {
  298. if (_abnormalTime > 0)
  299. {
  300. stopEffectTask();
  301. final int initialDelay = Math.max((_abnormalTime - _periodFirstTime) * 1000, 5);
  302. if (_count > 1)
  303. {
  304. _currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _abnormalTime * 1000);
  305. }
  306. else
  307. {
  308. _currentFuture = ThreadPoolManager.getInstance().scheduleEffect(new EffectTask(), initialDelay);
  309. }
  310. }
  311. if (_state == EffectState.ACTING)
  312. {
  313. if (isSelfEffectType())
  314. {
  315. _effector.addEffect(this);
  316. }
  317. else
  318. {
  319. _effected.addEffect(this);
  320. }
  321. }
  322. }
  323. /**
  324. * Stop the L2Effect task and send Server->Client update packet.<br>
  325. * <B><U>Actions</U>:</B>
  326. * <ul>
  327. * <li>Cancel the effect in the the abnormal effect map of the L2Character</li>
  328. * <li>Stop the task of the L2Effect, remove it and update client magic icon</li>
  329. * </ul>
  330. */
  331. public final void exit()
  332. {
  333. exit(false);
  334. }
  335. public final void exit(boolean preventUpdate)
  336. {
  337. preventExitUpdate = preventUpdate;
  338. _state = EffectState.FINISHING;
  339. scheduleEffect();
  340. }
  341. /**
  342. * Stop the task of the L2Effect, remove it and update client magic icon.<br>
  343. * <B><U>Actions</U>:</B>
  344. * <ul>
  345. * <li>Cancel the task</li>
  346. * <li>Stop and remove L2Effect from L2Character and update client magic icon</li>
  347. * </ul>
  348. */
  349. public final synchronized void stopEffectTask()
  350. {
  351. if (_currentFuture != null)
  352. {
  353. // Cancel the task
  354. _currentFuture.cancel(false);
  355. // ThreadPoolManager.getInstance().removeEffect(_currentTask);
  356. _currentFuture = null;
  357. if (isSelfEffectType() && (getEffector() != null))
  358. {
  359. getEffector().removeEffect(this);
  360. }
  361. else if (getEffected() != null)
  362. {
  363. getEffected().removeEffect(this);
  364. }
  365. }
  366. }
  367. /**
  368. * @return effect type
  369. */
  370. public abstract L2EffectType getEffectType();
  371. /**
  372. * Notify started.
  373. * @return {@code true} if all the start conditions are meet, {@code false} otherwise
  374. */
  375. public boolean onStart()
  376. {
  377. if (_abnormalEffect != AbnormalEffect.NULL)
  378. {
  379. getEffected().startAbnormalEffect(_abnormalEffect);
  380. }
  381. if (_specialEffect != null)
  382. {
  383. getEffected().startSpecialEffect(_specialEffect);
  384. }
  385. if ((_eventEffect != AbnormalEffect.NULL) && (getEffected() instanceof L2PcInstance))
  386. {
  387. getEffected().getActingPlayer().startEventEffect(_eventEffect);
  388. }
  389. return true;
  390. }
  391. /**
  392. * Cancel the effect in the the abnormal effect map of the effected L2Character.
  393. */
  394. public void onExit()
  395. {
  396. if (_abnormalEffect != AbnormalEffect.NULL)
  397. {
  398. getEffected().stopAbnormalEffect(_abnormalEffect);
  399. }
  400. if (_specialEffect != null)
  401. {
  402. getEffected().stopSpecialEffect(_specialEffect);
  403. }
  404. if ((_eventEffect != AbnormalEffect.NULL) && (getEffected() instanceof L2PcInstance))
  405. {
  406. getEffected().getActingPlayer().stopEventEffect(_eventEffect);
  407. }
  408. }
  409. /**
  410. * @return true for continuation of this effect
  411. */
  412. public abstract boolean onActionTime();
  413. public final void scheduleEffect()
  414. {
  415. switch (_state)
  416. {
  417. case CREATED:
  418. {
  419. _state = EffectState.ACTING;
  420. if (_skill.isPvpSkill() && _icon && (getEffected() instanceof L2PcInstance))
  421. {
  422. SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
  423. smsg.addSkillName(_skill);
  424. getEffected().sendPacket(smsg);
  425. }
  426. if (_abnormalTime != 0)
  427. {
  428. startEffectTask();
  429. return;
  430. }
  431. // effects not having count or period should start
  432. _startConditionsCorrect = onStart();
  433. }
  434. case ACTING:
  435. {
  436. if (_count > 0)
  437. {
  438. _count--;
  439. if (getInUse())
  440. {
  441. // effect has to be in use
  442. if (onActionTime() && _startConditionsCorrect && (_count >= 0))
  443. {
  444. return; // false causes effect to finish right away
  445. }
  446. }
  447. else if (_count > 0)
  448. {
  449. // do not finish it yet, in case reactivated
  450. return;
  451. }
  452. }
  453. _state = EffectState.FINISHING;
  454. }
  455. case FINISHING:
  456. {
  457. // If the time left is equal to zero, send the message
  458. if ((_count == 0) && _icon && (getEffected() instanceof L2PcInstance))
  459. {
  460. SystemMessage smsg3 = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_WORN_OFF);
  461. smsg3.addSkillName(_skill);
  462. getEffected().sendPacket(smsg3);
  463. }
  464. // if task is null - stopEffectTask does not remove effect
  465. if ((_currentFuture == null) && (getEffected() != null))
  466. {
  467. getEffected().removeEffect(this);
  468. }
  469. // Stop the task of the L2Effect, remove it and update client magic icon
  470. stopEffectTask();
  471. // Cancel the effect in the the abnormal effect map of the L2Character
  472. if (getInUse() || !((_count > 1) || (_abnormalTime > 0)))
  473. {
  474. if (_startConditionsCorrect)
  475. {
  476. onExit();
  477. }
  478. }
  479. if (_skill.getAfterEffectId() > 0)
  480. {
  481. L2Skill skill = SkillTable.getInstance().getInfo(_skill.getAfterEffectId(), _skill.getAfterEffectLvl());
  482. if (skill != null)
  483. {
  484. getEffected().broadcastPacket(new MagicSkillUse(_effected, skill.getId(), skill.getLevel(), 0, 0));
  485. getEffected().broadcastPacket(new MagicSkillLaunched(_effected, skill.getId(), skill.getLevel()));
  486. skill.getEffects(getEffected(), getEffected());
  487. }
  488. }
  489. }
  490. }
  491. }
  492. public Func[] getStatFuncs()
  493. {
  494. if (_funcTemplates == null)
  495. {
  496. return _emptyFunctionSet;
  497. }
  498. final ArrayList<Func> funcs = new ArrayList<>(_funcTemplates.length);
  499. Env env = new Env();
  500. env.setCharacter(_effector);
  501. env.setTarget(_effected);
  502. env.setSkill(_skill);
  503. Func f;
  504. for (FuncTemplate t : _funcTemplates)
  505. {
  506. f = t.getFunc(env, this); // effect is owner
  507. if (f != null)
  508. {
  509. funcs.add(f);
  510. }
  511. }
  512. if (funcs.isEmpty())
  513. {
  514. return _emptyFunctionSet;
  515. }
  516. return funcs.toArray(new Func[funcs.size()]);
  517. }
  518. public final void addIcon(AbnormalStatusUpdate mi)
  519. {
  520. if (_state != EffectState.ACTING)
  521. {
  522. return;
  523. }
  524. final ScheduledFuture<?> future = _currentFuture;
  525. final L2Skill sk = getSkill();
  526. if (_totalCount > 1)
  527. {
  528. if (sk.isStatic())
  529. {
  530. mi.addEffect(sk.getDisplayId(), getLevel(), sk.getBuffDuration() - (getTaskTime() * 1000));
  531. }
  532. else
  533. {
  534. mi.addEffect(sk.getDisplayId(), getLevel(), -1);
  535. }
  536. }
  537. else if (future != null)
  538. {
  539. mi.addEffect(sk.getDisplayId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
  540. }
  541. else if (_abnormalTime == -1)
  542. {
  543. mi.addEffect(sk.getDisplayId(), getLevel(), _abnormalTime);
  544. }
  545. }
  546. public final void addPartySpelledIcon(PartySpelled ps)
  547. {
  548. if (_state != EffectState.ACTING)
  549. {
  550. return;
  551. }
  552. final ScheduledFuture<?> future = _currentFuture;
  553. final L2Skill sk = getSkill();
  554. if (future != null)
  555. {
  556. ps.addPartySpelledEffect(sk.getDisplayId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
  557. }
  558. else if (_abnormalTime == -1)
  559. {
  560. ps.addPartySpelledEffect(sk.getDisplayId(), getLevel(), _abnormalTime);
  561. }
  562. }
  563. public final void addOlympiadSpelledIcon(ExOlympiadSpelledInfo os)
  564. {
  565. if (_state != EffectState.ACTING)
  566. {
  567. return;
  568. }
  569. final ScheduledFuture<?> future = _currentFuture;
  570. final L2Skill sk = getSkill();
  571. if (future != null)
  572. {
  573. os.addEffect(sk.getDisplayId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
  574. }
  575. else if (_abnormalTime == -1)
  576. {
  577. os.addEffect(sk.getDisplayId(), getLevel(), _abnormalTime);
  578. }
  579. }
  580. public int getLevel()
  581. {
  582. return getSkill().getLevel();
  583. }
  584. public int getPeriodStartTicks()
  585. {
  586. return _periodStartTicks;
  587. }
  588. public EffectTemplate getEffectTemplate()
  589. {
  590. return _template;
  591. }
  592. public double getEffectPower()
  593. {
  594. return _effectPower;
  595. }
  596. public L2SkillType getSkillType()
  597. {
  598. return _effectSkillType;
  599. }
  600. public boolean canBeStolen()
  601. {
  602. if (!effectCanBeStolen() || (getEffectType() == L2EffectType.TRANSFORMATION) || getSkill().isPassive() || getSkill().isToggle() || getSkill().isDebuff() || getSkill().isHeroSkill() || getSkill().isGMSkill() || getSkill().isStatic() || !getSkill().canBeDispeled())
  603. {
  604. return false;
  605. }
  606. return true;
  607. }
  608. /**
  609. * @return {@code true} if effect itself can be stolen, {@code false} otherwise
  610. */
  611. protected boolean effectCanBeStolen()
  612. {
  613. return false;
  614. }
  615. /**
  616. * Return bit flag for current effect
  617. * @return int flag
  618. */
  619. public int getEffectFlags()
  620. {
  621. return EffectFlag.NONE.getMask();
  622. }
  623. @Override
  624. public String toString()
  625. {
  626. return "L2Effect [_skill=" + _skill + ", _state=" + _state + ", _period=" + _abnormalTime + "]";
  627. }
  628. public boolean isSelfEffectType()
  629. {
  630. return false;
  631. }
  632. public void decreaseForce()
  633. {
  634. }
  635. public void increaseEffect()
  636. {
  637. }
  638. public int getForceEffect()
  639. {
  640. return 0;
  641. }
  642. public boolean isBuffEffect()
  643. {
  644. return false;
  645. }
  646. public boolean isDebuffEffect()
  647. {
  648. return false;
  649. }
  650. @Override
  651. public boolean triggersChanceSkill()
  652. {
  653. return false;
  654. }
  655. @Override
  656. public int getTriggeredChanceId()
  657. {
  658. return 0;
  659. }
  660. @Override
  661. public int getTriggeredChanceLevel()
  662. {
  663. return 0;
  664. }
  665. @Override
  666. public ChanceCondition getTriggeredChanceCondition()
  667. {
  668. return null;
  669. }
  670. }