MapleCouponInstaller + EXP/DROP Coupon System
Added mechanics for the EXP/DROP cash coupons (such as enabling out-of-time active coupons via command and automatic update of active ones over the designed interval). Created MapleCouponInstaller as means to gather info about the coupon intervals and rates from the WZs (the generated SQL table is already updated on the db_database.sql file).
This commit is contained in:
@@ -149,7 +149,7 @@ public final class ChangeMapHandler extends AbstractMaplePacketHandler {
|
||||
} else {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
}
|
||||
//chr.setRates();
|
||||
//chr.setWorldRates();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public final class DistributeSPHandler extends AbstractMaplePacketHandler {
|
||||
AutobanFactory.PACKET_EDIT.alert(player, "tried to packet edit in distributing sp.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skillid + " without it being in their job.\r\n");
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if (skillid % 10000000 > 999 && skillid % 10000000 < 1003) {
|
||||
int total = 0;
|
||||
|
||||
@@ -100,7 +100,8 @@ public final class DueyHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
if (!ServerConstants.USE_DUEY){
|
||||
return;
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
byte operation = slea.readByte();
|
||||
@@ -196,6 +197,7 @@ public final class DueyHandler extends AbstractMaplePacketHandler {
|
||||
dp = dueypack;
|
||||
if(dp == null) {
|
||||
System.out.println("Error: Null Duey package!");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,7 +205,6 @@ public final class DueyHandler extends AbstractMaplePacketHandler {
|
||||
if (!MapleInventoryManipulator.checkSpace(c, dp.getItem().getItemId(), dp.getItem().getQuantity(), dp.getItem().getOwner())) {
|
||||
c.getPlayer().dropMessage(1, "Your inventory is full");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
|
||||
return;
|
||||
} else {
|
||||
MapleInventoryManipulator.addFromDrop(c, dp.getItem(), false);
|
||||
|
||||
@@ -35,33 +35,32 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
||||
*/
|
||||
public class EnterCashShopHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
try {
|
||||
MapleCharacter mc = c.getPlayer();
|
||||
MapleCharacter mc = c.getPlayer();
|
||||
|
||||
if (mc.getCashShop().isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mc.closePlayerInteractions();
|
||||
|
||||
Server.getInstance().getPlayerBuffStorage().addBuffsToStorage(mc.getId(), mc.getAllBuffs());
|
||||
mc.cancelBuffEffects();
|
||||
mc.cancelExpirationTask();
|
||||
|
||||
c.announce(MaplePacketCreator.openCashShop(c, false));
|
||||
c.announce(MaplePacketCreator.showCashInventory(c));
|
||||
c.announce(MaplePacketCreator.showGifts(mc.getCashShop().loadGifts()));
|
||||
c.announce(MaplePacketCreator.showWishList(mc, false));
|
||||
c.announce(MaplePacketCreator.showCash(mc));
|
||||
|
||||
|
||||
c.getChannelServer().removePlayer(mc);
|
||||
mc.getMap().removePlayer(mc);
|
||||
mc.getCashShop().open(true);
|
||||
mc.saveToDB();
|
||||
if (mc.getCashShop().isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mc.closePlayerInteractions();
|
||||
|
||||
Server.getInstance().getPlayerBuffStorage().addBuffsToStorage(mc.getId(), mc.getAllBuffs());
|
||||
mc.cancelBuffEffects();
|
||||
mc.cancelExpirationTask();
|
||||
|
||||
c.announce(MaplePacketCreator.openCashShop(c, false));
|
||||
c.announce(MaplePacketCreator.showCashInventory(c));
|
||||
c.announce(MaplePacketCreator.showGifts(mc.getCashShop().loadGifts()));
|
||||
c.announce(MaplePacketCreator.showWishList(mc, false));
|
||||
c.announce(MaplePacketCreator.showCash(mc));
|
||||
|
||||
c.getChannelServer().removePlayer(mc);
|
||||
mc.getMap().removePlayer(mc);
|
||||
mc.getCashShop().open(true);
|
||||
mc.saveToDB();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
||||
player.changeSkillLevel(SkillFactory.getSkill(10000000 * player.getJobType() + 12), (byte) (player.getLinkedLevel() / 10), 20, -1);
|
||||
player.checkBerserk();
|
||||
player.expirationTask();
|
||||
//player.setRates();
|
||||
//player.setWorldRates();
|
||||
if (GameConstants.hasSPTable(player.getJob()) && player.getJob().getId() != 2001) {
|
||||
player.createDragon();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user