text = text.replace("-h custom_do", "bbs_bbs");
BaseBBSManager.separateAndSend(text, player);
}
else
{
NpcHtmlMessage htm = new NpcHtmlMessage(player.getLastQuestNpcObject());
htm.setHtml(text);
player.sendPacket(htm);
}
}
else if(parameters.startsWith("RestoreAll")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE*3) {
player.sendMessage("You don't have enough adena");
return;
}
player.getStatus().setCurrentCp(player.getMaxCp());
player.getStatus().setCurrentMp(player.getMaxMp());
player.getStatus().setCurrentHp(player.getMaxHp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE*3, null, true);
}
else if(parameters.startsWith("RestorePetAll")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE*3) {
player.sendMessage("You don't have enough adena");
return;
}
player.getPet().getStatus().setCurrentMp(player.getPet().getMaxMp());
player.getPet().getStatus().setCurrentHp(player.getPet().getMaxHp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE*3, null, true);
}
else if(parameters.startsWith("RestoreCP")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
player.sendMessage("You don't have enough adena");
return;
}
player.getStatus().setCurrentCp(player.getMaxCp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
}
else if(parameters.startsWith("RestoreMP")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
player.sendMessage("You don't have enough adena");
return;
}
player.getStatus().setCurrentMp(player.getMaxMp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
}
else if(parameters.startsWith("RestorePetMP")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
player.sendMessage("You don't have enough adena");
return;
}
player.getPet().getStatus().setCurrentMp(player.getPet().getMaxMp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
}
else if(parameters.startsWith("RestoreHP")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
player.sendMessage("You don't have enough adena");
return;
}
player.getStatus().setCurrentHp(player.getMaxHp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
}
else if(parameters.startsWith("RestorePetHP")) {
if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
player.sendMessage("You don't have enough adena");
return;
}
player.getPet().getStatus().setCurrentHp(player.getPet().getMaxHp());
player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
}
else if(parameters.startsWith("MakeBuffs") || parameters.startsWith("RestoreBuffs"))
{
String buffName = parameters.substring(9).trim();
int totaladena = 0;
ArrayList<Buff> buffs = null;
if(parameters.startsWith("RestoreBuffs"))
buffs = getOwnBuffs(player.getObjectId());
else
buffs = BuffTable.getInstance().getBuffsForName(buffName);
if(buffs!=null && buffs.size()==1)
{
if(!getOwnBuffs(player.getObjectId()).contains(buffs.get(0)))
getOwnBuffs(player.getObjectId()).add(buffs.get(0));
}
if(buffs==null || buffs.size()==0){
player.sendMessage("Your buff set is missing");
return;
}
for(Buff buff: buffs)
{
L2Skill skill = SkillTable.getInstance().getInfo(buff._skillId, buff._skillLevel);
if(skill!=null)
{
if(player.getLevel()>= buff._minLevel && player.getLevel()<=buff._maxLevel)
{
if(buff._price>0)
{
totaladena+=buff._price;
if(player.getAdena()<totaladena)
{
player.sendMessage("You don't have enough adena");
break;
}
}
if(!buff._force && buffer!=null)
{
buffer.setBusy(true);
buffer.setCurrentMp(buffer.getMaxMp());
buffer.setTarget(player);
//buffer.doCast(skill);
skill.getEffects(buffer, player,false,false,false);
buffer.setBusy(false);
} else
skill.getEffects(player, player,false,false,false);
}
try
{
Thread.sleep(100); // Delay for the packet...
}
catch(InterruptedException e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
}
}
if(totaladena>0)
player.reduceAdena("Buff", totaladena, null, true);
if(_visitedPages.get(player.getObjectId())!=null)
handleCommand(command,player,"Chat "+_visitedPages.get(player.getObjectId()));
else
useVoicedCommand(PowerPakConfig.BUFFER_COMMAND, player, "");
}else if(parameters.startsWith("MakePetBuffs") || parameters.startsWith("RestorePetBuffs"))
{
if(player.getPet()==null){
player.sendMessage("You have not a summoned pet");
return;
}
String buffName = parameters.substring(12).trim();
int totaladena = 0;
ArrayList<Buff> buffs = null;
if(parameters.startsWith("RestorePetBuffs"))
buffs = getOwnBuffs(player.getPet().getObjectId());
else
buffs = BuffTable.getInstance().getBuffsForName(buffName);
if(buffs!=null && buffs.size()==1)
{
if(!getOwnBuffs(player.getPet().getObjectId()).contains(buffs.get(0))){
getOwnBuffs(player.getPet().getObjectId()).add(buffs.get(0));
}
}
if(buffs==null || buffs.size()==0){
player.sendMessage("Your pet buff set is missing");
return;
}
for(Buff buff: buffs)
{
L2Skill skill = SkillTable.getInstance().getInfo(buff._skillId, buff._skillLevel);
if(skill!=null)
{
if(player.getLevel()>= buff._minLevel && player.getLevel()<=buff._maxLevel)
{
if(buff._price>0)
{
totaladena+=buff._price;
if(player.getAdena()<totaladena)
{
player.sendMessage("You don't have enough adena");
break;
}
}
if(!buff._force && buffer!=null)
{
buffer.setBusy(true);
buffer.setCurrentMp(buffer.getMaxMp());
buffer.setTarget(player.getPet());
skill.getEffects(buffer, player.getPet(),false,false,false);
//buffer.doCast(skill);
buffer.setBusy(false);
} else
skill.getEffects(player, player.getPet(),false,false,false);
}
try
{
Thread.sleep(100); // Delay for the packet...
}
catch(InterruptedException e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
}
}
if(totaladena>0)
player.reduceAdena("Buff", totaladena, null, true);
if(_visitedPages.get(player.getObjectId())!=null)
handleCommand(command,player,"Chat "+_visitedPages.get(player.getObjectId()));
else
useVoicedCommand(PowerPakConfig.BUFFER_COMMAND, player, "");
//SCHEMAS
}else if (currentCommand.startsWith("menu"))
{
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setFile(PARENT_DIR + "menu.htm");
sendHtmlMessage(player, html);
}
// handles giving effects {support player, support pet, givebuffs}
else if (currentCommand.startsWith("support"))
{
String targettype = st.nextToken();
showGiveBuffsWindow(player, targettype);
}
else if (currentCommand.startsWith("givebuffs"))
{
String targettype = st.nextToken();
String scheme_key = st.nextToken();
int cost = Integer.parseInt(st.nextToken());
if (cost == 0 || cost <= player.getInventory().getAdena())
{
L2Character target = player;
if (targettype.equalsIgnoreCase("pet"))
target = player.getPet();
if (target != null)
{
for (L2Skill sk : CharSchemesTable.getInstance().getScheme(player.getObjectId(), scheme_key))
if(buffer!=null)
{
buffer.setBusy(true);
buffer.setCurrentMp(buffer.getMaxMp());
buffer.setTarget(target);
//buffer.doCast(skill);
sk.getEffects(buffer, target,false,false,false);
buffer.setBusy(false);
} else
sk.getEffects(target, target,false,false,false);
//sk.getEffects(buffer, target);
player.reduceAdena("NPC Buffer", cost, null, true);
}else
{
player.sendMessage("Incorrect Target");
// go to main menu
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setFile(PARENT_DIR + "menu.htm");
sendHtmlMessage(player, html);
}
}
else
{