public class CustomMerchantInstance extends MerchantInstance {
public CustomMerchantInstance(int objectId, NpcTemplate template) {
super(objectId, template);
}
@Override
public void onBypassFeedback(final Player player, final String command) {
if (!canBypassCheck(player, this)) {
return;
}
final StringTokenizer st = new StringTokenizer(command, " ");
final String actualCommand = st.nextToken();
if ("CustomBuy".equalsIgnoreCase(actualCommand)) {
int val = 0;
if (st.countTokens() > 0) {
val = Integer.parseInt(st.nextToken());
}
if(checkPlayer(player)) {
showShopWindow(player, val, true);
} else {
player.sendActionFailed();
}
} else {
super.onBypassFeedback(player, command);
}
}
private boolean checkPlayer(final Player player) {
return player.isClanLeader();
}
}