Quick fix-up + Happyville
Fixed bug introduced on last update regarding events without event_schedule defined. Added path to Happyville maps, and raid boss event.
This commit is contained in:
@@ -498,7 +498,7 @@ public class MapleInventoryManipulator {
|
||||
if (ii.isDropRestricted(target.getItemId()) || MapleItemInformationProvider.getInstance().isCash(target.getItemId())) {
|
||||
c.getPlayer().getMap().disappearingItemDrop(c.getPlayer(), c.getPlayer(), target, dropPos);
|
||||
} else {
|
||||
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), target, dropPos, true, false);
|
||||
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), target, dropPos, true, true);
|
||||
}
|
||||
} else if (ii.isDropRestricted(target.getItemId()) || MapleItemInformationProvider.getInstance().isCash(target.getItemId())) {
|
||||
c.getPlayer().getMap().disappearingItemDrop(c.getPlayer(), c.getPlayer(), target, dropPos);
|
||||
@@ -515,7 +515,7 @@ public class MapleInventoryManipulator {
|
||||
if (ii.isDropRestricted(itemId) || ii.isCash(itemId)) {
|
||||
c.getPlayer().getMap().disappearingItemDrop(c.getPlayer(), c.getPlayer(), source, dropPos);
|
||||
} else {
|
||||
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), source, dropPos, true, false);
|
||||
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), source, dropPos, true, true);
|
||||
}
|
||||
} else if (ii.isDropRestricted(itemId) || ii.isCash(itemId)) {
|
||||
c.getPlayer().getMap().disappearingItemDrop(c.getPlayer(), c.getPlayer(), source, dropPos);
|
||||
|
||||
@@ -321,6 +321,28 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<Integer> getItemIdsInRange(int minId, int maxId, boolean ignoreCashItem) {
|
||||
List<Integer> list = new ArrayList<>();
|
||||
|
||||
if(ignoreCashItem) {
|
||||
for(int i = minId; i <= maxId; i++) {
|
||||
if(getItemData(i) != null && !isCash(i)) {
|
||||
list.add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(int i = minId; i <= maxId; i++) {
|
||||
if(getItemData(i) != null) {
|
||||
list.add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public short getSlotMax(MapleClient c, int itemId) {
|
||||
if (slotMaxCache.containsKey(itemId)) {
|
||||
|
||||
@@ -634,7 +634,6 @@ public class MapleMap {
|
||||
removeMapObject(monster);
|
||||
monster.dispatchMonsterKilled();
|
||||
broadcastMessage(MaplePacketCreator.killMonster(monster.getObjectId(), animation), monster.getPosition());
|
||||
//System.out.println("Counter: " + spawnedMonstersOnMap.toString() + " Size: " + countAllMonsters());
|
||||
return;
|
||||
}
|
||||
if (monster.getStats().getLevel() >= chr.getLevel() + 30 && !chr.isGM()) {
|
||||
@@ -702,6 +701,7 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapleCharacter dropOwner = monster.killBy(chr);
|
||||
if (withDrops && !monster.dropsDisabled()) {
|
||||
if (dropOwner == null) {
|
||||
@@ -712,7 +712,6 @@ public class MapleMap {
|
||||
|
||||
monster.dispatchMonsterKilled();
|
||||
broadcastMessage(MaplePacketCreator.killMonster(monster.getObjectId(), animation), monster.getPosition());
|
||||
//System.out.println("Counter: " + spawnedMonstersOnMap.toString() + " Size: " + countAllMonsters());
|
||||
}
|
||||
|
||||
public void killFriendlies(MapleMonster mob) {
|
||||
@@ -737,6 +736,8 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void softKillAllMonsters() {
|
||||
|
||||
|
||||
for (MapleMapObject monstermo : getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER))) {
|
||||
MapleMonster monster = (MapleMonster) monstermo;
|
||||
if (monster.getStats().isFriendly()) {
|
||||
@@ -1331,6 +1332,48 @@ public class MapleMap {
|
||||
activateItemReactors(drop, owner.getClient());
|
||||
}
|
||||
}
|
||||
|
||||
public final void spawnItemDropList(List<Integer> list, final MapleMapObject dropper, final MapleCharacter owner, Point pos) {
|
||||
spawnItemDropList(list, 1, 1, dropper, owner, pos, true, false);
|
||||
}
|
||||
|
||||
public final void spawnItemDropList(List<Integer> list, int minCopies, int maxCopies, final MapleMapObject dropper, final MapleCharacter owner, Point pos) {
|
||||
spawnItemDropList(list, minCopies, maxCopies, dropper, owner, pos, true, false);
|
||||
}
|
||||
|
||||
// spawns item instances of all defined item ids on a list
|
||||
public final void spawnItemDropList(List<Integer> list, int minCopies, int maxCopies, final MapleMapObject dropper, final MapleCharacter owner, Point pos, final boolean ffaDrop, final boolean playerDrop) {
|
||||
int copies = (maxCopies - minCopies) + 1;
|
||||
if(copies < 1) return;
|
||||
|
||||
Collections.shuffle(list);
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
Random rnd = new Random();
|
||||
|
||||
final Point dropPos = new Point(pos);
|
||||
dropPos.x -= (12 * list.size());
|
||||
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
if(list.get(i) == 0) {
|
||||
spawnMesoDrop(owner != null ? 10 * owner.getMesoRate() : 10, calcDropPos(dropPos, pos), dropper, owner, playerDrop, (byte) (ffaDrop ? 2 : 0));
|
||||
}
|
||||
else {
|
||||
final Item drop;
|
||||
int randomedId = list.get(i);
|
||||
|
||||
if (ii.getInventoryType(randomedId) != MapleInventoryType.EQUIP) {
|
||||
drop = new Item(randomedId, (short) 0, (short) (rnd.nextInt(copies) + minCopies));
|
||||
} else {
|
||||
drop = ii.randomizeStats((Equip) ii.getEquipById(randomedId));
|
||||
}
|
||||
|
||||
spawnItemDrop(dropper, owner, drop, calcDropPos(dropPos, pos), ffaDrop, playerDrop);
|
||||
}
|
||||
|
||||
dropPos.x += 25;
|
||||
}
|
||||
}
|
||||
|
||||
private void activateItemReactors(final MapleMapItem drop, final MapleClient c) {
|
||||
final Item item = drop.getItem();
|
||||
|
||||
@@ -194,7 +194,7 @@ public class MapleMapFactory {
|
||||
}
|
||||
|
||||
map.setClock(mapData.getChildByPath("clock") != null);
|
||||
map.setEverlast(mapData.getChildByPath("everlast") != null);
|
||||
map.setEverlast(mapData.getChildByPath("info/everlast") != null);
|
||||
map.setTown(mapData.getChildByPath("info/town") != null);
|
||||
map.setHPDec(MapleDataTool.getIntConvert("info/decHP", mapData, 0));
|
||||
map.setHPDecProtect(MapleDataTool.getIntConvert("info/protectItem", mapData, 0));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MapleMapItem extends AbstractMapleMapObject {
|
||||
protected int character_ownerid, meso, questid = -1;
|
||||
protected byte type;
|
||||
protected boolean pickedUp = false, playerDrop;
|
||||
protected long dropTime;
|
||||
protected long dropTime;
|
||||
public ReentrantLock itemLock = new ReentrantLock();
|
||||
|
||||
public MapleMapItem(Item item, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop) {
|
||||
|
||||
@@ -29,7 +29,8 @@ public enum SavedLocationType {
|
||||
INTRO,
|
||||
SUNDAY_MARKET,
|
||||
MIRROR,
|
||||
DOJO;
|
||||
DOJO,
|
||||
HAPPYVILLE;
|
||||
|
||||
public static SavedLocationType fromString(String Str) {
|
||||
return valueOf(Str);
|
||||
|
||||
Reference in New Issue
Block a user