Crafters & keybinding & commands fix + updated MobBook info

Fixed player receiving DOT even if protected on Orbis Tower <B2>, added
HPbar on Rombot, fixed keybinding issue with clashing skill-item id's,
fixed some mischeckings on NPC crafters, fixed "travelling events"
sending players to random spawnpoints when arriving, fixed hair&face
commands, fixed dispel effect not showing to others, updated drop data
on mobbook.
This commit is contained in:
ronancpl
2017-08-18 19:35:23 -03:00
parent c8e36c10e7
commit ba6b5bc191
122 changed files with 30229 additions and 10188 deletions
+35 -11
View File
@@ -1315,7 +1315,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
byte value = (byte)mbs.getValue().value;
if(value == 1 && thisMap.getReturnMapId() == 211000000) return true; //protection from cold
else if(value == 2 && thisMap.getReturnMapId() == 230000000) return true; //breathing underwater
else if(value == 2 && (thisMap.getReturnMapId() == 211000000 || thisMap.getReturnMapId() == 230000000)) return true; //breathing underwater
else return false;
}
}
@@ -2035,6 +2035,11 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
extraRecoveryTask = TimerManager.getInstance().register(new Runnable() {
@Override
public void run() {
if (getBuffSource(MapleBuffStat.HPREC) == -1 && getBuffSource(MapleBuffStat.MPREC) == -1) {
stopExtraTask();
return;
}
if(hp < localmaxhp) {
if(healHP > 0) {
client.announce(MaplePacketCreator.showOwnRecovery(healHP));
@@ -3457,7 +3462,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public Map<Skill, SkillEntry> getSkills() {
return Collections.unmodifiableMap(skills);
}
public int getSkillLevel(int skill) {
SkillEntry ret = skills.get(SkillFactory.getSkill(skill));
if (ret == null) {
@@ -4979,16 +4984,35 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
} else if (effect.isRecovery()) {
int healInterval = (ServerConstants.USE_ULTRA_RECOVERY) ? 2500 : 5000;
final byte heal = (byte) effect.getX();
recoveryTask = TimerManager.getInstance().register(new Runnable() {
@Override
public void run() {
addHP(heal);
client.announce(MaplePacketCreator.showOwnRecovery(heal));
getMap().broadcastMessage(MapleCharacter.this, MaplePacketCreator.showRecovery(id, heal), false);
}
}, healInterval, healInterval);
chrLock.lock();
try {
recoveryTask = TimerManager.getInstance().register(new Runnable() {
@Override
public void run() {
if (getBuffSource(MapleBuffStat.RECOVERY) == -1) {
chrLock.lock();
try {
if (recoveryTask != null) {
recoveryTask.cancel(false);
recoveryTask = null;
}
} finally {
chrLock.unlock();
}
return;
}
addHP(heal);
client.announce(MaplePacketCreator.showOwnRecovery(heal));
getMap().broadcastMessage(MapleCharacter.this, MaplePacketCreator.showRecovery(id, heal), false);
}
}, healInterval, healInterval);
} finally {
chrLock.unlock();
}
} else if (effect.isDojoBuff() || effect.getSourceId() == 2022337) {
boolean isRecoveryBuff = false;
if(effect.getHpRRate() > 0) {
+89 -57
View File
@@ -1548,21 +1548,31 @@ public class Commands {
victim.updateSingleStat(MapleStat.FAME, victim.getFame());
break;
case "giftnx":
case "givenx":
if (sub.length < 3){
player.yellowMessage("Syntax: !giftnx <playername> <gainnx>");
player.yellowMessage("Syntax: !givenx <playername> <gainnx>");
break;
}
cserv.getPlayerStorage().getCharacterByName(sub[1]).getCashShop().gainCash(1, Integer.parseInt(sub[2]));
player.message("NX given.");
break;
case "vp":
if (sub.length < 2){
player.yellowMessage("Syntax: !vp <gainvotepoint>");
case "givevp":
if (sub.length < 3){
player.yellowMessage("Syntax: !givevp <playername> <gainvotepoint>");
break;
}
c.addVotePoints(Integer.parseInt(sub[1]));
cserv.getPlayerStorage().getCharacterByName(sub[1]).getClient().addVotePoints(Integer.parseInt(sub[2]));
player.message("VP given.");
break;
case "givems":
if (sub.length < 3){
player.yellowMessage("Syntax: !givemx <playername> <gainmx>");
break;
}
cserv.getPlayerStorage().getCharacterByName(sub[1]).gainMeso(Integer.parseInt(sub[2]), true);
player.message("MESO given.");
break;
case "id":
@@ -1871,6 +1881,79 @@ public class Commands {
}
break;
case "face":
if (sub.length < 2){
player.yellowMessage("Syntax: !face [<playername>] <faceid>");
break;
}
try {
if (sub.length == 2) {
int itemId = Integer.parseInt(sub[1]);
if(!(itemId >= 20000 && itemId < 22000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
player.yellowMessage("Face id '" + sub[1] + "' does not exist.");
break;
}
player.setFace(itemId);
player.updateSingleStat(MapleStat.FACE, itemId);
player.equipChanged();
} else {
int itemId = Integer.parseInt(sub[2]);
if(!(itemId >= 20000 && itemId < 22000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
player.yellowMessage("Face id '" + sub[2] + "' does not exist.");
break;
}
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]);
if(victim == null) {
player.yellowMessage("Player '" + sub[1] + "' has not been found on this channel.");
break;
}
victim.setFace(itemId);
victim.updateSingleStat(MapleStat.FACE, itemId);
victim.equipChanged();
}
} catch(Exception e) {}
break;
case "hair":
if (sub.length < 2){
player.yellowMessage("Syntax: !hair [<playername>] <hairid>");
break;
}
try {
if (sub.length == 2) {
int itemId = Integer.parseInt(sub[1]);
if(!(itemId >= 30000 && itemId < 32000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
player.yellowMessage("Hair id '" + sub[1] + "' does not exist.");
break;
}
player.setHair(itemId);
player.updateSingleStat(MapleStat.HAIR, itemId);
player.equipChanged();
} else {
int itemId = Integer.parseInt(sub[2]);
if(!(itemId >= 30000 && itemId < 32000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
player.yellowMessage("Hair id '" + sub[2] + "' does not exist.");
break;
}
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]);
if(victim == null) {
player.yellowMessage("Player '" + sub[1] + "' has not been found on this channel.");
break;
}
victim.setHair(itemId);
victim.updateSingleStat(MapleStat.HAIR, itemId);
victim.equipChanged();
}
} catch(Exception e) {}
break;
default:
return false;
}
@@ -2053,57 +2136,6 @@ public class Commands {
player.playerNPC(c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]), Integer.parseInt(sub[2]));
break;
case "face":
if (sub.length < 2){
player.yellowMessage("Syntax: !face [<playername>] <faceid>");
break;
}
try {
if (sub.length == 2) {
player.setFace(Integer.parseInt(sub[1]));
player.equipChanged();
} else {
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]);
if(victim == null) {
player.yellowMessage("Player '" + sub[1] + "' has not been found on this channel.");
break;
}
victim.setFace(Integer.parseInt(sub[2]));
victim.equipChanged();
}
} catch(Exception e) {}
break;
case "hair":
if (sub.length < 2){
player.yellowMessage("Syntax: !hair [<playername>] <hairid>");
break;
}
try {
if (sub.length == 2) {
player.setHair(Integer.parseInt(sub[1]));
player.equipChanged();
player.getMap().removePlayer(player);
player.getMap().addPlayer(player);
} else {
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]);
if(victim == null) {
player.yellowMessage("Player '" + sub[1] + "' has not been found on this channel.");
break;
}
victim.setHair(Integer.parseInt(sub[2]));
victim.equipChanged();
victim.getMap().removePlayer(victim);
victim.getMap().addPlayer(victim);
}
} catch(Exception e) {}
break;
default:
return false;
}
+8 -8
View File
@@ -34,9 +34,9 @@ public class ServerConstants {
public static final boolean USE_CUSTOM_KEYSET = true; //Enables auto-setup of the MapleSolaxiaV2's custom keybindings when creating characters.
public static final boolean USE_MAXRANGE_ECHO_OF_HERO = true;
public static final boolean USE_MAXRANGE = true; //Will send and receive packets from all events of a map, rather than those of only view range.
public static final boolean USE_DEBUG = true; //Will enable some text prints on the client, oriented for debugging purposes.
public static final boolean USE_DEBUG = false; //Will enable some text prints on the client, oriented for debugging purposes.
public static final boolean USE_DEBUG_SHOW_RCVD_PACKET = false; //Prints on the cmd all received packet ids.
public static final boolean USE_DEBUG_SHOW_INFO_EQPEXP = true; //Prints on the cmd all equip exp gain info.
public static final boolean USE_DEBUG_SHOW_INFO_EQPEXP = false; //Prints on the cmd all equip exp gain info.
public static final boolean USE_MTS = false;
public static final boolean USE_FAMILY_SYSTEM = false;
public static final boolean USE_DUEY = true;
@@ -44,12 +44,12 @@ public class ServerConstants {
public static final boolean USE_ITEM_SORT_BY_NAME = false; //Item sorting based on name rather than id.
public static final boolean USE_PARTY_SEARCH = false;
public static final boolean USE_AUTOBAN = false; //Commands the server to detect infractors automatically.
public static final boolean USE_ANOTHER_AUTOASSIGN = true; //Based on distributing AP accordingly with higher secondary stat on equipments.
public static final boolean USE_ANOTHER_AUTOASSIGN = true; //Based on distributing AP accordingly to required secondary stat on equipments.
public static final boolean USE_REFRESH_RANK_MOVE = true;
public static final boolean USE_PERFECT_PITCH = true; //For lvl 30 or above, each lvlup player gains 1 perfect pitch.
public static final boolean USE_PERMISSIVE_BUFFS = false; //WARNING: Allows players that does not have increased certain buff-type skills to use it's effect. Used mainly on buff-cast commands, however making this active may generate a source for possible client-edited exploits.
public static final boolean USE_ENFORCE_MDOOR_POSITION = true; //Forces mystic door to be spawned near spawnpoints. (since things bugs out other way, and this helps players locate the door faster)
public static final boolean USE_ERASE_UNTRADEABLE_DROP = true; //Forces flagged untradeable items to disappear when dropped.
public static final boolean USE_ERASE_UNTRADEABLE_DROP = true; //Forces flagged untradeable items to disappear when dropped.
public static final int MAX_AP = 20000; //Max AP allotted on the auto-assigner.
public static final int MAX_EVENT_LEVELS = 8; //Event has different levels of rewarding system.
@@ -74,14 +74,14 @@ public class ServerConstants {
public static final boolean USE_EQUIPMNT_LVLUP_SLOTS = true;//Equips can upgrade slots at level up.
public static final boolean USE_EQUIPMNT_LVLUP_POWER = true;//Enable more powerful stats upgrades at equip level up.
public static final boolean USE_SPIKES_AVOID_BANISH = true; //Shoes equipped with spikes blocks mobs from banishing wearer.
public static final boolean USE_CHAIR_EXTRAHEAL = true; //Enable map chairs to futher recover player`s HP and MP.
public static final boolean USE_CHAIR_EXTRAHEAL = true; //Enable map chairs to further recover player`s HP and MP.
public static final int MAX_EQUIPMNT_LVLUP_STAT_GAIN = 10000; //Max stat upgrade an equipment can have on a levelup.
public static final int MAX_EQUIPMNT_STAT = 32767; //Max stat on an equipment by leveling up.
public static final int USE_EQUIPMNT_LVLUP = 7; //All equips lvlup at max level of N, set 1 to disable.
public static final byte CHAIR_EXTRA_HEAL_HP = 70; //Each extra heal proc increasing HP.
public static final byte CHAIR_EXTRA_HEAL_MP = 42; //Each extra heal proc increasing MP.
public static final byte CHAIR_EXTRA_HEAL_HP = 70; //Each chair extra heal proc increasing HP.
public static final byte CHAIR_EXTRA_HEAL_MP = 42; //Each chair extra heal proc increasing MP.
public static final int FAME_GAIN_BY_QUEST = 4; //Fame gain each N quest completes, set 0 to disable.
public static final int SCROLL_CHANCE_RATE = 10; //Number of tries for success on a scroll, set 0 for default.
public static final int SCROLL_CHANCE_RATE = 10; //Number of rolls for success on a scroll, set 0 for default.
//Pet Auto-Pot Recovery Rates
public static final double PET_AUTOHP_RATIO = 0.99; //Will automatically consume potions until given ratio of the MaxHP/MaxMP is reached.
+1 -1
View File
@@ -328,7 +328,7 @@ public class Server implements Runnable {
System.out.println("Listening on port 8484\r\n\r\n");
System.out.println("Solaxia is now online.");
System.out.println("Solaxia is now online.\r\n");
online = true;
}
@@ -44,22 +44,24 @@ public final class KeymapChangeHandler extends AbstractMaplePacketHandler {
int type = slea.readByte();
int action = slea.readInt();
Skill skill = SkillFactory.getSkill(action);
boolean isBanndedSkill;
if (skill != null) {
isBanndedSkill = GameConstants.bannedBindSkills(skill.getId());
if (isBanndedSkill || (!c.getPlayer().isGM() && GameConstants.isGMSkills(skill.getId())) || (!GameConstants.isInJobTree(skill.getId(), c.getPlayer().getJob().getId()) && !c.getPlayer().isGM())) { //for those skills are are "technically" in the beginner tab, like bamboo rain in Dojo or skills you find in PYPQ
//AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit keymapping.");
//FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skill.getId() + "\r\n");
//c.disconnect(true, false);
//return;
continue; // fk that
}
/* if (c.getPlayer().getSkillLevel(skill) < 1) { HOW WOULD A SKILL EVEN BE AVAILABLE TO KEYBINDING
continue; IF THERE IS NOT EVEN A SINGLE POINT USED INTO IT??
} */ //Nice to know some skills have the same ids as items, heh.
}
if(type == 1) {
Skill skill = SkillFactory.getSkill(action);
boolean isBanndedSkill;
if (skill != null) {
isBanndedSkill = GameConstants.bannedBindSkills(skill.getId());
if (isBanndedSkill || (!c.getPlayer().isGM() && GameConstants.isGMSkills(skill.getId())) || (!GameConstants.isInJobTree(skill.getId(), c.getPlayer().getJob().getId()) && !c.getPlayer().isGM())) { //for those skills are are "technically" in the beginner tab, like bamboo rain in Dojo or skills you find in PYPQ
//AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit keymapping.");
//FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skill.getId() + "\r\n");
//c.disconnect(true, false);
//return;
continue; // fk that
}
/* if (c.getPlayer().getSkillLevel(skill) < 1) { HOW WOULD A SKILL EVEN BE AVAILABLE TO KEYBINDING
continue; IF THERE IS NOT EVEN A SINGLE POINT USED INTO IT??
} */
}
}
c.getPlayer().changeKeybinding(key, new MapleKeyBinding(type, action));
}
@@ -45,6 +45,8 @@ import constants.skills.DarkKnight;
import constants.skills.Hero;
import constants.skills.Paladin;
import constants.skills.Priest;
import constants.skills.Hermit;
import constants.skills.SuperGM;
public final class SpecialMoveHandler extends AbstractMaplePacketHandler {
@@ -111,6 +113,12 @@ public final class SpecialMoveHandler extends AbstractMaplePacketHandler {
int gain = lose * (ef.getY() / 100);
chr.setMp(chr.getMp() + gain);
chr.updateSingleStat(MapleStat.MP, chr.getMp());
} else if (skillid == Hermit.FLASH_JUMP) {
slea.skip(2); // always 0? Also 3rd party FJ effect doesn't seem to work, agh!
//chr.getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.showBuffeffect(chr.getId(), skillid, chr.getSkillLevel(skillid), (byte)0), false);
} else if (skillid == Priest.DISPEL || skillid == SuperGM.HEAL_PLUS_DISPEL) {
slea.skip((skillid == Priest.DISPEL) ? 10 : 11);
chr.getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.showBuffeffect(chr.getId(), skillid, chr.getSkillLevel(skillid)), false);
} else if (skillid % 10000000 == 1004) {
slea.readShort();
}
+1 -1
View File
@@ -929,7 +929,7 @@ public class MapleStatEffect {
for (MapleMapObject affectedmo : affecteds) {
MapleCharacter affected = (MapleCharacter) affectedmo;
if (affected != applyfrom && (isGmBuff() || applyfrom.getParty().equals(affected.getParty()))) {
if ((isResurrection() && !affected.isAlive()) || (!isResurrection() && affected.isAlive())) {
if ((!isResurrection() && affected.isAlive()) || (isResurrection() && !affected.isAlive())) {
affectedp.add(affected);
}
}
+8
View File
@@ -2956,6 +2956,14 @@ public class MapleMap {
chr.changeMap(to);
}
}
public void warpEveryone(int to, int pto) {
List<MapleCharacter> players = new ArrayList<>(getCharacters());
for (MapleCharacter chr : players) {
chr.changeMap(to, pto);
}
}
// BEGIN EVENTS
public void setSnowball(int team, MapleSnowball ball) {
+3 -1
View File
@@ -74,7 +74,9 @@ public class SkillAction extends MapleQuestAction {
public void run(MapleCharacter chr, Integer extSelection) {
for(SkillData skill : skillData.values()) {
Skill skillObject = SkillFactory.getSkill(skill.getId());
boolean shouldLearn = false;
if(skillObject == null) continue;
boolean shouldLearn = false;
if(skill.jobsContains(chr.getJob()) || skillObject.isBeginnerSkill())
shouldLearn = true;