[question]Как доделать скрипт ?
7 ответов223 просмотровСейчас просматривают: 1
· 15.09.2009, 16:29
Сборка:l2jserv gFinal
Суть Проблемы:На форуме один хороший челове квыложил скрипт на бафера по команде ".buff". Но при нажатии на баф он бафает но окно закрывается.
Вопрос: Как сделать чтобы он возвращался обратно на диалог с бафами ? Срипт ниже в спойлере ;)
Раскрывающийся текст
Код
else if (_command.startsWith("player_help "))
{
playerHelp(activeChar, _command.substring(12));
}
+ // Воины
+ else if (_command.startsWith("vica_buff")) { buffer(1363,1,activeChar);} // Chant of Victory
+ else if (_command.startsWith("mig_buff")) { buffer(4345,3,activeChar);} // Might
+ else if (_command.startsWith("hast_buff")){ buffer(4357,2,activeChar);} // Haste
+ else if (_command.startsWith("gue_buff")){ buffer(4358,3,activeChar);} // Guedance
+ else if (_command.startsWith("focus_buff")){ buffer(4359,3,activeChar);} // Focus
+ else if (_command.startsWith("dw_buff")){ buffer(4360,3,activeChar);} // Dead Wisper
+ else if (_command.startsWith("dancef_buff")){ buffer(275,1,activeChar);} // Dance of Fury
+ else if (_command.startsWith("dancefire_buff")){ buffer(274,1,activeChar);} // Dance of Fire
+ else if (_command.startsWith("dancew_buff")){ buffer(271,1,activeChar);} // Dance of the Warrior
+ else if (_command.startsWith("magnus_buff")) { buffer(1413,1,activeChar);} // Magnus' Chant
+ else if (_command.startsWith("emp_buff")) { buffer(4356,2,activeChar);} // Empower
+ else if (_command.startsWith("acum_buff")) { buffer(4355,2,activeChar);} // Acument
+ else if (_command.startsWith("conc_buff")) { buffer(4351,6,activeChar);} // Dance of Concentration
+ else if (_command.startsWith("wm_buff")) { buffer(1303,2,activeChar);} // Wild Magic
+ else if (_command.startsWith("dancem_buff")) { buffer(273,1,activeChar);} // Dance of the Mystic
+ else if (_command.startsWith("dancesiren_buff")) { buffer(365,1,activeChar);} // Dance of Siren
+ else if (_command.startsWith("bs_buff")) { buffer(4348,6,activeChar);} // Blessed Soul
+ else if (_command.startsWith("sh_buff")) { buffer(4344,3,activeChar);} // Shield
+ else if (_command.startsWith("gs_buff")) { buffer(1389,3,activeChar);} // Greater Shield
+ else if (_command.startsWith("gm_buff")) { buffer(1388,3,activeChar);} // Greater Might
+ else if (_command.startsWith("ww_buff")) { buffer(4342,2,activeChar);} // Wind Walk
+ else if (_command.startsWith("sh_buff")) { buffer(4344,3,activeChar);} // Shield
+ else if (_command.startsWith("ms_buff")) { buffer(4346,4,activeChar);} // Mental Shield
+ else if (_command.startsWith("bb_buff")) { buffer(4347,6,activeChar);} // Blessed Body
+ else if (_command.startsWith("mb_buff")) { buffer(4349,2,activeChar);} // Magic Barrier
+ else if (_command.startsWith("bers_buff")) { buffer(4352,2,activeChar);} // Berserker Spirit
+ else if (_command.startsWith("blss_buff")) { buffer(4353,6,activeChar);} // Bless Shield
+ else if (_command.startsWith("soe_buff")) { buffer(264,1,activeChar);} // Song of Earth
+ else if (_command.startsWith("sow_buff")) { buffer(267,1,activeChar);} // Song of Warding
+ else if (_command.startsWith("sowind_buff")) { buffer(268,1,activeChar);} // Song of Wind
+ else if (_command.startsWith("soh_buff")) { buffer(269,1,activeChar);} // Song of Hunter
+ else if (_command.startsWith("sov_buff")) { buffer(304,1,activeChar);} // Song of Vitality
+ else if (_command.startsWith("sov2_buff")) { buffer(305,1,activeChar);} // Song of Vengeance
+ else if (_command.startsWith("sofg_buff")) { buffer(306,1,activeChar);} // Song of Flame Guard
+ else if (_command.startsWith("sol_buff")) { buffer(265,1,activeChar);} // Song of Life
+ else if (_command.startsWith("soc_buff")) { buffer(364,1,activeChar);} // Song of Champion
else if (_command.startsWith("npc_"))
{
{
playerHelp(activeChar, _command.substring(12));
}
+ // Воины
+ else if (_command.startsWith("vica_buff")) { buffer(1363,1,activeChar);} // Chant of Victory
+ else if (_command.startsWith("mig_buff")) { buffer(4345,3,activeChar);} // Might
+ else if (_command.startsWith("hast_buff")){ buffer(4357,2,activeChar);} // Haste
+ else if (_command.startsWith("gue_buff")){ buffer(4358,3,activeChar);} // Guedance
+ else if (_command.startsWith("focus_buff")){ buffer(4359,3,activeChar);} // Focus
+ else if (_command.startsWith("dw_buff")){ buffer(4360,3,activeChar);} // Dead Wisper
+ else if (_command.startsWith("dancef_buff")){ buffer(275,1,activeChar);} // Dance of Fury
+ else if (_command.startsWith("dancefire_buff")){ buffer(274,1,activeChar);} // Dance of Fire
+ else if (_command.startsWith("dancew_buff")){ buffer(271,1,activeChar);} // Dance of the Warrior
+ else if (_command.startsWith("magnus_buff")) { buffer(1413,1,activeChar);} // Magnus' Chant
+ else if (_command.startsWith("emp_buff")) { buffer(4356,2,activeChar);} // Empower
+ else if (_command.startsWith("acum_buff")) { buffer(4355,2,activeChar);} // Acument
+ else if (_command.startsWith("conc_buff")) { buffer(4351,6,activeChar);} // Dance of Concentration
+ else if (_command.startsWith("wm_buff")) { buffer(1303,2,activeChar);} // Wild Magic
+ else if (_command.startsWith("dancem_buff")) { buffer(273,1,activeChar);} // Dance of the Mystic
+ else if (_command.startsWith("dancesiren_buff")) { buffer(365,1,activeChar);} // Dance of Siren
+ else if (_command.startsWith("bs_buff")) { buffer(4348,6,activeChar);} // Blessed Soul
+ else if (_command.startsWith("sh_buff")) { buffer(4344,3,activeChar);} // Shield
+ else if (_command.startsWith("gs_buff")) { buffer(1389,3,activeChar);} // Greater Shield
+ else if (_command.startsWith("gm_buff")) { buffer(1388,3,activeChar);} // Greater Might
+ else if (_command.startsWith("ww_buff")) { buffer(4342,2,activeChar);} // Wind Walk
+ else if (_command.startsWith("sh_buff")) { buffer(4344,3,activeChar);} // Shield
+ else if (_command.startsWith("ms_buff")) { buffer(4346,4,activeChar);} // Mental Shield
+ else if (_command.startsWith("bb_buff")) { buffer(4347,6,activeChar);} // Blessed Body
+ else if (_command.startsWith("mb_buff")) { buffer(4349,2,activeChar);} // Magic Barrier
+ else if (_command.startsWith("bers_buff")) { buffer(4352,2,activeChar);} // Berserker Spirit
+ else if (_command.startsWith("blss_buff")) { buffer(4353,6,activeChar);} // Bless Shield
+ else if (_command.startsWith("soe_buff")) { buffer(264,1,activeChar);} // Song of Earth
+ else if (_command.startsWith("sow_buff")) { buffer(267,1,activeChar);} // Song of Warding
+ else if (_command.startsWith("sowind_buff")) { buffer(268,1,activeChar);} // Song of Wind
+ else if (_command.startsWith("soh_buff")) { buffer(269,1,activeChar);} // Song of Hunter
+ else if (_command.startsWith("sov_buff")) { buffer(304,1,activeChar);} // Song of Vitality
+ else if (_command.startsWith("sov2_buff")) { buffer(305,1,activeChar);} // Song of Vengeance
+ else if (_command.startsWith("sofg_buff")) { buffer(306,1,activeChar);} // Song of Flame Guard
+ else if (_command.startsWith("sol_buff")) { buffer(265,1,activeChar);} // Song of Life
+ else if (_command.startsWith("soc_buff")) { buffer(364,1,activeChar);} // Song of Champion
else if (_command.startsWith("npc_"))
{
0
· 15.09.2009, 17:26
мм ты же из Open-Team? Спроси у ваших кодеров About и Diagod или это им и надо?)
0
· 15.09.2009, 17:41
Прощу прощения за оффтоп...))
Но глядя на этот код хочется расстрелять его автора.
Ну это-же не PHP чтобы так издеватся...ппц )
— Ålderdom - ingen glädje..
0
· 15.09.2009, 17:53
AbsT: Прощу прощения за оффтоп...))
Но глядя на этот код хочется расстрелять его автора.
Ну это-же не PHP чтобы так издеватся...ппц )
Это не весь код это кусок со списком бафов
Я пробывал поставить значение return но при компиляции на него ругается компилер :(
0
· 15.09.2009, 18:28
VlLight: А что происходит при команде ".buff"?
Открывается окно со списком бафов
Раскрывающийся текст
/*
* 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.Siege;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
public class Buff implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "buff" };
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.startsWith("buff"))
{
String filename = "data/html/optional/buff.htm";
String content = HtmCache.getInstance().getHtm(filename);
if (content == null)
{
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setHtml("<html><body>My Text is missing:<br>"+filename+"</body></html>");
activeChar.sendPacket(html);
}
else
{
NpcHtmlMessage html = new NpcHtmlMessage(5);
html.setHtml(content);
activeChar.sendPacket(html);
}
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
}
return true;
}
private boolean buff(L2PcInstance activeChar, String text)
{
// Check player if player is dead
if (activeChar.isDead())
{
activeChar.sendMessage("You can't use buff While you are dead!");
return false;
}
// Check player if is sitting
if (activeChar.isSitting())
{
activeChar.sendMessage("You can't use buff While You are Sitting");
return false;
}
//check is in DimensionsRift
if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift())
{
activeChar.sendMessage("You can't use buff! You are in the dimensional rift.");
return false;
}
// Check player is in observer mode
if (activeChar.inObserverMode())
{
activeChar.sendMessage("You can't use buff in Observer mode!");
return false;
}
return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}
* 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.Siege;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
public class Buff implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "buff" };
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.startsWith("buff"))
{
String filename = "data/html/optional/buff.htm";
String content = HtmCache.getInstance().getHtm(filename);
if (content == null)
{
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setHtml("<html><body>My Text is missing:<br>"+filename+"</body></html>");
activeChar.sendPacket(html);
}
else
{
NpcHtmlMessage html = new NpcHtmlMessage(5);
html.setHtml(content);
activeChar.sendPacket(html);
}
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
}
return true;
}
private boolean buff(L2PcInstance activeChar, String text)
{
// Check player if player is dead
if (activeChar.isDead())
{
activeChar.sendMessage("You can't use buff While you are dead!");
return false;
}
// Check player if is sitting
if (activeChar.isSitting())
{
activeChar.sendMessage("You can't use buff While You are Sitting");
return false;
}
//check is in DimensionsRift
if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift())
{
activeChar.sendMessage("You can't use buff! You are in the dimensional rift.");
return false;
}
// Check player is in observer mode
if (activeChar.inObserverMode())
{
activeChar.sendMessage("You can't use buff in Observer mode!");
return false;
}
return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}
0
Войдите или зарегистрируйтесь чтобы ответить


