/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 ~ 2010 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 scripting;
import client.MapleClient;
import server.MaplePortal;
public class PortalPlayerInteraction extends AbstractPlayerInteraction {
private final MaplePortal portal;
public PortalPlayerInteraction(final MapleClient c, final MaplePortal portal) {
super(c, portal.getId(), c.getPlayer().getMapId(), null);
this.portal = portal;
}
public final MaplePortal getPortal() {
return portal;
}
public final void inFreeMarket() {
if (getMapId() != 910000000) {
if (getPlayer().getLevel() >= 10) {
saveLocation("FREE_MARKET");
playPortalSE();
warp(910000000, "st00");
} else {
playerMessage(5, "你必須10級以上才能進入自由市場。");
}
}
}
public final void inArdentmill() {
if (getMapId() != 910001000) {
saveLocation("ARDENTMILL");
playPortalSE();
warp(910001000, "st00");
}
}
// summon one monster on reactor location
@Override
public void spawnMonster(int id) {
spawnMonster(id, 1, portal.getPosition());
}
// summon monsters on reactor location
@Override
public void spawnMonster(int id, int qty) {
spawnMonster(id, qty, portal.getPosition());
}
}