Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_ReunionProject_Core
- Index: java/l2r/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/l2r/gameserver/model/actor/instance/L2PcInstance.java (revision 518)
- +++ java/l2r/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -28,7 +28,6 @@
- import java.util.Calendar;
- import java.util.Collection;
- import java.util.Collections;
- -import java.util.EventListener;
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.Iterator;
- @@ -216,6 +215,7 @@
- import l2r.gameserver.model.holders.ItemHolder;
- import l2r.gameserver.model.holders.PlayerEventHolder;
- import l2r.gameserver.model.holders.SkillUseHolder;
- +import l2r.gameserver.model.interfaces.IEventListener;
- import l2r.gameserver.model.itemcontainer.Inventory;
- import l2r.gameserver.model.itemcontainer.ItemContainer;
- import l2r.gameserver.model.itemcontainer.PcFreight;
- @@ -418,7 +418,7 @@
- public static final int REQUEST_TIMEOUT = 15;
- - private final List<EventListener> _eventListeners = new FastList<EventListener>().shared();
- + private final List<IEventListener> _eventListeners = new FastList<IEventListener>().shared();
- public class AIAccessor extends L2Character.AIAccessor
- {
- @@ -871,6 +871,7 @@
- private int _cursedWeaponEquippedId = 0;
- private boolean _combatFlagEquippedId = false;
- + private boolean _canRevive = true;
- private int _reviveRequested = 0;
- private double _revivePower = 0;
- private boolean _revivePet = false;
- @@ -963,6 +964,8 @@
- // Save responder name for log it
- private String _lastPetitionGmName = null;
- + private boolean _hasCharmOfCourage = false;
- +
- /**
- * Create a new L2PcInstance and add it in the characters table of the database.<br>
- * <B><U> Actions</U> :</B>
- @@ -5564,29 +5567,6 @@
- @Override
- public boolean doDie(L2Character killer)
- {
- - // Kill the L2PcInstance
- - if (!super.doDie(killer))
- - {
- - return false;
- - }
- -
- - if (CustomServerConfigs.PVP_SPREE_SYSTEM && (getPvpFlag() > 0))
- - {
- - spreeKills = 0;
- - }
- -
- - if (isMounted())
- - {
- - stopFeed();
- - }
- - synchronized (this)
- - {
- - if (isFakeDeath())
- - {
- - stopFakeDeath(true);
- - }
- - }
- -
- if (killer != null)
- {
- final L2PcInstance pk = killer.getActingPlayer();
- @@ -5749,6 +5729,29 @@
- }
- }
- + // Kill the L2PcInstance
- + if (!super.doDie(killer))
- + {
- + return false;
- + }
- +
- + if (CustomServerConfigs.PVP_SPREE_SYSTEM && (getPvpFlag() > 0))
- + {
- + spreeKills = 0;
- + }
- +
- + if (isMounted())
- + {
- + stopFeed();
- + }
- + synchronized (this)
- + {
- + if (isFakeDeath())
- + {
- + stopFakeDeath(true);
- + }
- + }
- +
- // Unsummon Cubics
- if (!_cubics.isEmpty())
- {
- @@ -5794,10 +5797,6 @@
- AntiFeedManager.getInstance().setLastDeathTime(getObjectId());
- - if (isPhoenixBlessed() || (isAffected(EffectFlag.CHARM_OF_COURAGE) && isInSiege()))
- - {
- - reviveRequest(this, null, false);
- - }
- return true;
- }
- @@ -11384,7 +11383,6 @@
- public void doRevive()
- {
- super.doRevive();
- - stopEffects(L2EffectType.CHARMOFCOURAGE);
- updateEffectIcons();
- sendPacket(new EtcStatusUpdate(this));
- _reviveRequested = 0;
- @@ -11430,7 +11428,7 @@
- doRevive();
- }
- - public void reviveRequest(L2PcInstance reviver, L2Skill skill, boolean Pet)
- + public void reviveRequest(L2PcInstance reviver, L2Skill skill, boolean Pet, int power)
- {
- if (isResurrectionBlocked())
- {
- @@ -11456,35 +11454,23 @@
- }
- return;
- }
- - if ((Pet && hasSummon() && getSummon().isDead()) || (!Pet && isDead()))
- + if ((Pet && hasPet() && getSummon().isDead()) || (!Pet && isDead()))
- {
- _reviveRequested = 1;
- int restoreExp = 0;
- - if (isPhoenixBlessed())
- - {
- - _revivePower = 100;
- - }
- - else if (isAffected(EffectFlag.CHARM_OF_COURAGE))
- - {
- - _revivePower = 0;
- - }
- - else
- - {
- - _revivePower = Formulas.calculateSkillResurrectRestorePercent(skill.getPower(), reviver);
- - }
- + _revivePower = Formulas.calculateSkillResurrectRestorePercent(power, reviver);
- restoreExp = (int) Math.round(((getExpBeforeDeath() - getExp()) * _revivePower) / 100);
- -
- _revivePet = Pet;
- - if (isAffected(EffectFlag.CHARM_OF_COURAGE))
- + if (hasCharmOfCourage())
- {
- ConfirmDlg dlg = new ConfirmDlg(SystemMessageId.RESURRECT_USING_CHARM_OF_COURAGE.getId());
- dlg.addTime(60000);
- sendPacket(dlg);
- return;
- }
- - ConfirmDlg dlg = new ConfirmDlg(SystemMessageId.RESSURECTION_REQUEST_BY_C1_FOR_S2_XP.getId());
- + ConfirmDlg dlg = new ConfirmDlg(SystemMessageId.RESURRECTION_REQUEST_BY_C1_FOR_S2_XP.getId());
- dlg.addPcName(reviver);
- dlg.addString(Integer.toString(restoreExp));
- sendPacket(dlg);
- @@ -11493,16 +11479,11 @@
- public void reviveAnswer(int answer)
- {
- - if ((_reviveRequested != 1) || (!isDead() && !_revivePet) || (_revivePet && hasSummon() && !getSummon().isDead()))
- + if ((_reviveRequested != 1) || (!isDead() && !_revivePet) || (_revivePet && hasPet() && !getSummon().isDead()))
- {
- return;
- }
- - // If character refuses a PhoenixBless autoress, cancel all buffs he had
- - if ((answer == 0) && isPhoenixBlessed())
- - {
- - stopEffects(L2EffectType.NOBLESSE_BLESSING);
- - stopAllEffectsExceptThoseThatLastThroughDeath();
- - }
- +
- if (answer == 1)
- {
- if (!_revivePet)
- @@ -11516,7 +11497,7 @@
- doRevive();
- }
- }
- - else if (hasSummon())
- + else if (hasPet())
- {
- if (_revivePower != 0)
- {
- @@ -13249,9 +13230,15 @@
- public void calculateDeathPenaltyBuffLevel(L2Character killer)
- {
- - 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)))
- + if ((getKarma() > 0) || (Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE))
- {
- - increaseDeathPenaltyBuffLevel();
- + if (!(killer.getActingPlayer() != null) && !(canOverrideCond(PcCondOverride.DEATH_PENALTY)))
- + {
- + if (!(isCharmOfLuckAffected() && killer.isRaid()) && !isResurrectSpecialAffected() && !isLucky() && !isBlockedFromDeathPenalty() && !(isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
- + {
- + increaseDeathPenaltyBuffLevel();
- + }
- + }
- }
- }
- @@ -14437,6 +14424,43 @@
- _clientHeading = val;
- }
- + /**
- + * Adds a event listener.
- + * @param listener
- + */
- + public void addEventListener(IEventListener listener)
- + {
- + _eventListeners.add(listener);
- + }
- +
- + /**
- + * Removes event listener
- + * @param listener
- + */
- + public void removeEventListener(IEventListener listener)
- + {
- + _eventListeners.remove(listener);
- + }
- +
- + public void removeEventListener(Class<? extends IEventListener> clazz)
- + {
- + final Iterator<IEventListener> it = _eventListeners.iterator();
- + IEventListener event;
- + while (it.hasNext())
- + {
- + event = it.next();
- + if (event.getClass() == clazz)
- + {
- + it.remove();
- + }
- + }
- + }
- +
- + public Collection<IEventListener> getEventListeners()
- + {
- + return _eventListeners;
- + }
- +
- @Override
- public int getId()
- {
- @@ -15177,40 +15201,53 @@
- }
- /**
- - * Adds a event listener.
- - * @param listener
- + * @return {@code true} if current player can revive and shows 'To Village' button upon death, {@code false} otherwise.
- */
- - public void addEventListener(EventListener listener)
- + @Override
- + public boolean canRevive()
- {
- - _eventListeners.add(listener);
- + for (IEventListener listener : _eventListeners)
- + {
- + if (listener.isOnEvent() && !listener.canRevive())
- + {
- + return false;
- + }
- + }
- + return _canRevive;
- }
- /**
- - * Removes event listener
- - * @param listener
- + * This method can prevent from displaying 'To Village' button upon death.
- + * @param val
- */
- - public void removeEventListener(EventListener listener)
- + @Override
- + public void setCanRevive(boolean val)
- {
- - _eventListeners.remove(listener);
- + _canRevive = val;
- }
- - public void removeEventListener(Class<? extends EventListener> clazz)
- + public boolean isBlockedFromExit()
- {
- - final Iterator<EventListener> it = _eventListeners.iterator();
- - EventListener event;
- - while (it.hasNext())
- + for (IEventListener listener : _eventListeners)
- {
- - event = it.next();
- - if (event.getClass() == clazz)
- + if (listener.isOnEvent() && listener.isBlockingExit())
- {
- - it.remove();
- + return true;
- }
- }
- + return false;
- }
- - public Collection<EventListener> getEventListeners()
- + public boolean isBlockedFromDeathPenalty()
- {
- - return _eventListeners;
- + for (IEventListener listener : _eventListeners)
- + {
- + if (listener.isOnEvent() && listener.isBlockingDeathPenalty())
- + {
- + return true;
- + }
- + }
- + return false;
- }
- @Override
- @@ -15237,6 +15274,25 @@
- _gamePoints = gamePoints;
- }
- + /**
- + * Set true/false if character got Charm of Courage
- + * @param val true/false
- + */
- + public void setCharmOfCourage(boolean val)
- + {
- + _hasCharmOfCourage = val;
- +
- + }
- +
- + /**
- + * @return {@code true} if effect is present, {@code false} otherwise.
- + */
- + public boolean hasCharmOfCourage()
- + {
- + return _hasCharmOfCourage;
- +
- + }
- +
- // ============================================== //
- // Donate Engine By L][Reunion Team //
- // ============================================== //
- Index: java/l2r/gameserver/network/serverpackets/Die.java
- ===================================================================
- --- java/l2r/gameserver/network/serverpackets/Die.java (revision 518)
- +++ java/l2r/gameserver/network/serverpackets/Die.java (working copy)
- @@ -33,6 +33,7 @@
- import l2r.gameserver.model.entity.Castle;
- import l2r.gameserver.model.entity.Fort;
- import l2r.gameserver.model.entity.clanhall.SiegableHall;
- +import l2r.gameserver.model.entity.olympiad.OlympiadManager;
- import gr.reunion.configsEngine.ChaoticZoneConfigs;
- import gr.reunion.configsEngine.FlagZoneConfigs;
- import gr.reunion.interf.ReunionEvents;
- @@ -46,6 +47,7 @@
- private L2Clan _clan;
- private final L2Character _activeChar;
- private boolean _isJailed;
- + private boolean _staticRes = false;
- /**
- * @param cha
- @@ -98,6 +100,12 @@
- writeC(0x00);
- writeD(_charObjId);
- writeD(_canTeleport ? 0x01 : 0);
- +
- + if (_activeChar.isPlayer() && !OlympiadManager.getInstance().isRegistered(_activeChar.getActingPlayer()) && !_activeChar.isOnEvent())
- + {
- + _staticRes = _activeChar.getInventory().haveItemForSelfResurrection();
- + }
- +
- if (_canTeleport && (_clan != null) && !_isJailed)
- {
- boolean isInCastleDefense = false;
- @@ -126,6 +134,11 @@
- }
- }
- + if (_access.allowFixedRes())
- + {
- + _staticRes = true;
- + }
- +
- writeD(_clan.getHideoutId() > 0 ? 0x01 : 0x00); // 6d 01 00 00 00 - to hide away
- writeD((_clan.getCastleId() > 0) || isInCastleDefense ? 0x01 : 0x00); // 6d 02 00 00 00 - to castle
- 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
- @@ -139,7 +152,7 @@
- writeD(0x00); // 6d 02 00 00 00 - to castle
- writeD(0x00); // 6d 03 00 00 00 - to siege HQ
- writeD(_sweepable ? 0x01 : 0x00); // sweepable (blue glow)
- - writeD(_access.allowFixedRes() ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED
- + writeD(_staticRes ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED
- writeD(0x00); // 6d 05 00 00 00 - to fortress
- }
- // TODO: protocol 152
- Index: java/l2r/gameserver/model/actor/instance/L2PetInstance.java
- ===================================================================
- --- java/l2r/gameserver/model/actor/instance/L2PetInstance.java (revision 518)
- +++ java/l2r/gameserver/model/actor/instance/L2PetInstance.java (working copy)
- @@ -656,6 +656,11 @@
- @Override
- public boolean doDie(L2Character killer)
- {
- + L2PcInstance owner = getOwner();
- + if ((owner != null) && !owner.isInDuel() && (!isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
- + {
- + deathPenalty();
- + }
- if (!super.doDie(killer, true))
- {
- return false;
- @@ -664,11 +669,6 @@
- sendPacket(SystemMessageId.MAKE_SURE_YOU_RESSURECT_YOUR_PET_WITHIN_24_HOURS);
- DecayTaskManager.getInstance().addDecayTask(this, PET_DECAY_DELAY);
- // do not decrease exp if is in duel, arena
- - L2PcInstance owner = getOwner();
- - if ((owner != null) && !owner.isInDuel() && (!isInsideZone(ZoneIdType.PVP) || isInsideZone(ZoneIdType.SIEGE)))
- - {
- - deathPenalty();
- - }
- return true;
- }
- Index: java/l2r/gameserver/ai/L2FortSiegeGuardAI.java
- ===================================================================
- --- java/l2r/gameserver/ai/L2FortSiegeGuardAI.java (revision 518)
- +++ java/l2r/gameserver/ai/L2FortSiegeGuardAI.java (working copy)
- @@ -174,7 +174,7 @@
- if (target instanceof L2Playable)
- {
- // Check if the target isn't in silent move mode AND too far (>100)
- - if (((L2Playable) target).isSilentMoving() && !_actor.isInsideRadius(target, 250, false, false))
- + if (((L2Playable) target).isSilentMovingAffected() && !_actor.isInsideRadius(target, 250, false, false))
- {
- return false;
- }
- Index: java/l2r/gameserver/network/clientpackets/RequestRestartPoint.java
- ===================================================================
- --- java/l2r/gameserver/network/clientpackets/RequestRestartPoint.java (revision 518)
- +++ java/l2r/gameserver/network/clientpackets/RequestRestartPoint.java (working copy)
- @@ -232,7 +232,7 @@
- _log.warn("Player [" + activeChar.getName() + "] called RestartPointPacket - Fixed and he isn't festival participant!");
- return;
- }
- - if (activeChar.isGM())
- + if (activeChar.isGM() || activeChar.destroyItemByItemId("Feather", 10649, 1, activeChar, false) || activeChar.destroyItemByItemId("Feather", 13300, 1, activeChar, false) || activeChar.destroyItemByItemId("Feather", 13128, 1, activeChar, false))
- {
- activeChar.doRevive(100.00);
- }
- Index: java/l2r/gameserver/ai/L2ControllableMobAI.java
- ===================================================================
- --- java/l2r/gameserver/ai/L2ControllableMobAI.java (revision 518)
- +++ java/l2r/gameserver/ai/L2ControllableMobAI.java (working copy)
- @@ -426,7 +426,7 @@
- if (target.isPlayable())
- {
- // Check if the target isn't in silent move mode
- - if (((L2Playable) target).isSilentMoving())
- + if (((L2Playable) target).isSilentMovingAffected())
- {
- return false;
- }
- Index: java/l2r/gameserver/model/itemcontainer/ItemContainer.java
- ===================================================================
- --- java/l2r/gameserver/model/itemcontainer/ItemContainer.java (revision 518)
- +++ java/l2r/gameserver/model/itemcontainer/ItemContainer.java (working copy)
- @@ -104,6 +104,21 @@
- }
- /**
- + * @return true if player got item for self resurrection
- + */
- + public final boolean haveItemForSelfResurrection()
- + {
- + for (L2ItemInstance item : _items)
- + {
- + if ((item != null) && (item.getItem().isAllowSelfResurrection()))
- + {
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + /**
- * @param itemId the item Id
- * @return the items list from inventory by using its itemId
- */
- Index: java/l2r/gameserver/model/items/L2Item.java
- ===================================================================
- --- java/l2r/gameserver/model/items/L2Item.java (revision 518)
- +++ java/l2r/gameserver/model/items/L2Item.java (working copy)
- @@ -140,6 +140,7 @@
- private final boolean _elementable;
- private final boolean _questItem;
- private final boolean _freightable;
- + private final boolean _allow_self_resurrection;
- private final boolean _is_oly_restricted;
- private final boolean _for_npc;
- private final boolean _common;
- @@ -199,6 +200,7 @@
- _enchantable = set.getInt("enchant_enabled", 0);
- _questItem = set.getBoolean("is_questitem", false);
- _freightable = set.getBoolean("is_freightable", false);
- + _allow_self_resurrection = set.getBoolean("allow_self_resurrection", false);
- _is_oly_restricted = set.getBoolean("is_oly_restricted", false);
- _for_npc = set.getBoolean("for_npc", false);
- @@ -974,6 +976,11 @@
- return _freightable;
- }
- + public boolean isAllowSelfResurrection()
- + {
- + return _allow_self_resurrection;
- + }
- +
- public boolean isOlyRestrictedItem()
- {
- return _is_oly_restricted || Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId);
- Index: java/l2r/gameserver/model/actor/L2Summon.java
- ===================================================================
- --- java/l2r/gameserver/model/actor/L2Summon.java (revision 518)
- +++ java/l2r/gameserver/model/actor/L2Summon.java (working copy)
- @@ -313,7 +313,7 @@
- @Override
- public boolean doDie(L2Character killer)
- {
- - if (isNoblesseBlessed())
- + if (isNoblesseBlessedAffected())
- {
- stopEffects(L2EffectType.NOBLESSE_BLESSING);
- storeEffect(true);
- @@ -351,11 +351,6 @@
- }
- }
- - if (isPhoenixBlessed() && (getOwner() != null))
- - {
- - getOwner().reviveRequest(getOwner(), null, true);
- - }
- -
- DecayTaskManager.getInstance().addDecayTask(this);
- return true;
- }
- Index: java/l2r/gameserver/model/effects/EffectFlag.java
- ===================================================================
- --- java/l2r/gameserver/model/effects/EffectFlag.java (revision 518)
- +++ java/l2r/gameserver/model/effects/EffectFlag.java (working copy)
- @@ -24,9 +24,8 @@
- public enum EffectFlag
- {
- NONE,
- - CHARM_OF_COURAGE,
- CHARM_OF_LUCK,
- - PHOENIX_BLESSING,
- + RESURRECTION_SPECIAL,
- NOBLESS_BLESSING,
- SILENT_MOVE,
- PROTECTION_BLESSING,
- Index: java/l2r/gameserver/model/actor/L2Attackable.java
- ===================================================================
- --- java/l2r/gameserver/model/actor/L2Attackable.java (revision 518)
- +++ java/l2r/gameserver/model/actor/L2Attackable.java (working copy)
- @@ -1727,6 +1727,7 @@
- /**
- * @return True if a Dwarf use Sweep on the L2Attackable and if item can be spoiled.
- */
- + @Override
- public boolean isSweepActive()
- {
- return _sweepItems != null;
- Index: java/l2r/gameserver/model/effects/L2EffectType.java
- ===================================================================
- --- java/l2r/gameserver/model/effects/L2EffectType.java (revision 518)
- +++ java/l2r/gameserver/model/effects/L2EffectType.java (working copy)
- @@ -35,7 +35,6 @@
- CANCEL_ALL,
- CANCEL_DEBUFF,
- CHARM_OF_LUCK,
- - CHARMOFCOURAGE,
- CHAT_BLOCK,
- CLAN_GATE,
- CONFUSE_MOB_ONLY,
- @@ -77,7 +76,6 @@
- NONE,
- PARALYZE,
- PETRIFICATION,
- - PHOENIX_BLESSING,
- PHYSICAL_ATTACK_MUTE,
- PHYSICAL_MUTE,
- PROTECTION_BLESSING,
- @@ -86,6 +84,7 @@
- RELAXING,
- REMOVE_TARGET,
- RESTORATION_RANDOM,
- + RESURRECTION_SPECIAL,
- ROOT,
- SIGNET_EFFECT,
- SIGNET_GROUND,
- Index: java/l2r/gameserver/ai/L2SiegeGuardAI.java
- ===================================================================
- --- java/l2r/gameserver/ai/L2SiegeGuardAI.java (revision 518)
- +++ java/l2r/gameserver/ai/L2SiegeGuardAI.java (working copy)
- @@ -163,7 +163,7 @@
- if (target instanceof L2Playable)
- {
- // Check if the target isn't in silent move mode AND too far (>100)
- - if (((L2Playable) target).isSilentMoving() && !_actor.isInsideRadius(target, 250, false, false))
- + if (((L2Playable) target).isSilentMovingAffected() && !_actor.isInsideRadius(target, 250, false, false))
- {
- return false;
- }
- Index: java/l2r/gameserver/model/actor/L2Character.java
- ===================================================================
- --- java/l2r/gameserver/model/actor/L2Character.java (revision 518)
- +++ java/l2r/gameserver/model/actor/L2Character.java (working copy)
- @@ -2536,33 +2536,7 @@
- // Stop HP/MP/CP Regeneration task
- getStatus().stopHpMpRegeneration();
- - // Stop all active skills effects in progress on the L2Character,
- - // if the Character isn't affected by Soul of The Phoenix or Salvation
- - if (isPlayable() && ((L2Playable) this).isPhoenixBlessed())
- - {
- - if (((L2Playable) this).isCharmOfLuckAffected())
- - {
- - stopEffects(L2EffectType.CHARM_OF_LUCK);
- - }
- - if (((L2Playable) this).isNoblesseBlessed())
- - {
- - stopEffects(L2EffectType.NOBLESSE_BLESSING);
- - }
- - }
- - // Same thing if the Character isn't a Noblesse Blessed L2Playable
- - else if (isPlayable() && ((L2Playable) this).isNoblesseBlessed())
- - {
- - stopEffects(L2EffectType.NOBLESSE_BLESSING);
- -
- - if (((L2Playable) this).isCharmOfLuckAffected())
- - {
- - stopEffects(L2EffectType.CHARM_OF_LUCK);
- - }
- - }
- - else
- - {
- - stopAllEffectsExceptThoseThatLastThroughDeath();
- - }
- + stopAllEffectsExceptThoseThatLastThroughDeath();
- if (isPlayer() && (getActingPlayer().getAgathionId() != 0))
- {
- @@ -2585,27 +2559,7 @@
- }
- getAttackByList().clear();
- - // If character is PhoenixBlessed
- - // or has charm of courage inside siege battlefield (exact operation to be confirmed)
- - // a resurrection popup will show up
- - if (isSummon())
- - {
- - if (((L2Summon) this).isPhoenixBlessed() && (((L2Summon) this).getOwner() != null))
- - {
- - ((L2Summon) this).getOwner().reviveRequest(((L2Summon) this).getOwner(), null, true);
- - }
- - }
- - if (isPlayer())
- - {
- - if (((L2Playable) this).isPhoenixBlessed())
- - {
- - getActingPlayer().reviveRequest(getActingPlayer(), null, false);
- - }
- - else if (isAffected(EffectFlag.CHARM_OF_COURAGE) && getActingPlayer().isInSiege())
- - {
- - getActingPlayer().reviveRequest(getActingPlayer(), null, false);
- - }
- - }
- +
- try
- {
- if (_fusionSkill != null)
- @@ -2654,33 +2608,18 @@
- {
- setIsPendingRevive(false);
- setIsDead(false);
- - boolean restorefull = false;
- - if (isPlayable() && ((L2Playable) this).isPhoenixBlessed())
- + if ((Config.RESPAWN_RESTORE_CP > 0) && (getCurrentCp() < (getMaxCp() * Config.RESPAWN_RESTORE_CP)))
- {
- - restorefull = true;
- - stopEffects(L2EffectType.PHOENIX_BLESSING);
- + _status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);
- }
- - if (restorefull)
- + if ((Config.RESPAWN_RESTORE_HP > 0) && (getCurrentHp() < (getMaxHp() * Config.RESPAWN_RESTORE_HP)))
- {
- - _status.setCurrentCp(getCurrentCp()); // this is not confirmed, so just trigger regeneration
- - _status.setCurrentHp(getMaxHp()); // confirmed
- - _status.setCurrentMp(getMaxMp()); // and also confirmed
- + _status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
- }
- - else
- + if ((Config.RESPAWN_RESTORE_MP > 0) && (getCurrentMp() < (getMaxMp() * Config.RESPAWN_RESTORE_MP)))
- {
- - if ((Config.RESPAWN_RESTORE_CP > 0) && (getCurrentCp() < (getMaxCp() * Config.RESPAWN_RESTORE_CP)))
- - {
- - _status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);
- - }
- - if ((Config.RESPAWN_RESTORE_HP > 0) && (getCurrentHp() < (getMaxHp() * Config.RESPAWN_RESTORE_HP)))
- - {
- - _status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
- - }
- - if ((Config.RESPAWN_RESTORE_MP > 0) && (getCurrentMp() < (getMaxMp() * Config.RESPAWN_RESTORE_MP)))
- - {
- - _status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);
- - }
- + _status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);
- }
- // Start broadcast status
- @@ -7744,6 +7683,32 @@
- /**
- * Dummy method overriden in {@link L2PcInstance}
- + * @return {@code true} if current player can revive and shows 'To Village' button upon death, {@code false} otherwise.
- + */
- + public boolean canRevive()
- + {
- + return true;
- + }
- +
- + /**
- + * Dummy method overriden in {@link L2PcInstance}
- + * @param val
- + */
- + public void setCanRevive(boolean val)
- + {
- + }
- +
- + /**
- + * Dummy method overriden in {@link L2Attackable}
- + * @return {@code true} if there is a loot to sweep, {@code false} otherwise.
- + */
- + public boolean isSweepActive()
- + {
- + return false;
- + }
- +
- + /**
- + * Dummy method overriden in {@link L2PcInstance}
- * @return {@code true} if player is on event, {@code false} otherwise.
- */
- public boolean isOnEvent()
- Index: java/l2r/gameserver/model/actor/L2Playable.java
- ===================================================================
- --- java/l2r/gameserver/model/actor/L2Playable.java (revision 518)
- +++ java/l2r/gameserver/model/actor/L2Playable.java (working copy)
- @@ -35,6 +35,7 @@
- import l2r.gameserver.model.events.returns.TerminateReturn;
- import l2r.gameserver.model.quest.QuestState;
- import l2r.gameserver.model.skills.L2Skill;
- +import l2r.gameserver.network.serverpackets.EtcStatusUpdate;
- /**
- * This class represents all Playable characters in the world.<br>
- @@ -130,30 +131,39 @@
- // Stop HP/MP/CP Regeneration task
- getStatus().stopHpMpRegeneration();
- - // Stop all active skills effects in progress on the L2Character,
- - // if the Character isn't affected by Soul of The Phoenix or Salvation
- - if (isPhoenixBlessed())
- + if (isCharmOfLuckAffected())
- {
- - if (isCharmOfLuckAffected())
- - {
- - stopEffects(L2EffectType.CHARM_OF_LUCK);
- - }
- - if (isNoblesseBlessed())
- - {
- - stopEffects(L2EffectType.NOBLESSE_BLESSING);
- - }
- + stopEffects(L2EffectType.CHARM_OF_LUCK);
- }
- - // Same thing if the Character isn't a Noblesse Blessed L2Playable
- - else if (isNoblesseBlessed())
- +
- + boolean deleteBuffs = true;
- +
- + if (isNoblesseBlessedAffected())
- {
- stopEffects(L2EffectType.NOBLESSE_BLESSING);
- + deleteBuffs = false;
- + }
- + if (isResurrectSpecialAffected())
- + {
- + stopEffects(L2EffectType.RESURRECTION_SPECIAL);
- + deleteBuffs = false;
- + }
- + if (isPlayer())
- + {
- + L2PcInstance activeChar = getActingPlayer();
- - if (isCharmOfLuckAffected())
- + if (activeChar.hasCharmOfCourage())
- {
- - stopEffects(L2EffectType.CHARM_OF_LUCK);
- + if (activeChar.isInSiege())
- + {
- + getActingPlayer().reviveRequest(getActingPlayer(), null, false, 0);
- + }
- + activeChar.setCharmOfCourage(false);
- + activeChar.sendPacket(new EtcStatusUpdate(activeChar));
- }
- }
- - else
- +
- + if (deleteBuffs)
- {
- stopAllEffectsExceptThoseThatLastThroughDeath();
- }
- @@ -168,6 +178,7 @@
- // Notify Quest of L2Playable's death
- L2PcInstance actingPlayer = getActingPlayer();
- +
- if (!actingPlayer.isNotifyQuestOfDeathEmpty())
- {
- for (QuestState qs : actingPlayer.getNotifyQuestOfDeath())
- @@ -245,6 +256,7 @@
- // Notify L2Character AI
- getAI().notifyEvent(CtrlEvent.EVT_DEAD);
- + super.updateEffectIcons();
- return true;
- }
- @@ -319,23 +331,24 @@
- return true;
- }
- - // Support for Noblesse Blessing skill, where buffs are retained
- - // after resurrect
- - public final boolean isNoblesseBlessed()
- + // Support for Noblesse Blessing skill, where buffs are retained after resurrect
- + public final boolean isNoblesseBlessedAffected()
- {
- return _effects.isAffected(EffectFlag.NOBLESS_BLESSING);
- }
- - // Support for Soul of the Phoenix and Salvation skills
- - public final boolean isPhoenixBlessed()
- + /**
- + * @return {@code true} if char can resurrect by himself, {@code false} otherwise
- + */
- + public final boolean isResurrectSpecialAffected()
- {
- - return _effects.isAffected(EffectFlag.PHOENIX_BLESSING);
- + return isAffected(EffectFlag.RESURRECTION_SPECIAL);
- }
- /**
- * @return True if the Silent Moving mode is active.
- */
- - public boolean isSilentMoving()
- + public boolean isSilentMovingAffected()
- {
- return _effects.isAffected(EffectFlag.SILENT_MOVE);
- }
- Index: java/l2r/gameserver/ai/L2AttackableAI.java
- ===================================================================
- --- java/l2r/gameserver/ai/L2AttackableAI.java (revision 518)
- +++ java/l2r/gameserver/ai/L2AttackableAI.java (working copy)
- @@ -190,7 +190,7 @@
- if (target.isPlayable())
- {
- // Check if the AI isn't a Raid Boss, can See Silent Moving players and the target isn't in silent move mode
- - if (!(me.isRaid()) && !(me.canSeeThroughSilentMove()) && ((L2Playable) target).isSilentMoving())
- + if (!(me.isRaid()) && !(me.canSeeThroughSilentMove()) && ((L2Playable) target).isSilentMovingAffected())
- {
- return false;
- }
- Index: java/l2r/gameserver/network/SystemMessageId.java
- ===================================================================
- --- java/l2r/gameserver/network/SystemMessageId.java (revision 518)
- +++ java/l2r/gameserver/network/SystemMessageId.java (working copy)
- @@ -8842,7 +8842,7 @@
- * ID: 1510<br>
- * Message: $c1 is making an attempt at resurrection with $s2 experience points. Do you want to be resurrected?
- */
- - public static final SystemMessageId RESSURECTION_REQUEST_BY_C1_FOR_S2_XP;
- + public static final SystemMessageId RESURRECTION_REQUEST_BY_C1_FOR_S2_XP;
- /**
- * ID: 1511<br>
- @@ -16744,7 +16744,7 @@
- THIS_ITEM_CANT_BE_EQUIPPED_FOR_THE_OLYMPIAD_EVENT = new SystemMessageId(1507);
- THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT = new SystemMessageId(1508);
- THIS_SKILL_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT = new SystemMessageId(1509);
- - RESSURECTION_REQUEST_BY_C1_FOR_S2_XP = new SystemMessageId(1510);
- + RESURRECTION_REQUEST_BY_C1_FOR_S2_XP = new SystemMessageId(1510);
- MASTER_CANNOT_RES = new SystemMessageId(1511);
- CANNOT_RES_PET = new SystemMessageId(1512);
- RES_HAS_ALREADY_BEEN_PROPOSED = new SystemMessageId(1513);
- Index: java/l2r/gameserver/network/serverpackets/EtcStatusUpdate.java
- ===================================================================
- --- java/l2r/gameserver/network/serverpackets/EtcStatusUpdate.java (revision 518)
- +++ java/l2r/gameserver/network/serverpackets/EtcStatusUpdate.java (working copy)
- @@ -20,7 +20,6 @@
- import l2r.gameserver.enums.ZoneIdType;
- import l2r.gameserver.model.actor.instance.L2PcInstance;
- -import l2r.gameserver.model.effects.EffectFlag;
- /**
- * @author Luca Baldi
- @@ -44,7 +43,7 @@
- writeD(_activeChar.isInsideZone(ZoneIdType.DANGER_AREA) ? 1 : 0); // 1 = danger area
- writeD(_activeChar.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4]
- writeD(_activeChar.getExpertiseArmorPenalty()); // Armor Grade Penalty [1-4]
- - 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)
- + writeD(_activeChar.hasCharmOfCourage() ? 1 : 0); // 1 = charm of courage (allows resurrection on the same spot upon death on the siege battlefield)
- writeD(_activeChar.getDeathPenaltyBuffLevel()); // 1-15 death penalty, lvl (combat ability decreased due to death)
- writeD(_activeChar.getChargedSouls());
- }
- Index: java/l2r/gameserver/model/interfaces/IEventListener.java
- ===================================================================
- --- java/l2r/gameserver/model/interfaces/IEventListener.java (revision 0)
- +++ java/l2r/gameserver/model/interfaces/IEventListener.java (working copy)
- @@ -0,0 +1,49 @@
- +/*
- + * Copyright (C) 2004-2014 L2J Server
- + *
- + * This file is part of L2J Server.
- + *
- + * L2J Server is free software: you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation, either version 3 of the License, or
- + * (at your option) any later version.
- + *
- + * L2J Server is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + * General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package l2r.gameserver.model.interfaces;
- +
- +import l2r.gameserver.model.actor.instance.L2PcInstance;
- +
- +/**
- + * @author UnAfraid
- + */
- +public interface IEventListener
- +{
- + /**
- + * @return {@code true} if player is on event, {@code false} otherwise.
- + */
- + public boolean isOnEvent();
- +
- + /**
- + * @return {@code true} if player is blocked from leaving the game, {@code false} otherwise.
- + */
- + public boolean isBlockingExit();
- +
- + /**
- + * @return {@code true} if player is blocked from receiving death penalty upon death, {@code false} otherwise.
- + */
- + public boolean isBlockingDeathPenalty();
- +
- + /**
- + * @return {@code true} if player can revive after death, {@code false} otherwise.
- + */
- + public boolean canRevive();
- +
- + public L2PcInstance getPlayer();
- +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement