Code style changes.

This commit is contained in:
MobiusDev
2016-04-26 19:21:19 +00:00
parent 6a13705766
commit fc070c9238
768 changed files with 3338 additions and 4252 deletions

View File

@@ -89,41 +89,38 @@ public class L2PcInstanceAction implements IActionHandler
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, player);
}
else
// Check if this L2PcInstance is autoAttackable
else if (player.isAutoAttackable(activeChar))
{
// Check if this L2PcInstance is autoAttackable
if (player.isAutoAttackable(activeChar))
if ((player.isCursedWeaponEquipped() && (activeChar.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)) //
|| (activeChar.isCursedWeaponEquipped() && (player.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)))
{
if ((player.isCursedWeaponEquipped() && (activeChar.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)) //
|| (activeChar.isCursedWeaponEquipped() && (player.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)))
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
}
else
{
if (GeoData.getInstance().canSeeTarget(activeChar, player))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
else
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
}
activeChar.onActionRequest();
}
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
}
else
{
// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
if (GeoData.getInstance().canSeeTarget(activeChar, player))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
else
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
}
activeChar.onActionRequest();
}
}
else
{
// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
if (GeoData.getInstance().canSeeTarget(activeChar, player))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
}
}
}

View File

@@ -51,29 +51,26 @@ public class L2StaticObjectInstanceAction implements IActionHandler
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, staticObject);
}
else
else if (staticObject.getType() == 2)
{
if (staticObject.getType() == 2)
final String filename = (staticObject.getId() == 24230101) ? "html/signboards/tomb_of_crystalgolem.htm" : "html/signboards/pvp_signboard.htm";
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId());
if (content != null)
{
final String filename = (staticObject.getId() == 24230101) ? "html/signboards/tomb_of_crystalgolem.htm" : "html/signboards/pvp_signboard.htm";
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId());
if (content == null)
{
html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>");
}
else
{
html.setHtml(content);
}
activeChar.sendPacket(html);
html.setHtml(content);
}
else if (staticObject.getType() == 0)
else
{
activeChar.sendPacket(staticObject.getMap());
html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>");
}
activeChar.sendPacket(html);
}
else if (staticObject.getType() == 0)
{
activeChar.sendPacket(staticObject.getMap());
}
}
return true;

View File

@@ -72,12 +72,9 @@ public class L2SummonAction implements IActionHandler
{
activeChar.updateNotMoveUntil();
}
else
else if (GeoData.getInstance().canSeeTarget(activeChar, target))
{
if (GeoData.getInstance().canSeeTarget(activeChar, target))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
}
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
}
}
}