Boss Daily Entry + Maker enable actions + Duey Quick Delivery

Fixed Legendary Spirit UI getting stuck when trying to apply scrolls in equipments without upgrade slots available.
Revised map leasing. Players no longer lose ownership when changing maps. Players are allowed to lease one map each time.
Revised expeditions warping players out as soon as the leader leaves the event or the number of players inside gets to be less than the minimum required to enter.
Fixed start/complete quest commands not acting properly for some quests.
Refactored quest loadouts unnecessarily reloading MapleData.
Implemented support for daily boss limit entry, usable on expeditions.
Revised potential exploit cases within chair, face expression, quest action, summon damage and mob damage mob handlers.
Adjusted displayed date in Duey. Value displayed now should be consistent with the expected expiration time.
Refactored damage for friendly mobs getting handled inside packet structure.
Implemented support for Quick Delivery from Duey.
Fixed Horntail specifically not dropping loots after recent updates.
Refactored commands system. All commands are instanced at boot time instead of at every call.
Fixed usage of Maker skill not sending MAKER_RESULT packet to players. This automatically reenables the actions button (such as create) in Maker UI.
Adjusted minidungeons, now using time limits specified in their respective recipes.
Reviewed the "timeLimit" property utilized by maps, which was poised to work on 2 different concepts altogether.
Fixed Gaga space event, should be functional now.
Added RPS minigame, resources implemented by Arnah.
Fixed damage taken from mob auto-destruction not working properly.
This commit is contained in:
ronancpl
2019-06-27 20:34:39 -03:00
parent a39a210c1f
commit fba27fb3b1
82 changed files with 2902 additions and 2611 deletions
@@ -0,0 +1,84 @@
package server.minigame;
import client.MapleClient;
import client.inventory.Item;
import client.inventory.manipulator.MapleInventoryManipulator;
import tools.MaplePacketCreator;
import tools.Randomizer;
/**
* @Author Arnah
* @Website http://Vertisy.ca/
* @since Aug 15, 2016
*/
public class MapleRockPaperScissor{
private int round = 0;
private boolean ableAnswer = true;
private boolean win = false;
public MapleRockPaperScissor(final MapleClient c, final byte mode){
c.announce(MaplePacketCreator.rpsMode((byte) (9 + mode)));
if(mode == 0){
c.getPlayer().gainMeso(-1000, true, true, true);
}
}
public final boolean answer(final MapleClient c, final int answer){
if(ableAnswer && !win && answer >= 0 && answer <= 2){
final int response = Randomizer.nextInt(3);
if(response == answer){
c.announce(MaplePacketCreator.rpsSelection((byte) response, (byte) round));
// dont do anything. they can still answer once a draw
}else if((answer == 0 && response == 2) || (answer == 1 && response == 0) || (answer == 2 && response == 1)){ // they win
c.announce(MaplePacketCreator.rpsSelection((byte) response, (byte) (round + 1)));
ableAnswer = false;
win = true;
}else{ // they lose
c.announce(MaplePacketCreator.rpsSelection((byte) response, (byte) -1));
ableAnswer = false;
}
return true;
}
reward(c);
return false;
}
public final boolean timeOut(final MapleClient c){
if(ableAnswer && !win){
ableAnswer = false;
c.announce(MaplePacketCreator.rpsMode((byte) 0x0A));
return true;
}
reward(c);
return false;
}
public final boolean nextRound(final MapleClient c){
if(win){
round++;
if(round < 10){
win = false;
ableAnswer = true;
c.announce(MaplePacketCreator.rpsMode((byte) 0x0C));
return true;
} else {
round = 10;
}
}
reward(c);
return false;
}
public final void reward(final MapleClient c){
if(win){
MapleInventoryManipulator.addFromDrop(c, new Item(4031332 + round, (short) 0, (short) 1), true);
}
c.getPlayer().setRPS(null);
}
public final void dispose(final MapleClient c){
reward(c);
c.announce(MaplePacketCreator.rpsMode((byte) 0x0D));
}
}