Code improvements.
This commit is contained in:
@@ -50,14 +50,11 @@ public class L2ArtefactInstanceAction implements IActionHandler
|
||||
{
|
||||
activeChar.setTarget(target);
|
||||
}
|
||||
else if (interact)
|
||||
// Calculate the distance between the L2PcInstance and the L2NpcInstance
|
||||
else if (interact && !((L2Npc) target).canInteract(activeChar))
|
||||
{
|
||||
// Calculate the distance between the L2PcInstance and the L2NpcInstance
|
||||
if (!((L2Npc) target).canInteract(activeChar))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.L2Event;
|
||||
@@ -88,8 +87,7 @@ public class L2NpcAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, target);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, target));
|
||||
}
|
||||
}
|
||||
else if (!target.isAutoAttackable(activeChar))
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.TvTEvent;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@@ -108,8 +107,7 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
activeChar.onActionRequest();
|
||||
}
|
||||
@@ -124,8 +122,7 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
public class L2StaticObjectInstanceAction implements IActionHandler
|
||||
{
|
||||
@Override
|
||||
public boolean action(L2PcInstance activeChar, final L2Object target, final boolean interact)
|
||||
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||
{
|
||||
final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target;
|
||||
if (staticObject.getType() < 0)
|
||||
|
||||
@@ -31,8 +31,7 @@ public class L2ItemInstanceActionShift implements IActionShiftHandler
|
||||
{
|
||||
if (activeChar.getAccessLevel().isGm())
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Item Info</font></center><br><table border=0>", "<tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Item ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Owner ID: </td><td>", String.valueOf(((L2ItemInstance) target).getOwnerId()), "</td></tr><tr><td>Location: </td><td>", String.valueOf(((L2ItemInstance) target).getLocation()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>"));
|
||||
activeChar.sendPacket(html);
|
||||
activeChar.sendPacket(new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Item Info</font></center><br><table border=0>", "<tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Item ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Owner ID: </td><td>", String.valueOf(((L2ItemInstance) target).getOwnerId()), "</td></tr><tr><td>Location: </td><td>", String.valueOf(((L2ItemInstance) target).getLocation()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,7 @@ public class L2StaticObjectInstanceActionShift implements IActionShiftHandler
|
||||
{
|
||||
activeChar.setTarget(target);
|
||||
activeChar.sendPacket(new StaticObject((L2StaticObjectInstance) target));
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Static Object Info</font></center><br><table border=0><tr><td>Coords X,Y,Z: </td><td>", String.valueOf(target.getX()), ", ", String.valueOf(target.getY()), ", ", String.valueOf(target.getZ()), "</td></tr><tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Static Object ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Mesh Index: </td><td>", String.valueOf(((L2StaticObjectInstance) target).getMeshIndex()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>"));
|
||||
activeChar.sendPacket(html);
|
||||
activeChar.sendPacket(new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Static Object Info</font></center><br><table border=0><tr><td>Coords X,Y,Z: </td><td>", String.valueOf(target.getX()), ", ", String.valueOf(target.getY()), ", ", String.valueOf(target.getZ()), "</td></tr><tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Static Object ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Mesh Index: </td><td>", String.valueOf(((L2StaticObjectInstance) target).getMeshIndex()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -287,16 +287,11 @@ public class AdminAdmin implements IAdminCommandHandler
|
||||
showConfigPage(activeChar);
|
||||
}
|
||||
}
|
||||
else if (command.startsWith("admin_gmon"))
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
else if (command.startsWith("admin_worldchat"))
|
||||
{
|
||||
final StringTokenizer st = new StringTokenizer(command);
|
||||
st.nextToken(); // admin_worldchat
|
||||
final String subCmd = st.hasMoreTokens() ? st.nextToken() : "";
|
||||
switch (subCmd)
|
||||
switch (st.hasMoreTokens() ? st.nextToken() : "")
|
||||
{
|
||||
case "shout":
|
||||
{
|
||||
@@ -372,6 +367,10 @@ public class AdminAdmin implements IAdminCommandHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (command.startsWith("admin_gmon"))
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,8 +83,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
||||
}
|
||||
case "admin_announces":
|
||||
{
|
||||
final String subCmd = st.hasMoreTokens() ? st.nextToken() : "";
|
||||
switch (subCmd)
|
||||
switch (st.hasMoreTokens() ? st.nextToken() : "")
|
||||
{
|
||||
case "add":
|
||||
{
|
||||
|
||||
@@ -138,9 +138,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(22);
|
||||
final int page = Integer.parseInt(val);
|
||||
listCharacters(activeChar, page);
|
||||
listCharacters(activeChar, Integer.parseInt(command.substring(22)));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -152,8 +150,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(21);
|
||||
findCharacter(activeChar, val);
|
||||
findCharacter(activeChar, command.substring(21));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{ // Case of empty character name
|
||||
@@ -165,8 +162,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(14);
|
||||
findCharactersPerIp(activeChar, val);
|
||||
findCharactersPerIp(activeChar, command.substring(14));
|
||||
}
|
||||
catch (Exception e)
|
||||
{ // Case of empty or malformed IP number
|
||||
@@ -178,8 +174,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
findCharactersPerAccount(activeChar, val);
|
||||
findCharactersPerAccount(activeChar, command.substring(19));
|
||||
}
|
||||
catch (Exception e)
|
||||
{ // Case of empty or malformed player name
|
||||
@@ -212,9 +207,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(15);
|
||||
final int karma = Integer.parseInt(val);
|
||||
setTargetKarma(activeChar, karma);
|
||||
setTargetKarma(activeChar, Integer.parseInt(command.substring(15)));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -570,9 +563,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
final boolean changeCreateExpiryTime = st.nextToken().equalsIgnoreCase("create");
|
||||
|
||||
final String playerName = st.nextToken();
|
||||
L2PcInstance player = null;
|
||||
player = L2World.getInstance().getPlayer(playerName);
|
||||
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(playerName);
|
||||
if (player == null)
|
||||
{
|
||||
final String updateQuery = "UPDATE characters SET " + (changeCreateExpiryTime ? "clan_create_expiry_time" : "clan_join_expiry_time") + " WHERE char_name=? LIMIT 1";
|
||||
@@ -751,9 +742,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
L2Object target;
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
final int objId = Integer.parseInt(val);
|
||||
target = L2World.getInstance().getPet(objId);
|
||||
target = L2World.getInstance().getPet(Integer.parseInt(command.substring(19)));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -888,8 +877,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||
return false;
|
||||
}
|
||||
final L2Playable playable = ((L2Playable) target);
|
||||
playable.updatePvPFlag(Math.abs(playable.getPvpFlag() - 1));
|
||||
((L2Playable) target).updatePvPFlag(Math.abs(((L2Playable) target).getPvpFlag() - 1));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1079,8 +1067,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
|
||||
if (target instanceof L2PcInstance)
|
||||
{
|
||||
final L2PcInstance player = (L2PcInstance) target;
|
||||
gatherCharacterInfo(activeChar, player, "charedit.htm");
|
||||
gatherCharacterInfo(activeChar, ((L2PcInstance) target), "charedit.htm");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1378,8 +1365,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = (prime * result) + ((ip == null) ? 0 : ip.hashCode());
|
||||
int result = (prime * 1) + ((ip == null) ? 0 : ip.hashCode());
|
||||
for (int[] array : tracert)
|
||||
{
|
||||
result = (prime * result) + Arrays.hashCode(array);
|
||||
@@ -1455,8 +1441,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
html.replace("%race%", target.getTemplate().getRace().toString());
|
||||
if (target instanceof L2PetInstance)
|
||||
{
|
||||
final int objId = target.getActingPlayer().getObjectId();
|
||||
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + objId + "\">view</a>");
|
||||
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + target.getActingPlayer().getObjectId() + "\">view</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2ChestInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.CharInfo;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
|
||||
@@ -227,8 +226,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
||||
for (L2PcInstance player : plrs)
|
||||
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
|
||||
{
|
||||
if (!player.isGM())
|
||||
{
|
||||
@@ -246,8 +244,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
||||
for (L2PcInstance player : plrs)
|
||||
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
|
||||
{
|
||||
player.stopAbnormalVisualEffect(AbnormalVisualEffect.PARALYZE);
|
||||
player.setIsParalyzed(false);
|
||||
@@ -363,8 +360,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
activeChar.stopSkillEffects((val == 0) && sendMessage, 7029);
|
||||
if ((val >= 1) && (val <= 4))
|
||||
{
|
||||
final Skill gmSpeedSkill = SkillData.getInstance().getSkill(7029, val);
|
||||
activeChar.doSimultaneousCast(gmSpeedSkill);
|
||||
activeChar.doSimultaneousCast(SkillData.getInstance().getSkill(7029, val));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -386,8 +382,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
activeChar.teleToLocation(activeChar.getLocation());
|
||||
final CharInfo info1 = new CharInfo(activeChar);
|
||||
activeChar.broadcastPacket(info1);
|
||||
final UserInfo info2 = new UserInfo(activeChar);
|
||||
activeChar.sendPacket(info2);
|
||||
activeChar.sendPacket(new UserInfo(activeChar));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -401,15 +396,13 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
|
||||
final CharInfo info1 = new CharInfo(activeChar);
|
||||
activeChar.broadcastPacket(info1);
|
||||
final UserInfo info2 = new UserInfo(activeChar);
|
||||
activeChar.sendPacket(info2);
|
||||
activeChar.sendPacket(new UserInfo(activeChar));
|
||||
}
|
||||
else if (command.equals("admin_clearteams"))
|
||||
{
|
||||
try
|
||||
{
|
||||
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
||||
for (L2PcInstance player : plrs)
|
||||
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
|
||||
{
|
||||
player.setTeam(Team.NONE);
|
||||
player.broadcastUserInfo();
|
||||
@@ -430,9 +423,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
radius = Integer.parseInt(st.nextToken());
|
||||
}
|
||||
final Team team = Team.valueOf(val.toUpperCase());
|
||||
final Collection<L2Character> plrs = activeChar.getKnownList().getKnownCharactersInRadius(radius);
|
||||
|
||||
for (L2Character player : plrs)
|
||||
for (L2Character player : activeChar.getKnownList().getKnownCharactersInRadius(radius))
|
||||
{
|
||||
player.setTeam(team);
|
||||
}
|
||||
@@ -648,9 +639,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
final L2Npc npc = (L2Npc) target;
|
||||
try
|
||||
{
|
||||
final String type = st.nextToken();
|
||||
final int diplayeffect = Integer.parseInt(type);
|
||||
npc.setDisplayEffect(diplayeffect);
|
||||
npc.setDisplayEffect(Integer.parseInt(st.nextToken()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -709,8 +698,7 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
return false;
|
||||
}
|
||||
final L2Character character = (L2Character) target;
|
||||
character.broadcastPacket(new SocialAction(character.getObjectId(), action));
|
||||
((L2Character) target).broadcastPacket(new SocialAction(((L2Character) target).getObjectId(), action));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -781,11 +769,6 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
|
||||
private void showMainPage(L2PcInstance activeChar, String command)
|
||||
{
|
||||
String filename = "effects_menu";
|
||||
if (command.contains("social"))
|
||||
{
|
||||
filename = "social";
|
||||
}
|
||||
AdminHtml.showAdminHtml(activeChar, filename + ".htm");
|
||||
AdminHtml.showAdminHtml(activeChar, (command.contains("social") ? "social" : "effects_menu") + ".htm");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,8 +321,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
player.teleToLocation(player.getLocation(), true);
|
||||
final CharInfo info1 = new CharInfo(player);
|
||||
player.broadcastPacket(info1);
|
||||
final UserInfo info2 = new UserInfo(player);
|
||||
player.sendPacket(info2);
|
||||
player.sendPacket(new UserInfo(player));
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
@@ -337,8 +336,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
player.spawnMe(player.getX(), player.getY(), player.getZ());
|
||||
final CharInfo info1 = new CharInfo(player);
|
||||
player.broadcastPacket(info1);
|
||||
final UserInfo info2 = new UserInfo(player);
|
||||
player.sendPacket(info2);
|
||||
player.sendPacket(new UserInfo(player));
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
|
||||
@@ -52,8 +52,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(16);
|
||||
if (!adminAddExpSp(activeChar, val))
|
||||
if (!adminAddExpSp(activeChar, command.substring(16)))
|
||||
{
|
||||
activeChar.sendMessage("Usage: //add_exp_sp exp sp");
|
||||
}
|
||||
@@ -67,8 +66,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
if (!adminRemoveExpSP(activeChar, val))
|
||||
if (!adminRemoveExpSP(activeChar, command.substring(19)))
|
||||
{
|
||||
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
|
||||
}
|
||||
|
||||
@@ -106,16 +106,8 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
}
|
||||
}
|
||||
|
||||
L2NpcTemplate npc1 = null;
|
||||
if (mid1 != 0)
|
||||
{
|
||||
npc1 = NpcData.getInstance().getTemplate(mid1);
|
||||
}
|
||||
L2NpcTemplate npc2 = null;
|
||||
if (mid2 != 0)
|
||||
{
|
||||
npc2 = NpcData.getInstance().getTemplate(mid2);
|
||||
}
|
||||
final L2NpcTemplate npc1 = mid1 != 0 ? NpcData.getInstance().getTemplate(mid1) : null;
|
||||
final L2NpcTemplate npc2 = mid2 != 0 ? NpcData.getInstance().getTemplate(mid2) : null;
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.Fort;
|
||||
@@ -124,8 +123,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
||||
}
|
||||
else if (command.equalsIgnoreCase("admin_removefort"))
|
||||
{
|
||||
final L2Clan clan = fort.getOwnerClan();
|
||||
if (clan != null)
|
||||
if (fort.getOwnerClan() != null)
|
||||
{
|
||||
fort.removeOwner(true);
|
||||
}
|
||||
@@ -190,5 +188,4 @@ public class AdminFortSiege implements IAdminCommandHandler
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -112,8 +112,7 @@ public class AdminGmChat implements IAdminCommandHandler
|
||||
offset = 13;
|
||||
}
|
||||
text = command.substring(offset);
|
||||
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text);
|
||||
AdminData.getInstance().broadcastToGMs(cs);
|
||||
AdminData.getInstance().broadcastToGMs((new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text)));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
|
||||
@@ -39,12 +39,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
|
||||
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||
final String actualCommand = st.nextToken(); // Get actual command
|
||||
|
||||
String val = "";
|
||||
if (st.countTokens() >= 1)
|
||||
{
|
||||
val = st.nextToken();
|
||||
}
|
||||
|
||||
final String val = st.countTokens() >= 1 ? st.nextToken() : "";
|
||||
if (actualCommand.equalsIgnoreCase("admin_kill_tiat"))
|
||||
{
|
||||
GraciaSeedsManager.getInstance().increaseSoDTiatKilled();
|
||||
|
||||
@@ -68,8 +68,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
final int grandBossId = Integer.parseInt(st.nextToken());
|
||||
manageHtml(activeChar, grandBossId);
|
||||
manageHtml(activeChar, Integer.parseInt(st.nextToken()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -138,9 +137,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
|
||||
{
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
final int grandBossId = Integer.parseInt(st.nextToken());
|
||||
|
||||
switch (grandBossId)
|
||||
switch (Integer.parseInt(st.nextToken()))
|
||||
{
|
||||
case ANTHARAS:
|
||||
{
|
||||
|
||||
@@ -50,8 +50,7 @@ public class AdminHeal implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String healTarget = command.substring(11);
|
||||
handleHeal(activeChar, healTarget);
|
||||
handleHeal(activeChar, command.substring(11));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
|
||||
@@ -96,8 +96,7 @@ public class AdminHtml implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final File file = new File(Config.DATAPACK_ROOT, path);
|
||||
content = HtmCache.getInstance().loadFile(file);
|
||||
content = HtmCache.getInstance().loadFile((new File(Config.DATAPACK_ROOT, path)));
|
||||
}
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||
if (content != null)
|
||||
@@ -116,5 +115,4 @@ public class AdminHtml implements IAdminCommandHandler
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,12 +40,7 @@ public class AdminLevel implements IAdminCommandHandler
|
||||
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||
final String actualCommand = st.nextToken(); // Get actual command
|
||||
|
||||
String val = "";
|
||||
if (st.countTokens() >= 1)
|
||||
{
|
||||
val = st.nextToken();
|
||||
}
|
||||
|
||||
final String val = st.countTokens() >= 1 ? st.nextToken() : "";
|
||||
if (actualCommand.equalsIgnoreCase("admin_add_level"))
|
||||
{
|
||||
try
|
||||
|
||||
@@ -79,9 +79,7 @@ public class AdminMenu implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String targetName = command.substring(23);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(targetName);
|
||||
teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you.");
|
||||
teleportCharacter(L2World.getInstance().getPlayer(command.substring(23)), activeChar.getLocation(), activeChar, "Admin is teleporting you.");
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -194,8 +192,7 @@ public class AdminMenu implements IAdminCommandHandler
|
||||
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
||||
return false;
|
||||
}
|
||||
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
|
||||
ach.useAdminCommand(subCommand + command.substring(14), activeChar);
|
||||
AdminCommandHandler.getInstance().getHandler(subCommand).useAdminCommand(subCommand + command.substring(14), activeChar);
|
||||
}
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
@@ -211,8 +208,7 @@ public class AdminMenu implements IAdminCommandHandler
|
||||
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
||||
return false;
|
||||
}
|
||||
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
|
||||
ach.useAdminCommand(subCommand + command.substring(16), activeChar);
|
||||
AdminCommandHandler.getInstance().getHandler(subCommand).useAdminCommand(subCommand + command.substring(16), activeChar);
|
||||
}
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
|
||||
@@ -95,8 +95,7 @@ public class AdminMobGroup implements IAdminCommandHandler
|
||||
{
|
||||
if (activeChar.getTarget() instanceof L2Character)
|
||||
{
|
||||
final L2Character target = (L2Character) activeChar.getTarget();
|
||||
attack(command, activeChar, target);
|
||||
attack(command, activeChar, ((L2Character) activeChar.getTarget()));
|
||||
}
|
||||
}
|
||||
else if (command.startsWith("admin_mobgroup_rnd"))
|
||||
@@ -141,8 +140,7 @@ public class AdminMobGroup implements IAdminCommandHandler
|
||||
*/
|
||||
private void showMainPage(L2PcInstance activeChar, String command)
|
||||
{
|
||||
final String filename = "mobgroup.htm";
|
||||
AdminHtml.showAdminHtml(activeChar, filename);
|
||||
AdminHtml.showAdminHtml(activeChar, "mobgroup.htm");
|
||||
}
|
||||
|
||||
private void returnToChar(String command, L2PcInstance activeChar)
|
||||
|
||||
@@ -139,23 +139,17 @@ public final class AdminPCBangPoints implements IAdminCommandHandler
|
||||
|
||||
if (range <= 0)
|
||||
{
|
||||
final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
|
||||
activeChar.sendMessage("You increased PC point(s) of all online players (" + count + ") by " + value + ".");
|
||||
activeChar.sendMessage("You increased PC point(s) of all online players (" + increaseForAll(L2World.getInstance().getPlayers(), value) + ") by " + value + ".");
|
||||
}
|
||||
else if (range > 0)
|
||||
{
|
||||
final int count = increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value);
|
||||
activeChar.sendMessage("You increased PC point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
|
||||
activeChar.sendMessage("You increased PC point(s) of all players (" + increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value) + ") in range " + range + " by " + value + ".");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
showMenuHtml(activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
showMenuHtml(activeChar);
|
||||
}
|
||||
showMenuHtml(activeChar);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -92,12 +92,7 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return i > 0;
|
||||
}
|
||||
|
||||
if (opCodeLong < 0)
|
||||
@@ -430,14 +425,7 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
case "$boid":
|
||||
{
|
||||
boat = activeChar.getBoat();
|
||||
if (boat != null)
|
||||
{
|
||||
value = String.valueOf(boat.getObjectId());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
value = boat != null ? String.valueOf(boat.getObjectId()) : "0";
|
||||
break;
|
||||
}
|
||||
case "$title":
|
||||
@@ -481,93 +469,44 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
if ((target != null) && (target instanceof L2Playable))
|
||||
{
|
||||
boat = ((L2Playable) target).getActingPlayer().getBoat();
|
||||
if (boat != null)
|
||||
{
|
||||
value = String.valueOf(boat.getObjectId());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
value = boat != null ? String.valueOf(boat.getObjectId()) : "0";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "$ttitle":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if ((target != null) && (target instanceof L2Character))
|
||||
{
|
||||
value = String.valueOf(((L2Character) target).getTitle());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
value = (target != null) && (target instanceof L2Character) ? String.valueOf(((L2Character) target).getTitle()) : "";
|
||||
break;
|
||||
}
|
||||
case "$tname":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
value = String.valueOf(target.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
value = target != null ? String.valueOf(target.getName()) : "";
|
||||
break;
|
||||
}
|
||||
case "$tx":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
value = String.valueOf(target.getX());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
value = target != null ? String.valueOf(target.getX()) : "0";
|
||||
break;
|
||||
}
|
||||
case "$ty":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
value = String.valueOf(target.getY());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
value = target != null ? String.valueOf(target.getY()) : "0";
|
||||
break;
|
||||
}
|
||||
case "$tz":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
value = String.valueOf(target.getZ());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
value = target != null ? String.valueOf(target.getZ()) : "0";
|
||||
break;
|
||||
}
|
||||
case "$theading":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
value = String.valueOf(target.getHeading());
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "0";
|
||||
}
|
||||
value = target != null ? String.valueOf(target.getHeading()) : "0";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,5 +213,4 @@ public class AdminPledge implements IAdminCommandHandler
|
||||
{
|
||||
AdminHtml.showAdminHtml(activeChar, "game_menu.htm");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -164,8 +164,7 @@ public class AdminPolymorph implements IAdminCommandHandler
|
||||
final L2Character Char = (L2Character) obj;
|
||||
final MagicSkillUse msk = new MagicSkillUse(Char, 1008, 1, 4000, 0);
|
||||
Char.broadcastPacket(msk);
|
||||
final SetupGauge sg = new SetupGauge(0, 4000);
|
||||
Char.sendPacket(sg);
|
||||
Char.sendPacket(new SetupGauge(0, 4000));
|
||||
}
|
||||
// end of animation
|
||||
obj.decayMe();
|
||||
|
||||
@@ -51,8 +51,7 @@ public class AdminPremium implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
addPremiumStatus(activeChar, 1, val);
|
||||
addPremiumStatus(activeChar, 1, command.substring(19));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -63,8 +62,7 @@ public class AdminPremium implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
addPremiumStatus(activeChar, 2, val);
|
||||
addPremiumStatus(activeChar, 2, command.substring(19));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -75,8 +73,7 @@ public class AdminPremium implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
addPremiumStatus(activeChar, 3, val);
|
||||
addPremiumStatus(activeChar, 3, command.substring(19));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -87,8 +84,7 @@ public class AdminPremium implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(19);
|
||||
viewPremiumInfo(activeChar, val);
|
||||
viewPremiumInfo(activeChar, command.substring(19));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -99,8 +95,7 @@ public class AdminPremium implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(21);
|
||||
removePremium(activeChar, val);
|
||||
removePremium(activeChar, command.substring(21));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -124,18 +119,14 @@ public class AdminPremium implements IAdminCommandHandler
|
||||
|
||||
// TODO: Add check if account exists XD
|
||||
PremiumManager.getInstance().updatePremiumData(months, accountName);
|
||||
final SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
|
||||
final long endDate = PremiumManager.getInstance().getPremiumEndDate(accountName);
|
||||
admin.sendMessage("Account " + accountName + " will now have premium status until " + String.valueOf(format.format(endDate)) + ".");
|
||||
admin.sendMessage("Account " + accountName + " will now have premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + ".");
|
||||
}
|
||||
|
||||
private void viewPremiumInfo(L2PcInstance admin, String accountName)
|
||||
{
|
||||
if (PremiumManager.getInstance().getPremiumEndDate(accountName) > 0)
|
||||
{
|
||||
final SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
|
||||
final long endDate = PremiumManager.getInstance().getPremiumEndDate(accountName);
|
||||
admin.sendMessage("Account " + accountName + " has premium status until " + String.valueOf(format.format(endDate)) + ".");
|
||||
admin.sendMessage("Account " + accountName + " has premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -123,23 +123,17 @@ public final class AdminPrimePoints implements IAdminCommandHandler
|
||||
|
||||
if (range <= 0)
|
||||
{
|
||||
final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
|
||||
activeChar.sendMessage("You increased NCoin(s) of all online players (" + count + ") by " + value + ".");
|
||||
activeChar.sendMessage("You increased NCoin(s) of all online players (" + increaseForAll(L2World.getInstance().getPlayers(), value) + ") by " + value + ".");
|
||||
}
|
||||
else if (range > 0)
|
||||
{
|
||||
final int count = increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value);
|
||||
activeChar.sendMessage("You increased NCoin(s) of all players (" + count + ") in range " + range + " by " + value + ".");
|
||||
activeChar.sendMessage("You increased NCoin(s) of all players (" + increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value) + ") in range " + range + " by " + value + ".");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
showMenuHtml(activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
showMenuHtml(activeChar);
|
||||
}
|
||||
showMenuHtml(activeChar);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -91,8 +91,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final String subcmd = st.nextToken();
|
||||
switch (subcmd)
|
||||
switch (st.nextToken())
|
||||
{
|
||||
case "info":
|
||||
{
|
||||
@@ -388,11 +387,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
||||
private static final String findCharId(String key)
|
||||
{
|
||||
final int charId = CharNameTable.getInstance().getIdByName(key);
|
||||
if (charId > 0) // Yeah its a char name!
|
||||
{
|
||||
return Integer.toString(charId);
|
||||
}
|
||||
return key;
|
||||
return charId > 0 ? Integer.toString(charId) : key;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -76,8 +76,7 @@ public class AdminQuest implements IAdminCommandHandler
|
||||
// try the first param as id
|
||||
try
|
||||
{
|
||||
final int questId = Integer.parseInt(parts[1]);
|
||||
if (QuestManager.getInstance().reload(questId))
|
||||
if (QuestManager.getInstance().reload(Integer.parseInt(parts[1])))
|
||||
{
|
||||
activeChar.sendMessage("Quest Reloaded Successfully.");
|
||||
}
|
||||
|
||||
@@ -298,5 +298,4 @@ public class AdminReload implements IAdminCommandHandler
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -167,5 +167,4 @@ public class AdminRide implements IAdminCommandHandler
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -92,9 +92,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
time -= TimeUnit.DAYS.toMillis(days);
|
||||
final long hours = TimeUnit.MILLISECONDS.toHours(time);
|
||||
time -= TimeUnit.HOURS.toMillis(hours);
|
||||
final long minutes = TimeUnit.MILLISECONDS.toMinutes(time);
|
||||
|
||||
return days + " Days, " + hours + " Hours, " + minutes + " Minutes";
|
||||
return days + " Days, " + hours + " Hours, " + TimeUnit.MILLISECONDS.toMinutes(time) + " Minutes";
|
||||
}
|
||||
|
||||
private String buildTheardInfo(String category)
|
||||
|
||||
@@ -94,13 +94,10 @@ public class AdminShowQuests implements IAdminCommandHandler
|
||||
val[0] = "name";
|
||||
val[1] = cmdParams[2];
|
||||
}
|
||||
if (cmdParams.length > 3)
|
||||
if ((cmdParams.length > 3) && cmdParams[3].equals("custom"))
|
||||
{
|
||||
if (cmdParams[3].equals("custom"))
|
||||
{
|
||||
val[0] = "custom";
|
||||
val[1] = cmdParams[2];
|
||||
}
|
||||
val[0] = "custom";
|
||||
val[1] = cmdParams[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,5 +125,4 @@ public class AdminShutdown implements IAdminCommandHandler
|
||||
{
|
||||
Shutdown.getInstance().abort(activeChar);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -94,8 +94,7 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(20);
|
||||
removeSkillsPage(activeChar, Integer.parseInt(val));
|
||||
removeSkillsPage(activeChar, Integer.parseInt(command.substring(20)));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -109,8 +108,7 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(18);
|
||||
AdminHtml.showAdminHtml(activeChar, "skills/" + val + ".htm");
|
||||
AdminHtml.showAdminHtml(activeChar, "skills/" + command.substring(18) + ".htm");
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -120,8 +118,7 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(15);
|
||||
adminAddSkill(activeChar, val);
|
||||
adminAddSkill(activeChar, command.substring(15));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -132,9 +129,7 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String id = command.substring(19);
|
||||
final int idval = Integer.parseInt(id);
|
||||
adminRemoveSkill(activeChar, idval);
|
||||
adminRemoveSkill(activeChar, Integer.parseInt(command.substring(19)));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -308,19 +303,13 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
final int skillsStart = maxSkillsPerPage * page;
|
||||
int skillsEnd = skills.length;
|
||||
if ((skillsEnd - skillsStart) > maxSkillsPerPage)
|
||||
{
|
||||
skillsEnd = skillsStart + maxSkillsPerPage;
|
||||
}
|
||||
|
||||
final int skillsEnd = (skills.length - skillsStart) > maxSkillsPerPage ? skillsStart + maxSkillsPerPage : skills.length;
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final StringBuilder replyMSG = StringUtil.startAppend(500 + (maxPages * 50) + (((skillsEnd - skillsStart) + 1) * 50), "<html><body><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Selection Menu</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_show_skills\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><br><center>Editing <font color=\"LEVEL\">", player.getName(), "</font></center><br><table width=270><tr><td>Lv: ", String.valueOf(player.getLevel()), " ", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "</td></tr></table><br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr><tr><td>ruin the game...</td></tr></table><br><center>Click on the skill you wish to remove:</center><br><center><table width=270><tr>");
|
||||
|
||||
for (int x = 0; x < maxPages; x++)
|
||||
{
|
||||
final int pagenr = x + 1;
|
||||
StringUtil.append(replyMSG, "<td><a action=\"bypass -h admin_remove_skills ", String.valueOf(x), "\">Page ", String.valueOf(pagenr), "</a></td>");
|
||||
StringUtil.append(replyMSG, "<td><a action=\"bypass -h admin_remove_skills ", String.valueOf(x), "\">Page ", String.valueOf((x + 1)), "</a></td>");
|
||||
}
|
||||
|
||||
replyMSG.append("</tr></table></center><br><table width=270><tr><td width=80>Name:</td><td width=60>Level:</td><td width=40>Id:</td></tr>");
|
||||
@@ -448,20 +437,12 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
}
|
||||
final L2PcInstance player = target.getActingPlayer();
|
||||
final StringTokenizer st = new StringTokenizer(val);
|
||||
if (st.countTokens() != 2)
|
||||
{
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
else
|
||||
if (st.countTokens() == 2)
|
||||
{
|
||||
Skill skill = null;
|
||||
try
|
||||
{
|
||||
final String id = st.nextToken();
|
||||
final String level = st.nextToken();
|
||||
final int idval = Integer.parseInt(id);
|
||||
final int levelval = Integer.parseInt(level);
|
||||
skill = SkillData.getInstance().getSkill(idval, levelval);
|
||||
skill = SkillData.getInstance().getSkill(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -486,8 +467,8 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
{
|
||||
activeChar.sendMessage("Error: there is no such skill.");
|
||||
}
|
||||
showMainPage(activeChar); // Back to start
|
||||
}
|
||||
showMainPage(activeChar); // Back to start
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,8 +71,7 @@ public class AdminSummon implements IAdminCommandHandler
|
||||
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
||||
return false;
|
||||
}
|
||||
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
|
||||
ach.useAdminCommand(subCommand + " " + id + " " + count, activeChar);
|
||||
AdminCommandHandler.getInstance().getHandler(subCommand).useAdminCommand(subCommand + " " + id + " " + count, activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -140,8 +140,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(14);
|
||||
teleportTo(activeChar, val);
|
||||
teleportTo(activeChar, command.substring(14));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -158,9 +157,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String val = command.substring(25);
|
||||
|
||||
teleportCharacter(activeChar, val);
|
||||
teleportCharacter(activeChar, command.substring(25));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -173,9 +170,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
final String targetName = command.substring(17);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(targetName);
|
||||
teleportToCharacter(activeChar, player);
|
||||
teleportToCharacter(activeChar, L2World.getInstance().getPlayer(command.substring(17)));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
@@ -646,5 +641,4 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ public class AdminVitality implements IAdminCommandHandler
|
||||
|
||||
if (activeChar.getTarget() instanceof L2PcInstance)
|
||||
{
|
||||
L2PcInstance target;
|
||||
target = (L2PcInstance) activeChar.getTarget();
|
||||
final L2PcInstance target = (L2PcInstance) activeChar.getTarget();
|
||||
|
||||
if (cmd.equals("admin_set_vitality"))
|
||||
{
|
||||
|
||||
@@ -97,8 +97,7 @@ public class AdminZone implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final int zoneId = Integer.parseInt(next);
|
||||
ZoneManager.getInstance().getZoneById(zoneId).visualizeZone(activeChar.getZ());
|
||||
ZoneManager.getInstance().getZoneById(Integer.parseInt(next)).visualizeZone(activeChar.getZ());
|
||||
}
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("admin_zone_visual_clear"))
|
||||
|
||||
@@ -114,8 +114,7 @@ public class NpcViewMod implements IBypassHandler
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final int page = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
sendNpcDropList(activeChar, npc, dropListScope, page);
|
||||
sendNpcDropList(activeChar, npc, dropListScope, (st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0));
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
|
||||
@@ -87,9 +87,7 @@ public class OlympiadManagerLink implements IBypassHandler
|
||||
{
|
||||
if (command.toLowerCase().startsWith("olympiaddesc"))
|
||||
{
|
||||
final int val = Integer.parseInt(command.substring(13, 14));
|
||||
final String suffix = command.substring(14);
|
||||
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, val, suffix);
|
||||
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, Integer.parseInt(command.substring(13, 14)), command.substring(14));
|
||||
}
|
||||
else if (command.toLowerCase().startsWith("olympiadnoble"))
|
||||
{
|
||||
|
||||
@@ -53,8 +53,7 @@ public class PlayerHelp implements IBypassHandler
|
||||
final NpcHtmlMessage html;
|
||||
if (cmd.length > 1)
|
||||
{
|
||||
final int itemId = Integer.parseInt(cmd[1]);
|
||||
html = new NpcHtmlMessage(0, itemId);
|
||||
html = new NpcHtmlMessage(0, Integer.parseInt(cmd[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -219,19 +219,12 @@ public class QuestLink implements IBypassHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if (qs == null)
|
||||
if ((qs == null) && (q.getId() >= 1) && (q.getId() < 20000) && (player.getAllActiveQuests().size() >= MAX_QUEST_COUNT))
|
||||
{
|
||||
if ((q.getId() >= 1) && (q.getId() < 20000))
|
||||
{
|
||||
// Too many ongoing quests.
|
||||
if (player.getAllActiveQuests().size() >= MAX_QUEST_COUNT)
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), "html/fullquest.html");
|
||||
player.sendPacket(html);
|
||||
return;
|
||||
}
|
||||
}
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), "html/fullquest.html");
|
||||
player.sendPacket(html);
|
||||
return;
|
||||
}
|
||||
|
||||
q.notifyTalk(npc, player);
|
||||
|
||||
@@ -72,8 +72,7 @@ public class SkillList implements IBypassHandler
|
||||
|
||||
if (!own_class)
|
||||
{
|
||||
final String charType = activeChar.getClassId().isMage() ? "fighter" : "mage";
|
||||
text += "Skills of your class are the easiest to learn.<br>Skills of another class of your race are a little harder.<br>Skills for classes of another race are extremely difficult.<br>But the hardest of all to learn are the " + charType + "skills!<br>";
|
||||
text += "Skills of your class are the easiest to learn.<br>Skills of another class of your race are a little harder.<br>Skills for classes of another race are extremely difficult.<br>But the hardest of all to learn are the " + (activeChar.getClassId().isMage() ? "fighter" : "mage") + "skills!<br>";
|
||||
}
|
||||
|
||||
// make a list of classes
|
||||
|
||||
@@ -58,7 +58,6 @@ public final class ChatGeneral implements IChatHandler
|
||||
{
|
||||
command = st.nextToken().substring(1);
|
||||
params = text.substring(command.length() + 2);
|
||||
vch = VoicedCommandHandler.getInstance().getHandler(command);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -67,8 +66,8 @@ public final class ChatGeneral implements IChatHandler
|
||||
{
|
||||
_log.info("Command: " + command);
|
||||
}
|
||||
vch = VoicedCommandHandler.getInstance().getHandler(command);
|
||||
}
|
||||
vch = VoicedCommandHandler.getInstance().getHandler(command);
|
||||
if (vch != null)
|
||||
{
|
||||
vch.useVoicedCommand(command, activeChar, params);
|
||||
|
||||
@@ -39,39 +39,41 @@ public class ChatPartyMatchRoom implements IChatHandler
|
||||
@Override
|
||||
public void handleChat(ChatType type, L2PcInstance activeChar, String target, String text)
|
||||
{
|
||||
if (activeChar.isInPartyMatchRoom())
|
||||
if (!activeChar.isInPartyMatchRoom())
|
||||
{
|
||||
final PartyMatchRoom _room = PartyMatchRoomList.getInstance().getPlayerRoom(activeChar);
|
||||
if (_room != null)
|
||||
return;
|
||||
}
|
||||
final PartyMatchRoom _room = PartyMatchRoomList.getInstance().getPlayerRoom(activeChar);
|
||||
if (_room == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
|
||||
for (L2PcInstance _member : _room.getPartyMembers())
|
||||
{
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
|
||||
if (Config.FACTION_SPECIFIC_CHAT)
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
return;
|
||||
}
|
||||
|
||||
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
|
||||
for (L2PcInstance _member : _room.getPartyMembers())
|
||||
{
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if (Config.FACTION_SPECIFIC_CHAT)
|
||||
{
|
||||
if ((activeChar.isGood() && _member.isGood()) || (activeChar.isEvil() && _member.isEvil()))
|
||||
{
|
||||
_member.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_member.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((activeChar.isGood() && _member.isGood()) || (activeChar.isEvil() && _member.isEvil()))
|
||||
{
|
||||
_member.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_member.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_member.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,18 +37,16 @@ public final class ChatPartyRoomAll implements IChatHandler
|
||||
@Override
|
||||
public void handleChat(ChatType type, L2PcInstance activeChar, String target, String text)
|
||||
{
|
||||
if (activeChar.isInParty())
|
||||
if (!activeChar.isInParty() || !activeChar.getParty().isInCommandChannel() || !activeChar.getParty().isLeader(activeChar))
|
||||
{
|
||||
if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().isLeader(activeChar))
|
||||
{
|
||||
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
return;
|
||||
}
|
||||
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
return;
|
||||
}
|
||||
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,18 +37,16 @@ public final class ChatPartyRoomCommander implements IChatHandler
|
||||
@Override
|
||||
public void handleChat(ChatType type, L2PcInstance activeChar, String target, String text)
|
||||
{
|
||||
if (activeChar.isInParty())
|
||||
if (!activeChar.isInParty() || !activeChar.getParty().isInCommandChannel() || !activeChar.getParty().getCommandChannel().getLeader().equals(activeChar))
|
||||
{
|
||||
if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().getCommandChannel().getLeader().equals(activeChar))
|
||||
{
|
||||
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
return;
|
||||
}
|
||||
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
return;
|
||||
}
|
||||
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,20 +60,13 @@ public final class ChatShout implements IChatHandler
|
||||
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);
|
||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if ((region == MapRegionManager.getInstance().getMapRegionLocId(player)) && !BlockList.isBlocked(player, activeChar) && (player.getInstanceId() == activeChar.getInstanceId()))
|
||||
if ((region == MapRegionManager.getInstance().getMapRegionLocId(player)) && !BlockList.isBlocked(player, activeChar) && (player.getInstanceId() == activeChar.getInstanceId()) && !BlockList.isBlocked(player, activeChar))
|
||||
{
|
||||
if (!BlockList.isBlocked(player, activeChar))
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
if (Config.FACTION_SPECIFIC_CHAT)
|
||||
{
|
||||
if (Config.FACTION_SPECIFIC_CHAT)
|
||||
{
|
||||
if ((activeChar.isGood() && player.isGood()) || (activeChar.isEvil() && player.isEvil()))
|
||||
{
|
||||
player.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((activeChar.isGood() && player.isGood()) || (activeChar.isEvil() && player.isEvil()))
|
||||
{
|
||||
player.sendPacket(cs);
|
||||
}
|
||||
@@ -83,6 +76,10 @@ public final class ChatShout implements IChatHandler
|
||||
player.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(cs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,27 +68,27 @@ public final class ChatWhisper implements IChatHandler
|
||||
activeChar.sendMessage("Player is in jail.");
|
||||
return;
|
||||
}
|
||||
else if (receiver.isChatBanned())
|
||||
if (receiver.isChatBanned())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THAT_PERSON_IS_IN_MESSAGE_REFUSAL_MODE);
|
||||
return;
|
||||
}
|
||||
else if ((receiver.getClient() == null) || receiver.getClient().isDetached())
|
||||
if ((receiver.getClient() == null) || receiver.getClient().isDetached())
|
||||
{
|
||||
activeChar.sendMessage("Player is in offline mode.");
|
||||
return;
|
||||
}
|
||||
else if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT && ((activeChar.isGood() && receiver.isEvil()) || (activeChar.isEvil() && receiver.isGood())))
|
||||
if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT && ((activeChar.isGood() && receiver.isEvil()) || (activeChar.isEvil() && receiver.isGood())))
|
||||
{
|
||||
activeChar.sendMessage("Player belongs to the opposing faction.");
|
||||
return;
|
||||
}
|
||||
else if ((activeChar.getLevel() < Config.MINIMUM_CHAT_LEVEL) && !activeChar.getWhisperers().contains(receiver.getObjectId()) && !activeChar.canOverrideCond(PcCondOverride.CHAT_CONDITIONS))
|
||||
if ((activeChar.getLevel() < Config.MINIMUM_CHAT_LEVEL) && !activeChar.getWhisperers().contains(receiver.getObjectId()) && !activeChar.canOverrideCond(PcCondOverride.CHAT_CONDITIONS))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PLAYERS_CAN_RESPOND_TO_A_WHISPER_BUT_CANNOT_INITIATE_A_WHISPER_UNTIL_LV_S1).addInt(Config.MINIMUM_CHAT_LEVEL));
|
||||
return;
|
||||
}
|
||||
else if (!BlockList.isBlocked(receiver, activeChar))
|
||||
if (!BlockList.isBlocked(receiver, activeChar))
|
||||
{
|
||||
// Allow reciever to send PMs to this char, which is in silence mode.
|
||||
if (Config.SILENCE_MODE_EXCLUDE && activeChar.isSilenceMode())
|
||||
|
||||
@@ -69,17 +69,14 @@ public class FavoriteBoard implements IParseBoardHandler
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
String link = list.replaceAll("%fav_bypass%", String.valueOf(rs.getString("favBypass")));
|
||||
link = link.replaceAll("%fav_title%", rs.getString("favTitle"));
|
||||
String link = list.replaceAll("%fav_bypass%", String.valueOf(rs.getString("favBypass"))).replaceAll("%fav_title%", rs.getString("favTitle"));
|
||||
final SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
link = link.replaceAll("%fav_add_date%", date.format(rs.getTimestamp("favAddDate")));
|
||||
link = link.replaceAll("%fav_id%", String.valueOf(rs.getInt("favId")));
|
||||
sb.append(link);
|
||||
}
|
||||
}
|
||||
String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/favorite.html");
|
||||
html = html.replaceAll("%fav_list%", sb.toString());
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/favorite.html").replaceAll("%fav_list%", sb.toString()), activeChar);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -45,21 +45,12 @@ public class FriendsBoard implements IParseBoardHandler
|
||||
if (command.equals("_friendlist"))
|
||||
{
|
||||
CommunityBoardHandler.getInstance().addBypass(activeChar, "Friends List", command);
|
||||
|
||||
final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/friends_list.html");
|
||||
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/friends_list.html"), activeChar);
|
||||
}
|
||||
else if (command.equals("_friendblocklist"))
|
||||
{
|
||||
CommunityBoardHandler.getInstance().addBypass(activeChar, "Ignore list", command);
|
||||
|
||||
final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/friends_block_list.html");
|
||||
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/friends_block_list.html"), activeChar);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,8 +95,7 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
final String path = command.replace("_bbstop;", "");
|
||||
if ((path.length() > 0) && path.endsWith(".html"))
|
||||
{
|
||||
final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/" + customPath + path);
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/" + customPath + path), activeChar);
|
||||
}
|
||||
}
|
||||
else if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_ENABLE_MULTISELLS && command.startsWith("_bbsmultisell"))
|
||||
@@ -162,8 +161,7 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
SkillData.getInstance().getSkill(buffId, buffLevel).applyEffects(activeChar.getPet(), activeChar.getPet());
|
||||
}
|
||||
}
|
||||
final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/Custom/" + page + ".html");
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/Custom/" + page + ".html"), activeChar);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -71,16 +71,13 @@ public class RegionBoard implements IWriteBoardHandler
|
||||
sb.append(link);
|
||||
}
|
||||
|
||||
String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/region.html");
|
||||
html = html.replace("%region_list%", sb.toString());
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/region.html").replace("%region_list%", sb.toString()), activeChar);
|
||||
}
|
||||
else if (command.startsWith("_bbsloc;"))
|
||||
{
|
||||
CommunityBoardHandler.getInstance().addBypass(activeChar, "Region>", command);
|
||||
|
||||
final String id = command.replace("_bbsloc;", "");
|
||||
if (!Util.isDigit(id))
|
||||
if (!Util.isDigit(command.replace("_bbsloc;", "")))
|
||||
{
|
||||
LOG.warning(RegionBoard.class.getSimpleName() + ": Player " + activeChar + " sent and invalid region bypass " + command + "!");
|
||||
return false;
|
||||
|
||||
@@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
@@ -89,8 +88,7 @@ public final class Backstab extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
activeChar.getActingPlayer().sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
|
||||
@@ -41,8 +41,7 @@ public final class BlockAction extends AbstractEffect
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
final String[] actions = params.getString("blockedActions").split(",");
|
||||
for (String action : actions)
|
||||
for (String action : params.getString("blockedActions").split(","))
|
||||
{
|
||||
_blockedActions.add(Integer.parseInt(action));
|
||||
}
|
||||
|
||||
@@ -49,12 +49,9 @@ public final class CallParty extends AbstractEffect
|
||||
|
||||
for (L2PcInstance partyMember : info.getEffector().getParty().getMembers())
|
||||
{
|
||||
if (CallPc.checkSummonTargetStatus(partyMember, info.getEffector().getActingPlayer()))
|
||||
if (CallPc.checkSummonTargetStatus(partyMember, info.getEffector().getActingPlayer()) && (info.getEffector() != partyMember))
|
||||
{
|
||||
if (info.getEffector() != partyMember)
|
||||
{
|
||||
partyMember.teleToLocation(info.getEffector().getLocation(), true);
|
||||
}
|
||||
partyMember.teleToLocation(info.getEffector().getLocation(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.entity.Instance;
|
||||
import com.l2jmobius.gameserver.model.entity.TvTEvent;
|
||||
import com.l2jmobius.gameserver.model.holders.SummonRequestHolder;
|
||||
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
@@ -151,14 +150,10 @@ public final class CallPc extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activeChar.getInstanceId() > 0)
|
||||
if ((activeChar.getInstanceId() > 0) && (!Config.ALLOW_SUMMON_IN_INSTANCE || !InstanceManager.getInstance().getInstance(activeChar.getInstanceId()).isSummonAllowed()))
|
||||
{
|
||||
final Instance summonerInstance = InstanceManager.getInstance().getInstance(activeChar.getInstanceId());
|
||||
if (!Config.ALLOW_SUMMON_IN_INSTANCE || !summonerInstance.isSummonAllowed())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
|
||||
return false;
|
||||
}
|
||||
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,19 +54,11 @@ public final class ChameleonRest extends AbstractEffect
|
||||
@Override
|
||||
public boolean onActionTime(BuffInfo info)
|
||||
{
|
||||
if (info.getEffected().isDead())
|
||||
if (info.getEffected().isDead() || (info.getEffected().isPlayer() && !info.getEffected().getActingPlayer().isSitting()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
if (!info.getEffected().getActingPlayer().isSitting())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
{
|
||||
|
||||
@@ -111,13 +111,12 @@ public final class ConvertItem extends AbstractEffect
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_EQUIPMENT_S1_S2_HAS_BEEN_REMOVED);
|
||||
sm.addInt(item.getEnchantLevel());
|
||||
sm.addItemName(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_BEEN_UNEQUIPPED);
|
||||
sm.addItemName(item);
|
||||
}
|
||||
sm.addItemName(item);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
|
||||
@@ -150,13 +149,12 @@ public final class ConvertItem extends AbstractEffect
|
||||
{
|
||||
msg = SystemMessage.getSystemMessage(SystemMessageId.EQUIPPED_S1_S2);
|
||||
msg.addInt(newItem.getEnchantLevel());
|
||||
msg.addItemName(newItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EQUIPPED_YOUR_S1);
|
||||
msg.addItemName(newItem);
|
||||
}
|
||||
msg.addItemName(newItem);
|
||||
player.sendPacket(msg);
|
||||
|
||||
final InventoryUpdate u = new InventoryUpdate();
|
||||
|
||||
@@ -61,10 +61,8 @@ public final class CpHeal extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
double amount = _power;
|
||||
|
||||
// Prevents overheal and negative amount
|
||||
amount = Math.max(Math.min(amount, target.getMaxRecoverableCp() - target.getCurrentCp()), 0);
|
||||
final double amount = Math.max(Math.min(_power, target.getMaxRecoverableCp() - target.getCurrentCp()), 0);
|
||||
if (amount != 0)
|
||||
{
|
||||
target.setCurrentCp(amount + target.getCurrentCp());
|
||||
|
||||
@@ -81,7 +81,7 @@ public final class DamOverTime extends AbstractEffect
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_FORCE_HAS_REACHED_MAXIMUM_CAPACITY);
|
||||
return false;
|
||||
}
|
||||
else if (_charge != 0)
|
||||
if (_charge != 0)
|
||||
{
|
||||
info.getEffected().getActingPlayer().increaseCharges(1, _charge);
|
||||
}
|
||||
|
||||
@@ -47,26 +47,13 @@ public final class Detection extends AbstractEffect
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance target = info.getEffected().getActingPlayer();
|
||||
|
||||
if (target.isInvisible())
|
||||
if (!target.isInvisible() || player.isInPartyWith(target) || player.isInClanWith(target) || player.isInAllyWith(target))
|
||||
{
|
||||
if (player.isInPartyWith(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (player.isInClanWith(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (player.isInAllyWith(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Remove Hide.
|
||||
target.getEffectList().stopSkillEffects(true, AbnormalType.HIDE);
|
||||
return;
|
||||
}
|
||||
// Remove Hide.
|
||||
target.getEffectList().stopSkillEffects(true, AbnormalType.HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
@@ -64,8 +62,7 @@ public final class DispelByCategory extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
final List<BuffInfo> canceled = Formulas.calcCancelStealEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max);
|
||||
for (BuffInfo can : canceled)
|
||||
for (BuffInfo can : Formulas.calcCancelStealEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max))
|
||||
{
|
||||
info.getEffected().getEffectList().stopSkillEffects(true, can.getSkill());
|
||||
}
|
||||
|
||||
@@ -87,13 +87,10 @@ public final class DispelBySlot extends AbstractEffect
|
||||
for (Entry<AbnormalType, Short> entry : _dispelAbnormals.entrySet())
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM))
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0))))
|
||||
{
|
||||
if (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0)))
|
||||
{
|
||||
info.getEffected().stopTransformation(true);
|
||||
continue;
|
||||
}
|
||||
info.getEffected().stopTransformation(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
final BuffInfo toDispel = effectList.getBuffInfoByAbnormalType(entry.getKey());
|
||||
|
||||
@@ -92,12 +92,9 @@ public final class DispelBySlotProbability extends AbstractEffect
|
||||
if ((Rnd.get(100) < _rate))
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM))
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0))))
|
||||
{
|
||||
if (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0)))
|
||||
{
|
||||
info.getEffected().stopTransformation(true);
|
||||
}
|
||||
info.getEffected().stopTransformation(true);
|
||||
}
|
||||
|
||||
final BuffInfo toDispel = effectList.getBuffInfoByAbnormalType(entry.getKey());
|
||||
|
||||
@@ -87,8 +87,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
if (!_ignoreShieldDefence)
|
||||
{
|
||||
final byte shield = Formulas.calcShldUse(attacker, target, skill, true);
|
||||
switch (shield)
|
||||
switch (Formulas.calcShldUse(attacker, target, skill, true))
|
||||
{
|
||||
case Formulas.SHIELD_DEFENSE_FAILED:
|
||||
{
|
||||
|
||||
@@ -55,13 +55,10 @@ public final class FakeDeath extends AbstractEffect
|
||||
}
|
||||
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
if ((manaDam > info.getEffected().getCurrentMp()) && info.getSkill().isToggle())
|
||||
{
|
||||
if (info.getSkill().isToggle())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentMp(manaDam);
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.StringTokenizer;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
@@ -87,8 +86,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
final StringTokenizer st = new StringTokenizer(_targetAbnormalType, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
final String abnormal = st.nextToken().trim();
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(abnormal)) != null)
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(st.nextToken().trim())) != null)
|
||||
{
|
||||
damage *= _skillAddPower;
|
||||
break;
|
||||
@@ -121,8 +119,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
activeChar.getActingPlayer().sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
|
||||
@@ -50,8 +50,7 @@ public final class FocusMaxEnergy extends AbstractEffect
|
||||
final int maxCharge = (sonicMastery != null) ? sonicMastery.getLevel() : (focusMastery != null) ? focusMastery.getLevel() : (maximumForceMastery != null) ? 15 : 0;
|
||||
if (maxCharge != 0)
|
||||
{
|
||||
final int count = maxCharge - info.getEffected().getActingPlayer().getCharges();
|
||||
info.getEffected().getActingPlayer().increaseCharges(count, maxCharge);
|
||||
info.getEffected().getActingPlayer().increaseCharges((maxCharge - info.getEffected().getActingPlayer().getCharges()), maxCharge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,11 +57,9 @@ public final class FocusSouls extends AbstractEffect
|
||||
final int maxSouls = (int) target.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (maxSouls > 0)
|
||||
{
|
||||
final int amount = _charge;
|
||||
if ((target.getChargedSouls() < maxSouls))
|
||||
{
|
||||
final int count = ((target.getChargedSouls() + amount) <= maxSouls) ? amount : (maxSouls - target.getChargedSouls());
|
||||
target.increaseSouls(count);
|
||||
target.increaseSouls(((target.getChargedSouls() + _charge) <= maxSouls) ? _charge : (maxSouls - target.getChargedSouls()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -55,32 +55,28 @@ public final class GiveRecommendation extends AbstractEffect
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
final L2PcInstance target = info.getEffected() instanceof L2PcInstance ? (L2PcInstance) info.getEffected() : null;
|
||||
if (target != null)
|
||||
if (target == null)
|
||||
{
|
||||
int recommendationsGiven = _amount;
|
||||
return;
|
||||
}
|
||||
|
||||
final int recommendationsGiven = (target.getRecomHave() + _amount) >= 255 ? 255 - target.getRecomHave() : _amount;
|
||||
if (recommendationsGiven > 0)
|
||||
{
|
||||
target.setRecomHave(target.getRecomHave() + recommendationsGiven);
|
||||
|
||||
if ((target.getRecomHave() + _amount) >= 255)
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATION_S);
|
||||
sm.addInt(recommendationsGiven);
|
||||
target.sendPacket(sm);
|
||||
target.sendPacket(new UserInfo(target));
|
||||
target.sendPacket(new ExVoteSystemInfo(target));
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null;
|
||||
if (player != null)
|
||||
{
|
||||
recommendationsGiven = 255 - target.getRecomHave();
|
||||
}
|
||||
|
||||
if (recommendationsGiven > 0)
|
||||
{
|
||||
target.setRecomHave(target.getRecomHave() + recommendationsGiven);
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATION_S);
|
||||
sm.addInt(recommendationsGiven);
|
||||
target.sendPacket(sm);
|
||||
target.sendPacket(new UserInfo(target));
|
||||
target.sendPacket(new ExVoteSystemInfo(target));
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null;
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
}
|
||||
player.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,15 +90,14 @@ public final class Harvesting extends AbstractEffect
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HARVESTED_S2);
|
||||
sm.addString(player.getName());
|
||||
sm.addItemName(item.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HARVESTED_S3_S2_S);
|
||||
sm.addString(player.getName());
|
||||
sm.addLong(item.getCount());
|
||||
sm.addItemName(item.getId());
|
||||
}
|
||||
sm.addItemName(item.getId());
|
||||
player.getParty().broadcastToPartyMembers(player, sm);
|
||||
}
|
||||
}
|
||||
@@ -127,12 +126,7 @@ public final class Harvesting extends AbstractEffect
|
||||
|
||||
// apply penalty, target <=> player levels
|
||||
// 5% penalty for each level
|
||||
int basicSuccess = 100;
|
||||
if (diff > 5)
|
||||
{
|
||||
basicSuccess -= (diff - 5) * 5;
|
||||
}
|
||||
|
||||
int basicSuccess = diff > 5 ? 100 - ((diff - 5) * 5) : 100;
|
||||
// success rate can't be less than 1%
|
||||
if (basicSuccess < 1)
|
||||
{
|
||||
|
||||
@@ -73,34 +73,36 @@ public final class MagicalAttack extends AbstractEffect
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
|
||||
if (damage > 0)
|
||||
if (damage <= 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||
if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
|
||||
{
|
||||
target.breakAttack();
|
||||
target.breakCast();
|
||||
}
|
||||
|
||||
// Shield Deflect Magic: Reflect all damage on caster.
|
||||
if (target.getStat().calcStat(Stats.VENGEANCE_SKILL_MAGIC_DAMAGE, 0, target, info.getSkill()) > Rnd.get(100))
|
||||
{
|
||||
activeChar.reduceCurrentHp(damage, target, info.getSkill());
|
||||
activeChar.notifyDamageReceived(damage, target, info.getSkill(), mcrit, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), mcrit, false);
|
||||
activeChar.sendDamageMessage(target, damage, mcrit, false, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||
if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
|
||||
{
|
||||
target.breakAttack();
|
||||
target.breakCast();
|
||||
}
|
||||
|
||||
// Shield Deflect Magic: Reflect all damage on caster.
|
||||
if (target.getStat().calcStat(Stats.VENGEANCE_SKILL_MAGIC_DAMAGE, 0, target, info.getSkill()) > Rnd.get(100))
|
||||
{
|
||||
activeChar.reduceCurrentHp(damage, target, info.getSkill());
|
||||
activeChar.notifyDamageReceived(damage, target, info.getSkill(), mcrit, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), mcrit, false);
|
||||
activeChar.sendDamageMessage(target, damage, mcrit, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,9 +74,7 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
damage *= 1 + (((activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount()) * 0.04);
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
|
||||
@@ -114,5 +114,4 @@ public final class MaxCp extends AbstractEffect
|
||||
charStat.getActiveChar().removeStatsOwner(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -114,5 +114,4 @@ public final class MaxHp extends AbstractEffect
|
||||
charStat.getActiveChar().removeStatsOwner(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,12 +102,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
final boolean crit = (skill.getBaseCritRate() > 0) && Formulas.calcCrit(activeChar, target, skill);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if (crit)
|
||||
@@ -120,8 +115,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
StringTokenizer st = new StringTokenizer(_type1, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
final String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(st.nextToken().trim()))
|
||||
{
|
||||
damage *= _valueReduce;
|
||||
break;
|
||||
@@ -130,8 +124,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
st = new StringTokenizer(_type2, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
final String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(st.nextToken().trim()))
|
||||
{
|
||||
damage *= _valueIncrease;
|
||||
break;
|
||||
|
||||
@@ -80,12 +80,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
final boolean crit = (skill.getBaseCritRate() > 0) && Formulas.calcCrit(activeChar, target, skill);
|
||||
int damage = 0;
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
@@ -87,19 +87,13 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
final boolean crit = (skill.getBaseCritRate() > 0) && Formulas.calcCrit(activeChar, target, skill);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if ((skill.getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
damage *= 1 + (((activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount()) * 0.04);
|
||||
}
|
||||
if (crit)
|
||||
{
|
||||
|
||||
@@ -86,12 +86,11 @@ public final class RebalanceHP extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
final double percentHP = currentHPs / fullHP;
|
||||
for (L2PcInstance member : party.getMembers())
|
||||
{
|
||||
if (!member.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, member, true))
|
||||
{
|
||||
double newHP = member.getMaxHp() * percentHP;
|
||||
double newHP = (member.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > member.getCurrentHp()) // The target gets healed
|
||||
{
|
||||
// The heal will be blocked if the current hp passes the limit
|
||||
@@ -104,14 +103,12 @@ public final class RebalanceHP extends AbstractEffect
|
||||
newHP = member.getMaxRecoverableHp();
|
||||
}
|
||||
}
|
||||
|
||||
member.setCurrentHp(newHP);
|
||||
}
|
||||
|
||||
final L2Summon summon = member.getPet();
|
||||
if ((summon != null) && (!summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true)))
|
||||
{
|
||||
double newHP = summon.getMaxHp() * percentHP;
|
||||
double newHP = (summon.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > summon.getCurrentHp()) // The target gets healed
|
||||
{
|
||||
// The heal will be blocked if the current hp passes the limit
|
||||
@@ -131,7 +128,7 @@ public final class RebalanceHP extends AbstractEffect
|
||||
{
|
||||
if (!servitors.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true))
|
||||
{
|
||||
double newHP = servitors.getMaxHp() * percentHP;
|
||||
double newHP = (servitors.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > servitors.getCurrentHp()) // The target gets healed
|
||||
{
|
||||
// The heal will be blocked if the current hp passes the limit
|
||||
|
||||
@@ -59,31 +59,22 @@ public final class Relax extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (info.getEffected().isPlayer())
|
||||
if (info.getEffected().isPlayer() && !info.getEffected().getActingPlayer().isSitting())
|
||||
{
|
||||
if (!info.getEffected().getActingPlayer().isSitting())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((info.getEffected().getCurrentHp() + 1) > info.getEffected().getMaxRecoverableHp())
|
||||
if (((info.getEffected().getCurrentHp() + 1) > info.getEffected().getMaxRecoverableHp()) && info.getSkill().isToggle())
|
||||
{
|
||||
if (info.getSkill().isToggle())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.THAT_SKILL_HAS_BEEN_DE_ACTIVATED_AS_HP_WAS_FULLY_RECOVERED);
|
||||
return false;
|
||||
}
|
||||
info.getEffected().sendPacket(SystemMessageId.THAT_SKILL_HAS_BEEN_DE_ACTIVATED_AS_HP_WAS_FULLY_RECOVERED);
|
||||
return false;
|
||||
}
|
||||
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
if ((manaDam > info.getEffected().getCurrentMp()) && info.getSkill().isToggle())
|
||||
{
|
||||
if (info.getSkill().isToggle())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentMp(manaDam);
|
||||
|
||||
@@ -71,8 +71,7 @@ public final class ResurrectionSpecial extends AbstractEffect
|
||||
}
|
||||
if (info.getEffected().isPet())
|
||||
{
|
||||
final L2PetInstance pet = (L2PetInstance) info.getEffected();
|
||||
info.getEffected().getActingPlayer().reviveRequest(pet.getActingPlayer(), skill, true, _power);
|
||||
info.getEffected().getActingPlayer().reviveRequest(((L2PetInstance) info.getEffected()).getActingPlayer(), skill, true, _power);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,12 +51,7 @@ public final class RunAway extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
if (!info.getEffected().isAttackable())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Rnd.get(100) > _power)
|
||||
if (!info.getEffected().isAttackable() || (Rnd.get(100) > _power))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,7 @@ public class ShiftTarget extends AbstractEffect
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Attackable hater = (L2Attackable) obj;
|
||||
hater.addDamageHate(info.getEffected(), 0, hater.getHating(info.getEffector()) + 1);
|
||||
((L2Attackable) obj).addDamageHate(info.getEffected(), 0, ((L2Attackable) obj).getHating(info.getEffector()) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
@@ -75,8 +74,7 @@ public final class SoulBlow extends AbstractEffect
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
damage *= 1 + (((activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount()) * 0.04);
|
||||
}
|
||||
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
@@ -91,8 +89,7 @@ public final class SoulBlow extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
activeChar.getActingPlayer().sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), true);
|
||||
|
||||
@@ -56,23 +56,24 @@ public final class SoulEating extends AbstractEffect
|
||||
private void onExperienceReceived(L2Playable playable, long exp)
|
||||
{
|
||||
// TODO: Verify logic.
|
||||
if (playable.isPlayer() && (exp >= _expNeeded))
|
||||
if (!playable.isPlayer() || (exp < _expNeeded))
|
||||
{
|
||||
final L2PcInstance player = playable.getActingPlayer();
|
||||
final int maxSouls = (int) player.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (player.getChargedSouls() >= maxSouls)
|
||||
{
|
||||
playable.sendPacket(SystemMessageId.SOUL_CANNOT_BE_ABSORBED_ANYMORE);
|
||||
return;
|
||||
}
|
||||
|
||||
player.increaseSouls(1);
|
||||
|
||||
if ((player.getTarget() != null) && player.getTarget().isNpc())
|
||||
{
|
||||
final L2Npc npc = (L2Npc) playable.getTarget();
|
||||
player.broadcastPacket(new ExSpawnEmitter(player, npc), 500);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final L2PcInstance player = playable.getActingPlayer();
|
||||
final int maxSouls = (int) player.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (player.getChargedSouls() >= maxSouls)
|
||||
{
|
||||
playable.sendPacket(SystemMessageId.SOUL_CANNOT_BE_ABSORBED_ANYMORE);
|
||||
return;
|
||||
}
|
||||
|
||||
player.increaseSouls(1);
|
||||
|
||||
if ((player.getTarget() != null) && player.getTarget().isNpc())
|
||||
{
|
||||
player.broadcastPacket(new ExSpawnEmitter(player, (L2Npc) playable.getTarget()), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,12 +89,7 @@ public final class SummonCubic extends AbstractEffect
|
||||
// 8 at 101 (+1 Power)
|
||||
// 12 at 130 (+30 Power)
|
||||
// Because 12 is max 5115-5117 skills
|
||||
int _cubicSkillLevel = info.getSkill().getLevel();
|
||||
if (_cubicSkillLevel > 100)
|
||||
{
|
||||
_cubicSkillLevel = ((info.getSkill().getLevel() - 100) / 7) + 8;
|
||||
}
|
||||
|
||||
final int _cubicSkillLevel = info.getSkill().getLevel() > 100 ? ((info.getSkill().getLevel() - 100) / 7) + 8 : info.getSkill().getLevel();
|
||||
// If cubic is already present, it's replaced.
|
||||
final L2CubicInstance cubic = player.getCubicById(_cubicId);
|
||||
if (cubic != null)
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class SummonDebuff extends AbstractEffect
|
||||
skill.applyEffects(player, player);
|
||||
return true;
|
||||
}
|
||||
else if (player.getEffectList().isAffectedBySkill(PRICE_OF_SUMMONING_LUMI))
|
||||
if (player.getEffectList().isAffectedBySkill(PRICE_OF_SUMMONING_LUMI))
|
||||
{
|
||||
final Skill skill = SkillData.getInstance().getSkill(PRICE_OF_SUMMONING_LUMI, 1);
|
||||
skill.applyEffects(player, player);
|
||||
|
||||
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.enums.CastleSide;
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
|
||||
/**
|
||||
@@ -56,9 +54,6 @@ public final class TakeCastle extends AbstractEffect
|
||||
}
|
||||
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final Castle castle = CastleManager.getInstance().getCastle(effector);
|
||||
final L2Character effected = info.getEffected();
|
||||
|
||||
castle.engrave(effector.getClan(), effected, _side);
|
||||
CastleManager.getInstance().getCastle(effector).engrave(effector.getClan(), info.getEffected(), _side);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,9 +65,8 @@ public final class TeleportToTarget extends AbstractEffect
|
||||
|
||||
final int px = target.getX();
|
||||
final int py = target.getY();
|
||||
double ph = Util.convertHeadingToDegree(target.getHeading());
|
||||
double ph = Util.convertHeadingToDegree(target.getHeading()) + 180;
|
||||
|
||||
ph += 180;
|
||||
if (ph > 360)
|
||||
{
|
||||
ph -= 360;
|
||||
|
||||
@@ -57,12 +57,7 @@ public final class TrapRemove extends AbstractEffect
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
final L2Character target = info.getEffected();
|
||||
if (!target.isTrap())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.isAlikeDead())
|
||||
if (!target.isTrap() || target.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,13 +77,7 @@ public final class TriggerForce extends AbstractEffect
|
||||
{
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance effected = info.getEffected().getActingPlayer();
|
||||
|
||||
if (effected.isDead() || (effector == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_skill.getSkillId() == 0)
|
||||
if (effected.isDead() || (effector == null) || (_skill.getSkillId() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -240,20 +234,13 @@ public final class TriggerForce extends AbstractEffect
|
||||
activeForces++;
|
||||
}
|
||||
|
||||
if ((activeForces < 4) || ((member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) == null) || (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) == null)))
|
||||
if (((activeForces < 4) || ((member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) == null) || (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) == null))) && (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY) != null))
|
||||
{
|
||||
if (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY) != null)
|
||||
{
|
||||
member.getEffectList().remove(true, member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY));
|
||||
}
|
||||
member.getEffectList().remove(true, member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY));
|
||||
}
|
||||
if ((activeForces >= 4) && (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) != null) && (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) != null))
|
||||
if ((activeForces >= 4) && (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) != null) && (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) != null) && (!member.getEffectList().isAffectedBySkill(PARTY_SOLIDARITY) || (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY).getSkill().getLevel() != Math.min((activeForces - 3), 3))))
|
||||
{
|
||||
final BuffInfo skill = member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY);
|
||||
if (!member.getEffectList().isAffectedBySkill(PARTY_SOLIDARITY) || (skill.getSkill().getLevel() != Math.min((activeForces - 3), 3)))
|
||||
{
|
||||
member.makeTriggerCast(SkillData.getInstance().getSkill(PARTY_SOLIDARITY, Math.min((activeForces - 3), 3)), member);
|
||||
}
|
||||
member.makeTriggerCast(SkillData.getInstance().getSkill(PARTY_SOLIDARITY, Math.min((activeForces - 3), 3)), member);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,28 +116,21 @@ public final class TriggerSkillByAttack extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
if (_allowWeapons > 0)
|
||||
if ((_allowWeapons > 0) && ((event.getAttacker().getActiveWeaponItem() == null) || ((event.getAttacker().getActiveWeaponItem().getItemType().mask() & _allowWeapons) == 0)))
|
||||
{
|
||||
if ((event.getAttacker().getActiveWeaponItem() == null) || ((event.getAttacker().getActiveWeaponItem().getItemType().mask() & _allowWeapons) == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getAttacker(), false, event.getTarget());
|
||||
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getAttacker(), false, event.getTarget()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getAttacker().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getAttacker().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,19 +77,15 @@ public final class TriggerSkillByAvoid extends AbstractEffect
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker());
|
||||
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getTarget().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getTarget().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,18 +90,15 @@ public final class TriggerSkillByDamage extends AbstractEffect
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker());
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getTarget().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getTarget().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,19 +85,15 @@ public final class TriggerSkillBySkill extends AbstractEffect
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getCaster(), false, event.getTarget());
|
||||
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getCaster(), false, event.getTarget()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getCaster().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getCaster().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,13 +45,9 @@ public final class Unsummon extends AbstractEffect
|
||||
public boolean calcSuccess(BuffInfo info)
|
||||
{
|
||||
final int magicLevel = info.getSkill().getMagicLevel();
|
||||
if ((magicLevel <= 0) || ((info.getEffected().getLevel() - 9) <= magicLevel))
|
||||
if (((magicLevel <= 0) || ((info.getEffected().getLevel() - 9) <= magicLevel)) && ((_chance * Formulas.calcAttributeBonus(info.getEffector(), info.getEffected(), info.getSkill()) * Formulas.calcGeneralTraitBonus(info.getEffector(), info.getEffected(), info.getSkill().getTraitType(), false)) > (Rnd.nextDouble() * 100)))
|
||||
{
|
||||
final double chance = _chance * Formulas.calcAttributeBonus(info.getEffector(), info.getEffected(), info.getSkill()) * Formulas.calcGeneralTraitBonus(info.getEffector(), info.getEffected(), info.getSkill().getTraitType(), false);
|
||||
if (chance > (Rnd.nextDouble() * 100))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,12 +72,9 @@ public class BeastSoulShot implements IItemHandler
|
||||
final SkillHolder[] skills = item.getItem().getSkills();
|
||||
short shotConsumption = 0;
|
||||
|
||||
if (pet != null)
|
||||
if ((pet != null) && !pet.isChargedShot(ShotType.SOULSHOTS))
|
||||
{
|
||||
if (!pet.isChargedShot(ShotType.SOULSHOTS))
|
||||
{
|
||||
shotConsumption += pet.getSoulShotsPerHit();
|
||||
}
|
||||
shotConsumption += pet.getSoulShotsPerHit();
|
||||
}
|
||||
|
||||
for (L2Summon servitors : aliveServitor)
|
||||
@@ -116,28 +113,25 @@ public class BeastSoulShot implements IItemHandler
|
||||
|
||||
// Pet uses the power of spirit.
|
||||
activeOwner.sendPacket(SystemMessageId.YOUR_PET_USES_SPIRITSHOT);
|
||||
if (pet != null)
|
||||
if ((pet != null) && !pet.isChargedShot(ShotType.SOULSHOTS))
|
||||
{
|
||||
if (!pet.isChargedShot(ShotType.SOULSHOTS))
|
||||
pet.setChargedShot(ShotType.SOULSHOTS, true);
|
||||
// Visual effect change if player has equipped Ruby lvl 3 or higher
|
||||
if ((activeOwner.getInventory().getItemByItemId(38859) != null) && (activeOwner.getInventory().getItemByItemId(38859).isEquipped()))
|
||||
{
|
||||
pet.setChargedShot(ShotType.SOULSHOTS, true);
|
||||
// Visual effect change if player has equipped Ruby lvl 3 or higher
|
||||
if ((activeOwner.getInventory().getItemByItemId(38859) != null) && (activeOwner.getInventory().getItemByItemId(38859).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17817, 1, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38858) != null) && (activeOwner.getInventory().getItemByItemId(38858).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17816, 1, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38857) != null) && (activeOwner.getInventory().getItemByItemId(38857).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17815, 1, 0, 0), 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
|
||||
}
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17817, 1, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38858) != null) && (activeOwner.getInventory().getItemByItemId(38858).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17816, 1, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38857) != null) && (activeOwner.getInventory().getItemByItemId(38857).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17815, 1, 0, 0), 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user