Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.52 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_ReunionProject_Core
  3. Index: java/l2r/gameserver/model/actor/instance/L2PcInstance.java
  4. ===================================================================
  5. --- java/l2r/gameserver/model/actor/instance/L2PcInstance.java (revision 518)
  6. +++ java/l2r/gameserver/model/actor/instance/L2PcInstance.java (working copy)
  7. @@ -28,7 +28,6 @@
  8. import java.util.Calendar;
  9. import java.util.Collection;
  10. import java.util.Collections;
  11. -import java.util.EventListener;
  12. import java.util.HashMap;
  13. import java.util.HashSet;
  14. import java.util.Iterator;
  15. @@ -216,6 +215,7 @@
  16. import l2r.gameserver.model.holders.ItemHolder;
  17. import l2r.gameserver.model.holders.PlayerEventHolder;
  18. import l2r.gameserver.model.holders.SkillUseHolder;
  19. +import l2r.gameserver.model.interfaces.IEventListener;
  20. import l2r.gameserver.model.itemcontainer.Inventory;
  21. import l2r.gameserver.model.itemcontainer.ItemContainer;
  22. import l2r.gameserver.model.itemcontainer.PcFreight;
  23. @@ -418,7 +418,7 @@
  24.  
  25. public static final int REQUEST_TIMEOUT = 15;
  26.  
  27. - private final List<EventListener> _eventListeners = new FastList<EventListener>().shared();
  28. + private final List<IEventListener> _eventListeners = new FastList<IEventListener>().shared();
  29.  
  30. public class AIAccessor extends L2Character.AIAccessor
  31. {
  32. @@ -871,6 +871,7 @@
  33. private int _cursedWeaponEquippedId = 0;
  34. private boolean _combatFlagEquippedId = false;
  35.  
  36. + private boolean _canRevive = true;
  37. private int _reviveRequested = 0;
  38. private double _revivePower = 0;
  39. private boolean _revivePet = false;
  40. @@ -963,6 +964,8 @@
  41. // Save responder name for log it
  42. private String _lastPetitionGmName = null;
  43.  
  44. + private boolean _hasCharmOfCourage = false;
  45. +
  46. /**
  47. * Create a new L2PcInstance and add it in the characters table of the database.<br>
  48. * <B><U> Actions</U> :</B>
  49. @@ -5564,29 +5567,6 @@
  50. @Override
  51. public boolean doDie(L2Character killer)
  52. {
  53. - // Kill the L2PcInstance
  54. - if (!super.doDie(killer))
  55. - {
  56. - return false;
  57. - }
  58. -
  59. - if (CustomServerConfigs.PVP_SPREE_SYSTEM && (getPvpFlag() > 0))
  60. - {
  61. - spreeKills = 0;
  62. - }
  63. -
  64. - if (isMounted())
  65. - {
  66. - stopFeed();
  67. - }
  68. - synchronized (this)
  69. - {
  70. - if (isFakeDeath())
  71. - {
  72. - stopFakeDeath(true);
  73. - }
  74. - }
  75. -
  76. if (killer != null)
  77. {
  78. final L2PcInstance pk = killer.getActingPlayer();
  79. @@ -5749,6 +5729,29 @@
  80. }
  81. }
  82.  
  83. + // Kill the L2PcInstance
  84. + if (!super.doDie(killer))
  85. + {
  86. + return false;
  87. + }
  88. +
  89. + if (CustomServerConfigs.PVP_SPREE_SYSTEM && (getPvpFlag() > 0))
  90. + {
  91. + spreeKills = 0;
  92. + }
  93. +
  94. + if (isMounted())
  95. + {
  96. + stopFeed();
  97. + }
  98. + synchronized (this)
  99. + {
  100. + if (isFakeDeath())
  101. + {
  102. + stopFakeDeath(true);
  103. + }
  104. + }
  105. +
  106. // Unsummon Cubics
  107. if (!_cubics.isEmpty())
  108. {
  109. @@ -5794,10 +5797,6 @@
  110.  
  111. AntiFeedManager.getInstance().setLastDeathTime(getObjectId());
  112.  
  113. - if (isPhoenixBlessed() || (isAffected(EffectFlag.CHARM_OF_COURAGE) && isInSiege()))
  114. - {
  115. - reviveRequest(this, null, false);
  116. - }
  117. return true;
  118. }
  119.  
  120. @@ -11384,7 +11383,6 @@
  121. public void doRevive()
  122. {
  123. super.doRevive();
  124. - stopEffects(L2EffectType.CHARMOFCOURAGE);
  125. updateEffectIcons();
  126. sendPacket(new EtcStatusUpdate(this));
  127. _reviveRequested = 0;
  128. @@ -11430,7 +11428,7 @@
  129. doRevive();
  130. }
  131.  
  132. - public void reviveRequest(L2PcInstance reviver, L2Skill skill, boolean Pet)
  133. + public void reviveRequest(L2PcInstance reviver, L2Skill skill, boolean Pet, int power)
  134. {
  135. if (isResurrectionBlocked())
  136. {
  137. @@ -11456,35 +11454,23 @@
  138. }
  139. return;
  140. }
  141. - if ((Pet && hasSummon() && getSummon().isDead()) || (!Pet && isDead()))
  142. + if ((Pet && hasPet() && getSummon().isDead()) || (!Pet && isDead()))
  143. {
  144. _reviveRequested = 1;
  145. int restoreExp = 0;
  146. - if (isPhoenixBlessed())
  147. - {
  148. - _revivePower = 100;
  149. - }
  150. - else if (isAffected(EffectFlag.CHARM_OF_COURAGE))
  151. - {
  152. - _revivePower = 0;
  153. - }
  154. - else
  155. - {
  156. - _revivePower = Formulas.calculateSkillResurrectRestorePercent(skill.getPower(), reviver);
  157. - }
  158.  
  159. + _revivePower = Formulas.calculateSkillResurrectRestorePercent(power, reviver);
  160. restoreExp = (int) Math.round(((getExpBeforeDeath() - getExp()) * _revivePower) / 100);
  161. -
  162. _revivePet = Pet;
  163.  
  164. - if (isAffected(EffectFlag.CHARM_OF_COURAGE))
  165. + if (hasCharmOfCourage())
  166. {
  167. ConfirmDlg dlg = new ConfirmDlg(SystemMessageId.RESURRECT_USING_CHARM_OF_COURAGE.getId());
  168. dlg.addTime(60000);
  169. sendPacket(dlg);
  170. return;
  171. }
  172. - ConfirmDlg dlg = new ConfirmDlg(SystemMessageId.RESSURECTION_REQUEST_BY_C1_FOR_S2_XP.getId());
  173. + ConfirmDlg dlg = new ConfirmDlg(SystemMessageId.RESURRECTION_REQUEST_BY_C1_FOR_S2_XP.getId());
  174. dlg.addPcName(reviver);
  175. dlg.addString(Integer.toString(restoreExp));
  176. sendPacket(dlg);
  177. @@ -11493,16 +11479,11 @@
  178.  
  179. public void reviveAnswer(int answer)
  180. {
  181. - if ((_reviveRequested != 1) || (!isDead() && !_revivePet) || (_revivePet && hasSummon() && !getSummon().isDead()))
  182. + if ((_reviveRequested != 1) || (!isDead() && !_revivePet) || (_revivePet && hasPet() && !getSummon().isDead()))
  183. {
  184. return;
  185. }
  186. - // If character refuses a PhoenixBless autoress, cancel all buffs he had
  187. - if ((answer == 0) && isPhoenixBlessed())
  188. - {
  189. - stopEffects(L2EffectType.NOBLESSE_BLESSING);
  190. - stopAllEffectsExceptThoseThatLastThroughDeath();
  191. - }
  192. +
  193. if (answer == 1)
  194. {
  195. if (!_revivePet)
  196. @@ -11516,7 +11497,7 @@
  197. doRevive();
  198. }
  199. }
  200. - else if (hasSummon())
  201. + else if (hasPet())
  202. {
  203. if (_revivePower != 0)
  204. {
  205. @@ -13249,9 +13230,15 @@
  206.  
  207. public void calculateDeathPenaltyBuffLevel(L2Character killer)
  208. {
  209. - if (((getKarma() > 0) || (Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE)) && !(killer instanceof L2PcInstance) && !(canOverrideCond(PcCondOverride.DEATH_PENALTY)) && !(isCharmOfLuckAffected() && killer.isRaid()) && !isPhoenixBlessed() && !isLucky() && !(isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
  210. + if ((getKarma() > 0) || (Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE))
  211. {
  212. - increaseDeathPenaltyBuffLevel();
  213. + if (!(killer.getActingPlayer() != null) && !(canOverrideCond(PcCondOverride.DEATH_PENALTY)))
  214. + {
  215. + if (!(isCharmOfLuckAffected() && killer.isRaid()) && !isResurrectSpecialAffected() && !isLucky() && !isBlockedFromDeathPenalty() && !(isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
  216. + {
  217. + increaseDeathPenaltyBuffLevel();
  218. + }
  219. + }
  220. }
  221. }
  222.  
  223. @@ -14437,6 +14424,43 @@
  224. _clientHeading = val;
  225. }
  226.  
  227. + /**
  228. + * Adds a event listener.
  229. + * @param listener
  230. + */
  231. + public void addEventListener(IEventListener listener)
  232. + {
  233. + _eventListeners.add(listener);
  234. + }
  235. +
  236. + /**
  237. + * Removes event listener
  238. + * @param listener
  239. + */
  240. + public void removeEventListener(IEventListener listener)
  241. + {
  242. + _eventListeners.remove(listener);
  243. + }
  244. +
  245. + public void removeEventListener(Class<? extends IEventListener> clazz)
  246. + {
  247. + final Iterator<IEventListener> it = _eventListeners.iterator();
  248. + IEventListener event;
  249. + while (it.hasNext())
  250. + {
  251. + event = it.next();
  252. + if (event.getClass() == clazz)
  253. + {
  254. + it.remove();
  255. + }
  256. + }
  257. + }
  258. +
  259. + public Collection<IEventListener> getEventListeners()
  260. + {
  261. + return _eventListeners;
  262. + }
  263. +
  264. @Override
  265. public int getId()
  266. {
  267. @@ -15177,40 +15201,53 @@
  268. }
  269.  
  270. /**
  271. - * Adds a event listener.
  272. - * @param listener
  273. + * @return {@code true} if current player can revive and shows 'To Village' button upon death, {@code false} otherwise.
  274. */
  275. - public void addEventListener(EventListener listener)
  276. + @Override
  277. + public boolean canRevive()
  278. {
  279. - _eventListeners.add(listener);
  280. + for (IEventListener listener : _eventListeners)
  281. + {
  282. + if (listener.isOnEvent() && !listener.canRevive())
  283. + {
  284. + return false;
  285. + }
  286. + }
  287. + return _canRevive;
  288. }
  289.  
  290. /**
  291. - * Removes event listener
  292. - * @param listener
  293. + * This method can prevent from displaying 'To Village' button upon death.
  294. + * @param val
  295. */
  296. - public void removeEventListener(EventListener listener)
  297. + @Override
  298. + public void setCanRevive(boolean val)
  299. {
  300. - _eventListeners.remove(listener);
  301. + _canRevive = val;
  302. }
  303.  
  304. - public void removeEventListener(Class<? extends EventListener> clazz)
  305. + public boolean isBlockedFromExit()
  306. {
  307. - final Iterator<EventListener> it = _eventListeners.iterator();
  308. - EventListener event;
  309. - while (it.hasNext())
  310. + for (IEventListener listener : _eventListeners)
  311. {
  312. - event = it.next();
  313. - if (event.getClass() == clazz)
  314. + if (listener.isOnEvent() && listener.isBlockingExit())
  315. {
  316. - it.remove();
  317. + return true;
  318. }
  319. }
  320. + return false;
  321. }
  322.  
  323. - public Collection<EventListener> getEventListeners()
  324. + public boolean isBlockedFromDeathPenalty()
  325. {
  326. - return _eventListeners;
  327. + for (IEventListener listener : _eventListeners)
  328. + {
  329. + if (listener.isOnEvent() && listener.isBlockingDeathPenalty())
  330. + {
  331. + return true;
  332. + }
  333. + }
  334. + return false;
  335. }
  336.  
  337. @Override
  338. @@ -15237,6 +15274,25 @@
  339. _gamePoints = gamePoints;
  340. }
  341.  
  342. + /**
  343. + * Set true/false if character got Charm of Courage
  344. + * @param val true/false
  345. + */
  346. + public void setCharmOfCourage(boolean val)
  347. + {
  348. + _hasCharmOfCourage = val;
  349. +
  350. + }
  351. +
  352. + /**
  353. + * @return {@code true} if effect is present, {@code false} otherwise.
  354. + */
  355. + public boolean hasCharmOfCourage()
  356. + {
  357. + return _hasCharmOfCourage;
  358. +
  359. + }
  360. +
  361. // ============================================== //
  362. // Donate Engine By L][Reunion Team //
  363. // ============================================== //
  364. Index: java/l2r/gameserver/network/serverpackets/Die.java
  365. ===================================================================
  366. --- java/l2r/gameserver/network/serverpackets/Die.java (revision 518)
  367. +++ java/l2r/gameserver/network/serverpackets/Die.java (working copy)
  368. @@ -33,6 +33,7 @@
  369. import l2r.gameserver.model.entity.Castle;
  370. import l2r.gameserver.model.entity.Fort;
  371. import l2r.gameserver.model.entity.clanhall.SiegableHall;
  372. +import l2r.gameserver.model.entity.olympiad.OlympiadManager;
  373. import gr.reunion.configsEngine.ChaoticZoneConfigs;
  374. import gr.reunion.configsEngine.FlagZoneConfigs;
  375. import gr.reunion.interf.ReunionEvents;
  376. @@ -46,6 +47,7 @@
  377. private L2Clan _clan;
  378. private final L2Character _activeChar;
  379. private boolean _isJailed;
  380. + private boolean _staticRes = false;
  381.  
  382. /**
  383. * @param cha
  384. @@ -98,6 +100,12 @@
  385. writeC(0x00);
  386. writeD(_charObjId);
  387. writeD(_canTeleport ? 0x01 : 0);
  388. +
  389. + if (_activeChar.isPlayer() && !OlympiadManager.getInstance().isRegistered(_activeChar.getActingPlayer()) && !_activeChar.isOnEvent())
  390. + {
  391. + _staticRes = _activeChar.getInventory().haveItemForSelfResurrection();
  392. + }
  393. +
  394. if (_canTeleport && (_clan != null) && !_isJailed)
  395. {
  396. boolean isInCastleDefense = false;
  397. @@ -126,6 +134,11 @@
  398. }
  399. }
  400.  
  401. + if (_access.allowFixedRes())
  402. + {
  403. + _staticRes = true;
  404. + }
  405. +
  406. writeD(_clan.getHideoutId() > 0 ? 0x01 : 0x00); // 6d 01 00 00 00 - to hide away
  407. writeD((_clan.getCastleId() > 0) || isInCastleDefense ? 0x01 : 0x00); // 6d 02 00 00 00 - to castle
  408. writeD((TerritoryWarManager.getInstance().getHQForClan(_clan) != null) || ((siegeClan != null) && !isInCastleDefense && !isInFortDefense && !siegeClan.getFlag().isEmpty()) || ((hall != null) && hall.getSiege().checkIsAttacker(_clan)) ? 0x01 : 0x00); // 6d 03 00 00 00 - to siege HQ
  409. @@ -139,7 +152,7 @@
  410. writeD(0x00); // 6d 02 00 00 00 - to castle
  411. writeD(0x00); // 6d 03 00 00 00 - to siege HQ
  412. writeD(_sweepable ? 0x01 : 0x00); // sweepable (blue glow)
  413. - writeD(_access.allowFixedRes() ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED
  414. + writeD(_staticRes ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED
  415. writeD(0x00); // 6d 05 00 00 00 - to fortress
  416. }
  417. // TODO: protocol 152
  418. Index: java/l2r/gameserver/model/actor/instance/L2PetInstance.java
  419. ===================================================================
  420. --- java/l2r/gameserver/model/actor/instance/L2PetInstance.java (revision 518)
  421. +++ java/l2r/gameserver/model/actor/instance/L2PetInstance.java (working copy)
  422. @@ -656,6 +656,11 @@
  423. @Override
  424. public boolean doDie(L2Character killer)
  425. {
  426. + L2PcInstance owner = getOwner();
  427. + if ((owner != null) && !owner.isInDuel() && (!isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
  428. + {
  429. + deathPenalty();
  430. + }
  431. if (!super.doDie(killer, true))
  432. {
  433. return false;
  434. @@ -664,11 +669,6 @@
  435. sendPacket(SystemMessageId.MAKE_SURE_YOU_RESSURECT_YOUR_PET_WITHIN_24_HOURS);
  436. DecayTaskManager.getInstance().addDecayTask(this, PET_DECAY_DELAY);
  437. // do not decrease exp if is in duel, arena
  438. - L2PcInstance owner = getOwner();
  439. - if ((owner != null) && !owner.isInDuel() && (!isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
  440. - {
  441. - deathPenalty();
  442. - }
  443. return true;
  444. }
  445.  
  446. Index: java/l2r/gameserver/ai/L2FortSiegeGuardAI.java
  447. ===================================================================
  448. --- java/l2r/gameserver/ai/L2FortSiegeGuardAI.java (revision 518)
  449. +++ java/l2r/gameserver/ai/L2FortSiegeGuardAI.java (working copy)
  450. @@ -174,7 +174,7 @@
  451. if (target instanceof L2Playable)
  452. {
  453. // Check if the target isn't in silent move mode AND too far (>100)
  454. - if (((L2Playable) target).isSilentMoving() && !_actor.isInsideRadius(target, 250, false, false))
  455. + if (((L2Playable) target).isSilentMovingAffected() && !_actor.isInsideRadius(target, 250, false, false))
  456. {
  457. return false;
  458. }
  459. Index: java/l2r/gameserver/network/clientpackets/RequestRestartPoint.java
  460. ===================================================================
  461. --- java/l2r/gameserver/network/clientpackets/RequestRestartPoint.java (revision 518)
  462. +++ java/l2r/gameserver/network/clientpackets/RequestRestartPoint.java (working copy)
  463. @@ -232,7 +232,7 @@
  464. _log.warn("Player [" + activeChar.getName() + "] called RestartPointPacket - Fixed and he isn't festival participant!");
  465. return;
  466. }
  467. - if (activeChar.isGM())
  468. + if (activeChar.isGM() || activeChar.destroyItemByItemId("Feather", 10649, 1, activeChar, false) || activeChar.destroyItemByItemId("Feather", 13300, 1, activeChar, false) || activeChar.destroyItemByItemId("Feather", 13128, 1, activeChar, false))
  469. {
  470. activeChar.doRevive(100.00);
  471. }
  472. Index: java/l2r/gameserver/ai/L2ControllableMobAI.java
  473. ===================================================================
  474. --- java/l2r/gameserver/ai/L2ControllableMobAI.java (revision 518)
  475. +++ java/l2r/gameserver/ai/L2ControllableMobAI.java (working copy)
  476. @@ -426,7 +426,7 @@
  477. if (target.isPlayable())
  478. {
  479. // Check if the target isn't in silent move mode
  480. - if (((L2Playable) target).isSilentMoving())
  481. + if (((L2Playable) target).isSilentMovingAffected())
  482. {
  483. return false;
  484. }
  485. Index: java/l2r/gameserver/model/itemcontainer/ItemContainer.java
  486. ===================================================================
  487. --- java/l2r/gameserver/model/itemcontainer/ItemContainer.java (revision 518)
  488. +++ java/l2r/gameserver/model/itemcontainer/ItemContainer.java (working copy)
  489. @@ -104,6 +104,21 @@
  490. }
  491.  
  492. /**
  493. + * @return true if player got item for self resurrection
  494. + */
  495. + public final boolean haveItemForSelfResurrection()
  496. + {
  497. + for (L2ItemInstance item : _items)
  498. + {
  499. + if ((item != null) && (item.getItem().isAllowSelfResurrection()))
  500. + {
  501. + return true;
  502. + }
  503. + }
  504. + return false;
  505. + }
  506. +
  507. + /**
  508. * @param itemId the item Id
  509. * @return the items list from inventory by using its itemId
  510. */
  511. Index: java/l2r/gameserver/model/items/L2Item.java
  512. ===================================================================
  513. --- java/l2r/gameserver/model/items/L2Item.java (revision 518)
  514. +++ java/l2r/gameserver/model/items/L2Item.java (working copy)
  515. @@ -140,6 +140,7 @@
  516. private final boolean _elementable;
  517. private final boolean _questItem;
  518. private final boolean _freightable;
  519. + private final boolean _allow_self_resurrection;
  520. private final boolean _is_oly_restricted;
  521. private final boolean _for_npc;
  522. private final boolean _common;
  523. @@ -199,6 +200,7 @@
  524. _enchantable = set.getInt("enchant_enabled", 0);
  525. _questItem = set.getBoolean("is_questitem", false);
  526. _freightable = set.getBoolean("is_freightable", false);
  527. + _allow_self_resurrection = set.getBoolean("allow_self_resurrection", false);
  528. _is_oly_restricted = set.getBoolean("is_oly_restricted", false);
  529. _for_npc = set.getBoolean("for_npc", false);
  530.  
  531. @@ -974,6 +976,11 @@
  532. return _freightable;
  533. }
  534.  
  535. + public boolean isAllowSelfResurrection()
  536. + {
  537. + return _allow_self_resurrection;
  538. + }
  539. +
  540. public boolean isOlyRestrictedItem()
  541. {
  542. return _is_oly_restricted || Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId);
  543. Index: java/l2r/gameserver/model/actor/L2Summon.java
  544. ===================================================================
  545. --- java/l2r/gameserver/model/actor/L2Summon.java (revision 518)
  546. +++ java/l2r/gameserver/model/actor/L2Summon.java (working copy)
  547. @@ -313,7 +313,7 @@
  548. @Override
  549. public boolean doDie(L2Character killer)
  550. {
  551. - if (isNoblesseBlessed())
  552. + if (isNoblesseBlessedAffected())
  553. {
  554. stopEffects(L2EffectType.NOBLESSE_BLESSING);
  555. storeEffect(true);
  556. @@ -351,11 +351,6 @@
  557. }
  558. }
  559.  
  560. - if (isPhoenixBlessed() && (getOwner() != null))
  561. - {
  562. - getOwner().reviveRequest(getOwner(), null, true);
  563. - }
  564. -
  565. DecayTaskManager.getInstance().addDecayTask(this);
  566. return true;
  567. }
  568. Index: java/l2r/gameserver/model/effects/EffectFlag.java
  569. ===================================================================
  570. --- java/l2r/gameserver/model/effects/EffectFlag.java (revision 518)
  571. +++ java/l2r/gameserver/model/effects/EffectFlag.java (working copy)
  572. @@ -24,9 +24,8 @@
  573. public enum EffectFlag
  574. {
  575. NONE,
  576. - CHARM_OF_COURAGE,
  577. CHARM_OF_LUCK,
  578. - PHOENIX_BLESSING,
  579. + RESURRECTION_SPECIAL,
  580. NOBLESS_BLESSING,
  581. SILENT_MOVE,
  582. PROTECTION_BLESSING,
  583. Index: java/l2r/gameserver/model/actor/L2Attackable.java
  584. ===================================================================
  585. --- java/l2r/gameserver/model/actor/L2Attackable.java (revision 518)
  586. +++ java/l2r/gameserver/model/actor/L2Attackable.java (working copy)
  587. @@ -1727,6 +1727,7 @@
  588. /**
  589. * @return True if a Dwarf use Sweep on the L2Attackable and if item can be spoiled.
  590. */
  591. + @Override
  592. public boolean isSweepActive()
  593. {
  594. return _sweepItems != null;
  595. Index: java/l2r/gameserver/model/effects/L2EffectType.java
  596. ===================================================================
  597. --- java/l2r/gameserver/model/effects/L2EffectType.java (revision 518)
  598. +++ java/l2r/gameserver/model/effects/L2EffectType.java (working copy)
  599. @@ -35,7 +35,6 @@
  600. CANCEL_ALL,
  601. CANCEL_DEBUFF,
  602. CHARM_OF_LUCK,
  603. - CHARMOFCOURAGE,
  604. CHAT_BLOCK,
  605. CLAN_GATE,
  606. CONFUSE_MOB_ONLY,
  607. @@ -77,7 +76,6 @@
  608. NONE,
  609. PARALYZE,
  610. PETRIFICATION,
  611. - PHOENIX_BLESSING,
  612. PHYSICAL_ATTACK_MUTE,
  613. PHYSICAL_MUTE,
  614. PROTECTION_BLESSING,
  615. @@ -86,6 +84,7 @@
  616. RELAXING,
  617. REMOVE_TARGET,
  618. RESTORATION_RANDOM,
  619. + RESURRECTION_SPECIAL,
  620. ROOT,
  621. SIGNET_EFFECT,
  622. SIGNET_GROUND,
  623. Index: java/l2r/gameserver/ai/L2SiegeGuardAI.java
  624. ===================================================================
  625. --- java/l2r/gameserver/ai/L2SiegeGuardAI.java (revision 518)
  626. +++ java/l2r/gameserver/ai/L2SiegeGuardAI.java (working copy)
  627. @@ -163,7 +163,7 @@
  628. if (target instanceof L2Playable)
  629. {
  630. // Check if the target isn't in silent move mode AND too far (>100)
  631. - if (((L2Playable) target).isSilentMoving() && !_actor.isInsideRadius(target, 250, false, false))
  632. + if (((L2Playable) target).isSilentMovingAffected() && !_actor.isInsideRadius(target, 250, false, false))
  633. {
  634. return false;
  635. }
  636. Index: java/l2r/gameserver/model/actor/L2Character.java
  637. ===================================================================
  638. --- java/l2r/gameserver/model/actor/L2Character.java (revision 518)
  639. +++ java/l2r/gameserver/model/actor/L2Character.java (working copy)
  640. @@ -2536,33 +2536,7 @@
  641. // Stop HP/MP/CP Regeneration task
  642. getStatus().stopHpMpRegeneration();
  643.  
  644. - // Stop all active skills effects in progress on the L2Character,
  645. - // if the Character isn't affected by Soul of The Phoenix or Salvation
  646. - if (isPlayable() && ((L2Playable) this).isPhoenixBlessed())
  647. - {
  648. - if (((L2Playable) this).isCharmOfLuckAffected())
  649. - {
  650. - stopEffects(L2EffectType.CHARM_OF_LUCK);
  651. - }
  652. - if (((L2Playable) this).isNoblesseBlessed())
  653. - {
  654. - stopEffects(L2EffectType.NOBLESSE_BLESSING);
  655. - }
  656. - }
  657. - // Same thing if the Character isn't a Noblesse Blessed L2Playable
  658. - else if (isPlayable() && ((L2Playable) this).isNoblesseBlessed())
  659. - {
  660. - stopEffects(L2EffectType.NOBLESSE_BLESSING);
  661. -
  662. - if (((L2Playable) this).isCharmOfLuckAffected())
  663. - {
  664. - stopEffects(L2EffectType.CHARM_OF_LUCK);
  665. - }
  666. - }
  667. - else
  668. - {
  669. - stopAllEffectsExceptThoseThatLastThroughDeath();
  670. - }
  671. + stopAllEffectsExceptThoseThatLastThroughDeath();
  672.  
  673. if (isPlayer() && (getActingPlayer().getAgathionId() != 0))
  674. {
  675. @@ -2585,27 +2559,7 @@
  676. }
  677.  
  678. getAttackByList().clear();
  679. - // If character is PhoenixBlessed
  680. - // or has charm of courage inside siege battlefield (exact operation to be confirmed)
  681. - // a resurrection popup will show up
  682. - if (isSummon())
  683. - {
  684. - if (((L2Summon) this).isPhoenixBlessed() && (((L2Summon) this).getOwner() != null))
  685. - {
  686. - ((L2Summon) this).getOwner().reviveRequest(((L2Summon) this).getOwner(), null, true);
  687. - }
  688. - }
  689. - if (isPlayer())
  690. - {
  691. - if (((L2Playable) this).isPhoenixBlessed())
  692. - {
  693. - getActingPlayer().reviveRequest(getActingPlayer(), null, false);
  694. - }
  695. - else if (isAffected(EffectFlag.CHARM_OF_COURAGE) && getActingPlayer().isInSiege())
  696. - {
  697. - getActingPlayer().reviveRequest(getActingPlayer(), null, false);
  698. - }
  699. - }
  700. +
  701. try
  702. {
  703. if (_fusionSkill != null)
  704. @@ -2654,33 +2608,18 @@
  705. {
  706. setIsPendingRevive(false);
  707. setIsDead(false);
  708. - boolean restorefull = false;
  709.  
  710. - if (isPlayable() && ((L2Playable) this).isPhoenixBlessed())
  711. + if ((Config.RESPAWN_RESTORE_CP > 0) && (getCurrentCp() < (getMaxCp() * Config.RESPAWN_RESTORE_CP)))
  712. {
  713. - restorefull = true;
  714. - stopEffects(L2EffectType.PHOENIX_BLESSING);
  715. + _status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);
  716. }
  717. - if (restorefull)
  718. + if ((Config.RESPAWN_RESTORE_HP > 0) && (getCurrentHp() < (getMaxHp() * Config.RESPAWN_RESTORE_HP)))
  719. {
  720. - _status.setCurrentCp(getCurrentCp()); // this is not confirmed, so just trigger regeneration
  721. - _status.setCurrentHp(getMaxHp()); // confirmed
  722. - _status.setCurrentMp(getMaxMp()); // and also confirmed
  723. + _status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
  724. }
  725. - else
  726. + if ((Config.RESPAWN_RESTORE_MP > 0) && (getCurrentMp() < (getMaxMp() * Config.RESPAWN_RESTORE_MP)))
  727. {
  728. - if ((Config.RESPAWN_RESTORE_CP > 0) && (getCurrentCp() < (getMaxCp() * Config.RESPAWN_RESTORE_CP)))
  729. - {
  730. - _status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);
  731. - }
  732. - if ((Config.RESPAWN_RESTORE_HP > 0) && (getCurrentHp() < (getMaxHp() * Config.RESPAWN_RESTORE_HP)))
  733. - {
  734. - _status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
  735. - }
  736. - if ((Config.RESPAWN_RESTORE_MP > 0) && (getCurrentMp() < (getMaxMp() * Config.RESPAWN_RESTORE_MP)))
  737. - {
  738. - _status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);
  739. - }
  740. + _status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);
  741. }
  742.  
  743. // Start broadcast status
  744. @@ -7744,6 +7683,32 @@
  745.  
  746. /**
  747. * Dummy method overriden in {@link L2PcInstance}
  748. + * @return {@code true} if current player can revive and shows 'To Village' button upon death, {@code false} otherwise.
  749. + */
  750. + public boolean canRevive()
  751. + {
  752. + return true;
  753. + }
  754. +
  755. + /**
  756. + * Dummy method overriden in {@link L2PcInstance}
  757. + * @param val
  758. + */
  759. + public void setCanRevive(boolean val)
  760. + {
  761. + }
  762. +
  763. + /**
  764. + * Dummy method overriden in {@link L2Attackable}
  765. + * @return {@code true} if there is a loot to sweep, {@code false} otherwise.
  766. + */
  767. + public boolean isSweepActive()
  768. + {
  769. + return false;
  770. + }
  771. +
  772. + /**
  773. + * Dummy method overriden in {@link L2PcInstance}
  774. * @return {@code true} if player is on event, {@code false} otherwise.
  775. */
  776. public boolean isOnEvent()
  777. Index: java/l2r/gameserver/model/actor/L2Playable.java
  778. ===================================================================
  779. --- java/l2r/gameserver/model/actor/L2Playable.java (revision 518)
  780. +++ java/l2r/gameserver/model/actor/L2Playable.java (working copy)
  781. @@ -35,6 +35,7 @@
  782. import l2r.gameserver.model.events.returns.TerminateReturn;
  783. import l2r.gameserver.model.quest.QuestState;
  784. import l2r.gameserver.model.skills.L2Skill;
  785. +import l2r.gameserver.network.serverpackets.EtcStatusUpdate;
  786.  
  787. /**
  788. * This class represents all Playable characters in the world.<br>
  789. @@ -130,30 +131,39 @@
  790. // Stop HP/MP/CP Regeneration task
  791. getStatus().stopHpMpRegeneration();
  792.  
  793. - // Stop all active skills effects in progress on the L2Character,
  794. - // if the Character isn't affected by Soul of The Phoenix or Salvation
  795. - if (isPhoenixBlessed())
  796. + if (isCharmOfLuckAffected())
  797. {
  798. - if (isCharmOfLuckAffected())
  799. - {
  800. - stopEffects(L2EffectType.CHARM_OF_LUCK);
  801. - }
  802. - if (isNoblesseBlessed())
  803. - {
  804. - stopEffects(L2EffectType.NOBLESSE_BLESSING);
  805. - }
  806. + stopEffects(L2EffectType.CHARM_OF_LUCK);
  807. }
  808. - // Same thing if the Character isn't a Noblesse Blessed L2Playable
  809. - else if (isNoblesseBlessed())
  810. +
  811. + boolean deleteBuffs = true;
  812. +
  813. + if (isNoblesseBlessedAffected())
  814. {
  815. stopEffects(L2EffectType.NOBLESSE_BLESSING);
  816. + deleteBuffs = false;
  817. + }
  818. + if (isResurrectSpecialAffected())
  819. + {
  820. + stopEffects(L2EffectType.RESURRECTION_SPECIAL);
  821. + deleteBuffs = false;
  822. + }
  823. + if (isPlayer())
  824. + {
  825. + L2PcInstance activeChar = getActingPlayer();
  826.  
  827. - if (isCharmOfLuckAffected())
  828. + if (activeChar.hasCharmOfCourage())
  829. {
  830. - stopEffects(L2EffectType.CHARM_OF_LUCK);
  831. + if (activeChar.isInSiege())
  832. + {
  833. + getActingPlayer().reviveRequest(getActingPlayer(), null, false, 0);
  834. + }
  835. + activeChar.setCharmOfCourage(false);
  836. + activeChar.sendPacket(new EtcStatusUpdate(activeChar));
  837. }
  838. }
  839. - else
  840. +
  841. + if (deleteBuffs)
  842. {
  843. stopAllEffectsExceptThoseThatLastThroughDeath();
  844. }
  845. @@ -168,6 +178,7 @@
  846.  
  847. // Notify Quest of L2Playable's death
  848. L2PcInstance actingPlayer = getActingPlayer();
  849. +
  850. if (!actingPlayer.isNotifyQuestOfDeathEmpty())
  851. {
  852. for (QuestState qs : actingPlayer.getNotifyQuestOfDeath())
  853. @@ -245,6 +256,7 @@
  854. // Notify L2Character AI
  855. getAI().notifyEvent(CtrlEvent.EVT_DEAD);
  856.  
  857. + super.updateEffectIcons();
  858. return true;
  859. }
  860.  
  861. @@ -319,23 +331,24 @@
  862. return true;
  863. }
  864.  
  865. - // Support for Noblesse Blessing skill, where buffs are retained
  866. - // after resurrect
  867. - public final boolean isNoblesseBlessed()
  868. + // Support for Noblesse Blessing skill, where buffs are retained after resurrect
  869. + public final boolean isNoblesseBlessedAffected()
  870. {
  871. return _effects.isAffected(EffectFlag.NOBLESS_BLESSING);
  872. }
  873.  
  874. - // Support for Soul of the Phoenix and Salvation skills
  875. - public final boolean isPhoenixBlessed()
  876. + /**
  877. + * @return {@code true} if char can resurrect by himself, {@code false} otherwise
  878. + */
  879. + public final boolean isResurrectSpecialAffected()
  880. {
  881. - return _effects.isAffected(EffectFlag.PHOENIX_BLESSING);
  882. + return isAffected(EffectFlag.RESURRECTION_SPECIAL);
  883. }
  884.  
  885. /**
  886. * @return True if the Silent Moving mode is active.
  887. */
  888. - public boolean isSilentMoving()
  889. + public boolean isSilentMovingAffected()
  890. {
  891. return _effects.isAffected(EffectFlag.SILENT_MOVE);
  892. }
  893. Index: java/l2r/gameserver/ai/L2AttackableAI.java
  894. ===================================================================
  895. --- java/l2r/gameserver/ai/L2AttackableAI.java (revision 518)
  896. +++ java/l2r/gameserver/ai/L2AttackableAI.java (working copy)
  897. @@ -190,7 +190,7 @@
  898. if (target.isPlayable())
  899. {
  900. // Check if the AI isn't a Raid Boss, can See Silent Moving players and the target isn't in silent move mode
  901. - if (!(me.isRaid()) && !(me.canSeeThroughSilentMove()) && ((L2Playable) target).isSilentMoving())
  902. + if (!(me.isRaid()) && !(me.canSeeThroughSilentMove()) && ((L2Playable) target).isSilentMovingAffected())
  903. {
  904. return false;
  905. }
  906. Index: java/l2r/gameserver/network/SystemMessageId.java
  907. ===================================================================
  908. --- java/l2r/gameserver/network/SystemMessageId.java (revision 518)
  909. +++ java/l2r/gameserver/network/SystemMessageId.java (working copy)
  910. @@ -8842,7 +8842,7 @@
  911. * ID: 1510<br>
  912. * Message: $c1 is making an attempt at resurrection with $s2 experience points. Do you want to be resurrected?
  913. */
  914. - public static final SystemMessageId RESSURECTION_REQUEST_BY_C1_FOR_S2_XP;
  915. + public static final SystemMessageId RESURRECTION_REQUEST_BY_C1_FOR_S2_XP;
  916.  
  917. /**
  918. * ID: 1511<br>
  919. @@ -16744,7 +16744,7 @@
  920. THIS_ITEM_CANT_BE_EQUIPPED_FOR_THE_OLYMPIAD_EVENT = new SystemMessageId(1507);
  921. THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT = new SystemMessageId(1508);
  922. THIS_SKILL_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT = new SystemMessageId(1509);
  923. - RESSURECTION_REQUEST_BY_C1_FOR_S2_XP = new SystemMessageId(1510);
  924. + RESURRECTION_REQUEST_BY_C1_FOR_S2_XP = new SystemMessageId(1510);
  925. MASTER_CANNOT_RES = new SystemMessageId(1511);
  926. CANNOT_RES_PET = new SystemMessageId(1512);
  927. RES_HAS_ALREADY_BEEN_PROPOSED = new SystemMessageId(1513);
  928. Index: java/l2r/gameserver/network/serverpackets/EtcStatusUpdate.java
  929. ===================================================================
  930. --- java/l2r/gameserver/network/serverpackets/EtcStatusUpdate.java (revision 518)
  931. +++ java/l2r/gameserver/network/serverpackets/EtcStatusUpdate.java (working copy)
  932. @@ -20,7 +20,6 @@
  933.  
  934. import l2r.gameserver.enums.ZoneIdType;
  935. import l2r.gameserver.model.actor.instance.L2PcInstance;
  936. -import l2r.gameserver.model.effects.EffectFlag;
  937.  
  938. /**
  939. * @author Luca Baldi
  940. @@ -44,7 +43,7 @@
  941. writeD(_activeChar.isInsideZone(ZoneIdType.DANGER_AREA) ? 1 : 0); // 1 = danger area
  942. writeD(_activeChar.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4]
  943. writeD(_activeChar.getExpertiseArmorPenalty()); // Armor Grade Penalty [1-4]
  944. - writeD(_activeChar.isAffected(EffectFlag.CHARM_OF_COURAGE) ? 1 : 0); // 1 = charm of courage (allows resurrection on the same spot upon death on the siege battlefield)
  945. + writeD(_activeChar.hasCharmOfCourage() ? 1 : 0); // 1 = charm of courage (allows resurrection on the same spot upon death on the siege battlefield)
  946. writeD(_activeChar.getDeathPenaltyBuffLevel()); // 1-15 death penalty, lvl (combat ability decreased due to death)
  947. writeD(_activeChar.getChargedSouls());
  948. }
  949. Index: java/l2r/gameserver/model/interfaces/IEventListener.java
  950. ===================================================================
  951. --- java/l2r/gameserver/model/interfaces/IEventListener.java (revision 0)
  952. +++ java/l2r/gameserver/model/interfaces/IEventListener.java (working copy)
  953. @@ -0,0 +1,49 @@
  954. +/*
  955. + * Copyright (C) 2004-2014 L2J Server
  956. + *
  957. + * This file is part of L2J Server.
  958. + *
  959. + * L2J Server is free software: you can redistribute it and/or modify
  960. + * it under the terms of the GNU General Public License as published by
  961. + * the Free Software Foundation, either version 3 of the License, or
  962. + * (at your option) any later version.
  963. + *
  964. + * L2J Server is distributed in the hope that it will be useful,
  965. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  966. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  967. + * General Public License for more details.
  968. + *
  969. + * You should have received a copy of the GNU General Public License
  970. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  971. + */
  972. +package l2r.gameserver.model.interfaces;
  973. +
  974. +import l2r.gameserver.model.actor.instance.L2PcInstance;
  975. +
  976. +/**
  977. + * @author UnAfraid
  978. + */
  979. +public interface IEventListener
  980. +{
  981. + /**
  982. + * @return {@code true} if player is on event, {@code false} otherwise.
  983. + */
  984. + public boolean isOnEvent();
  985. +
  986. + /**
  987. + * @return {@code true} if player is blocked from leaving the game, {@code false} otherwise.
  988. + */
  989. + public boolean isBlockingExit();
  990. +
  991. + /**
  992. + * @return {@code true} if player is blocked from receiving death penalty upon death, {@code false} otherwise.
  993. + */
  994. + public boolean isBlockingDeathPenalty();
  995. +
  996. + /**
  997. + * @return {@code true} if player can revive after death, {@code false} otherwise.
  998. + */
  999. + public boolean canRevive();
  1000. +
  1001. + public L2PcInstance getPlayer();
  1002. +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement