Reformat and clean up "server" package
This commit is contained in:
@@ -48,10 +48,12 @@ import java.util.concurrent.locks.Lock;
|
|||||||
public class CashShop {
|
public class CashShop {
|
||||||
public static class CashItem {
|
public static class CashItem {
|
||||||
|
|
||||||
private int sn, itemId, price;
|
private final int sn;
|
||||||
private long period;
|
private final int itemId;
|
||||||
private short count;
|
private final int price;
|
||||||
private boolean onSale;
|
private final long period;
|
||||||
|
private final short count;
|
||||||
|
private final boolean onSale;
|
||||||
|
|
||||||
private CashItem(int sn, int itemId, int price, long period, short count, boolean onSale) {
|
private CashItem(int sn, int itemId, int price, long period, short count, boolean onSale) {
|
||||||
this.sn = sn;
|
this.sn = sn;
|
||||||
@@ -120,8 +122,9 @@ public class CashShop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class SpecialCashItem {
|
public static class SpecialCashItem {
|
||||||
private int sn, modifier;
|
private final int sn;
|
||||||
private byte info; //?
|
private final int modifier;
|
||||||
|
private final byte info; //?
|
||||||
|
|
||||||
public SpecialCashItem(int sn, int modifier, byte info) {
|
public SpecialCashItem(int sn, int modifier, byte info) {
|
||||||
this.sn = sn;
|
this.sn = sn;
|
||||||
@@ -240,13 +243,17 @@ public class CashShop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int accountId, characterId, nxCredit, maplePoint, nxPrepaid;
|
private final int accountId;
|
||||||
|
private final int characterId;
|
||||||
|
private int nxCredit;
|
||||||
|
private int maplePoint;
|
||||||
|
private int nxPrepaid;
|
||||||
private boolean opened;
|
private boolean opened;
|
||||||
private ItemFactory factory;
|
private ItemFactory factory;
|
||||||
private List<Item> inventory = new ArrayList<>();
|
private final List<Item> inventory = new ArrayList<>();
|
||||||
private List<Integer> wishList = new ArrayList<>();
|
private final List<Integer> wishList = new ArrayList<>();
|
||||||
private int notes = 0;
|
private int notes = 0;
|
||||||
private Lock lock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CASHSHOP);
|
private final Lock lock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CASHSHOP);
|
||||||
|
|
||||||
public CashShop(int accountId, int characterId, int jobType) throws SQLException {
|
public CashShop(int accountId, int characterId, int jobType) throws SQLException {
|
||||||
this.accountId = accountId;
|
this.accountId = accountId;
|
||||||
|
|||||||
@@ -22,8 +22,9 @@
|
|||||||
package server;
|
package server;
|
||||||
|
|
||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
public class DueyPackage {
|
public class DueyPackage {
|
||||||
private String sender = null;
|
private String sender = null;
|
||||||
|
|||||||
@@ -22,18 +22,20 @@
|
|||||||
package server;
|
package server;
|
||||||
|
|
||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Traitor
|
* @author Traitor
|
||||||
*/
|
*/
|
||||||
public class MTSItemInfo {
|
public class MTSItemInfo {
|
||||||
private int price;
|
private final int price;
|
||||||
private Item item;
|
private final Item item;
|
||||||
private String seller;
|
private final String seller;
|
||||||
private int id;
|
private final int id;
|
||||||
private int year, month, day = 1;
|
private final int year;
|
||||||
|
private final int month;
|
||||||
|
private int day = 1;
|
||||||
|
|
||||||
public MTSItemInfo(Item item, int price, int id, int cid, String seller, String date) {
|
public MTSItemInfo(Item item, int price, int id, int cid, String seller, String date) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
|||||||
@@ -31,11 +31,10 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Jay Estrella, Ronan
|
* @author Jay Estrella, Ronan
|
||||||
*/
|
*/
|
||||||
public class MakerItemFactory {
|
public class MakerItemFactory {
|
||||||
private static ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
private static final ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||||
|
|
||||||
public static MakerItemCreateEntry getItemCreateEntry(int toCreate, int stimulantid, Map<Integer, Short> reagentids) {
|
public static MakerItemCreateEntry getItemCreateEntry(int toCreate, int stimulantid, Map<Integer, Short> reagentids) {
|
||||||
MakerItemCreateEntry makerEntry = ii.getMakerItemEntry(toCreate);
|
MakerItemCreateEntry makerEntry = ii.getMakerItemEntry(toCreate);
|
||||||
@@ -145,11 +144,12 @@ public class MakerItemFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class MakerItemCreateEntry {
|
public static class MakerItemCreateEntry {
|
||||||
private int reqLevel, reqMakerLevel;
|
private final int reqLevel;
|
||||||
|
private final int reqMakerLevel;
|
||||||
private double cost;
|
private double cost;
|
||||||
private int reqCost;
|
private int reqCost;
|
||||||
private List<Pair<Integer, Integer>> reqItems = new ArrayList<>(); // itemId / amount
|
private final List<Pair<Integer, Integer>> reqItems = new ArrayList<>(); // itemId / amount
|
||||||
private List<Pair<Integer, Integer>> gainItems = new ArrayList<>(); // itemId / amount
|
private final List<Pair<Integer, Integer>> gainItems = new ArrayList<>(); // itemId / amount
|
||||||
|
|
||||||
public MakerItemCreateEntry(int cost, int reqLevel, int reqMakerLevel) {
|
public MakerItemCreateEntry(int cost, int reqLevel, int reqMakerLevel) {
|
||||||
this.cost = cost;
|
this.cost = cost;
|
||||||
|
|||||||
@@ -1648,7 +1648,9 @@ public class StatEffect {
|
|||||||
private boolean isCureAllAbnormalStatus() {
|
private boolean isCureAllAbnormalStatus() {
|
||||||
if (skill) {
|
if (skill) {
|
||||||
return isHerosWill(sourceid);
|
return isHerosWill(sourceid);
|
||||||
} else return sourceid == 2022544;
|
} else {
|
||||||
|
return sourceid == 2022544;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHerosWill(int skillid) {
|
public static boolean isHerosWill(int skillid) {
|
||||||
|
|||||||
@@ -22,11 +22,10 @@ package server;
|
|||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class ThreadManager {
|
public class ThreadManager {
|
||||||
private static ThreadManager instance = new ThreadManager();
|
private static final ThreadManager instance = new ThreadManager();
|
||||||
|
|
||||||
public static ThreadManager getInstance() {
|
public static ThreadManager getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
@@ -61,7 +60,8 @@ public class ThreadManager {
|
|||||||
tpe.shutdown();
|
tpe.shutdown();
|
||||||
try {
|
try {
|
||||||
tpe.awaitTermination(5, TimeUnit.MINUTES);
|
tpe.awaitTermination(5, TimeUnit.MINUTES);
|
||||||
} catch (InterruptedException ie) {}
|
} catch (InterruptedException ie) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class TimerManager implements TimerManagerMBean {
|
public class TimerManager implements TimerManagerMBean {
|
||||||
private static TimerManager instance = new TimerManager();
|
private static final TimerManager instance = new TimerManager();
|
||||||
|
|
||||||
public static TimerManager getInstance() {
|
public static TimerManager getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import client.Character;
|
|||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author kevintjuh93
|
* @author kevintjuh93
|
||||||
*/
|
*/
|
||||||
public class RescueGaga extends Events {
|
public class RescueGaga extends Events {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX)
|
* @author Alan (SharpAceX)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX)
|
* @author Alan (SharpAceX)
|
||||||
* @author Ronan - added ores and reworked global loots
|
* @author Ronan - added ores and reworked global loots
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub
|
* @author Alan (SharpAceX) - gachapon source classes stub
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub
|
* @author Alan (SharpAceX) - gachapon source classes stub
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub & pirate items
|
* @author Alan (SharpAceX) - gachapon source classes stub & pirate items
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
||||||
* @author Ronan - parsed MapleSEA loots, thanks Vcoc for noticing somewhat unbalanced loots in NLC
|
* @author Ronan - parsed MapleSEA loots, thanks Vcoc for noticing somewhat unbalanced loots in NLC
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub
|
* @author Alan (SharpAceX) - gachapon source classes stub
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots src: http://maplesecrets.blogspot.com/2011/06/gachapon-showa-towns-sauna-female-spa.html
|
* MapleSEA-like loots src: http://maplesecrets.blogspot.com/2011/06/gachapon-showa-towns-sauna-female-spa.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub
|
* @author Alan (SharpAceX) - gachapon source classes stub
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots src: http://maplesecrets.blogspot.com/2011/05/gachapon-showa-towns-sauna.html
|
* MapleSEA-like loots src: http://maplesecrets.blogspot.com/2011/05/gachapon-showa-towns-sauna.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package server.gachapon;
|
package server.gachapon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
|
||||||
* @author Ronan - parsed MapleSEA loots
|
* @author Ronan - parsed MapleSEA loots
|
||||||
*
|
* <p>
|
||||||
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
* MapleSEA-like loots thanks to AyumiLove - src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,14 @@ package server.life;
|
|||||||
public enum Element {
|
public enum Element {
|
||||||
NEUTRAL(0), PHYSICAL(1), FIRE(2, true), ICE(3, true), LIGHTING(4), POISON(5), HOLY(6, true), DARKNESS(7);
|
NEUTRAL(0), PHYSICAL(1), FIRE(2, true), ICE(3, true), LIGHTING(4), POISON(5), HOLY(6, true), DARKNESS(7);
|
||||||
|
|
||||||
private int value;
|
private final int value;
|
||||||
private boolean special = false;
|
private boolean special = false;
|
||||||
private Element(int v) {
|
|
||||||
|
Element(int v) {
|
||||||
this.value = v;
|
this.value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Element(int v, boolean special) {
|
Element(int v, boolean special) {
|
||||||
this.value = v;
|
this.value = v;
|
||||||
this.special = special;
|
this.special = special;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
package server.life;
|
package server.life;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Danny (Leifde)
|
* @author Danny (Leifde)
|
||||||
*/
|
*/
|
||||||
public class MobAttackInfo {
|
public class MobAttackInfo {
|
||||||
|
|||||||
@@ -32,12 +32,11 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Danny (Leifde)
|
* @author Danny (Leifde)
|
||||||
*/
|
*/
|
||||||
public class MobAttackInfoFactory {
|
public class MobAttackInfoFactory {
|
||||||
private static Map<String, MobAttackInfo> mobAttacks = new HashMap<>();
|
private static final Map<String, MobAttackInfo> mobAttacks = new HashMap<>();
|
||||||
private static DataProvider dataSource = DataProviderFactory.getDataProvider(WZFiles.MOB);
|
private static final DataProvider dataSource = DataProviderFactory.getDataProvider(WZFiles.MOB);
|
||||||
|
|
||||||
public static MobAttackInfo getMobAttackInfo(Monster mob, int attack) {
|
public static MobAttackInfo getMobAttackInfo(Monster mob, int attack) {
|
||||||
MobAttackInfo ret = mobAttacks.get(mob.getId() + "" + attack);
|
MobAttackInfo ret = mobAttacks.get(mob.getId() + "" + attack);
|
||||||
|
|||||||
@@ -39,13 +39,14 @@ import java.util.List;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Danny (Leifde)
|
* @author Danny (Leifde)
|
||||||
*/
|
*/
|
||||||
public class MobSkill {
|
public class MobSkill {
|
||||||
|
|
||||||
private int skillId, skillLevel, mpCon;
|
private final int skillId;
|
||||||
private List<Integer> toSummon = new ArrayList<>();
|
private final int skillLevel;
|
||||||
|
private int mpCon;
|
||||||
|
private final List<Integer> toSummon = new ArrayList<>();
|
||||||
private int spawnEffect, hp, x, y, count;
|
private int spawnEffect, hp, x, y, count;
|
||||||
private long duration, cooltime;
|
private long duration, cooltime;
|
||||||
private float prop;
|
private float prop;
|
||||||
|
|||||||
@@ -40,14 +40,13 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Danny (Leifde)
|
* @author Danny (Leifde)
|
||||||
*/
|
*/
|
||||||
public class MobSkillFactory {
|
public class MobSkillFactory {
|
||||||
|
|
||||||
private static Map<String, MobSkill> mobSkills = new HashMap<>();
|
private static final Map<String, MobSkill> mobSkills = new HashMap<>();
|
||||||
private final static DataProvider dataSource = DataProviderFactory.getDataProvider(WZFiles.SKILL);
|
private final static DataProvider dataSource = DataProviderFactory.getDataProvider(WZFiles.SKILL);
|
||||||
private static Data skillRoot = dataSource.getData("MobSkill.img");
|
private static final Data skillRoot = dataSource.getData("MobSkill.img");
|
||||||
private final static MonitoredReentrantReadWriteLock dataLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.MOBSKILL_FACTORY);
|
private final static MonitoredReentrantReadWriteLock dataLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.MOBSKILL_FACTORY);
|
||||||
private final static MonitoredReadLock rL = MonitoredReadLockFactory.createLock(dataLock);
|
private final static MonitoredReadLock rL = MonitoredReadLockFactory.createLock(dataLock);
|
||||||
private final static MonitoredWriteLock wL = MonitoredWriteLockFactory.createLock(dataLock);
|
private final static MonitoredWriteLock wL = MonitoredWriteLockFactory.createLock(dataLock);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
package server.life;
|
package server.life;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LightPepsi
|
* @author LightPepsi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -33,6 +32,7 @@ public class MonsterDropEntry {
|
|||||||
this.Minimum = Minimum;
|
this.Minimum = Minimum;
|
||||||
this.Maximum = Maximum;
|
this.Maximum = Maximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public short questid;
|
public short questid;
|
||||||
public int itemId, chance, Minimum, Maximum;
|
public int itemId, chance, Minimum, Maximum;
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
package server.life;
|
package server.life;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LightPepsi
|
* @author LightPepsi
|
||||||
*/
|
*/
|
||||||
public class MonsterGlobalDropEntry {
|
public class MonsterGlobalDropEntry {
|
||||||
@@ -33,6 +32,7 @@ public class MonsterGlobalDropEntry {
|
|||||||
this.Minimum = Minimum;
|
this.Minimum = Minimum;
|
||||||
this.Maximum = Maximum;
|
this.Maximum = Maximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int itemId, chance, Minimum, Maximum, continentid;
|
public int itemId, chance, Minimum, Maximum, continentid;
|
||||||
public short questid;
|
public short questid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package server.life;
|
package server.life;
|
||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
|
|
||||||
public interface MonsterListener {
|
public interface MonsterListener {
|
||||||
|
|||||||
@@ -28,12 +28,17 @@ import java.awt.*;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class SpawnPoint {
|
public class SpawnPoint {
|
||||||
private int monster, mobTime, team, fh, f;
|
private final int monster;
|
||||||
private Point pos;
|
private final int mobTime;
|
||||||
|
private final int team;
|
||||||
|
private final int fh;
|
||||||
|
private final int f;
|
||||||
|
private final Point pos;
|
||||||
private long nextPossibleSpawn;
|
private long nextPossibleSpawn;
|
||||||
private int mobInterval = 5000;
|
private int mobInterval = 5000;
|
||||||
private AtomicInteger spawnedMonsters = new AtomicInteger(0);
|
private final AtomicInteger spawnedMonsters = new AtomicInteger(0);
|
||||||
private boolean immobile, denySpawn = false;
|
private final boolean immobile;
|
||||||
|
private boolean denySpawn = false;
|
||||||
|
|
||||||
public SpawnPoint(final Monster monster, Point pos, boolean immobile, int mobTime, int mobInterval, int team) {
|
public SpawnPoint(final Monster monster, Point pos, boolean immobile, int mobTime, int mobInterval, int team) {
|
||||||
this.monster = monster.getId();
|
this.monster = monster.getId();
|
||||||
@@ -67,11 +72,7 @@ public class SpawnPoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldForceSpawn() {
|
public boolean shouldForceSpawn() {
|
||||||
if (mobTime < 0 || spawnedMonsters.get() > 0) {
|
return mobTime >= 0 && spawnedMonsters.get() <= 0;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Monster getMonster() {
|
public Monster getMonster() {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
package server.maps;
|
package server.maps;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author AngelSL
|
* @author AngelSL
|
||||||
*/
|
*/
|
||||||
public enum FieldLimit {
|
public enum FieldLimit {
|
||||||
@@ -53,9 +52,9 @@ public enum FieldLimit {
|
|||||||
DROP_LIMIT(0x400000);
|
DROP_LIMIT(0x400000);
|
||||||
//ROCKETBOOSTER_LIMIT(0x800000) //lol we don't even have mechanics <3
|
//ROCKETBOOSTER_LIMIT(0x800000) //lol we don't even have mechanics <3
|
||||||
|
|
||||||
private long i;
|
private final long i;
|
||||||
|
|
||||||
private FieldLimit(long i) {
|
FieldLimit(long i) {
|
||||||
this.i = i;
|
this.i = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -334,7 +334,9 @@ public class Reactor extends AbstractMapObject {
|
|||||||
if (this.getDelay() > 0) {
|
if (this.getDelay() > 0) {
|
||||||
this.delayedRespawn();
|
this.delayedRespawn();
|
||||||
}
|
}
|
||||||
} else return !this.inDelayedRespawn();
|
} else {
|
||||||
|
return !this.inDelayedRespawn();
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
reactorLock.unlock();
|
reactorLock.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class ReactorDropEntry {
|
|||||||
this.chance = chance;
|
this.chance = chance;
|
||||||
this.questid = questId;
|
this.questid = questId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int itemId, chance, questid;
|
public int itemId, chance, questid;
|
||||||
public int assignedRangeStart, assignedRangeLength;
|
public int assignedRangeStart, assignedRangeLength;
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
package server.maps;
|
package server.maps;
|
||||||
|
|
||||||
public class SavedLocation {
|
public class SavedLocation {
|
||||||
private int mapid = 102000000, portal;
|
private int mapid = 102000000;
|
||||||
|
private final int portal;
|
||||||
|
|
||||||
public SavedLocation(int mapid, int portal) {
|
public SavedLocation(int mapid, int portal) {
|
||||||
this.mapid = mapid;
|
this.mapid = mapid;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public enum SummonMovementType {
|
|||||||
STATIONARY(0), FOLLOW(1), CIRCLE_FOLLOW(3);
|
STATIONARY(0), FOLLOW(1), CIRCLE_FOLLOW(3);
|
||||||
private final int val;
|
private final int val;
|
||||||
|
|
||||||
private SummonMovementType(int val) {
|
SummonMovementType(int val) {
|
||||||
this.val = val;
|
this.val = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,13 @@
|
|||||||
*/
|
*/
|
||||||
package server.movement;
|
package server.movement;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.*;
|
||||||
|
|
||||||
public abstract class AbstractLifeMovement implements LifeMovement {
|
public abstract class AbstractLifeMovement implements LifeMovement {
|
||||||
private Point position;
|
private final Point position;
|
||||||
private int duration;
|
private final int duration;
|
||||||
private int newstate, type;
|
private final int newstate;
|
||||||
|
private final int type;
|
||||||
|
|
||||||
public AbstractLifeMovement(int type, Point position, int duration, int newstate) {
|
public AbstractLifeMovement(int type, Point position, int duration, int newstate) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
package server.movement;
|
package server.movement;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.*;
|
||||||
|
|
||||||
public interface LifeMovement extends LifeMovementFragment {
|
public interface LifeMovement extends LifeMovementFragment {
|
||||||
Point getPosition();
|
Point getPosition();
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import java.util.Map.Entry;
|
|||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class AriantColiseum {
|
public class AriantColiseum {
|
||||||
@@ -43,8 +42,8 @@ public class AriantColiseum {
|
|||||||
private Expedition exped;
|
private Expedition exped;
|
||||||
private MapleMap map;
|
private MapleMap map;
|
||||||
|
|
||||||
private Map<Character, Integer> score;
|
private final Map<Character, Integer> score;
|
||||||
private Map<Character, Integer> rewardTier;
|
private final Map<Character, Integer> rewardTier;
|
||||||
private boolean scoreDirty = false;
|
private boolean scoreDirty = false;
|
||||||
|
|
||||||
private ScheduledFuture<?> ariantUpdate;
|
private ScheduledFuture<?> ariantUpdate;
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package server.partyquest;
|
package server.partyquest;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author David
|
* @author David
|
||||||
*/
|
*/
|
||||||
public class GuardianSpawnPoint {
|
public class GuardianSpawnPoint {
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import java.util.List;
|
|||||||
public class MonsterCarnivalParty {
|
public class MonsterCarnivalParty {
|
||||||
|
|
||||||
private List<Character> members = new LinkedList<>();
|
private List<Character> members = new LinkedList<>();
|
||||||
private Character leader;
|
private final Character leader;
|
||||||
private byte team;
|
private final byte team;
|
||||||
private short availableCP = 0, totalCP = 0;
|
private short availableCP = 0, totalCP = 0;
|
||||||
private int summons = 8;
|
private int summons = 8;
|
||||||
private boolean winner = false;
|
private boolean winner = false;
|
||||||
@@ -77,11 +77,12 @@ public class MonsterCarnivalParty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void warpOut() {
|
public void warpOut() {
|
||||||
if (winner == true)
|
if (winner == true) {
|
||||||
warpOut(980000003 + (leader.getMonsterCarnival().getRoom() * 100));
|
warpOut(980000003 + (leader.getMonsterCarnival().getRoom() * 100));
|
||||||
else
|
} else {
|
||||||
warpOut(980000004 + (leader.getMonsterCarnival().getRoom() * 100));
|
warpOut(980000004 + (leader.getMonsterCarnival().getRoom() * 100));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean allInMap(MapleMap map) {
|
public boolean allInMap(MapleMap map) {
|
||||||
boolean status = true;
|
boolean status = true;
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author kevintjuh93
|
* @author kevintjuh93
|
||||||
*/
|
*/
|
||||||
public class PartyQuest {
|
public class PartyQuest {
|
||||||
@@ -49,11 +48,12 @@ public class PartyQuest {
|
|||||||
for (PartyCharacter pchr : party.getMembers()) {
|
for (PartyCharacter pchr : party.getMembers()) {
|
||||||
if (pchr.getChannel() == channel && pchr.getMapId() == mapid) {
|
if (pchr.getChannel() == channel && pchr.getMapId() == mapid) {
|
||||||
Character chr = Server.getInstance().getWorld(world).getChannel(channel).getPlayerStorage().getCharacterById(pchr.getId());
|
Character chr = Server.getInstance().getWorld(world).getChannel(channel).getPlayerStorage().getCharacterById(pchr.getId());
|
||||||
if (chr != null)
|
if (chr != null) {
|
||||||
this.participants.add(chr);
|
this.participants.add(chr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Party getParty() {
|
public Party getParty() {
|
||||||
return party;
|
return party;
|
||||||
@@ -67,7 +67,9 @@ public class PartyQuest {
|
|||||||
synchronized (participants) {
|
synchronized (participants) {
|
||||||
participants.remove(chr);
|
participants.remove(chr);
|
||||||
chr.setPartyQuest(null);
|
chr.setPartyQuest(null);
|
||||||
if (participants.isEmpty()) super.finalize();
|
if (participants.isEmpty()) {
|
||||||
|
super.finalize();
|
||||||
|
}
|
||||||
//System.gc();
|
//System.gc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import tools.PacketCreator;
|
|||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author kevintjuh93
|
* @author kevintjuh93
|
||||||
*/
|
*/
|
||||||
public class Pyramid extends PartyQuest {
|
public class Pyramid extends PartyQuest {
|
||||||
@@ -82,7 +81,9 @@ public class Pyramid extends PartyQuest {
|
|||||||
count = 0;
|
count = 0;
|
||||||
gaugeSchedule = TimerManager.getInstance().register(() -> {
|
gaugeSchedule = TimerManager.getInstance().register(() -> {
|
||||||
gauge -= decrease;
|
gauge -= decrease;
|
||||||
if (gauge <= 0) warp(926010001);
|
if (gauge <= 0) {
|
||||||
|
warp(926010001);
|
||||||
|
}
|
||||||
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@@ -90,20 +91,28 @@ public class Pyramid extends PartyQuest {
|
|||||||
|
|
||||||
public void kill() {
|
public void kill() {
|
||||||
kill++;
|
kill++;
|
||||||
if (gauge < 100) count++;
|
if (gauge < 100) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
gauge++;
|
gauge++;
|
||||||
broadcastInfo("hit", kill);
|
broadcastInfo("hit", kill);
|
||||||
if (gauge >= 100) gauge = 100;
|
if (gauge >= 100) {
|
||||||
|
gauge = 100;
|
||||||
|
}
|
||||||
checkBuffs();
|
checkBuffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cool() {
|
public void cool() {
|
||||||
cool++;
|
cool++;
|
||||||
int plus = coolAdd;
|
int plus = coolAdd;
|
||||||
if ((gauge + coolAdd) > 100) plus -= ((gauge + coolAdd) - 100);
|
if ((gauge + coolAdd) > 100) {
|
||||||
|
plus -= ((gauge + coolAdd) - 100);
|
||||||
|
}
|
||||||
gauge += plus;
|
gauge += plus;
|
||||||
count += plus;
|
count += plus;
|
||||||
if (gauge >= 100) gauge = 100;
|
if (gauge >= 100) {
|
||||||
|
gauge = 100;
|
||||||
|
}
|
||||||
broadcastInfo("cool", cool);
|
broadcastInfo("cool", cool);
|
||||||
checkBuffs();
|
checkBuffs();
|
||||||
|
|
||||||
@@ -118,10 +127,11 @@ public class Pyramid extends PartyQuest {
|
|||||||
|
|
||||||
public int timer() {
|
public int timer() {
|
||||||
int value;
|
int value;
|
||||||
if (stage > 0)
|
if (stage > 0) {
|
||||||
value = 180;
|
value = 180;
|
||||||
else
|
} else {
|
||||||
value = 120;
|
value = 120;
|
||||||
|
}
|
||||||
|
|
||||||
timer = TimerManager.getInstance().schedule(() -> {
|
timer = TimerManager.getInstance().schedule(() -> {
|
||||||
stage++;
|
stage++;
|
||||||
@@ -146,7 +156,9 @@ public class Pyramid extends PartyQuest {
|
|||||||
gaugeSchedule = null;
|
gaugeSchedule = null;
|
||||||
timer.cancel(false);
|
timer.cancel(false);
|
||||||
timer = null;
|
timer = null;
|
||||||
} else stage = 0;
|
} else {
|
||||||
|
stage = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void broadcastInfo(String info, int amount) {
|
public void broadcastInfo(String info, int amount) {
|
||||||
@@ -157,7 +169,9 @@ public class Pyramid extends PartyQuest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean useSkill() {
|
public boolean useSkill() {
|
||||||
if (skill < 1) return false;
|
if (skill < 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
skill--;
|
skill--;
|
||||||
broadcastInfo("skill", skill);
|
broadcastInfo("skill", skill);
|
||||||
@@ -169,8 +183,9 @@ public class Pyramid extends PartyQuest {
|
|||||||
if (buffcount == 0 && total >= 250) {
|
if (buffcount == 0 && total >= 250) {
|
||||||
buffcount++;
|
buffcount++;
|
||||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||||
for (Character chr : getParticipants())
|
for (Character chr : getParticipants()) {
|
||||||
ii.getItemEffect(2022585).applyTo(chr);
|
ii.getItemEffect(2022585).applyTo(chr);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (buffcount == 1 && total >= 500) {
|
} else if (buffcount == 1 && total >= 500) {
|
||||||
buffcount++;
|
buffcount++;
|
||||||
@@ -212,20 +227,34 @@ public class Pyramid extends PartyQuest {
|
|||||||
if (exp == 0) {
|
if (exp == 0) {
|
||||||
int totalkills = (kill + cool);
|
int totalkills = (kill + cool);
|
||||||
if (stage == 5) {
|
if (stage == 5) {
|
||||||
if (totalkills >= 3000) rank = 0;
|
if (totalkills >= 3000) {
|
||||||
else if (totalkills >= 2000) rank = 1;
|
rank = 0;
|
||||||
else if (totalkills >= 1500) rank = 2;
|
} else if (totalkills >= 2000) {
|
||||||
else if(totalkills >= 500) rank = 3;
|
rank = 1;
|
||||||
else rank = 4;
|
} else if (totalkills >= 1500) {
|
||||||
|
rank = 2;
|
||||||
|
} else if (totalkills >= 500) {
|
||||||
|
rank = 3;
|
||||||
} else {
|
} else {
|
||||||
if (totalkills >= 2000) rank = 3;
|
rank = 4;
|
||||||
else rank = 4;
|
}
|
||||||
|
} else {
|
||||||
|
if (totalkills >= 2000) {
|
||||||
|
rank = 3;
|
||||||
|
} else {
|
||||||
|
rank = 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rank == 0) exp = (60500 + (5500 * mode.getMode()));
|
if (rank == 0) {
|
||||||
else if(rank == 1) exp = (55000 + (5000 * mode.getMode()));
|
exp = (60500 + (5500 * mode.getMode()));
|
||||||
else if (rank == 2) exp = (46750 + (4250 * mode.getMode()));
|
} else if (rank == 1) {
|
||||||
else if (rank == 3) exp = (22000 + (2000 * mode.getMode()));
|
exp = (55000 + (5000 * mode.getMode()));
|
||||||
|
} else if (rank == 2) {
|
||||||
|
exp = (46750 + (4250 * mode.getMode()));
|
||||||
|
} else if (rank == 3) {
|
||||||
|
exp = (22000 + (2000 * mode.getMode()));
|
||||||
|
}
|
||||||
|
|
||||||
exp += ((kill * 2) + (cool * 10));
|
exp += ((kill * 2) + (cool * 10));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class BuffAction extends AbstractQuestAction {
|
public class BuffAction extends AbstractQuestAction {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class ExpAction extends AbstractQuestAction {
|
public class ExpAction extends AbstractQuestAction {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class FameAction extends AbstractQuestAction {
|
public class FameAction extends AbstractQuestAction {
|
||||||
|
|||||||
@@ -26,13 +26,12 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class InfoAction extends AbstractQuestAction {
|
public class InfoAction extends AbstractQuestAction {
|
||||||
|
|
||||||
private String info;
|
private String info;
|
||||||
private int questID;
|
private final int questID;
|
||||||
|
|
||||||
public InfoAction(Quest quest, Data data) {
|
public InfoAction(Quest quest, Data data) {
|
||||||
super(QuestActionType.INFO, quest);
|
super(QuestActionType.INFO, quest);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
@@ -65,16 +64,19 @@ public class ItemAction extends AbstractQuestAction {
|
|||||||
|
|
||||||
Integer prop = null;
|
Integer prop = null;
|
||||||
Data propData = iEntry.getChildByPath("prop");
|
Data propData = iEntry.getChildByPath("prop");
|
||||||
if(propData != null)
|
if (propData != null) {
|
||||||
prop = DataTool.getInt(propData);
|
prop = DataTool.getInt(propData);
|
||||||
|
}
|
||||||
|
|
||||||
int gender = 2;
|
int gender = 2;
|
||||||
if (iEntry.getChildByPath("gender") != null)
|
if (iEntry.getChildByPath("gender") != null) {
|
||||||
gender = DataTool.getInt(iEntry.getChildByPath("gender"));
|
gender = DataTool.getInt(iEntry.getChildByPath("gender"));
|
||||||
|
}
|
||||||
|
|
||||||
int job = -1;
|
int job = -1;
|
||||||
if (iEntry.getChildByPath("job") != null)
|
if (iEntry.getChildByPath("job") != null) {
|
||||||
job = DataTool.getInt(iEntry.getChildByPath("job"));
|
job = DataTool.getInt(iEntry.getChildByPath("job"));
|
||||||
|
}
|
||||||
|
|
||||||
items.add(new ItemData(Integer.parseInt(iEntry.getName()), id, count, prop, job, gender, period));
|
items.add(new ItemData(Integer.parseInt(iEntry.getName()), id, count, prop, job, gender, period));
|
||||||
}
|
}
|
||||||
@@ -105,8 +107,9 @@ public class ItemAction extends AbstractQuestAction {
|
|||||||
|
|
||||||
if (iEntry.getProp() != null) {
|
if (iEntry.getProp() != null) {
|
||||||
if (iEntry.getProp() == -1) {
|
if (iEntry.getProp() == -1) {
|
||||||
if(extSelection != extNum++)
|
if (extSelection != extNum++) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
accProps += iEntry.getProp();
|
accProps += iEntry.getProp();
|
||||||
|
|
||||||
@@ -161,7 +164,9 @@ public class ItemAction extends AbstractQuestAction {
|
|||||||
List<Pair<Item, InventoryType>> randomList = new LinkedList<>();
|
List<Pair<Item, InventoryType>> randomList = new LinkedList<>();
|
||||||
|
|
||||||
List<Integer> allSlotUsed = new ArrayList(5);
|
List<Integer> allSlotUsed = new ArrayList(5);
|
||||||
for(byte i = 0; i < 5; i++) allSlotUsed.add(0);
|
for (byte i = 0; i < 5; i++) {
|
||||||
|
allSlotUsed.add(0);
|
||||||
|
}
|
||||||
|
|
||||||
for (ItemData item : items) {
|
for (ItemData item : items) {
|
||||||
if (!canGetItem(item, chr)) {
|
if (!canGetItem(item, chr)) {
|
||||||
@@ -189,8 +194,9 @@ public class ItemAction extends AbstractQuestAction {
|
|||||||
|
|
||||||
int freeSlotCount = chr.getInventory(type).freeSlotCountById(item.getId(), quantity);
|
int freeSlotCount = chr.getInventory(type).freeSlotCountById(item.getId(), quantity);
|
||||||
if (freeSlotCount == -1) {
|
if (freeSlotCount == -1) {
|
||||||
if(type.equals(InventoryType.EQUIP) && chr.getInventory(InventoryType.EQUIPPED).countById(item.getId()) > quantity)
|
if (type.equals(InventoryType.EQUIP) && chr.getInventory(InventoryType.EQUIPPED).countById(item.getId()) > quantity) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
announceInventoryLimit(Collections.singletonList(item.getId()), chr);
|
announceInventoryLimit(Collections.singletonList(item.getId()), chr);
|
||||||
return false;
|
return false;
|
||||||
@@ -207,7 +213,9 @@ public class ItemAction extends AbstractQuestAction {
|
|||||||
Client c = chr.getClient();
|
Client c = chr.getClient();
|
||||||
|
|
||||||
List<Integer> rndUsed = new ArrayList(5);
|
List<Integer> rndUsed = new ArrayList(5);
|
||||||
for(byte i = 0; i < 5; i++) rndUsed.add(allSlotUsed.get(i));
|
for (byte i = 0; i < 5; i++) {
|
||||||
|
rndUsed.add(allSlotUsed.get(i));
|
||||||
|
}
|
||||||
|
|
||||||
for (Pair<Item, InventoryType> it : randomList) {
|
for (Pair<Item, InventoryType> it : randomList) {
|
||||||
int idx = it.getRight().getType() - 1;
|
int idx = it.getRight().getType() - 1;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class MesoAction extends AbstractQuestAction {
|
public class MesoAction extends AbstractQuestAction {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import server.quest.QuestActionType;
|
|||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class NextQuestAction extends AbstractQuestAction {
|
public class NextQuestAction extends AbstractQuestAction {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class PetSkillAction extends AbstractQuestAction {
|
public class PetSkillAction extends AbstractQuestAction {
|
||||||
@@ -51,8 +50,9 @@ public class PetSkillAction extends AbstractQuestAction {
|
|||||||
@Override
|
@Override
|
||||||
public boolean check(Character chr, Integer extSelection) {
|
public boolean check(Character chr, Integer extSelection) {
|
||||||
QuestStatus status = chr.getQuest(Quest.getInstance(questID));
|
QuestStatus status = chr.getQuest(Quest.getInstance(questID));
|
||||||
if(!(status.getStatus() == QuestStatus.Status.NOT_STARTED && status.getForfeited() > 0))
|
if (!(status.getStatus() == QuestStatus.Status.NOT_STARTED && status.getForfeited() > 0)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return chr.getPet(0) != null;
|
return chr.getPet(0) != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class PetSpeedAction extends AbstractQuestAction {
|
public class PetSpeedAction extends AbstractQuestAction {
|
||||||
@@ -46,7 +45,9 @@ public class PetSpeedAction extends AbstractQuestAction {
|
|||||||
Client c = chr.getClient();
|
Client c = chr.getClient();
|
||||||
|
|
||||||
Pet pet = chr.getPet(0); // assuming here only the pet leader will gain owner speed
|
Pet pet = chr.getPet(0); // assuming here only the pet leader will gain owner speed
|
||||||
if(pet == null) return;
|
if (pet == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
c.lockClient();
|
c.lockClient();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestActionType;
|
import server.quest.QuestActionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class PetTamenessAction extends AbstractQuestAction {
|
public class PetTamenessAction extends AbstractQuestAction {
|
||||||
@@ -51,7 +50,9 @@ public class PetTamenessAction extends AbstractQuestAction {
|
|||||||
Client c = chr.getClient();
|
Client c = chr.getClient();
|
||||||
|
|
||||||
Pet pet = chr.getPet(0); // assuming here only the pet leader will gain tameness
|
Pet pet = chr.getPet(0); // assuming here only the pet leader will gain tameness
|
||||||
if(pet == null) return;
|
if (pet == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
c.lockClient();
|
c.lockClient();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class QuestAction extends AbstractQuestAction {
|
public class QuestAction extends AbstractQuestAction {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class SkillAction extends AbstractQuestAction {
|
public class SkillAction extends AbstractQuestAction {
|
||||||
@@ -55,8 +54,9 @@ public class SkillAction extends AbstractQuestAction {
|
|||||||
byte skillLevel = 0;
|
byte skillLevel = 0;
|
||||||
int skillid = DataTool.getInt(sEntry.getChildByPath("id"));
|
int skillid = DataTool.getInt(sEntry.getChildByPath("id"));
|
||||||
Data skillLevelData = sEntry.getChildByPath("skillLevel");
|
Data skillLevelData = sEntry.getChildByPath("skillLevel");
|
||||||
if(skillLevelData != null)
|
if (skillLevelData != null) {
|
||||||
skillLevel = (byte) DataTool.getInt(skillLevelData);
|
skillLevel = (byte) DataTool.getInt(skillLevelData);
|
||||||
|
}
|
||||||
int masterLevel = DataTool.getInt(sEntry.getChildByPath("masterLevel"));
|
int masterLevel = DataTool.getInt(sEntry.getChildByPath("masterLevel"));
|
||||||
List<Integer> jobs = new ArrayList<>();
|
List<Integer> jobs = new ArrayList<>();
|
||||||
|
|
||||||
@@ -75,12 +75,11 @@ public class SkillAction extends AbstractQuestAction {
|
|||||||
public void run(Character chr, Integer extSelection) {
|
public void run(Character chr, Integer extSelection) {
|
||||||
for (SkillData skill : skillData.values()) {
|
for (SkillData skill : skillData.values()) {
|
||||||
Skill skillObject = SkillFactory.getSkill(skill.getId());
|
Skill skillObject = SkillFactory.getSkill(skill.getId());
|
||||||
if(skillObject == null) continue;
|
if (skillObject == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
boolean shouldLearn = false;
|
boolean shouldLearn = skill.jobsContains(chr.getJob()) || skillObject.isBeginnerSkill();
|
||||||
|
|
||||||
if(skill.jobsContains(chr.getJob()) || skillObject.isBeginnerSkill())
|
|
||||||
shouldLearn = true;
|
|
||||||
|
|
||||||
byte skillLevel = (byte) Math.max(skill.getLevel(), chr.getSkillLevel(skillObject));
|
byte skillLevel = (byte) Math.max(skill.getLevel(), chr.getSkillLevel(skillObject));
|
||||||
int masterLevel = Math.max(skill.getMasterLevel(), chr.getMasterLevel(skillObject));
|
int masterLevel = Math.max(skill.getMasterLevel(), chr.getMasterLevel(skillObject));
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class BuffExceptRequirement extends AbstractQuestRequirement {
|
public class BuffExceptRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class BuffRequirement extends AbstractQuestRequirement {
|
public class BuffRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class CompletedQuestRequirement extends AbstractQuestRequirement {
|
public class CompletedQuestRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import server.quest.QuestRequirementType;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class EndDateRequirement extends AbstractQuestRequirement {
|
public class EndDateRequirement extends AbstractQuestRequirement {
|
||||||
@@ -43,7 +42,6 @@ public class EndDateRequirement extends AbstractQuestRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class FieldEnterRequirement extends AbstractQuestRequirement {
|
public class FieldEnterRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -31,12 +31,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class InfoExRequirement extends AbstractQuestRequirement {
|
public class InfoExRequirement extends AbstractQuestRequirement {
|
||||||
private List<String> infoExpected = new ArrayList<>();
|
private final List<String> infoExpected = new ArrayList<>();
|
||||||
private int questID;
|
private final int questID;
|
||||||
|
|
||||||
|
|
||||||
public InfoExRequirement(Quest quest, Data data) {
|
public InfoExRequirement(Quest quest, Data data) {
|
||||||
|
|||||||
@@ -26,13 +26,12 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class InfoNumberRequirement extends AbstractQuestRequirement {
|
public class InfoNumberRequirement extends AbstractQuestRequirement {
|
||||||
|
|
||||||
private short infoNumber;
|
private short infoNumber;
|
||||||
private int questID;
|
private final int questID;
|
||||||
|
|
||||||
public InfoNumberRequirement(Quest quest, Data data) {
|
public InfoNumberRequirement(Quest quest, Data data) {
|
||||||
super(QuestRequirementType.INFO_NUMBER);
|
super(QuestRequirementType.INFO_NUMBER);
|
||||||
|
|||||||
@@ -29,12 +29,11 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class IntervalRequirement extends AbstractQuestRequirement {
|
public class IntervalRequirement extends AbstractQuestRequirement {
|
||||||
private int interval = -1;
|
private int interval = -1;
|
||||||
private int questID;
|
private final int questID;
|
||||||
|
|
||||||
public IntervalRequirement(Quest quest, Data data) {
|
public IntervalRequirement(Quest quest, Data data) {
|
||||||
super(QuestRequirementType.INTERVAL);
|
super(QuestRequirementType.INTERVAL);
|
||||||
@@ -61,9 +60,10 @@ public class IntervalRequirement extends AbstractQuestRequirement {
|
|||||||
if (leftTime / (60 * 1000) > 0) {
|
if (leftTime / (60 * 1000) > 0) {
|
||||||
mode++; //counts minutes
|
mode++; //counts minutes
|
||||||
|
|
||||||
if(leftTime / (60*60*1000) > 0)
|
if (leftTime / (60 * 60 * 1000) > 0) {
|
||||||
mode++; //counts hours
|
mode++; //counts hours
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class ItemRequirement extends AbstractQuestRequirement {
|
public class ItemRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class JobRequirement extends AbstractQuestRequirement {
|
public class JobRequirement extends AbstractQuestRequirement {
|
||||||
@@ -44,7 +43,6 @@ public class JobRequirement extends AbstractQuestRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class MaxLevelRequirement extends AbstractQuestRequirement {
|
public class MaxLevelRequirement extends AbstractQuestRequirement {
|
||||||
@@ -41,7 +40,6 @@ public class MaxLevelRequirement extends AbstractQuestRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class MesoRequirement extends AbstractQuestRequirement {
|
public class MesoRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class MinLevelRequirement extends AbstractQuestRequirement {
|
public class MinLevelRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class MinTamenessRequirement extends AbstractQuestRequirement {
|
public class MinTamenessRequirement extends AbstractQuestRequirement {
|
||||||
@@ -42,7 +41,6 @@ public class MinTamenessRequirement extends AbstractQuestRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -56,11 +54,14 @@ public class MinTamenessRequirement extends AbstractQuestRequirement {
|
|||||||
int curCloseness = 0;
|
int curCloseness = 0;
|
||||||
|
|
||||||
for (Pet pet : chr.getPets()) {
|
for (Pet pet : chr.getPets()) {
|
||||||
if(pet == null) continue;
|
if (pet == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(pet.getCloseness() > curCloseness)
|
if (pet.getCloseness() > curCloseness) {
|
||||||
curCloseness = pet.getCloseness();
|
curCloseness = pet.getCloseness();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return curCloseness >= minTameness;
|
return curCloseness >= minTameness;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,12 +33,11 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class MobRequirement extends AbstractQuestRequirement {
|
public class MobRequirement extends AbstractQuestRequirement {
|
||||||
Map<Integer, Integer> mobs = new HashMap<>();
|
Map<Integer, Integer> mobs = new HashMap<>();
|
||||||
private int questID;
|
private final int questID;
|
||||||
|
|
||||||
public MobRequirement(Quest quest, Data data) {
|
public MobRequirement(Quest quest, Data data) {
|
||||||
super(QuestRequirementType.MOB);
|
super(QuestRequirementType.MOB);
|
||||||
@@ -47,7 +46,6 @@ public class MobRequirement extends AbstractQuestRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -74,9 +72,10 @@ public class MobRequirement extends AbstractQuestRequirement {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(progress < countReq)
|
if (progress < countReq) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class MonsterBookCountRequirement extends AbstractQuestRequirement {
|
public class MonsterBookCountRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class NpcRequirement extends AbstractQuestRequirement {
|
public class NpcRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class PetRequirement extends AbstractQuestRequirement {
|
public class PetRequirement extends AbstractQuestRequirement {
|
||||||
@@ -56,11 +55,14 @@ public class PetRequirement extends AbstractQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public boolean check(Character chr, Integer npcid) {
|
public boolean check(Character chr, Integer npcid) {
|
||||||
for (Pet pet : chr.getPets()) {
|
for (Pet pet : chr.getPets()) {
|
||||||
if(pet == null) continue; // thanks Arufonsu for showing a NPE occurring here
|
if (pet == null) {
|
||||||
|
continue; // thanks Arufonsu for showing a NPE occurring here
|
||||||
|
}
|
||||||
|
|
||||||
if(petIDs.contains(pet.getItemId()))
|
if (petIDs.contains(pet.getItemId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Tyler (Twdtwd)
|
* @author Tyler (Twdtwd)
|
||||||
*/
|
*/
|
||||||
public class QuestRequirement extends AbstractQuestRequirement {
|
public class QuestRequirement extends AbstractQuestRequirement {
|
||||||
@@ -41,7 +40,6 @@ public class QuestRequirement extends AbstractQuestRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -60,8 +58,9 @@ public class QuestRequirement extends AbstractQuestRequirement {
|
|||||||
int stateReq = quests.get(questID);
|
int stateReq = quests.get(questID);
|
||||||
QuestStatus qs = chr.getQuest(Quest.getInstance(questID));
|
QuestStatus qs = chr.getQuest(Quest.getInstance(questID));
|
||||||
|
|
||||||
if(qs == null && QuestStatus.Status.getById(stateReq).equals(QuestStatus.Status.NOT_STARTED))
|
if (qs == null && QuestStatus.Status.getById(stateReq).equals(QuestStatus.Status.NOT_STARTED)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (qs == null || !qs.getStatus().equals(QuestStatus.Status.getById(stateReq))) {
|
if (qs == null || !qs.getStatus().equals(QuestStatus.Status.getById(stateReq))) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import server.quest.Quest;
|
|||||||
import server.quest.QuestRequirementType;
|
import server.quest.QuestRequirementType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class ScriptRequirement extends AbstractQuestRequirement {
|
public class ScriptRequirement extends AbstractQuestRequirement {
|
||||||
|
|||||||
Reference in New Issue
Block a user