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:
ronancpl
2017-11-03 17:06:48 -02:00
parent 64af2cfa00
commit 1fead59c57
145 changed files with 3139 additions and 2726 deletions
+25 -18
View File
@@ -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);
+17 -4
View File
@@ -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;
+2 -2
View File
@@ -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 {
+5 -5
View File
@@ -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);
+17 -4
View File
@@ -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;
+1 -1
View File
@@ -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);
+17 -4
View File
@@ -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;