player.sendMessage("Схема с таким именем уже существует.");
return;
}
}
}
player.schemes.add(new OneScheme(name));
player.setVar("Buf_" + name, "");
}
catch(Exception e)
{
player.sendMessage("Введите имя схемы.");
}
Community.getInstance().show(objectId, showBuffer(objectId, null));
}
else if(command.startsWith("_bbsbaffer_select_scheme"))
{
StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
Community.getInstance().show(objectId, showBuffer(objectId, st.nextToken()));
}
else if(command.startsWith("_bbsbaffer_edit_scheme"))
{
StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
String name = st.nextToken();
int page = Integer.parseInt(st.nextToken());
boolean add = Boolean.parseBoolean(st.nextToken());
boolean del = Boolean.parseBoolean(st.nextToken());
boolean run = Boolean.parseBoolean(st.nextToken());
Community.getInstance().show(objectId, editScheme(objectId, page, player.getOneSchemeByName(name), add, del, run));
}
else if(command.startsWith("_bbsbaffer_del_scheme"))
{
StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
String name = st.nextToken();
for(OneScheme oneScheme : player.schemes)
{
if(oneScheme.getName().equals(name))
{
player.schemes.remove(oneScheme);
player.unsetVar("Buf_" + name);
break;
}
}
Community.getInstance().show(objectId, showBuffer(objectId, null));
}
else if(command.startsWith("_bbsbaffer_buff_scheme"))
{
StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
String name = st.nextToken();
String type = st.nextToken();
if(player.getOneSchemeByName(name).buffs.isEmpty())
{
return;
}
for(Buff buff : player.getOneSchemeByName(name).buffs)
{
if(buff != null)
{
if(type.equals("Player"))
{
if(mOption.price(player, Integer.parseInt(priceOneBuffScheme[0]), Integer.parseInt(priceOneBuffScheme[1])))
{
buff(buff.getId(), buff.getLevel(), objectId, false);
}
}
else if(type.equals("Pet") && player.getPet() != null)
{
if(mOption.price(player, Integer.parseInt(priceOneBuffScheme[0]), Integer.parseInt(priceOneBuffScheme[1])))
{
buff(buff.getId(), buff.getLevel(), objectId, true);
}
}
}
}
}
else if(command.startsWith("_bbsbaffer_adddelrun_buff_scheme"))
{
StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
String name = st.nextToken();
int id = Integer.parseInt(st.nextToken());
int page = Integer.parseInt(st.nextToken());
boolean add = Boolean.parseBoolean(st.nextToken());
boolean del = Boolean.parseBoolean(st.nextToken());
boolean run = Boolean.parseBoolean(st.nextToken());
OneScheme oneScheme = name.equalsIgnoreCase("Normal") ? null : player.getOneSchemeByName(name);
if(oneScheme != null)
{
if(add)
{
if(oneScheme.buffs.size() < buffer_max_buffs)