CitarCORE:
### Eclipse Workspace Patch 1.0
#P L2_GameServer
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 4422)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -828,6 +828,9 @@
private long _pvpFlagLasts;
+ /** Allow Player to receive Exp and Sp */
+ private boolean _canGetExpAndSp = true;
+
public void setPvpFlagLasts(long time)
{
_pvpFlagLasts = time;
@@ -15162,4 +15165,14 @@
L2DatabaseFactory.close(con);
}
}
-}
+
+ public final boolean canGetExpAndSp()
+ {
+ return _canGetExpAndSp;
+ }
+
+ public final void setCanGetExpAndSp(boolean b)
+ {
+ _canGetExpAndSp = b;
+ }
+}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 4422)
+++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
@@ -681,6 +681,15 @@
sp *= Config.L2JMOD_CHAMPION_REWARDS;
}
+ if (attacker instanceof L2PcInstance)
+ {
+ if (((L2PcInstance) attacker).canGetExpAndSp() == false)
+ {
+ exp = 0;
+ sp = 0;
+ }
+ }
+
// Check for an over-hit enabled strike
if (attacker instanceof L2PcInstance)
{
Index: java/com/l2jserver/gameserver/model/L2Party.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Party.java (revision 4422)
+++ java/com/l2jserver/gameserver/model/L2Party.java (working copy)
@@ -694,7 +694,8 @@
{
for (L2Character member : rewardedMembers)
{
- if(member.isDead()) continue;
+ if(member.isDead() || !((L2PcInstance) member).canGetExpAndSp())
+ continue;
penalty = 0;
--> http://pastebin.com/8JnfhLWf
CitarDATA:
package handlers.voicedcommandhandlers;
import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Allow player to enable or disable Experience and SP Gain.
*/
public class AllowExpAndSp implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS =
{
"allow_xp_sp"
};
public boolean useVoicedCommand(String command, L2PcInstance player, String params)
{
if (command.equalsIgnoreCase("allow_xp_sp"))
{
if (player != null)
{
if (player.canGetExp() == true)
{
player.setCanGetExp(false);
player.sendPacket(new CreatureSay(0, Say2.PARTY, "Server", "Exp and Sp Disabled."));
}
else
{
player.setCanGetExp(true);
player.sendPacket(new CreatureSay(0, Say2.PARTY, "Server", "Exp and Sp Enabled."));
}
}
}
return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}
--> http://pastebin.com/ZnDTs6E5
By crash_8675