כל שחקן שמזמן SUMMON BAG מקבל BAN במקום
איך אני מבטל את זה???
|
|
תראה את UseSummonBag.java
קוד PHP:/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License 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 net.sf.odinms.net.channel.handler;
import net.sf.odinms.client.IItem;
import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.MapleInventoryType;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.server.MapleInventoryManipulator;
import net.sf.odinms.server.MapleItemInformationProvider;
import net.sf.odinms.server.life.MapleLifeFactory;
import net.sf.odinms.server.life.MapleMonster;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
/**
*
* @author AngelSL
*/
public class UseSummonBag extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
if (!c.getPlayer().isAlive()) {
c.getSession().write(MaplePacketCreator.enableActions());
return;
}
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
slea.readInt(); // i have no idea :) (o.o)
byte slot = (byte) slea.readShort();
int itemId = slea.readInt(); //as if we cared... ;)
IItem toUse = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot);
if (toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemId && c.getPlayer().isAlive()) {
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, (short) 1, false);
int[][] toSpawn = ii.getSummonMobs(itemId);
for (int z = 0; z < toSpawn.length; z++) {
int[] toSpawnChild = toSpawn[z];
if ((int) Math.ceil(Math.random() * 100) <= toSpawnChild[1]) {
MapleMonster ht = MapleLifeFactory.getMonster(toSpawnChild[0]);
c.getPlayer().getMap().spawnMonsterOnGroundBelow(ht, c.getPlayer().getPosition());
}
}
} else {
c.getPlayer().ban("Trying to use a summonbag not in item inventory.", false);
return;
}
c.getSession().write(MaplePacketCreator.enableActions());
}
}
אפשר לנעול?קוד PHP:/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License 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 net.sf.odinms.net.channel.handler;
import net.sf.odinms.client.IItem;
import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.MapleInventoryType;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.server.MapleInventoryManipulator;
import net.sf.odinms.server.MapleItemInformationProvider;
import net.sf.odinms.server.life.MapleLifeFactory;
import net.sf.odinms.server.life.MapleMonster;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
/**
*
* @author AngelSL
*/
public class UseSummonBag extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
if (!c.getPlayer().isAlive()) {
c.getSession().write(MaplePacketCreator.enableActions());
return;
}
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
slea.readInt(); // i have no idea :) (o.o)
byte slot = (byte) slea.readShort();
int itemId = slea.readInt(); //as if we cared... ;)
IItem toUse = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot);
if (toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemId) {
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, (short) 1, false);
int[][] toSpawn = ii.getSummonMobs(itemId);
for (int z = 0; z < toSpawn.length; z++) {
int[] toSpawnChild = toSpawn[z];
if ((int) Math.ceil(Math.random() * 100) <= toSpawnChild[1]) {
MapleMonster ht = MapleLifeFactory.getMonster(toSpawnChild[0]);
c.getPlayer().getMap().spawnMonsterOnGroundBelow(ht, c.getPlayer().getPosition());
}
}
} else
return;
c.getSession().write(MaplePacketCreator.enableActions());
}
}
נערך לאחרונה על ידי Symphony; 31-08-2011 בשעה 17:56.
עוד משהו או שאפשר לנהול?
אך מתי כבר תבחיני
בין הטוב והרע ותביני
אני לא אלוהים לא אינני
אני רק בן-אדם אוהב הנניספוילר:
מי שצריך עזרה שיצטט או ישלח פרטית