Code style changes.
This commit is contained in:
@ -1030,7 +1030,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
*/
|
||||
public String onDeath(L2Character killer, L2Character victim, QuestState qs)
|
||||
{
|
||||
return onAdvEvent("", ((killer instanceof L2Npc) ? ((L2Npc) killer) : null), qs.getPlayer());
|
||||
return onAdvEvent("", (killer instanceof L2Npc) ? (L2Npc) killer : null, qs.getPlayer());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1439,7 +1439,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
{
|
||||
_log.warning(getClass().getSimpleName() + ": " + t.getMessage());
|
||||
}
|
||||
return (player != null) && player.getAccessLevel().isGm() && showResult(player, ("<html><body><title>Script error</title>" + Util.getStackTrace(t) + "</body></html>"));
|
||||
return (player != null) && player.getAccessLevel().isGm() && showResult(player, "<html><body><title>Script error</title>" + Util.getStackTrace(t) + "</body></html>");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1496,7 +1496,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
* Loads all quest states and variables for the specified player.
|
||||
* @param player the player who is entering the world
|
||||
*/
|
||||
public static final void playerEnter(L2PcInstance player)
|
||||
public static void playerEnter(L2PcInstance player)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement invalidQuestData = con.prepareStatement("DELETE FROM character_quests WHERE charId = ? AND name = ?");
|
||||
@ -2302,7 +2302,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
return null;
|
||||
}
|
||||
final L2Party party = player.getParty();
|
||||
return (party == null) || (party.getMembers().isEmpty()) ? player : party.getMembers().get(Rnd.get(party.getMembers().size()));
|
||||
return (party == null) || party.getMembers().isEmpty() ? player : party.getMembers().get(Rnd.get(party.getMembers().size()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2345,7 +2345,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
QuestState temp = null;
|
||||
final L2Party party = player.getParty();
|
||||
// if this player is not in a party, just check if this player instance matches the conditions itself
|
||||
if ((party == null) || (party.getMembers().isEmpty()))
|
||||
if ((party == null) || party.getMembers().isEmpty())
|
||||
{
|
||||
temp = player.getQuestState(getName());
|
||||
return (temp != null) && temp.isSet(var) && temp.get(var).equalsIgnoreCase(value) ? player : null;
|
||||
@ -2362,7 +2362,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
continue;
|
||||
}
|
||||
temp = partyMember.getQuestState(getName());
|
||||
if ((temp != null) && (temp.get(var) != null) && (temp.get(var)).equalsIgnoreCase(value) && partyMember.isInsideRadius(target, 1500, true, false))
|
||||
if ((temp != null) && (temp.get(var) != null) && temp.get(var).equalsIgnoreCase(value) && partyMember.isInsideRadius(target, 1500, true, false))
|
||||
{
|
||||
candidates.add(partyMember);
|
||||
}
|
||||
@ -2391,7 +2391,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
QuestState temp = null;
|
||||
final L2Party party = player.getParty();
|
||||
// if this player is not in a party, just check if this player instance matches the conditions itself
|
||||
if ((party == null) || (party.getMembers().isEmpty()))
|
||||
if ((party == null) || party.getMembers().isEmpty())
|
||||
{
|
||||
temp = player.getQuestState(getName());
|
||||
return (temp != null) && (temp.getState() == state) ? player : null;
|
||||
@ -2530,12 +2530,12 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
|
||||
private boolean checkPartyMemberConditions(QuestState qs, int condition, L2Npc npc)
|
||||
{
|
||||
return ((qs != null) && ((condition == -1) ? qs.isStarted() : qs.isCond(condition)) && checkPartyMember(qs, npc));
|
||||
return (qs != null) && ((condition == -1) ? qs.isStarted() : qs.isCond(condition)) && checkPartyMember(qs, npc);
|
||||
}
|
||||
|
||||
private static boolean checkDistanceToTarget(L2PcInstance player, L2Npc target)
|
||||
{
|
||||
return ((target == null) || com.l2jmobius.gameserver.util.Util.checkIfInRange(1500, player, target, true));
|
||||
return (target == null) || com.l2jmobius.gameserver.util.Util.checkIfInRange(1500, player, target, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,7 +120,7 @@ public final class QuestState
|
||||
*/
|
||||
public boolean isCreated()
|
||||
{
|
||||
return (_state == State.CREATED);
|
||||
return _state == State.CREATED;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,7 +129,7 @@ public final class QuestState
|
||||
*/
|
||||
public boolean isStarted()
|
||||
{
|
||||
return (_state == State.STARTED);
|
||||
return _state == State.STARTED;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -138,7 +138,7 @@ public final class QuestState
|
||||
*/
|
||||
public boolean isCompleted()
|
||||
{
|
||||
return (_state == State.COMPLETED);
|
||||
return _state == State.COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -322,10 +322,10 @@ public final class QuestState
|
||||
|
||||
// since no flag had been skipped until now, the least significant bits must all
|
||||
// be set to 1, up until "old" number of bits.
|
||||
completedStateFlags |= ((1 << old) - 1);
|
||||
completedStateFlags |= (1 << old) - 1;
|
||||
|
||||
// now, just set the bit corresponding to the passed cond to 1 (current step)
|
||||
completedStateFlags |= (1 << (cond - 1));
|
||||
completedStateFlags |= 1 << (cond - 1);
|
||||
set("__compltdStateFlags", String.valueOf(completedStateFlags));
|
||||
}
|
||||
}
|
||||
@ -334,7 +334,7 @@ public final class QuestState
|
||||
else if (cond < old)
|
||||
{
|
||||
// note, this also unsets the flag indicating that there exist skips
|
||||
completedStateFlags &= ((1 << cond) - 1);
|
||||
completedStateFlags &= (1 << cond) - 1;
|
||||
|
||||
// now, check if this resulted in no steps being skipped any more
|
||||
if (completedStateFlags == ((1 << cond) - 1))
|
||||
@ -354,7 +354,7 @@ public final class QuestState
|
||||
// Just mark this state and we are done.
|
||||
else
|
||||
{
|
||||
completedStateFlags |= (1 << (cond - 1));
|
||||
completedStateFlags |= 1 << (cond - 1);
|
||||
set("__compltdStateFlags", String.valueOf(completedStateFlags));
|
||||
}
|
||||
|
||||
@ -509,7 +509,7 @@ public final class QuestState
|
||||
*/
|
||||
public boolean isCond(int condition)
|
||||
{
|
||||
return (getInt("cond") == condition);
|
||||
return getInt("cond") == condition;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -546,7 +546,7 @@ public final class QuestState
|
||||
*/
|
||||
public boolean isSet(String variable)
|
||||
{
|
||||
return (get(variable) != null);
|
||||
return get(variable) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -588,7 +588,7 @@ public final class QuestState
|
||||
|
||||
public boolean isMemoState(int memoState)
|
||||
{
|
||||
return (getInt("memoState") == memoState);
|
||||
return getInt("memoState") == memoState;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -621,7 +621,7 @@ public final class QuestState
|
||||
*/
|
||||
public boolean isMemoStateEx(int slot, int memoStateEx)
|
||||
{
|
||||
return (getMemoStateEx(slot) == memoStateEx);
|
||||
return getMemoStateEx(slot) == memoStateEx;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1028,7 +1028,7 @@ public final class QuestState
|
||||
public boolean isNowAvailable()
|
||||
{
|
||||
final String val = get("restartTime");
|
||||
return ((val == null) || !Util.isDigit(val)) || (Long.parseLong(val) <= System.currentTimeMillis());
|
||||
return (val == null) || !Util.isDigit(val) || (Long.parseLong(val) <= System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user