Slot Max & Wind Walk fix + reviewed scripted portals
Fixed slotMax function caching up dirtied player data. Fixed many portals not supposed to warp players to "random spawnpoints". Fixed Wind Walk not being cancellable by attacking.
This commit is contained in:
@@ -110,6 +110,7 @@ public enum MapleBuffStat {
|
||||
// needs Soul Stone
|
||||
//end incorrect buffstats
|
||||
|
||||
//WIND_WALK(0x400000000L, true),
|
||||
ARAN_COMBO(0x1000000000L, true),
|
||||
COMBO_DRAIN(0x2000000000L, true),
|
||||
COMBO_BARRIER(0x4000000000L, true),
|
||||
|
||||
@@ -6563,6 +6563,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
} catch (SQLException se) {
|
||||
FilePrinter.printError(FilePrinter.SAVE_CHAR, se, "Error trying to rollback " + name);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FilePrinter.printError(FilePrinter.SAVE_CHAR, e, "Error saving " + name + " Level: " + level + " Job: " + job.getId());
|
||||
} finally {
|
||||
try {
|
||||
con.setAutoCommit(true);
|
||||
|
||||
@@ -60,7 +60,6 @@ public class MaplePet extends Item {
|
||||
|
||||
public static MaplePet loadFromDb(int itemid, short position, int petid) {
|
||||
try {
|
||||
System.out.println("fetching " + petid);
|
||||
MaplePet ret = new MaplePet(itemid, position, petid);
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT name, level, closeness, fullness, summoned FROM pets WHERE petid = ?"); // Get pet details..
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ServerConstants {
|
||||
public static final boolean USE_ERASE_UNTRADEABLE_DROP = true; //Forces flagged untradeable items to disappear when dropped.
|
||||
public static final boolean USE_ERASE_PET_ON_EXPIRATION = false;//Forces pets to be removed from inventory when expire time comes, rather than converting it to a doll.
|
||||
public static final boolean USE_BUFF_MOST_SIGNIFICANT = true; //When applying buffs, the player will stick with the highest stat boost among the listed, rather than overwriting stats.
|
||||
public static final boolean USE_UNDERLEVELED_EXP_BLOCK = true; //Players 20 levels below the killed mob will gain no experience from defeating it.
|
||||
public static final boolean USE_UNDERLEVELED_EXP_BLOCK = true; //Players N levels below the killed mob will gain no experience from defeating it.
|
||||
|
||||
//Server Rates And Experience
|
||||
public static final int EXP_RATE = 10;
|
||||
@@ -72,7 +72,7 @@ public class ServerConstants {
|
||||
public static final int PARTY_EXPERIENCE_MOD = 1; //Change for event stuff.
|
||||
|
||||
//Miscellaneous Configuration
|
||||
public static final byte MIN_UNDERLEVEL_FOR_EXP_GAIN = 5; //Characters are unable to get EXP from a mob if their level are under this threshold, only if "USE_UNDERLEVELED_EXP_BLOCK" is enabled.
|
||||
public static final byte MIN_UNDERLEVEL_TO_EXP_GAIN = 5; //Characters are unable to get EXP from a mob if their level are under this threshold, only if "USE_UNDERLEVELED_EXP_BLOCK" is enabled.
|
||||
public static final byte MAX_MONITORED_BUFFSTATS = 5; //Limits accounting for "dormant" buff effects, that should take place when stronger stat buffs expires.
|
||||
public static final int MAX_AP = 32767; //Max AP allotted on the auto-assigner.
|
||||
public static final int MAX_EVENT_LEVELS = 8; //Event has different levels of rewarding system.
|
||||
|
||||
@@ -23,9 +23,6 @@ import java.util.Scanner;
|
||||
*/
|
||||
public class Main {
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
private static ArrayList<DropEntry> drop_entries = new ArrayList<>();
|
||||
private static HashMap<String, Errors> problems = new HashMap<>();
|
||||
// private static final String TEST_STRING = " <a href=\"/items/leftover/ligator-skin\" alt=\"/tip.php?nid=2138\">Ligator Skin</a>, <a href=\"/items/leftover/the-magic-rock\" alt=\"/tip.php?nid=3954\">The Magic Rock</a>, <a href=\"/items/quest/witch-grass-leaves\" alt=\"/tip.php?nid=6129\">Witch Grass Leaves</a> </td> ";
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.MapleBuffStat;
|
||||
import client.MapleClient;
|
||||
import client.SkillFactory;
|
||||
import constants.skills.Bishop;
|
||||
@@ -31,6 +32,7 @@ import constants.skills.FPArchMage;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.WindArcher;
|
||||
import constants.skills.NightWalker;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import net.MaplePacketHandler;
|
||||
import tools.MaplePacketCreator;
|
||||
@@ -43,6 +45,11 @@ public final class CancelBuffHandler extends AbstractMaplePacketHandler implemen
|
||||
int sourceid = slea.readInt();
|
||||
|
||||
switch (sourceid) {
|
||||
case NightWalker.DARK_SIGHT: // wind walk as a dark sight...
|
||||
c.getPlayer().cancelEffect(SkillFactory.getSkill(NightWalker.DARK_SIGHT).getEffect(1), false, -1);
|
||||
c.getPlayer().cancelEffect(SkillFactory.getSkill(WindArcher.WIND_WALK).getEffect(1), false, -1);
|
||||
break;
|
||||
|
||||
case FPArchMage.BIG_BANG:
|
||||
case ILArchMage.BIG_BANG:
|
||||
case Bishop.BIG_BANG:
|
||||
@@ -54,6 +61,7 @@ public final class CancelBuffHandler extends AbstractMaplePacketHandler implemen
|
||||
case Evan.ICE_BREATH:
|
||||
c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.skillCancel(c.getPlayer(), sourceid), false);
|
||||
break;
|
||||
|
||||
default:
|
||||
c.getPlayer().cancelEffect(SkillFactory.getSkill(sourceid).getEffect(1), false, -1);
|
||||
break;
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import server.MapleStatEffect;
|
||||
import server.TimerManager;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
@@ -53,11 +52,12 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.setPetLootCd(System.currentTimeMillis());
|
||||
|
||||
/*long timeElapsed = System.currentTimeMillis() - player.getAutobanManager().getLastSpam(8);
|
||||
if(timeElapsed < 300) {
|
||||
AutobanFactory.FAST_ATTACK.alert(player, "Time: " + timeElapsed);
|
||||
}
|
||||
player.getAutobanManager().spam(8);*/
|
||||
/*long timeElapsed = System.currentTimeMillis() - player.getAutobanManager().getLastSpam(8);
|
||||
if(timeElapsed < 300) {
|
||||
AutobanFactory.FAST_ATTACK.alert(player, "Time: " + timeElapsed);
|
||||
}
|
||||
player.getAutobanManager().spam(8);*/
|
||||
|
||||
AttackInfo attack = parseDamage(slea, player, false, false);
|
||||
if (player.getBuffEffect(MapleBuffStat.MORPH) != null) {
|
||||
if(player.getBuffEffect(MapleBuffStat.MORPH).isMorphWithoutAttack()) {
|
||||
|
||||
@@ -206,6 +206,14 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean forceStartQuest(int id) {
|
||||
return MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
|
||||
}
|
||||
|
||||
public boolean forceCompleteQuest(int id) {
|
||||
return MapleQuest.getInstance(id).forceComplete(getPlayer(), npc);
|
||||
}
|
||||
|
||||
public void startQuest(int id) {
|
||||
try {
|
||||
MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
|
||||
|
||||
@@ -56,10 +56,6 @@ public class QuestActionManager extends NPCConversationManager {
|
||||
return forceStartQuest(quest);
|
||||
}
|
||||
|
||||
public boolean forceStartQuest(int id) {
|
||||
return MapleQuest.getInstance(id).forceStart(getPlayer(), getNpc());
|
||||
}
|
||||
|
||||
public boolean forceCompleteQuest() {
|
||||
return forceCompleteQuest(quest);
|
||||
}
|
||||
@@ -73,8 +69,4 @@ public class QuestActionManager extends NPCConversationManager {
|
||||
public void completeQuest() {
|
||||
forceCompleteQuest();
|
||||
}
|
||||
|
||||
public boolean forceCompleteQuest(int id) {
|
||||
return MapleQuest.getInstance(id).forceComplete(getPlayer(), getNpc());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,9 +358,26 @@ public class MapleItemInformationProvider {
|
||||
return list;
|
||||
}
|
||||
|
||||
private static short getExtraSlotMaxFromPlayer(MapleClient c, int itemId) {
|
||||
short ret = 0;
|
||||
|
||||
if (ItemConstants.isThrowingStar(itemId)) {
|
||||
if(c.getPlayer().getJob().isA(MapleJob.NIGHTWALKER1)) {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(NightWalker.CLAW_MASTERY)) * 10;
|
||||
} else {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(Assassin.CLAW_MASTERY)) * 10;
|
||||
}
|
||||
} else if (ItemConstants.isBullet(itemId)) {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(Gunslinger.GUN_MASTERY)) * 10;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public short getSlotMax(MapleClient c, int itemId) {
|
||||
if (slotMaxCache.containsKey(itemId)) {
|
||||
return slotMaxCache.get(itemId);
|
||||
Short slotMax = slotMaxCache.get(itemId);
|
||||
if (slotMax != null) {
|
||||
return (short)(slotMax + getExtraSlotMaxFromPlayer(c, itemId));
|
||||
}
|
||||
short ret = 0;
|
||||
MapleData item = getItemData(itemId);
|
||||
@@ -374,21 +391,11 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
} else {
|
||||
ret = (short) MapleDataTool.getInt(smEntry);
|
||||
if (ItemConstants.isThrowingStar(itemId)) {
|
||||
if(c.getPlayer().getJob().isA(MapleJob.NIGHTWALKER1)) {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(NightWalker.CLAW_MASTERY)) * 10;
|
||||
} else {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(Assassin.CLAW_MASTERY)) * 10;
|
||||
}
|
||||
} else {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(Gunslinger.GUN_MASTERY)) * 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ItemConstants.isRechargable(itemId)) {
|
||||
slotMaxCache.put(itemId, ret);
|
||||
}
|
||||
return ret;
|
||||
|
||||
slotMaxCache.put(itemId, ret);
|
||||
return (short)(ret + getExtraSlotMaxFromPlayer(c, itemId));
|
||||
}
|
||||
|
||||
public int getMeso(int itemId) {
|
||||
@@ -1238,7 +1245,7 @@ public class MapleItemInformationProvider {
|
||||
return rewardCache.get(itemId);
|
||||
}
|
||||
int totalprob = 0;
|
||||
List<RewardItem> rewards = new ArrayList<RewardItem>();
|
||||
List<RewardItem> rewards = new ArrayList<>();
|
||||
for (MapleData child : getItemData(itemId).getChildByPath("reward").getChildren()) {
|
||||
RewardItem reward = new RewardItem();
|
||||
reward.itemid = MapleDataTool.getInt("item", child, 0);
|
||||
@@ -1252,7 +1259,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
rewards.add(reward);
|
||||
}
|
||||
Pair<Integer, List<RewardItem>> hmm = new Pair<Integer, List<RewardItem>>(totalprob, rewards);
|
||||
Pair<Integer, List<RewardItem>> hmm = new Pair<>(totalprob, rewards);
|
||||
rewardCache.put(itemId, hmm);
|
||||
return hmm;
|
||||
}
|
||||
@@ -1441,7 +1448,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
public ArrayList<Pair<Integer, String>> getItemDataByName(String name)
|
||||
{
|
||||
ArrayList<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ArrayList<Pair<Integer, String>> ret = new ArrayList<>();
|
||||
for (Pair<Integer, String> itemPair : MapleItemInformationProvider.getInstance().getAllItems()) {
|
||||
if (itemPair.getRight().toLowerCase().contains(name.toLowerCase())) {
|
||||
ret.add(itemPair);
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
This file is part of the MapleSolaxiaV2 Maple Story Server
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package server;
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
}
|
||||
|
||||
int partyLevel = 0;
|
||||
int leechMinLevel = (ServerConstants.USE_UNDERLEVELED_EXP_BLOCK) ? getLevel() - ServerConstants.MIN_UNDERLEVEL_FOR_EXP_GAIN : 0; //NO EXP WILL BE GIVEN for those who are underleveled!
|
||||
int leechMinLevel = (ServerConstants.USE_UNDERLEVELED_EXP_BLOCK) ? getLevel() - ServerConstants.MIN_UNDERLEVEL_TO_EXP_GAIN : 0; //NO EXP WILL BE GIVEN for those who are underleveled!
|
||||
|
||||
int leechCount = 0;
|
||||
for (MapleCharacter mc : members) {
|
||||
@@ -347,7 +347,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
long pXP = (long)xp + (partyExp.containsKey(pID) ? partyExp.get(pID) : 0);
|
||||
partyExp.put(pID, (int)Math.min(pXP, Integer.MAX_VALUE));
|
||||
} else {
|
||||
if(!ServerConstants.USE_UNDERLEVELED_EXP_BLOCK || mc.getLevel() >= getLevel() - ServerConstants.MIN_UNDERLEVEL_FOR_EXP_GAIN) {
|
||||
if(!ServerConstants.USE_UNDERLEVELED_EXP_BLOCK || mc.getLevel() >= getLevel() - ServerConstants.MIN_UNDERLEVEL_TO_EXP_GAIN) {
|
||||
//NO EXP WILL BE GIVEN for those who are underleveled!
|
||||
giveExpToCharacter(mc, xp, isKiller, 1);
|
||||
} else {
|
||||
|
||||
@@ -1916,7 +1916,7 @@ public class MapleMap {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() == 200090060) {
|
||||
chr.changeMap(140020300);
|
||||
chr.changeMap(140020300, 0);
|
||||
}
|
||||
}
|
||||
}, 60 * 1000);
|
||||
@@ -1938,7 +1938,7 @@ public class MapleMap {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() == 200090030) {
|
||||
chr.changeMap(130000210);
|
||||
chr.changeMap(130000210, 0);
|
||||
}
|
||||
}
|
||||
}, 60 * 1000);
|
||||
@@ -1949,7 +1949,7 @@ public class MapleMap {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() == 200090031) {
|
||||
chr.changeMap(101000400);
|
||||
chr.changeMap(101000400, 0);
|
||||
}
|
||||
}
|
||||
}, 60 * 1000);
|
||||
@@ -1960,7 +1960,7 @@ public class MapleMap {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() == 200090021) {
|
||||
chr.changeMap(200000161);
|
||||
chr.changeMap(200000161, 0);
|
||||
}
|
||||
}
|
||||
}, 60 * 1000);
|
||||
@@ -1971,7 +1971,7 @@ public class MapleMap {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() == 200090020) {
|
||||
chr.changeMap(130000210);
|
||||
chr.changeMap(130000210, 0);
|
||||
}
|
||||
}
|
||||
}, 60 * 1000);
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
This file is part of the MapleSolaxiaV2 Maple Story Server
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package server.maps;
|
||||
|
||||
import server.TimerManager;
|
||||
|
||||
@@ -144,7 +144,7 @@ public class Pyramid extends PartyQuest {
|
||||
|
||||
public void warp(int mapid) {
|
||||
for (MapleCharacter chr : getParticipants()) {
|
||||
chr.changeMap(mapid);
|
||||
chr.changeMap(mapid, 0);
|
||||
}
|
||||
if (stage > -1) {
|
||||
gaugeSchedule.cancel(false);
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
This file is part of the MapleSolaxia Maple Story Server
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package server.quest.actions;
|
||||
|
||||
import client.MapleCharacter;
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
This file is part of the MapleSolaxia Maple Story Server
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package server.quest.requirements;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
Reference in New Issue
Block a user