Fixed quest rewarding + Lethal attacks in Dojo

Fixed quests not giving items in some cases, lethal damages rendering
dojo uncompletable and added new scripts.
This commit is contained in:
ronancpl
2017-04-07 21:42:42 -03:00
parent f6935d3d3b
commit c8f905e1a5
23 changed files with 7503 additions and 6922 deletions

View File

@@ -273,15 +273,14 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
Skill pickpocket = SkillFactory.getSkill(ChiefBandit.PICKPOCKET);
int delay = 0;
final int maxmeso = player.getBuffedValue(MapleBuffStat.PICKPOCKET).intValue();
for (Integer eachd : onedList) {
eachd += Integer.MAX_VALUE;
for (Integer eachd : onedList) {
eachd += Integer.MAX_VALUE;
if (pickpocket.getEffect(player.getSkillLevel(pickpocket)).makeChanceResult()) {
final Integer eachdf;
if(eachd < 0)
eachdf = eachd + Integer.MAX_VALUE;
else
eachdf = eachd;
final Integer eachdf;
if(eachd < 0)
eachdf = eachd + Integer.MAX_VALUE;
else
eachdf = eachd;
TimerManager.getInstance().schedule(new Runnable() {
@Override

View File

@@ -30,6 +30,7 @@ import client.inventory.Item;
import client.inventory.MapleInventoryType;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import constants.ServerConstants;
import constants.skills.Aran;
import constants.skills.Corsair;
@@ -63,7 +64,7 @@ public final class TakeDamageHandler extends AbstractMaplePacketHandler {
int damage = slea.readInt();
int oid = 0, monsteridfrom = 0, pgmr = 0, direction = 0;
int pos_x = 0, pos_y = 0, fake = 0;
boolean is_pgmr = false, is_pg = true;
boolean is_pgmr = false, is_pg = true, is_deadly = false;
int mpattack = 0;
MapleMonster attacker = null;
final MapleMap map = player.getMap();
@@ -111,6 +112,7 @@ public final class TakeDamageHandler extends AbstractMaplePacketHandler {
if (attackInfo != null) {
if (attackInfo.isDeadlyAttack()) {
mpattack = player.getMp() - 1;
is_deadly = true;
}
mpattack += attackInfo.getMpBurn();
MobSkill skill = MobSkillFactory.getMobSkill(attackInfo.getDiseaseSkill(), attackInfo.getDiseaseLevel());
@@ -142,6 +144,13 @@ public final class TakeDamageHandler extends AbstractMaplePacketHandler {
if (damage == -1) {
fake = 4020002 + (player.getJob().getId() / 10 - 40) * 100000;
}
//in dojo player cannot use pot, so deadly attacks should be turned off as well
if(is_deadly && player.getMap().isDojoMap() && !ServerConstants.USE_DEADLY_DOJO) {
damage = 0;
mpattack = 0;
}
if (damage == 0) {
player.getAutobanManager().addMiss();
} else {