т错误:
[22:19:14]错误脚本:没有这样的方法services.fakehero.list()!java.lang.nosuchmethodexception:在org.apache.commons.lang3.reflect.methodutils.invokemethod(methodutils)的object:services.fakehero上没有这样的可访问方法:list()。java:129)在l2f.gameserver.scripts.scripts.callscripts(脚本。java:360)在l2f.gameserver.scripts.scripts.callscripts(脚本。java:296)在l2f.gameserver.network.clientpackets.requestbypasstoserver.runimpl(requestbypasstoserver。java:94)在l2f.gameserver.network.clientpackets.l2gamesclientpacket.run(l2gamesclientpacket。java:49)在l2f.commons.net.nio.impl.mmoexecutablequeue.run(mmoexecutablequeue。java:39)位于java.util.concurrent.threadpoolexecutor.runworker(未知源)java.lang.thread.run(未知源)上的java.util.concurrent.threadpoolexecutor$worker.run(未知源)
代码:
public class FakeHero extends Functions{
private final int[] ITEM = Config.SERVICES_HERO_SELL_ITEM;
private final int[] PRICE = Config.SERVICES_HERO_SELL_PRICE;
private final int[] DAY = Config.SERVICES_HERO_SELL_DAY;
public void list(String[] arg)
{
final Player player = getSelf();
if (player == null)
return;
if (!Config.SERVICES_HERO_SELL_ENABLED)
{
player.sendMessage("This service is turned off.");
return;
}
NpcHtmlMessage html = null;
if ((!player.isHero()) && (!player.isFakeHero()))
{
html = new NpcHtmlMessage(5).setFile("scripts/services/FakeHero/index.htm");
String template = HtmCache.getInstance().getNotNull("scripts/services/FakeHero/template.htm", player);
String block = "";
String list = "";
int page = arg[0].length() > 0 ? Integer.parseInt(arg[0]) : 1;
int counter = 0;
for (int i = (page - 1) * 6; i < DAY.length; i++)
{
block = template;
block = block.replace("{bypass}", "bypass -h scripts_services.FakeHero:buy " + i);
block = block.replace("{info}", DAY[i] + " " + Util.declension(DAY[i], DeclensionKey.DAYS));
block = block.replace("{cost}", new CustomMessage("<font color=00ff00>Cost</font>: {0}").addString(Util.formatPay(player, PRICE[i], ITEM[i])).toString());
list = list + block;
counter++;
if (counter >= 6)
{
break;
}
}
double count = Math.ceil(DAY.length / 6.0D);
int inline = 1;
String navigation = "";
for (int i = 1; i <= count; i++)
{
if (i == page)
{
navigation = navigation + "<td width=25 align=center valign=top><button value=\"[" + i + "]\" action=\"bypass -h scripts_services.FakeHero:list " + i + "\" width=32 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>";
}
else
{
navigation = navigation + "<td width=25 align=center valign=top><button value=\"" + i + "\" action=\"bypass -h scripts_services.FakeHero:list " + i + "\" width=32 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>";
}
if (inline % 7 == 0)
{
navigation = navigation + "</tr><tr>";
}
inline++;
}
if (inline == 2)
{
navigation = "<td width=30 align=center valign=top>...</td>";
}
html.replace("%list%", list);
html.replace("%navigation%", navigation);
}
else
{
html = new NpcHtmlMessage(5).setFile("scripts/services/FakeHero/already.htm");
player.sendMessage(new CustomMessage("You are already a hero."));
}
player.sendPacket(html);
}
public void buy(String[] arg)
{
final Player player = getSelf();
if (player == null)
return;
if (!Config.SERVICES_HERO_SELL_ENABLED)
{
player.sendMessage("This service is turned off.");
return;
}
if (arg[0].isEmpty())
{
return;
}
int i = Integer.parseInt(arg[0]);
if (i > Config.SERVICES_HERO_SELL_DAY.length)
{
player.sendMessage("Error.");
return;
}
if ((player.isHero()) || (player.isFakeHero()))
{
player.sendMessage("You are already a hero.");
return;
}
if (Util.getPay(player, ITEM[i], PRICE[i], true))
{
long day = Util.addDay(DAY[i]);
long time = System.currentTimeMillis() + day;
try
{
player.setVar("hasFakeHero", 1, time);
player.sendChanges();
player.broadcastCharInfo();
if (Config.SERVICES_HERO_SELL_SKILL)
{
Hero.addSkills(player);
}
player.broadcastPacket(new SocialAction(player.getObjectId(), SocialAction.GIVE_HERO));
player.sendMessage(new CustomMessage("Congratulations!").addNumber(DAY[i]).addString(Util.declension(DAY[i], DeclensionKey.DAYS)));
}
catch (Exception e)
{
player.sendMessage(new CustomMessage("Error."));
}
}
}
}
我在这里调用函数:
<table width=247 height=42>
<tr>
<td width=243 align=center valign=center>
<table width=241 height=39>
<tr>
<td width=40 align=right valign=top>
<table cellspacing=0 cellpadding=0 width=32 height=32 background=icon.pvp_point_i00>
<tr>
<td width=32 height=32 align=center valign=top>
<img src=icon.panel_2 width=32 height=32>
</td>
</tr>
</table>
</td>
<td width=150 valign=center>
<font color=FF6600>15,000 Fame Points</font>
<br1>
<font color=669900>Cost:</font> 15 Donator Coin
</td>
<td width=47 valign=center align=center>
<button value=BUY action="bypass -h scripts_services.Donations:buy_fame" width=45 height=32 back=L2UI_CT1.ListCTRL_DF_Title_Down fore=L2UI_CT1.ListCTRL_DF_Title />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width=247 height=42 bgcolor=111111>
<tr>
<td width=243 align=center valign=center>
<table width=241 height=39>
<tr>
<td width=40 align=right valign=top>
<table cellspacing=0 cellpadding=0 width=32 height=32 background=icon.skill1323>
<tr>
<td width=32 height=32 align=center valign=top>
<img src=icon.panel_2 width=32 height=32>
</td>
</tr>
</table>
</td>
<td width=150 valign=center>
<font color=FF6600>Nobless</font>
<br1>
<font color=669900>Cost:</font> 10 Donator Coin
</td>
<td width=47 valign=center align=center>
<button value=BUY action="bypass -h scripts_services.NoblessSell:get" width=45 height=32 back=L2UI_CT1.ListCTRL_DF_Title_Down fore=L2UI_CT1.ListCTRL_DF_Title />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width=247 height=42>
<tr>
<td width=243 align=center valign=center>
<table width=241 height=39>
<tr>
<td width=40 align=right valign=top>
<table cellspacing=0 cellpadding=0 width=32 height=32 background=icon.skill0391>
<tr>
<td width=32 height=32 align=center valign=top>
<img src=icon.panel_2 width=32 height=32>
</td>
</tr>
</table>
</td>
<td width=150 valign=center>
<font color=FF6600>Clan level</font>
<br1>
<font color=LEVEL>Info:</font> Price by level!
</td>
<td width=47 valign=center align=center>
<button value=OPEN action="bypass -h scripts_services.Donations:clan_level_page" width=45 height=32 back=L2UI_CT1.ListCTRL_DF_Title_Down fore=L2UI_CT1.ListCTRL_DF_Title />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width=247 height=42 bgcolor=111111>
<tr>
<td width=243 align=center valign=center>
<table width=241 height=39>
<tr>
<td width=40 align=right valign=top>
<table cellspacing=0 cellpadding=0 width=32 height=32 background=icon.skill1464>
<tr>
<td width=32 height=32 align=center valign=top>
<img src=icon.panel_2 width=32 height=32>
</td>
</tr>
</table>
</td>
<td width=150 valign=center>
<font color=FF6600>Clan Skills</font>
<br1>
<font color=LEVEL>Info:</font> Price by Skill!
</td>
<td width=47 valign=center align=center>
<button value=OPEN action="bypass -h scripts_services.Donations:clan_skills_page" width=45 height=32 back=L2UI_CT1.ListCTRL_DF_Title_Down fore=L2UI_CT1.ListCTRL_DF_Title />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width=247 height=42 bgcolor=111111>
<tr>
<td width=243 align=center valign=center>
<table width=241 height=39>
<tr>
<td width=40 align=right valign=top>
<table cellspacing=0 cellpadding=0 width=32 height=32 background=icon.skill1323>
<tr>
<td width=32 height=32 align=center valign=top>
<img src=icon.panel_2 width=32 height=32>
</td>
</tr>
</table>
</td>
<td width=150 valign=center>
<font color=FF6600>HERO</font>
<br1>
<font color=669900>Info:</font> Price per day!
</td>
<td width=47 valign=center align=center>
<button value=BUY action="bypass -h scripts_services.FakeHero:list" width=45 height=32 back=L2UI_CT1.ListCTRL_DF_Title_Down fore=L2UI_CT1.ListCTRL_DF_Title />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
暂无答案!
目前还没有任何答案,快来回答吧!