Sync with L2jServer HighFive Mar 1st 2015.

This commit is contained in:
mobius
2015-03-01 22:48:14 +00:00
parent f14af24b41
commit 6fa0ed56e3
116 changed files with 971 additions and 676 deletions

View File

@@ -124,6 +124,8 @@ public final class EffectMasterHandler
ManaHealByLevel.class,
ManaHealOverTime.class,
ManaHealPercent.class,
MaxCp.class,
MaxHp.class,
MpConsumePerLevel.class,
Mute.class,
NoblesseBless.class,

View File

@@ -283,7 +283,15 @@ public class ClanBoard implements IWriteBoardHandler
@Override
public boolean writeCommunityBoardCommand(L2PcInstance activeChar, String arg1, String arg2, String arg3, String arg4, String arg5)
{
// TODO: Implement.
return false;
// the only Write bypass that comes to this handler is "Write Notice Set _ Content Content Content";
// arg1 = Set, arg2 = _
final L2Clan clan = activeChar.getClan();
if ((clan != null) && activeChar.isClanLeader())
{
clan.setNotice(arg3);
}
return true;
}
}

View File

@@ -52,25 +52,21 @@ public final class Detection extends AbstractEffect
final L2PcInstance player = info.getEffector().getActingPlayer();
final L2PcInstance target = info.getEffected().getActingPlayer();
final boolean hasParty = player.isInParty();
final boolean hasClan = player.getClanId() > 0;
final boolean hasAlly = player.getAllyId() > 0;
if (target.isInvisible())
{
if (hasParty && (target.isInParty()) && (player.getParty().getLeaderObjectId() == target.getParty().getLeaderObjectId()))
if (player.isInPartyWith(target))
{
return;
}
else if (hasClan && (player.getClanId() == target.getClanId()))
if (player.isInClanWith(target))
{
return;
}
else if (hasAlly && (player.getAllyId() == target.getAllyId()))
if (player.isInAllyWith(target))
{
return;
}
// Remove Hide.
target.getEffectList().stopSkillEffects(true, AbnormalType.HIDE);
}

View File

@@ -58,7 +58,7 @@ public final class HeadquarterCreate extends AbstractEffect
public void onStart(BuffInfo info)
{
final L2PcInstance player = info.getEffector().getActingPlayer();
if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
if (!player.isClanLeader())
{
return;
}

View File

@@ -0,0 +1,107 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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 DataPack 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 handlers.effecthandlers;
import com.l2jserver.gameserver.enums.EffectCalculationType;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.actor.stat.CharStat;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.skills.BuffInfo;
import com.l2jserver.gameserver.model.stats.Stats;
import com.l2jserver.gameserver.model.stats.functions.FuncAdd;
import com.l2jserver.gameserver.model.stats.functions.FuncMul;
/**
* @author Zealar
*/
public final class MaxCp extends AbstractEffect
{
private final double _power;
private final EffectCalculationType _type;
private final boolean _heal;
public MaxCp(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
{
super(attachCond, applyCond, set, params);
_type = params.getEnum("type", EffectCalculationType.class, EffectCalculationType.DIFF);
switch (_type)
{
case DIFF:
{
_power = params.getInt("power", 0);
break;
}
default:
{
_power = 1 + (params.getInt("power", 0) / 100.0);
}
}
_heal = params.getBoolean("heal", false);
if (params.isEmpty())
{
_log.warning(getClass().getSimpleName() + ": must have parameters.");
}
}
@Override
public void onStart(BuffInfo info)
{
final CharStat charStat = info.getEffected().getStat();
synchronized (charStat)
{
final double currentCp = info.getEffected().getCurrentCp();
switch (_type)
{
case DIFF:
{
charStat.getActiveChar().addStatFunc(new FuncAdd(Stats.MAX_CP, 1, this, _power, null));
if (_heal)
{
info.getEffected().setCurrentCp((currentCp + _power));
}
break;
}
case PER:
{
charStat.getActiveChar().addStatFunc(new FuncMul(Stats.MAX_CP, 1, this, _power, null));
if (_heal)
{
info.getEffected().setCurrentCp((currentCp * _power));
}
break;
}
}
}
}
@Override
public void onExit(BuffInfo info)
{
final CharStat charStat = info.getEffected().getStat();
synchronized (charStat)
{
charStat.getActiveChar().removeStatsOwner(this);
}
}
}

View File

@@ -0,0 +1,108 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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 DataPack 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 handlers.effecthandlers;
import com.l2jserver.gameserver.enums.EffectCalculationType;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.actor.stat.CharStat;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.skills.BuffInfo;
import com.l2jserver.gameserver.model.stats.Stats;
import com.l2jserver.gameserver.model.stats.functions.FuncAdd;
import com.l2jserver.gameserver.model.stats.functions.FuncMul;
/**
* @author Zealar
*/
public final class MaxHp extends AbstractEffect
{
private final double _power;
private final EffectCalculationType _type;
private final boolean _heal;
public MaxHp(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
{
super(attachCond, applyCond, set, params);
_type = params.getEnum("type", EffectCalculationType.class, EffectCalculationType.DIFF);
switch (_type)
{
case DIFF:
{
_power = params.getInt("power", 0);
break;
}
default:
{
_power = 1 + (params.getInt("power", 0) / 100.0);
}
}
_heal = params.getBoolean("heal", false);
if (params.isEmpty())
{
_log.warning(getClass().getSimpleName() + ": must have parameters.");
}
}
@Override
public void onStart(BuffInfo info)
{
final CharStat charStat = info.getEffected().getStat();
synchronized (charStat)
{
final double currentHp = info.getEffected().getCurrentHp();
switch (_type)
{
case DIFF:
{
charStat.getActiveChar().addStatFunc(new FuncAdd(Stats.MAX_HP, 1, this, _power, null));
if (_heal)
{
info.getEffected().setCurrentHp((currentHp + _power));
}
break;
}
case PER:
{
charStat.getActiveChar().addStatFunc(new FuncMul(Stats.MAX_HP, 1, this, _power, null));
if (_heal)
{
info.getEffected().setCurrentHp((currentHp * _power));
}
break;
}
}
}
}
@Override
public void onExit(BuffInfo info)
{
final CharStat charStat = info.getEffected().getStat();
synchronized (charStat)
{
charStat.getActiveChar().removeStatsOwner(this);
}
}
}

View File

@@ -28,9 +28,11 @@ import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.handler.ITargetTypeHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2SiegeFlagInstance;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.model.skills.targets.L2TargetType;
import com.l2jserver.gameserver.model.zone.ZoneId;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
@@ -42,9 +44,11 @@ public class AreaFriendly implements ITargetTypeHandler
public L2Object[] getTargetList(Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
List<L2Character> targetList = new ArrayList<>();
if (!checkTarget(activeChar, target) && (skill.getCastRange() >= 0))
L2PcInstance player = activeChar.getActingPlayer();
if (!checkTarget(player, target) && (skill.getCastRange() >= 0))
{
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
player.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
return EMPTY_TARGET_LIST;
}
@@ -56,11 +60,11 @@ public class AreaFriendly implements ITargetTypeHandler
};
}
if (activeChar.getActingPlayer().isInOlympiadMode())
if (player.getActingPlayer().isInOlympiadMode())
{
return new L2Character[]
{
activeChar
player
};
}
targetList.add(target); // Add target to target list
@@ -75,7 +79,7 @@ public class AreaFriendly implements ITargetTypeHandler
for (L2Character obj : objs)
{
if (!checkTarget(activeChar, obj) || (obj == activeChar))
if (!checkTarget(player, obj) || (obj == activeChar))
{
continue;
}
@@ -96,7 +100,7 @@ public class AreaFriendly implements ITargetTypeHandler
return targetList.toArray(new L2Character[targetList.size()]);
}
private boolean checkTarget(L2Character activeChar, L2Character target)
private boolean checkTarget(L2PcInstance activeChar, L2Character target)
{
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
{
@@ -108,29 +112,41 @@ public class AreaFriendly implements ITargetTypeHandler
return false;
}
if ((target.getActingPlayer() != null) && (target.getActingPlayer() != activeChar) && (target.getActingPlayer().inObserverMode() || target.getActingPlayer().isInOlympiadMode()))
{
return false;
}
if (target.isPlayable())
{
if ((target != activeChar) && activeChar.isInParty() && target.isInParty())
L2PcInstance targetPlayer = target.getActingPlayer();
if (activeChar == targetPlayer)
{
return (activeChar.getParty().getLeader() == target.getParty().getLeader());
return true;
}
if ((activeChar.getClanId() != 0) && (target.getClanId() != 0))
if (targetPlayer.inObserverMode() || targetPlayer.isInOlympiadMode())
{
return (activeChar.getClanId() == target.getClanId());
return false;
}
if ((activeChar.getAllyId() != 0) && (target.getAllyId() != 0))
if (activeChar.isInDuelWith(target))
{
return (activeChar.getAllyId() == target.getAllyId());
return false;
}
if ((target != activeChar) && (target.getActingPlayer().getPvpFlag() > 0))
if (activeChar.isInPartyWith(target))
{
return true;
}
if (target.isInsideZone(ZoneId.PVP))
{
return false;
}
if (activeChar.isInClanWith(target) || activeChar.isInAllyWith(target) || activeChar.isInCommandChannelWith(target))
{
return true;
}
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getKarma() > 0))
{
return false;
}
@@ -152,4 +168,4 @@ public class AreaFriendly implements ITargetTypeHandler
{
return L2TargetType.AREA_FRIENDLY;
}
}
}