Antibanish mechanics + Limited drops on map + SQL tidy-up

Added antibanish mechanics: as like other "diseases" that can be treated
with some useable items, banish will be able to be recovered as well.
Fixed some SQL issues introduced on the last commit, as well as
lingering inexistent ids on drop data. Fixed some concurrency issues
with MapleMapFactory. Set a ceiling for simultaneous items available per
map, where old ones are promptly discarded. Patched MWLB attack block
for higher level GMs.
This commit is contained in:
ronancpl
2017-08-05 19:38:07 -03:00
parent 0a2e382c3b
commit f78defec1f
112 changed files with 441 additions and 112 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ Credits are to be given too to Nexon(Duh!), the original MapleSolaxia staff and
Regarding distributability and usage of the code presented here: like it was before, this MapleStory server is open-source. By that, it is meant that anyone is free to install, use, modify and redistribute the contents, as long as there is no kind of commercial trading involved and the credits to the original creators are maintained within the codes.
This is a NetBeans 8.0.2 Project, that must be built and run under JDK/JRE 7 in order to run properly. This means that it's easier to install the project via opening the server project folder inside NetBeans' IDE. Once installed, build this project on your machine and run the server using the "launch.bat" application.
This is a NetBeans 8.0.2 Project, that MUST be built and run under JDK/JRE 7 in order to run properly. This means that it's easier to install the project via opening the server project folder inside NetBeans' IDE. Once installed, build this project on your machine and run the server using the "launch.bat" application.
In this project, many gameplay-wise issues generated from either the original WZ files and the server sources have been partially or completely solved. Considering the use of the provided edited WZ's and server-side wz.xml files should be of the greatest importance when dealing with this instance of private server, in order to perceive it at it's full potential. My opinion, though! Refer to "README_wzchanges.txt" for more information on what have been changed from Nexon's v83 WZ files.
+1 -1
View File
@@ -1,4 +1,4 @@
#Thu, 03 Aug 2017 23:09:50 -0300
#Sat, 05 Aug 2017 19:11:00 -0300
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -26,10 +26,11 @@ Quests:
Player Social Network:
* Guild and Alliance system fully functional.
Cash:
Cash & Items:
* EXP/DROP/Cosmetic Coupons 100%.
* EXP/DROP coupons now appears as a buff effect when on active time.
* Great deal of cash items functional.
* New scroll: antibanish. Used only in cases where bosses send a player back to town.
PQ potentials:
* Lobby system - Multiple PQ instances on same channel.
@@ -428,3 +428,9 @@ Consertado quests n
03 Agosto 2017,
Quests agora retiram itens antes de entregar recompensas.
Após a primeira inicialização, PQs inicializarão mais rápido, uma vez que há um sistema preparador de EIMs ativo.
04 - 05 Agosto 2017,
Novo scroll: antibanish. Retorna ao local de onde foi banido pela ultima vez.
Resolvido alguns problemas de concorrência com MapleMapFactory.
Removidos drops inexistentes da DB.
Resolvido problema com GMs de level alto recebendo bloqueio MWLB.
View File
+2 -1
View File
@@ -1,4 +1,4 @@
2000000 - Red Potion - A potion made out of red herbs.\nRecovers 50 HP.
2000000 - Red Potion - A potion made out of red herbs.\nRecovers 50 HP.
2000001 - Orange Potion - A concentrated potion made out of red herbs.\nRecovers 150 HP.
2000002 - White Potion - A highly-concentrated potion made out of red herbs.\nRecovers 300 HP.
2000003 - Blue Potion - A potion made out of blue herbs.\nRecovers 100 MP.
@@ -381,6 +381,7 @@
2030016 - Phyllia's Warp Powder - Warp powder made by fairy Phyllia. Teleports you to Magatia when used inside the Nihal desert region.
2030019 - Nautilus Return Scroll - This scroll enables you to return to the Pirate village, Nautilus. This is a one use item and will disappear after use.
2030020 - Return to New Leaf City Scroll - Use this scroll to venture back to New Leaf City whenever you want!
2030100 - Return Scroll - Banished Area - Returns you to the map where you were last banished. Requires immediate use and not have changed maps.
2031000 - Masked Man's Invitation - An invitation from the Masked Man to the Halloween Party at the Haunted Mansion. Double-click to move straight to the mansion.
2031001 - Studio Invitation - An invitation to the studio for the event "For Guild Only".
2040000 - Scroll for Helmet for DEF - Improves the helmet's weapon def.\nSuccess rate:100%, weapon def. +1
+5 -6
View File
@@ -3,16 +3,15 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapFactory.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventScriptManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/TimerManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapMonitor.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapItem.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/RankingWorker.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AbstractDealDamageHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/Channel.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/reactor/ReactorActionManager.java</file>
</group>
</open-files>
</project-private>
+1 -1
View File
@@ -7,7 +7,7 @@ var isPq = true;
var minPlayers = 6, maxPlayers = 6;
var minLevel = 120, maxLevel = 255;
var entryMap = 240050100;
var exitMap = 240050500;
var exitMap = 240050000;
var recruitMap = 240050000;
var clearMap = 240050400;
+3 -3
View File
@@ -1,4 +1,4 @@
#YOU MUST EXECUTE NEXT SQL: 'db_drops.sql'
#EXECUTE THIS FIRST, THEN NEXT SQL: 'db_drops.sql'
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
@@ -21180,8 +21180,8 @@ INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `position`) VALUES
( 57, 3992038, 500, 115),
-- missing CBD shop data
(9270027, 2022213, 6800, 0, 104),
(9270027, 2022212, 3200, 0, 108);
(9270027, 2022213, 6800, 104),
(9270027, 2022212, 3200, 108);
CREATE TABLE IF NOT EXISTS `skillmacros` (
`id` int(11) NOT NULL AUTO_INCREMENT,
+49 -1
View File
@@ -1,4 +1,7 @@
 #THIS SQL MUST BE USED AFTER 'db_database.sql'
#THIS SQL MUST BE USED AFTER 'db_database.sql'
#NEXT SQL 'db_shopupdate.sql' IS OPTIONAL
USE `maplesolaxia`;
INSERT IGNORE INTO temp_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
#-- copy+paste inside here as many drop data as possible from the spider (drop generator) files --
@@ -20051,3 +20054,48 @@
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
INSERT INTO `monstercarddata` (`cardid`, `mobid`) (SELECT itemid, min(dropperid) FROM drop_data where itemid>=2380000 and itemid<2390000 group by itemid);
# delete all unused content on drop data
DELETE FROM `drop_data` WHERE itemid=400000;
DELETE FROM `drop_data` WHERE itemid=400001;
DELETE FROM `drop_data` WHERE itemid=400002;
DELETE FROM `drop_data` WHERE itemid=400003;
DELETE FROM `drop_data` WHERE itemid=400004;
DELETE FROM `drop_data` WHERE itemid=400005;
DELETE FROM `drop_data` WHERE itemid=400006;
DELETE FROM `drop_data` WHERE itemid=400009;
DELETE FROM `drop_data` WHERE itemid=400010;
DELETE FROM `drop_data` WHERE itemid=400011;
DELETE FROM `drop_data` WHERE itemid=401000;
DELETE FROM `drop_data` WHERE itemid=404000;
DELETE FROM `drop_data` WHERE itemid=1002926;
DELETE FROM `drop_data` WHERE itemid=1002927;
DELETE FROM `drop_data` WHERE itemid=1027090;
DELETE FROM `drop_data` WHERE itemid=1302096;
DELETE FROM `drop_data` WHERE itemid=2002205;
DELETE FROM `drop_data` WHERE itemid=2040033;
DELETE FROM `drop_data` WHERE itemid=2040536;
DELETE FROM `drop_data` WHERE itemid=2040827;
DELETE FROM `drop_data` WHERE itemid=2040913;
DELETE FROM `drop_data` WHERE itemid=2040935;
DELETE FROM `drop_data` WHERE itemid=2043109;
DELETE FROM `drop_data` WHERE itemid=2043309;
DELETE FROM `drop_data` WHERE itemid=2043709;
DELETE FROM `drop_data` WHERE itemid=2044009;
DELETE FROM `drop_data` WHERE itemid=2044209;
DELETE FROM `drop_data` WHERE itemid=2044309;
DELETE FROM `drop_data` WHERE itemid=2044609;
DELETE FROM `drop_data` WHERE itemid=2049212;
DELETE FROM `drop_data` WHERE itemid=2049214;
DELETE FROM `drop_data` WHERE itemid=4000306;
DELETE FROM `drop_data` WHERE itemid=4000343;
DELETE FROM `drop_data` WHERE itemid=4000420;
DELETE FROM `drop_data` WHERE itemid=4000429;
DELETE FROM `drop_data` WHERE itemid=4000430;
DELETE FROM `drop_data` WHERE itemid=4000431;
DELETE FROM `drop_data` WHERE itemid=4000432;
DELETE FROM `drop_data` WHERE itemid=4000433;
DELETE FROM `drop_data` WHERE itemid=4000434;
DELETE FROM `drop_data` WHERE itemid=4000435;
DELETE FROM `drop_data` WHERE itemid=4032192;
DELETE FROM `drop_data` WHERE itemid=8143000;
+36 -1
View File
@@ -1,4 +1,9 @@
UPDATE shopitems SET itemid=1812005, price=1000 WHERE shopitemid=18;
#THIS SQL IS OPTIONAL, TO BE USED AFTER 'db_drops.sql'
#THIS REQUIRES PROVIDED WZ FILES
USE `maplesolaxia`;
UPDATE shopitems SET itemid=1812005, price=1000 WHERE shopitemid=18;
UPDATE shopitems SET itemid=1812004, price=1000 WHERE shopitemid=19;
UPDATE shopitems SET itemid=2120000, price=100 WHERE shopitemid=20;
UPDATE shopitems SET itemid=1812000, price=1000 WHERE shopitemid=21;
@@ -102,3 +107,33 @@ INSERT IGNORE INTO `shopitems` (`shopid`, `itemid`, `price`, `pitch`, `position`
(9110002, 3010008, 1000000, 0, 92),
(9110002, 3010007, 1000000, 0, 96),
(9110002, 3011000, 4200000, 0, 100);
# adding antibanish scrolls
INSERT IGNORE INTO `shopitems` (`shopid`, `itemid`, `price`, `pitch`, `position`) VALUES
(1001100, 2030100, 450, 0, 130),
(1011100, 2030100, 450, 0, 142),
(1021100, 2030100, 450, 0, 142),
(1031100, 2030100, 450, 0, 146),
(1051002, 2030100, 450, 0, 142),
(1061001, 2030100, 450, 0, 126),
(1061002, 2030100, 450, 0, 130),
(1091002, 2030100, 450, 0, 130),
(1100002, 2030100, 450, 0, 138),
(2012005, 2030100, 450, 0, 126),
(2022001, 2030100, 450, 0, 126),
(2030009, 2030100, 450, 0, 126),
(2040051, 2030100, 450, 0, 102),
(2041006, 2030100, 450, 0, 134),
(2051000, 2030100, 450, 0, 134),
(2060004, 2030100, 450, 0, 134),
(2070001, 2030100, 450, 0, 134),
(2080001, 2030100, 450, 0, 134),
(2090003, 2030100, 450, 0, 126),
(2093002, 2030100, 450, 0, 126),
(2100004, 2030100, 450, 0, 130),
(2110001, 2030100, 450, 0, 130),
(2130000, 2030100, 450, 0, 126),
(9201060, 2030100, 450, 0, 114),
(9270021, 2030100, 450, 0, 118),
(9270022, 2030100, 450, 0, 114),
(1338, 2030100, 450, 0, 114);
+1 -1
View File
@@ -3,4 +3,4 @@
These SQL files must be executed IN ORDER to set up the database:
- db_database.sql
- db_drops.sql
- db_shopupdate.sql (optional)
- db_shopupdate.sql (optional & require provided WZs)
+43 -14
View File
@@ -294,6 +294,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private short extraRecInterval;
private int targetHpBarHash = 0;
private long targetHpBarTime = 0;
private int banishMap = -1;
private int banishSp = -1;
private long banishTime = 0;
private MapleCharacter() {
useCS = false;
@@ -1192,10 +1195,42 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if (getEventInstance() != null) getEventInstance().changedMap(this, map);
}
public boolean canRecoverLastBanish() {
return System.currentTimeMillis() - this.banishTime < 5 * 60 * 1000;
}
public Pair<Integer, Integer> getLastBanishData() {
return new Pair<>(this.banishMap, this.banishSp);
}
private void clearBanishPlayerData() {
this.banishMap = -1;
this.banishSp = -1;
this.banishTime = 0;
}
private void setBanishPlayerData(int banishMap, int banishSp, long banishTime) {
this.banishMap = banishMap;
this.banishSp = banishSp;
this.banishTime = banishTime;
}
public void changeMapBanish(int mapid, String portal, String msg) {
if(ServerConstants.USE_SPIKES_AVOID_BANISH) {
for(Item it: this.getInventory(MapleInventoryType.EQUIPPED).list()) {
if((it.getFlag() & ItemConstants.SPIKES) == ItemConstants.SPIKES) return;
}
}
int banMap = this.getMapId();
int banSp = this.getMap().findClosestPlayerSpawnpoint(this.getPosition()).getId();
long banTime = System.currentTimeMillis();
dropMessage(5, msg);
MapleMap map_ = client.getChannelServer().getMapFactory().getMap(mapid);
changeMap(map_, map_.getPortal(portal));
setBanishPlayerData(banMap, banSp, banTime);
}
public void changeMap(int map) {
@@ -1298,6 +1333,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private void changeMapInternal(final MapleMap to, final Point pos, final byte[] warpPacket) {
if(!canWarpMap) return;
this.clearBanishPlayerData();
this.closePlayerInteractions();
this.resetPlayerAggro();
@@ -1468,19 +1504,13 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) {
if(mapitem.getMeso() > 0) {
this.gainMeso(mapitem.getMeso(), true, true, false);
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
mapitem.setPickedUp(true);
this.getMap().pickItemDrop(pickupPacket, mapitem);
} else if(mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866) {
// Add NX to account, show effect and make item disappear
this.getCashShop().gainCash(1, mapitem.getItemId() == 4031865 ? 100 : 250);
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
mapitem.setPickedUp(true);
this.getMap().pickItemDrop(pickupPacket, mapitem);
} else if (MapleInventoryManipulator.addFromDrop(client, mapitem.getItem(), true)) {
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
mapitem.setPickedUp(true);
this.getMap().pickItemDrop(pickupPacket, mapitem);
} else {
client.announce(MaplePacketCreator.enableActions());
return;
@@ -1558,9 +1588,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
client.announce(MaplePacketCreator.enableActions());
return;
}
mapitem.setPickedUp(true);
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
this.getMap().pickItemDrop(pickupPacket, mapitem);
}
} else if(!hasSpaceInventory) {
client.announce(MaplePacketCreator.getInventoryFull());
@@ -5473,13 +5502,13 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
psf.close();
ps = con.prepareStatement("UPDATE accounts SET gm = ? WHERE id = ?");
ps.setInt(1, gmLevel);
ps.setInt(1, gmLevel > 1 ? 1 : 0);
ps.setInt(2, client.getAccID());
ps.executeUpdate();
ps.close();
con.commit();
con.setAutoCommit(true);
con.setAutoCommit(true);
if (cashshop != null) {
cashshop.save(con);
+2 -3
View File
@@ -1961,9 +1961,8 @@ public class Commands {
} else {
MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true);
}
mapItem.setPickedUp(true);
player.getMap().removeMapObject(item);
player.getMap().broadcastMessage(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem.getPosition());
player.getMap().pickItemDrop(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem);
}
break;
+6 -2
View File
@@ -31,7 +31,7 @@ public class ServerConstants {
public static boolean SHUTDOWNHOOK;
//Gameplay Configuration
public static final boolean USE_CUSTOM_KEYSET = true;
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 = false; //Will enable some text prints on the client, oriented for debugging purposes.
@@ -56,7 +56,10 @@ public class ServerConstants {
public static final long BLOCK_NPC_RACE_CONDT = (long)(0.5 * 1000); //Time the player client must wait before reopening a conversation with an NPC.
public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //Time the pet must wait before trying to pick items up.
public static final int ITEM_EXPIRE_TIME = 3 * 60 * 1000; //Time before items start disappearing. Recommended to be set up to 3 minutes.
//Dangling Items Configuration
public static final int ITEM_EXPIRE_TIME = 3 * 60 * 1000; //Time before items start disappearing. Recommended to be set up to 3 minutes.
public static final int ITEM_MONITOR_TIME = 5 * 60 * 1000; //Interval between item monitoring task on maps, which checks for dangling item objects on the map item history.
public static final int ITEM_LIMIT_ON_MAP = 777; //Max number of items allowed on a map.
//Some Gameplay Enhancing Configuration
public static final boolean USE_PERFECT_SCROLLING = true; //Scrolls doesn't use slots upon failure.
@@ -70,6 +73,7 @@ public class ServerConstants {
public static final boolean USE_STACK_COUPON_RATES = true; //Multiple coupons effects builds up together.
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 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.
+1 -1
View File
@@ -278,7 +278,7 @@ public class Server implements Runnable {
System.out.println("Skills loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds");
timeToTake = System.currentTimeMillis();
MapleItemInformationProvider.getInstance().getAllItems();
//MapleItemInformationProvider.getInstance().getAllItems(); //unused, rofl
CashItemFactory.getSpecialCashItems();
System.out.println("Items loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds");
@@ -216,9 +216,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
map.removeMapObject(mapitem);
map.broadcastMessage(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 4, 0), mapitem.getPosition());
mapitem.setPickedUp(true);
map.pickItemDrop(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 4, 0), mapitem);
}
}, delay);
delay += 100;
@@ -45,14 +45,16 @@ public final class KeymapChangeHandler extends AbstractMaplePacketHandler {
int action = slea.readInt();
Skill skill = SkillFactory.getSkill(action);
boolean isBanndedSkill = false;
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;
//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??
@@ -21,8 +21,10 @@
*/
package net.server.channel.handlers;
import client.MapleCharacter;
import client.MapleClient;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import server.life.MapleMonster;
import server.life.MobSkill;
@@ -38,6 +40,8 @@ import tools.data.input.SeekableLittleEndianAccessor;
public final class MoveLifeHandler extends AbstractMovementPacketHandler {
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
List<MapleCharacter> banishPlayers = new ArrayList<>();
int objectid = slea.readInt();
short moveid = slea.readShort();
MapleMapObject mmo = c.getPlayer().getMap().getMapObject(objectid);
@@ -66,7 +70,7 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
if ((skill_1 >= 100 && skill_1 <= 200) && monster.hasSkill(skill_1, skill_2)) {
MobSkill skillData = MobSkillFactory.getMobSkill(skill_1, skill_2);
if (skillData != null && monster.canUseSkill(skillData)) {
skillData.applyEffect(c.getPlayer(), monster, true);
skillData.applyEffect(c.getPlayer(), monster, true, banishPlayers);
}
}
slea.readByte();
@@ -99,5 +103,9 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
updatePosition(res, monster, -1);
c.getPlayer().getMap().moveMonster(monster, monster.getPosition());
}
for (MapleCharacter chr : banishPlayers) {
chr.changeMapBanish(monster.getBanish().getMap(), monster.getBanish().getPortal(), monster.getBanish().getMsg());
}
}
}
@@ -36,6 +36,7 @@ import constants.skills.Corsair;
import java.awt.Point;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import net.AbstractMaplePacketHandler;
@@ -58,6 +59,8 @@ public final class TakeDamageHandler extends AbstractMaplePacketHandler {
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
List<MapleCharacter> banishPlayers = new ArrayList<>();
MapleCharacter player = c.getPlayer();
slea.readInt();
byte damagefrom = slea.readByte();
@@ -125,28 +128,27 @@ public final class TakeDamageHandler extends AbstractMaplePacketHandler {
mpattack += attackInfo.getMpBurn();
MobSkill skill = MobSkillFactory.getMobSkill(attackInfo.getDiseaseSkill(), attackInfo.getDiseaseLevel());
if (skill != null && damage > 0) {
skill.applyEffect(player, attacker, false);
}
if (attacker != null) {
attacker.setMp(attacker.getMp() - attackInfo.getMpCon());
if (player.getBuffedValue(MapleBuffStat.MANA_REFLECTION) != null && damage > 0 && !attacker.isBoss()) {
int jobid = player.getJob().getId();
if (jobid == 212 || jobid == 222 || jobid == 232) {
int id = jobid * 10000 + 1002;
Skill manaReflectSkill = SkillFactory.getSkill(id);
if (player.isBuffFrom(MapleBuffStat.MANA_REFLECTION, manaReflectSkill) && player.getSkillLevel(manaReflectSkill) > 0 && manaReflectSkill.getEffect(player.getSkillLevel(manaReflectSkill)).makeChanceResult()) {
int bouncedamage = (damage * manaReflectSkill.getEffect(player.getSkillLevel(manaReflectSkill)).getX() / 100);
if (bouncedamage > attacker.getMaxHp() / 5) {
bouncedamage = attacker.getMaxHp() / 5;
}
map.damageMonster(player, attacker, bouncedamage);
map.broadcastMessage(player, MaplePacketCreator.damageMonster(oid, bouncedamage), true);
player.getClient().announce(MaplePacketCreator.showOwnBuffEffect(id, 5));
map.broadcastMessage(player, MaplePacketCreator.showBuffeffect(player.getId(), id, 5), false);
}
}
}
skill.applyEffect(player, attacker, false, banishPlayers);
}
attacker.setMp(attacker.getMp() - attackInfo.getMpCon());
if (player.getBuffedValue(MapleBuffStat.MANA_REFLECTION) != null && damage > 0 && !attacker.isBoss()) {
int jobid = player.getJob().getId();
if (jobid == 212 || jobid == 222 || jobid == 232) {
int id = jobid * 10000 + 1002;
Skill manaReflectSkill = SkillFactory.getSkill(id);
if (player.isBuffFrom(MapleBuffStat.MANA_REFLECTION, manaReflectSkill) && player.getSkillLevel(manaReflectSkill) > 0 && manaReflectSkill.getEffect(player.getSkillLevel(manaReflectSkill)).makeChanceResult()) {
int bouncedamage = (damage * manaReflectSkill.getEffect(player.getSkillLevel(manaReflectSkill)).getX() / 100);
if (bouncedamage > attacker.getMaxHp() / 5) {
bouncedamage = attacker.getMaxHp() / 5;
}
map.damageMonster(player, attacker, bouncedamage);
map.broadcastMessage(player, MaplePacketCreator.damageMonster(oid, bouncedamage), true);
player.getClient().announce(MaplePacketCreator.showOwnBuffEffect(id, 5));
map.broadcastMessage(player, MaplePacketCreator.showBuffeffect(player.getId(), id, 5), false);
}
}
}
}
}
if (damage == -1) {
@@ -234,5 +236,9 @@ public final class TakeDamageHandler extends AbstractMaplePacketHandler {
player.setDojoEnergy(player.isGM() ? 300 : player.getDojoEnergy() < 300 ? player.getDojoEnergy() + 1 : 0); //Fking gm's
player.getClient().announce(MaplePacketCreator.getEnergy("energy", player.getDojoEnergy()));
}
for (MapleCharacter chr : banishPlayers) { // chill, if this list ever gets non-empty an attacker does exist, trust me :)
chr.changeMapBanish(attacker.getBanish().getMap(), attacker.getBanish().getPortal(), attacker.getBanish().getMsg());
}
}
}
@@ -66,12 +66,21 @@ public final class UseItemHandler extends AbstractMaplePacketHandler {
remove(c, slot);
return;
}
if (isTownScroll(itemId)) {
else if (isTownScroll(itemId)) {
if (ii.getItemEffect(toUse.getItemId()).applyTo(c.getPlayer())) {
remove(c, slot);
}
return;
}
else if (isAntibanishScroll(itemId)) {
if (ii.getItemEffect(toUse.getItemId()).applyTo(c.getPlayer())) {
remove(c, slot);
} else {
c.getPlayer().dropMessage(5, "You cannot recover from a banish state at the moment.");
}
return;
}
remove(c, slot);
ii.getItemEffect(toUse.getItemId()).applyTo(c.getPlayer());
@@ -84,7 +93,11 @@ public final class UseItemHandler extends AbstractMaplePacketHandler {
c.announce(MaplePacketCreator.enableActions());
}
private boolean isTownScroll(int itemId) {
private static boolean isTownScroll(int itemId) {
return itemId >= 2030000 && itemId < 2030021;
}
private static boolean isAntibanishScroll(int itemId) {
return itemId == 2030100;
}
}
+16 -2
View File
@@ -796,16 +796,30 @@ public class MapleStatEffect {
if (moveTo != -1) {
if (moveTo != applyto.getMapId()) {
MapleMap target;
MaplePortal pt;
if (moveTo == 999999999) {
target = applyto.getMap().getReturnMap();
if(sourceid != 2030100) {
target = applyto.getMap().getReturnMap();
pt = target.getRandomPlayerSpawnpoint();
} else {
if(!applyto.canRecoverLastBanish()) return false;
Pair<Integer, Integer> lastBanishInfo = applyto.getLastBanishData();
target = applyto.getWarpMap(lastBanishInfo.getLeft());
pt = target.getPortal(lastBanishInfo.getRight());
}
} else {
target = applyto.getClient().getWorldServer().getChannel(applyto.getClient().getChannel()).getMapFactory().getMap(moveTo);
int targetid = target.getId() / 10000000;
if (targetid != 60 && applyto.getMapId() / 10000000 != 61 && targetid != applyto.getMapId() / 10000000 && targetid != 21 && targetid != 20 && targetid != 12 && (applyto.getMapId() / 10000000 != 10 && applyto.getMapId() / 10000000 != 12)) {
return false;
}
pt = target.getRandomPlayerSpawnpoint();
}
applyto.changeMap(target, target.getRandomPlayerSpawnpoint());
applyto.changeMap(target, pt);
} else {
return false;
}

Some files were not shown because too many files have changed in this diff Show More