Sync with L2jServer HighFive Jun 14th 2015.

This commit is contained in:
MobiusDev
2015-06-14 11:51:57 +00:00
parent a3707acaaa
commit 166d6ff9d4
48 changed files with 675 additions and 356 deletions

View File

@@ -157,6 +157,7 @@ public final class EffectMasterHandler
Resurrection.class,
ResurrectionSpecial.class,
Root.class,
RunAway.class,
ServitorShare.class,
SetSkill.class,
ShilensBreath.class,

View File

@@ -217,9 +217,8 @@ public class ClanBoard implements IWriteBoardHandler
}
i = 0;
int nbp;
nbp = ClanTable.getInstance().getClans().length / 8;
if ((nbp * 8) != ClanTable.getInstance().getClans().length)
int nbp = ClanTable.getInstance().getClanCount() / 8;
if ((nbp * 8) != ClanTable.getInstance().getClanCount())
{
nbp++;
}

View File

@@ -86,9 +86,9 @@ public final class HomeBoard implements IParseBoardHandler
CommunityBoardHandler.getInstance().addBypass(activeChar, "Home", command);
String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/" + customPath + "home.html");
html = html.replaceAll("%fav_count%", String.valueOf(getFavoriteCount(activeChar)));
html = html.replaceAll("%region_count%", String.valueOf(getRegionCount(activeChar)));
html = html.replaceAll("%clan_count%", String.valueOf(getClansCount()));
html = html.replaceAll("%fav_count%", Integer.toString(getFavoriteCount(activeChar)));
html = html.replaceAll("%region_count%", Integer.toString(getRegionCount(activeChar)));
html = html.replaceAll("%clan_count%", Integer.toString(ClanTable.getInstance().getClanCount()));
CommunityBoardHandler.separateAndSend(html, activeChar);
}
else if (command.startsWith("_bbstop;"))
@@ -206,13 +206,4 @@ public final class HomeBoard implements IParseBoardHandler
{
return 0; // TODO: Implement.
}
/**
* Gets the clans count.
* @return the clans count
*/
private static int getClansCount()
{
return ClanTable.getInstance().getClans().length;
}
}

View File

@@ -18,12 +18,8 @@
*/
package handlers.effecthandlers;
import com.l2jserver.Config;
import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.ai.CtrlEvent;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.enums.Race;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.actor.instance.L2DefenderInstance;
import com.l2jserver.gameserver.model.actor.instance.L2FortCommanderInstance;
@@ -33,7 +29,6 @@ import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.effects.EffectFlag;
import com.l2jserver.gameserver.model.effects.L2EffectType;
import com.l2jserver.gameserver.model.skills.BuffInfo;
import com.l2jserver.gameserver.util.Util;
/**
* Fear effect implementation.
@@ -41,8 +36,6 @@ import com.l2jserver.gameserver.util.Util;
*/
public final class Fear extends AbstractEffect
{
public static final int FEAR_RANGE = 500;
public Fear(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
{
super(attachCond, applyCond, set, params);
@@ -77,7 +70,7 @@ public final class Fear extends AbstractEffect
@Override
public boolean onActionTime(BuffInfo info)
{
fearAction(info, false);
info.getEffected().getAI().notifyEvent(CtrlEvent.EVT_AFRAID, info.getEffector(), false);
return false;
}
@@ -89,34 +82,6 @@ public final class Fear extends AbstractEffect
info.getEffected().abortCast();
}
info.getEffected().getAI().notifyEvent(CtrlEvent.EVT_AFRAID);
fearAction(info, true);
}
private void fearAction(BuffInfo info, boolean start)
{
double radians = Math.toRadians(start ? Util.calculateAngleFrom(info.getEffector(), info.getEffected()) : Util.convertHeadingToDegree(info.getEffected().getHeading()));
int posX = (int) (info.getEffected().getX() + (FEAR_RANGE * Math.cos(radians)));
int posY = (int) (info.getEffected().getY() + (FEAR_RANGE * Math.sin(radians)));
int posZ = info.getEffected().getZ();
if (!info.getEffected().isPet())
{
info.getEffected().setRunning();
}
// If pathfinding enabled the creature will go to the defined destination (retail like).
// Otherwise it will go to the nearest obstacle.
final Location destination;
if (Config.PATHFINDING > 0)
{
destination = new Location(posX, posY, posZ, info.getEffected().getInstanceId());
}
else
{
destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), posX, posY, posZ, info.getEffected().getInstanceId());
}
info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
info.getEffected().getAI().notifyEvent(CtrlEvent.EVT_AFRAID, info.getEffector(), true);
}
}

View File

@@ -47,7 +47,6 @@ public final class Grow extends AbstractEffect
if (info.getEffected().isNpc())
{
L2Npc npc = (L2Npc) info.getEffected();
npc.setCollisionHeight(npc.getTemplate().getCollisionHeight());
npc.setCollisionRadius(npc.getTemplate().getfCollisionRadius());
}
}
@@ -58,7 +57,6 @@ public final class Grow extends AbstractEffect
if (info.getEffected().isNpc())
{
L2Npc npc = (L2Npc) info.getEffected();
npc.setCollisionHeight(npc.getTemplate().getCollisionHeightGrown());
npc.setCollisionRadius(npc.getTemplate().getCollisionRadiusGrown());
}
}

View File

@@ -0,0 +1,75 @@
/*
* 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.ai.CtrlEvent;
import com.l2jserver.gameserver.ai.L2AttackableAI;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.skills.BuffInfo;
import com.l2jserver.util.Rnd;
/**
* Run Away effect implementation.
* @author Zoey76
*/
public final class RunAway extends AbstractEffect
{
private final int _power;
private final int _time;
public RunAway(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
{
super(attachCond, applyCond, set, params);
_power = params.getInt("power", 0);
_time = params.getInt("time", 0);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void onStart(BuffInfo info)
{
if (!info.getEffected().isAttackable())
{
return;
}
if (Rnd.get(100) > _power)
{
return;
}
if (info.getEffected().isCastingNow() && info.getEffected().canAbortCast())
{
info.getEffected().abortCast();
}
((L2AttackableAI) info.getEffected().getAI()).setFearTime(_time);
info.getEffected().getAI().notifyEvent(CtrlEvent.EVT_AFRAID, info.getEffector(), true);
}
}