小七社区www.xiaoqishequ.cc
小七社区更多精彩等你来!! 作者: qq410328702 时间: 2018-7-21 14:52
/*
* DISCORD: https://discord.gg/YYjjPMM
*
* Copyright (C) 2018 bdoEmu
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.bdoemu.gameserver.model.pvp;
public enum ELocalWarStatusType {
Waiting,
Started,
Ending;
public boolean isStarted() {
return this == ELocalWarStatusType.Started;
}
public boolean isEnding() {
return this == ELocalWarStatusType.Ending;
}
public boolean isWaiting() {
return this == ELocalWarStatusType.Waiting;
}
} 作者: qq410328702 时间: 2018-7-22 05:00
啊实打实大苏打似的阿三啥的啥的阿三大厦大厦s作者: qq410328702 时间: 2018-7-22 20:20
/*
* DISCORD: https://discord.gg/YYjjPMM
*
* Copyright (C) 2018 bdoEmu
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
@CommandHandlerMethod
public static Object[] index(final Player player, final String... params) {
return AbstractCommandHandler.getAcceptResult(BagCommandHandler.helpBuilder.toString());
}
@CommandHandlerMethod
public static Object[] add(final Player player, final String[] params) {
int enchantLevel = 0;
if (params.length < 2) {
return index(player, params);
}
Integer itemId;
Long count;
try {
itemId = Integer.parseInt(params[0]);
count = Long.parseLong(params[1]);
if (params.length >= 3) {
enchantLevel = Integer.parseInt(params[2]);
}
} catch (NumberFormatException ex) {
return AbstractCommandHandler.getRejectResult("Incorrect number format.");
} catch (ArrayIndexOutOfBoundsException ex2) {
return AbstractCommandHandler.getRejectResult("Incorrect parameters count.");
}
if (!player.getPlayerBag().onEvent(new AddItemEvent(player, itemId, enchantLevel, count))) {
return AbstractCommandHandler.getRejectResult("Fail while executing add ItemEvent.");
}
return AbstractCommandHandler.getAcceptResult("Item successfully added.");
}
@CommandHandlerMethod(accessLevel = EAccessLevel.ADMIN)
public static Object[] addtoplayer(final Player player, final String[] params) {
int enchantLevel = 0;
if (params.length < 3) {
return index(player, params);
}
Player target;
Integer itemId;
Long count;
try {
target = World.getInstance().getPlayer(params[0]);
if (target == null) {
return AbstractCommandHandler.getRejectResult("Player " + params[3] + " doesn't exist in world!");
}
itemId = Integer.parseInt(params[1]);
count = Long.parseLong(params[2]);
if (params.length >= 4) {
enchantLevel = Integer.parseInt(params[3]);
}
} catch (NumberFormatException ex) {
return AbstractCommandHandler.getRejectResult("Incorrect number format.");
} catch (ArrayIndexOutOfBoundsException ex2) {
return AbstractCommandHandler.getRejectResult("Incorrect parameters count.");
}
if (!target.getPlayerBag().onEvent(new AddItemEvent(target, itemId, enchantLevel, count))) {
return AbstractCommandHandler.getRejectResult("Fail while executing add ItemEvent.");
}
return AbstractCommandHandler.getAcceptResult("Item successfully added.");
}
} 作者: qq410328702 时间: 2018-7-23 00:20