0 Matim Posted February 19, 2010 Posted February 19, 2010 And maybe cup of tea, ok? First of all, you have to put ALL proper information before posting (even if these informations are useless - we have to respect rules all the time) You can sync it from aother projects Core SVN and add it into your source.
0 xAddytzu Posted February 19, 2010 Posted February 19, 2010 Index: C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/actor/instance/L2PlayableInstance.java =================================================================== --- C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/actor/instance/L2PlayableInstance.java (revision 1617) +++ C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/actor/instance/L2PlayableInstance.java (working copy) @@ -37,6 +37,7 @@ private boolean _isNoblesseBlessed = false; // for Noblesse Blessing skill, restores buffs after death private boolean _getCharmOfLuck = false; // Charm of Luck - During a Raid/Boss war, decreased chance for death penalty + private boolean _isPhoenixBlessed = false; // for Soul of The Phoenix or Salvation buffs /** * Constructor of L2PlayableInstance (use L2Character constructor).<BR><BR> * @@ -173,6 +174,27 @@ setIsNoblesseBlessed(false); updateAbnormalEffect(); } + + // Support for Soul of the Phoenix and Salvation skills + public final boolean isPhoenixBlessed() { return _isPhoenixBlessed; } + public final void setIsPhoenixBlessed(boolean value) { _isPhoenixBlessed = value; } + + public final void startPhoenixBlessing() + { + setIsPhoenixBlessed(true); + updateAbnormalEffect(); + } + + public final void stopPhoenixBlessing(L2Effect effect) + { + if (effect == null) + stopEffects(L2Effect.EffectType.PHOENIX_BLESSING); + else + removeEffect(effect); + + setIsPhoenixBlessed(false); + updateAbnormalEffect(); + } public abstract boolean destroyItemByItemId(String process, int itemId, int count, L2Object reference, boolean sendMessage); public abstract boolean destroyItem(String process, int objectId, int count, L2Object reference, boolean sendMessage); Index: C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1617) +++ C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -9379,7 +9379,10 @@ if((Pet && getPet() != null && getPet().isDead()) || (!Pet && isDead())) { _reviveRequested = 1; - _revivePower = Formulas.getInstance().calculateSkillResurrectRestorePercent(skill.getPower(), Reviver.getWIT()); + if (isPhoenixBlessed()) + _revivePower=100; + else + _revivePower = Formulas.getInstance().calculateSkillResurrectRestorePercent(skill.getPower(), Reviver.getWIT()); _revivePet = Pet; sendPacket(new ConfirmDlg(SystemMessageId.RESSURECTION_REQUEST.getId(),Reviver.getName())); } @@ -9389,6 +9392,12 @@ { if (_reviveRequested != 1 || (!isDead() && !_revivePet) || (_revivePet && getPet() != null && !getPet().isDead())) return; + //If character refuses a PhoenixBless autoress, cancell all buffs he had + if (answer == 0 && isPhoenixBlessed()) + { + stopPhoenixBlessing(null); + stopAllEffects(); + } if (answer == 1) { if (!_revivePet) Index: C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/L2Effect.java =================================================================== --- C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/L2Effect.java (revision 1617) +++ C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/L2Effect.java (working copy) @@ -74,6 +74,7 @@ SILENCE_MAGIC_PHYSICAL, BETRAY, NOBLESSE_BLESSING, + PHOENIX_BLESSING, PETRIFICATION, BLUFF, BATTLE_FORCE, Index: C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/L2Character.java =================================================================== --- C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/L2Character.java (revision 1617) +++ C:/Documents and Settings/EdeN/Documenti/EclipseWorkspace/L2_GameServer_t1/java/net/sf/l2j/gameserver/model/L2Character.java (working copy) @@ -1576,9 +1576,17 @@ getStatus().stopHpMpRegeneration(); // Stop all active skills effects in progress on the L2Character, - // if the Character isn't a Noblesse Blessed L2PlayableInstance - if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isNoblesseBlessed()) - { + // if the Character isn't affected by Soul of The Phoenix or Salvation + if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isPhoenixBlessed()) + { + if (((L2PlayableInstance)this).getCharmOfLuck()) //remove Lucky Charm if player has SoulOfThePhoenix/Salvation buff + ((L2PlayableInstance)this).stopCharmOfLuck(null); + if (((L2PlayableInstance)this).isNoblesseBlessed()) + ((L2PlayableInstance)this).stopNoblesseBlessing(null); + } + // Same thing if the Character isn't a Noblesse Blessed L2PlayableInstance + else if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isNoblesseBlessed()) + { ((L2PlayableInstance)this).stopNoblesseBlessing(null); if (((L2PlayableInstance)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff ((L2PlayableInstance)this).stopCharmOfLuck(null); @@ -1605,6 +1613,14 @@ getNotifyQuestOfDeath().clear(); getAttackByList().clear(); + //If character is PhoenixBlessed a resurrection popup will show up + if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isPhoenixBlessed()) + { + if (this instanceof L2Summon) { + ((L2Summon)this).getOwner().reviveRequest(((L2Summon)this).getOwner(), null, true); + } + else ((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false); + } return true; } @@ -1618,11 +1634,15 @@ if (!isTeleporting()) { setIsPendingRevive(false); - - _status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP); + + if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isPhoenixBlessed()) + { + ((L2PlayableInstance)this).stopPhoenixBlessing(null); + } + //_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP); _status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP); - //_Status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP); - + //_Status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP); + // Start broadcast status broadcastPacket(new Revive(this)); if (getWorldRegion() != null) XML <skill id="438" levels="1" name="Soul of the Phoenix"> <!-- Description(s): Revives target from death and restores them to full health, retaining all buff/debuff effects except for Noblesse Blessing and Lucky Charm. Consumes 1 Blood of the Phoenix. --> <set name="magicLvl" val="79"/> <set name="mpConsume" val="250"/> <set name="itemConsumeId" val="8873"/> <set name="itemConsumeCount" val="1"/> <set name="power" val="0.0"/> <set name="target" val="TARGET_SELF"/> <set name="reuseDelay" val="3600000"/> <set name="hitTime" val="4000"/> <set name="skillType" val="BUFF"/> <set name="isMagic" val="true"/> <set name="operateType" val="OP_ACTIVE"/> <set name="buffDuration" val="1800000"/> <set name="castRange" val="400"/> <set name="effectRange" val="900"/> <for> <effect count="1" name="PhoenixBless" time="1800" val="0"/> </for> </skill> <skill id="1410" levels="1" name="Salvation"> <!-- Some values need to be confirmed --> <set name="magicLvl" val="79"/> <set name="mpConsume" val="87"/> <set name="itemConsumeId" val="8874"/> <set name="itemConsumeCount" val="2"/> <set name="power" val="0.0"/> <set name="target" val="TARGET_ONE"/> <set name="reuseDelay" val="3600000"/> <set name="hitTime" val="4000"/> <!--guessing--> <set name="skillType" val="BUFF"/> <set name="isMagic" val="true"/> <set name="operateType" val="OP_ACTIVE"/> <set name="buffDuration" val="3600000"/> <set name="castRange" val="400"/> <set name="effectRange" val="900"/> <for> <effect count="1" name="PhoenixBless" time="3600" val="0"/> </for> </skill> You will also need a new class, net.sf.l2j.gameserver.skills.effects.EffectPhoenixBless.java (Attached) /* * This program 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 2, or (at your option) * any later version. * * This program 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package net.sf.l2j.gameserver.skills.effects; import net.sf.l2j.gameserver.model.L2Effect; import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; import net.sf.l2j.gameserver.skills.Env; /** * @author Faror */ final class EffectPhoenixBless extends L2Effect { public EffectPhoenixBless(Env env, EffectTemplate template) { super(env, template); } @Override public EffectType getEffectType() { return EffectType.PHOENIX_BLESSING; } /** Notify started */ @Override public void onStart() { if (getEffected() instanceof L2PlayableInstance) ((L2PlayableInstance)getEffected()).startPhoenixBlessing(); } /** Notify exited */ @Override public void onExit() { if (getEffected() instanceof L2PlayableInstance) ((L2PlayableInstance)getEffected()).stopPhoenixBlessing(this); } @Override public boolean onActionTime() { // just stop this effect return false; } }
0 Commodus Posted February 19, 2010 Posted February 19, 2010 Addy , use [ code ] , [ /code ] next time.
0 Carbo Posted February 20, 2010 Author Posted February 20, 2010 thanx alot guys, specially to you addytzu
Question
Carbo
Salvation and phoenix blessing Core side.
6 answers to this question
Recommended Posts