New PQ: Boss Rush PQ + Ellin/PiratePQ bug fixes
Introducing Boss Rush PQ. Corrected a few issues regarding rewardings in PiratePQ and EllinPQ and implemented a standardized way to script PQs.
This commit is contained in:
@@ -48,8 +48,6 @@ import java.util.Set;
|
||||
//import java.util.TimeZone;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.server.PlayerBuffValueHolder;
|
||||
@@ -272,13 +270,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
private PartyQuest partyQuest = null;
|
||||
private boolean loggedIn = false;
|
||||
private MapleDragon dragon = null;
|
||||
private boolean useCS = false; //chaos scroll upon crafting item.
|
||||
private boolean useCS; //chaos scroll upon crafting item.
|
||||
private long useDuey;
|
||||
private long petLootCd;
|
||||
private int newWarpMap = -1;
|
||||
private Lock sLock = new ReentrantLock(true);
|
||||
|
||||
private MapleCharacter() {
|
||||
useCS = false;
|
||||
|
||||
setStance(0);
|
||||
inventory = new MapleInventory[MapleInventoryType.values().length];
|
||||
savedLocations = new SavedLocation[SavedLocationType.values().length];
|
||||
@@ -553,14 +552,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
|
||||
return MaxMP;
|
||||
}
|
||||
|
||||
|
||||
public void addSummon(int id, MapleSummon summon) {
|
||||
sLock.lock();
|
||||
try {
|
||||
summons.put(id, summon);
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
summons.put(id, summon);
|
||||
}
|
||||
|
||||
public void addVisibleMapObject(MapleMapObject mo) {
|
||||
@@ -1091,16 +1085,22 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
return target;
|
||||
}
|
||||
|
||||
// for use ONLY inside OnUserEnter map scripts that requires players changing map even before entering it.
|
||||
// for use ONLY inside OnUserEnter map scripts that requires a player to change map while still moving between maps.
|
||||
public void warpAhead(int map) {
|
||||
newWarpMap = map;
|
||||
}
|
||||
|
||||
private void eventChangedMap(int map) {
|
||||
if (getEventInstance() != null) getEventInstance().changedMap(MapleCharacter.this, map);
|
||||
}
|
||||
|
||||
public void changeMap(int map) {
|
||||
changeMap(map, 0);
|
||||
}
|
||||
|
||||
public void changeMap(int map, int portal) {
|
||||
eventChangedMap(map);
|
||||
|
||||
MapleMap warpMap;
|
||||
if (getEventInstance() != null) {
|
||||
warpMap = getEventInstance().getMapInstance(map);
|
||||
@@ -1112,6 +1112,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
|
||||
public void changeMap(int map, String portal) {
|
||||
eventChangedMap(map);
|
||||
|
||||
MapleMap warpMap;
|
||||
if (getEventInstance() != null) {
|
||||
warpMap = getEventInstance().getMapInstance(map);
|
||||
@@ -1123,6 +1125,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
|
||||
public void changeMap(int map, MaplePortal portal) {
|
||||
eventChangedMap(map);
|
||||
|
||||
MapleMap warpMap;
|
||||
if (getEventInstance() != null) {
|
||||
warpMap = getEventInstance().getMapInstance(map);
|
||||
@@ -1369,27 +1373,22 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
} else if (stat == MapleBuffStat.SUMMON || stat == MapleBuffStat.PUPPET) {
|
||||
int summonId = mbsvh.effect.getSourceId();
|
||||
|
||||
sLock.lock();
|
||||
try {
|
||||
MapleSummon summon = summons.get(summonId);
|
||||
if (summon != null) {
|
||||
getMap().broadcastMessage(MaplePacketCreator.removeSummon(summon, true), summon.getPosition());
|
||||
getMap().removeMapObject(summon);
|
||||
removeVisibleMapObject(summon);
|
||||
summons.remove(summonId);
|
||||
MapleSummon summon = summons.get(summonId);
|
||||
if (summon != null) {
|
||||
getMap().broadcastMessage(MaplePacketCreator.removeSummon(summon, true), summon.getPosition());
|
||||
getMap().removeMapObject(summon);
|
||||
removeVisibleMapObject(summon);
|
||||
summons.remove(summonId);
|
||||
}
|
||||
if (summon.getSkill() == DarkKnight.BEHOLDER) {
|
||||
if (beholderHealingSchedule != null) {
|
||||
beholderHealingSchedule.cancel(false);
|
||||
beholderHealingSchedule = null;
|
||||
}
|
||||
if (summon.getSkill() == DarkKnight.BEHOLDER) {
|
||||
if (beholderHealingSchedule != null) {
|
||||
beholderHealingSchedule.cancel(false);
|
||||
beholderHealingSchedule = null;
|
||||
}
|
||||
if (beholderBuffSchedule != null) {
|
||||
beholderBuffSchedule.cancel(false);
|
||||
beholderBuffSchedule = null;
|
||||
}
|
||||
if (beholderBuffSchedule != null) {
|
||||
beholderBuffSchedule.cancel(false);
|
||||
beholderBuffSchedule = null;
|
||||
}
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
} else if (stat == MapleBuffStat.DRAGONBLOOD) {
|
||||
dragonBloodSchedule.cancel(false);
|
||||
@@ -2530,48 +2529,23 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
|
||||
public Collection<MapleSummon> getSummonsValues() {
|
||||
sLock.lock();
|
||||
try {
|
||||
return summons.values();
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
return summons.values();
|
||||
}
|
||||
|
||||
public void clearSummons() {
|
||||
sLock.lock();
|
||||
try {
|
||||
summons.clear();
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
summons.clear();
|
||||
}
|
||||
|
||||
public MapleSummon getSummonByKey(int id) {
|
||||
sLock.lock();
|
||||
try {
|
||||
return summons.get(id);
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
return summons.get(id);
|
||||
}
|
||||
|
||||
public boolean isSummonsEmpty() {
|
||||
sLock.lock();
|
||||
try {
|
||||
return summons.isEmpty();
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
return summons.isEmpty();
|
||||
}
|
||||
|
||||
public boolean containsSummon(MapleSummon summon) {
|
||||
sLock.lock();
|
||||
try {
|
||||
return summons.containsValue(summon);
|
||||
} finally {
|
||||
sLock.unlock();
|
||||
}
|
||||
return summons.containsValue(summon);
|
||||
}
|
||||
|
||||
public int getTotalStr() {
|
||||
|
||||
@@ -333,6 +333,12 @@ public class Commands {
|
||||
player.message("@whodrops <item name>: Displays monsters that drop an item given an item name.");
|
||||
player.message("@uptime: Shows how long Solaxia has been online.");
|
||||
player.message("@bosshp: Displays the remaining HP of the bosses on your map.");
|
||||
if(ServerConstants.USE_DEBUG) {
|
||||
player.message("@debugpos: Displays the coordinates on the map the player is currently located.");
|
||||
player.message("@debugmapcount: Displays the current number of registered players in the map the player is located.");
|
||||
player.message("@debugevent: Displays the name of the event in which the player is currently registered.");
|
||||
player.message("@debugreactors: Displays current info for all reactors on the map the the player is currently located.");
|
||||
}
|
||||
break;
|
||||
case "time":
|
||||
DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
@@ -652,7 +658,7 @@ public class Commands {
|
||||
|
||||
case "debugevent":
|
||||
if(ServerConstants.USE_DEBUG) {
|
||||
if(player.getEventInstance() == null) player.dropMessage("Player currently not in a event.");
|
||||
if(player.getEventInstance() == null) player.dropMessage("Player currently not in an event.");
|
||||
else player.dropMessage("Current event name: " + player.getEventInstance().getName() + ".");
|
||||
}
|
||||
break;
|
||||
@@ -700,18 +706,18 @@ public class Commands {
|
||||
}
|
||||
if (sub.length > 2) {
|
||||
for (int i = 0; i < Integer.parseInt(sub[2]); i++) {
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(Integer.parseInt(sub[1])), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(Integer.parseInt(sub[1])), player.getPosition());
|
||||
}
|
||||
} else {
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(Integer.parseInt(sub[1])), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(Integer.parseInt(sub[1])), player.getPosition());
|
||||
}
|
||||
} else if (sub[0].equals("bomb")) {
|
||||
if (sub.length > 1){
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(sub[1]);
|
||||
victim.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
|
||||
victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
|
||||
Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));
|
||||
} else {
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300166), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), player.getPosition());
|
||||
}
|
||||
} else if (sub[0].equals("mutemap")) {
|
||||
if(player.getMap().isMuted()) {
|
||||
@@ -1189,9 +1195,9 @@ public class Commands {
|
||||
}
|
||||
player.dropMessage("There are a total of " + total + " players online.");
|
||||
} else if (sub[0].equals("pap")) {
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8500001), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8500001), player.getPosition());
|
||||
} else if (sub[0].equals("pianus")) {
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8510000), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8510000), player.getPosition());
|
||||
} else if (sub[0].equalsIgnoreCase("search")) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (sub.length > 2) {
|
||||
@@ -1338,7 +1344,7 @@ public class Commands {
|
||||
}
|
||||
break;
|
||||
case "horntail":
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8810026), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8810026), player.getPosition());
|
||||
break;
|
||||
case "packet":
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.customPacket(joinStringFrom(sub, 1)));
|
||||
@@ -1490,7 +1496,7 @@ public class Commands {
|
||||
case "zakum":
|
||||
player.getMap().spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8800000), player.getPosition());
|
||||
for (int x = 8800003; x < 8800011; x++) {
|
||||
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(x), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(x), player.getPosition());
|
||||
}
|
||||
break;
|
||||
case "clearquestcache":
|
||||
|
||||
Reference in New Issue
Block a user