Собственно для alt + b:
package services;
import sw.awaken.commons.util.Rnd;
import sw.awaken.gameserver.Config;
import sw.awaken.gameserver.model.Player;
import sw.awaken.gameserver.model.Skill;
import sw.awaken.gameserver.model.instances.NpcInstance;
import sw.awaken.gameserver.network.l2.s2c.MagicSkillUse;
import sw.awaken.gameserver.network.l2.s2c.SkillList;
import sw.awaken.gameserver.scripts.Functions;
import sw.awaken.gameserver.templates.npc.NpcTemplate;
import sw.awaken.gameserver.utils.ItemFunctions;
import sw.awaken.gameserver.tables.SkillTable;
public class SkillSell extends Functions
{
public void get()
{
Player player = getSelf();
if(player == null)
return;
if(player.getLevel() < 85)
{
player.sendMessage("Вы можете получить новые умения только после 84 уровня");
return;
}
if(ItemFunctions.getItemCount(player, 4037) < 5)
{
player.sendMessage("Недостаточно КоЛ");
return;
}
SellSkill();
}
public void SellSkill()
{
Player player = getSelf();
if(player == null)
return;
int CurrentSkill = Config.SKILLS[Rnd.get(Config.SKILLS.length)];
int SkillLevel = SkillTable.getInstance().getMaxLevel(CurrentSkill);
ItemFunctions.removeItem(player, 4037, 5, true);
Skill sk = SkillTable.getInstance().getInfo(CurrentSkill, SkillLevel);
player.addSkill(sk, true);
player.updateStats();
player.sendPacket(new SkillList(player));
player.broadcastPacket(new MagicSkillUse(player, player, 2790, 1, 1, 0));
}
}
HTML страничка:
<table width=600>
<tr>
<td valign="top" align="center"><button value="Купить Скилл" action="bypass _bbsscripts:services.SkillSell:get;_bbspage:SkillShop" width=200 height=26 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"/></td>
</tr>
</table>
В Config.java добавить:
public static final String EVT_SKILLS = "config/NEW.ini";
public static int[] SKILLS;
public static void loadSkillConfig()
{
ExProperties newSkill = load(EVT_SKILLS);
SKILLS = newSkill.getProperty("SkillsForEvent", new int[] {
2360,
16026 });
}
В метод load() добавить:
loadSkillConfig();
Создать конфиг NEW.ini, в него вписать
SkillsForEvent = id1,id2 и т.д