-
Публикаций
80 -
Зарегистрирован
-
Посещение
-
Отзывы
0%
Тип контента
Профили
Форумы
Загрузки
Магазин
Инструкции
Весь контент SkipOver
-
так проверил , хорошая и плохая новость . хорошая - парализ работает и после рестарта спадает плохая - я все равно могу говорить с НПЦ
-
по мимо этого ише 2 вопроса . 1.Как мне поставить этот шоп в Донат шопе 2.как мне зделать 2 различный цен для скилов для икрока и для оружий я сделал так private final static int ITEM_COUNT = 30; // Донки за скила в оружие private final static int CHAR_ITEM_COUNT = 60; // Донки за скила к игроку а далше 0 идей))
-
кароче код работает на ура , но нашол баг , при покупике скила , приходит сообшение о покупке скила и говорит чтобы я делал рестарт , но я могу купить скил и без рестарта . Суть моей проблемы в том что надо делать так чтоб игрок каторый купил скил не мог купить скил без рестарт . вот и сам код Скрытый текстpackage com.l2jfrozen.gameserver.model.actor.instance; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.datatables.SkillTable; import com.l2jfrozen.gameserver.datatables.sql.SkillTreeTable; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.Inventory; import com.l2jfrozen.gameserver.model.L2Skill; import com.l2jfrozen.gameserver.model.L2SkillLearn; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import com.l2jfrozen.util.database.L2DatabaseFactory; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.logging.Level; import javolution.text.TextBuilder; import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.StatusUpdate; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; /** * * @author Token * */ public class L2AugmenterInstance extends L2FolkInstance { // MINI CONFIGS private final static int ITEM_ID = 4037; // what you need to learn skill (Donate Coin) private final static int ITEM_COUNT = 30; // how much Donate Coin you need private final static int MAX_SKILLS = 1; // max skills character can learn(used if you are putting skills directly to char not on weapon) private static int[] AUGMENT_SKILLS = {3134,3132,3138,3125,3246,3250}; // IMPORTANT needed if you are putting skills directly to char not on weapon public L2AugmenterInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { if (player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != this.getObjectId()) { return; } else if (command.equals("active")) { showActiveWindow(player, 0); } else if (command.equals("passive")) { showPassiveWindow(player, 0); } else if (command.equals("activeChar")) { showActiveCharWindow(player, 0); } else if (command.equals("passiveChar")) { showPassiveCharWindow(player, 0); } else if (command.equals("back")) { showChatWindow(player, 0); } else if (command.equals("duelMight")) { addAugment(player, 14863, 3134, 10); } else if (command.equals("might")) { addAugment(player, 14960, 3132, 10); } else if (command.equals("healEmpower")) { addAugment(player, 15125, 3138, 10); } else if (command.equals("battleRoar")) { addAugment(player, 15214, 3125, 10); } else if (command.equals("empower")) { addAugment(player, 15389, 3246, 10); } else if (command.equals("wildMagic")) { addAugment(player, 15446, 3250, 10); } else if (command.equals("duelMightChar")) { addAugmentChar(player, 14863, 3134, 10); } else if (command.equals("mightChar")) { addAugmentChar(player, 14960, 3132, 10); } else if (command.equals("healEmpowerChar")) { addAugmentChar(player, 15125, 3138, 10); } else if (command.equals("battleRoarChar")) { addAugmentChar(player, 15214, 3125, 10); } else if (command.equals("empowerChar")) { addAugmentChar(player, 15389, 3246, 10); } else if (command.equals("wildMagicChar")) { addAugmentChar(player, 15446, 3250, 10); } else return; } @Override public void onAction(L2PcInstance player) { if (!this.canTarget(player)) return; player.setLastFolkNPC(this); if(player.getTarget() != this) { player.setTarget(this); getAI(); MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()); player.sendPacket(my); StatusUpdate su = new StatusUpdate(getObjectId()); su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp()); su.addAttribute(StatusUpdate.MAX_HP, getMaxHp()); player.sendPacket(su); player.sendPacket(new ValidateLocation(this)); } else { if(!isAutoAttackable(player)) showChatWindow(player, 0); else if(!player.isAlikeDead()) player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); player.sendPacket(new ValidateLocation(this)); player.sendPacket(ActionFailed.STATIC_PACKET); } } @Override public void showChatWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter</title><body><center><br>"); tb.append("<font color=LEVEL>Привествую "+ player.getName()+" </font><br>"); tb.append("Поставить скил в оружие<br>"); tb.append("<button value=\"Active\" action=\"bypass -h npc_%objectId%_active\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Passive\" action=\"bypass -h npc_%objectId%_passive\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("Поставить скил на чаре<br>"); tb.append("<button value=\"Active\" action=\"bypass -h npc_%objectId%_activeChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Passive\" action=\"bypass -h npc_%objectId%_passiveChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br><br><br><span color=LEVEL>lol</span>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showActiveWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter</title><body><center><br>"); tb.append("<button value=\"DuelMight\" action=\"bypass -h npc_%objectId%_duelMight\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Heal Emp\" action=\"bypass -h npc_%objectId%_healEmpower\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Might\" action=\"bypass -h npc_%objectId%_might\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showActiveCharWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter Char</title><body><center><br>"); tb.append("<button value=\"DuelMight\" action=\"bypass -h npc_%objectId%_duelMightChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Heal Emp\" action=\"bypass -h npc_%objectId%_healEmpowerChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Might\" action=\"bypass -h npc_%objectId%_mightChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showPassiveWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter</title><body><center><br>"); tb.append("<button value=\"Battle Road\" action=\"bypass -h npc_%objectId%_battleRoar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Empower\" action=\"bypass -h npc_%objectId%_empower\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Wild magic\" action=\"bypass -h npc_%objectId%_wildMagic\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showPassiveCharWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter Char</title><body><center><br>"); tb.append("<button value=\"Battle Road\" action=\"bypass -h npc_%objectId%_battleRoarChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Empower\" action=\"bypass -h npc_%objectId%_empowerChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Wild magic\" action=\"bypass -h npc_%objectId%_wildMagicChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } private static void addAugment(L2PcInstance player, int attribute, int skill, int level) { L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); if (item == null) { player.sendMessage("You have to equip a weapon."); return; } if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < ITEM_COUNT) { player.sendMessage("You dont have enough item."); return; } if (item.isAugmented()) { player.sendMessage("Remove augment first."); return; } Connection con = null; try { player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true); con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)"); statement.setInt(1, item.getObjectId()); statement.setInt(2, attribute*65536+1); statement.setInt(3, skill); statement.setInt(4, level); statement.executeUpdate(); player.sendMessage("Succesfully augmented. You have to relog now."); statement.close(); } catch (Exception e) { _log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e); } finally { L2DatabaseFactory.close(con); } } private static void addAugmentChar(L2PcInstance player, int attribute, int auguSkillId, int level) { final Set<Integer> values = new HashSet<Integer>(); boolean doHave = false; int counter = 0; for(int i : AUGMENT_SKILLS) values.add(i); // loop through all skills of player and check how muck augu skills he have for(L2Skill skills : player.getAllSkills()) { int skillid = skills.getId(); if(skillid == auguSkillId) { doHave = true; } if(values.contains(skillid)) { counter++; } } if(doHave == true) { player.sendMessage("You already have this skill"); return; } if(counter>=MAX_SKILLS) { player.sendMessage("Cant learn anymore skills"); counter = 0; return; } L2Skill skill = null; try { player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true); skill = SkillTable.getInstance().getInfo(auguSkillId, level); } catch(Exception e) { if(Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } if(skill != null) { String name = skill.getName(); player.sendMessage("You have got skill " + name + "."); player.addSkill(skill, true); ///activeChar.sendSkillList(); name = null; } else { player.sendMessage("Oops error."); return; } skill = null; player = null; } }
-
спасибо огромное , выручил)
-
по подробней пожалуйста , я не особо вбрубаюсь если честно что и где пихать
-
по сути код рабочий но в нем одна проблема , нпс не кушает итем , он тока смотрит если есть . Скрытый текст package com.l2jfrozen.gameserver.model.actor.instance; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.datatables.SkillTable; import com.l2jfrozen.gameserver.datatables.sql.SkillTreeTable; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.Inventory; import com.l2jfrozen.gameserver.model.L2Skill; import com.l2jfrozen.gameserver.model.L2SkillLearn; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import com.l2jfrozen.util.database.L2DatabaseFactory; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.logging.Level; import javolution.text.TextBuilder; import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.StatusUpdate; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; /** * * @author Token * */ public class L2AugmenterInstance extends L2FolkInstance { // MINI CONFIGS private final static int ITEM_ID = 4037; // what you need to learn skill (Donate Coin) private final static int ITEM_COUNT = 30; // how much Donate Coin you need private final static int MAX_SKILLS = 1; // max skills character can learn(used if you are putting skills directly to char not on weapon) private static int[] AUGMENT_SKILLS = {3134,3132,3138,3125,3246,3250}; // IMPORTANT needed if you are putting skills directly to char not on weapon public L2AugmenterInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { if (player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != this.getObjectId()) { return; } else if (command.equals("active")) { showActiveWindow(player, 0); } else if (command.equals("passive")) { showPassiveWindow(player, 0); } else if (command.equals("activeChar")) { showActiveCharWindow(player, 0); } else if (command.equals("passiveChar")) { showPassiveCharWindow(player, 0); } else if (command.equals("back")) { showChatWindow(player, 0); } else if (command.equals("duelMight")) { addAugment(player, 14863, 3134, 10); } else if (command.equals("might")) { addAugment(player, 14960, 3132, 10); } else if (command.equals("healEmpower")) { addAugment(player, 15125, 3138, 10); } else if (command.equals("battleRoar")) { addAugment(player, 15214, 3125, 10); } else if (command.equals("empower")) { addAugment(player, 15389, 3246, 10); } else if (command.equals("wildMagic")) { addAugment(player, 15446, 3250, 10); } else if (command.equals("duelMightChar")) { addAugmentChar(player, 14863, 3134, 10); } else if (command.equals("mightChar")) { addAugmentChar(player, 14960, 3132, 10); } else if (command.equals("healEmpowerChar")) { addAugmentChar(player, 15125, 3138, 10); } else if (command.equals("battleRoarChar")) { addAugmentChar(player, 15214, 3125, 10); } else if (command.equals("empowerChar")) { addAugmentChar(player, 15389, 3246, 10); } else if (command.equals("wildMagicChar")) { addAugmentChar(player, 15446, 3250, 10); } else return; } @Override public void onAction(L2PcInstance player) { if (!this.canTarget(player)) return; player.setLastFolkNPC(this); if(player.getTarget() != this) { player.setTarget(this); getAI(); MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()); player.sendPacket(my); StatusUpdate su = new StatusUpdate(getObjectId()); su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp()); su.addAttribute(StatusUpdate.MAX_HP, getMaxHp()); player.sendPacket(su); player.sendPacket(new ValidateLocation(this)); } else { if(!isAutoAttackable(player)) showChatWindow(player, 0); else if(!player.isAlikeDead()) player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); player.sendPacket(new ValidateLocation(this)); player.sendPacket(ActionFailed.STATIC_PACKET); } } @Override public void showChatWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter</title><body><center><br>"); tb.append("<font color=LEVEL>Привествую "+ player.getName()+" </font><br>"); tb.append("Поставить скил в оружие<br>"); tb.append("<button value=\"Active\" action=\"bypass -h npc_%objectId%_active\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Passive\" action=\"bypass -h npc_%objectId%_passive\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("Поставить скил на чаре<br>"); tb.append("<button value=\"Active\" action=\"bypass -h npc_%objectId%_activeChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Passive\" action=\"bypass -h npc_%objectId%_passiveChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br><br><br><span color=LEVEL>lol</span>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showActiveWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter</title><body><center><br>"); tb.append("<button value=\"DuelMight\" action=\"bypass -h npc_%objectId%_focus\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Heal Emp\" action=\"bypass -h npc_%objectId%_healEmpower\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Might\" action=\"bypass -h npc_%objectId%_might\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showActiveCharWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter Char</title><body><center><br>"); tb.append("<button value=\"DuelMight\" action=\"bypass -h npc_%objectId%_focusChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Heal Emp\" action=\"bypass -h npc_%objectId%_healEmpowerChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Might\" action=\"bypass -h npc_%objectId%_mightChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showPassiveWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter</title><body><center><br>"); tb.append("<button value=\"Battle Road\" action=\"bypass -h npc_%objectId%_magicBarrier\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Empower\" action=\"bypass -h npc_%objectId%_empower\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Wild magic\" action=\"bypass -h npc_%objectId%_wildMagic\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showPassiveCharWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><title>Augmenter Char</title><body><center><br>"); tb.append("<button value=\"Battle Road\" action=\"bypass -h npc_%objectId%_magicBarrierChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Empower\" action=\"bypass -h npc_%objectId%_empowerChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<button value=\"Wild magic\" action=\"bypass -h npc_%objectId%_wildMagicChar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); tb.append("<br/><button value=\"Back\" action=\"bypass -h npc_%objectId%_back\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } private static void addAugment(L2PcInstance player, int attribute, int skill, int level) { L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); if (item == null) { player.sendMessage("You have to equip a weapon."); return; } if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < ITEM_COUNT) { player.sendMessage("You dont have enough item."); return; } if (item.isAugmented()) { player.sendMessage("Remove augment first."); return; } Connection con = null; try { player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true); con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)"); statement.setInt(1, item.getObjectId()); statement.setInt(2, attribute*65536+1); statement.setInt(3, skill); statement.setInt(4, level); statement.executeUpdate(); player.sendMessage("Succesfully augmented. You have to relog now."); statement.close(); } catch (Exception e) { _log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e); } finally { L2DatabaseFactory.close(con); } } private static void addAugmentChar(L2PcInstance player, int attribute, int auguSkillId, int level) { final Set<Integer> values = new HashSet<Integer>(); boolean doHave = false; int counter = 0; for(int i : AUGMENT_SKILLS) values.add(i); // loop through all skills of player and check how muck augu skills he have for(L2Skill skills : player.getAllSkills()) { int skillid = skills.getId(); if(skillid == auguSkillId) { doHave = true; } if(values.contains(skillid)) { counter++; } } if(doHave == true) { player.sendMessage("You already have this skill"); return; } if(counter>=MAX_SKILLS) { player.sendMessage("Cant learn anymore skills"); counter = 0; return; } L2Skill skill = null; try { skill = SkillTable.getInstance().getInfo(auguSkillId, level); } catch(Exception e) { if(Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } if(skill != null) { String name = skill.getName(); player.sendMessage("You have got skill " + name + "."); player.addSkill(skill, true); ///activeChar.sendSkillList(); name = null; } else { player.sendMessage("Oops error."); return; } skill = null; player = null; } }
-
Держи Скрытый текст/** To change this template, choose Tools | Templates * and open the template in the editor. */ package com.l2jfrozen.gameserver.handler.voicedcommandhandlers; /** * * @author Shem */ public class menu { } import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler; import com.l2jfrozen.gameserver.managers.AwayManager; import com.l2jfrozen.gameserver.managers.SiegeManager; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.siege.Siege; public class menu implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "menu", "eon_menu_" }; public static boolean _vsc = Config.VIEW_SKILL_CHANCE; private boolean _ipblock = false; public static boolean _showanim = false; private long time; String str = ""; protected StatsSet _StateSet; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("menu")) { showHtm(activeChar); } else if (command.startsWith("anstar_menu_")) { String addcmd = command.substring(9).trim(); if (addcmd.startsWith("exp")) { int flag = Integer.parseInt(addcmd.substring(3).trim()); if (flag == 0) { activeChar.setExpOn(false); activeChar.sendMessage("- Получение опыта отключено. Помни! Для отмытия кармы нужен опыт!"); } else { activeChar.setExpOn(true); activeChar.sendMessage("- Получение опыта возобновлено"); } showHtm(activeChar); return true; } if (addcmd.startsWith("loot")) { int flag = Integer.parseInt(addcmd.substring(4).trim()); if (flag == 0) { activeChar.setAutoLoot(false); activeChar.sendMessage("- Автолут отключен!"); } else { activeChar.setAutoLoot(true); activeChar.sendMessage("- Автолут включен!"); } showHtm(activeChar); return true; } if (addcmd.startsWith("offline")) { if (((Config.OFFLINE_TRADE_ENABLE) && ((activeChar.getPrivateStoreType() == 1) || (activeChar.getPrivateStoreType() == 3) || (activeChar.getPrivateStoreType() == )) || ((Config.OFFLINE_CRAFT_ENABLE) && (activeChar.getPrivateStoreType() == 5))) { activeChar.store(); activeChar.closeNetConnection(); } else { activeChar.sendMessage("Вы не можете использовать оффлайн торговлю/крафт в данный момент"); showHtm(activeChar); } return true; } if (addcmd.startsWith("repair")) { String nick = addcmd.substring(6); if ((nick != null) && (nick.length() > 0)) { repair(activeChar, nick); } else { activeChar.sendMessage("Введите ник"); } showHtm(activeChar); return true; } if (addcmd.startsWith("trade")) { int flag = Integer.parseInt(addcmd.substring(5).trim()); if (flag == 0) { activeChar.setTradeRefusal(false); activeChar.sendMessage("- Возможность использовать трейд включена"); } else { activeChar.setTradeRefusal(true); activeChar.sendMessage("- Возможность использовать трейд отключена"); } showHtm(activeChar); return true; } if (addcmd.startsWith("pm")) { int flag = Integer.parseInt(addcmd.substring(2).trim()); if (flag == 0) { activeChar.setMessageRefusal(false); activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_ACCEPTANCE_MODE)); } else { activeChar.setMessageRefusal(true); activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_REFUSAL_MODE)); } showHtm(activeChar); return true; } if (addcmd.startsWith("skillchance")) { int flag = Integer.parseInt(addcmd.substring(11).trim()); if (flag == 0) { _vsc = true; activeChar.sendMessage("- Включено отображение шанса прохождения скиллов"); } else { _vsc = false; activeChar.sendMessage("- Отображение шанса прохождения скиллов отключено"); } showHtm(activeChar); return true; } if (addcmd.startsWith("showanim")) { int flag = Integer.parseInt(addcmd.substring(.trim()); if (flag == 0) { _showanim = true; } else { _showanim = false; } showHtm(activeChar); return true; } if (addcmd.startsWith("prem")) { int flag = Integer.parseInt(addcmd.substring(4).trim()); if (flag == 0) { showPremHtm(activeChar); } else if (flag == 1) { if ((activeChar.getInventory().getItemByItemId(L2DonateInstance.ITEM_ID) == null) || (activeChar.getInventory().getItemByItemId(L2DonateInstance.ITEM_ID).getCount() < Config.COL_PREM1)) { activeChar.sendMessage("Не хватает монет"); showPremHtm(activeChar); return false; } activeChar.destroyItemByItemId("Consume", L2DonateInstance.ITEM_ID, Config.COL_PREM1, activeChar, false); MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2023, 1, 1, 0); activeChar.sendPacket(MSU); activeChar.broadcastPacket(MSU); L2DonateInstance.addPremiumServices(1, activeChar.getAccountName()); showPremHtm(activeChar); activeChar.sendMessage("Вы получили премиум аккаунт на 1 месяц. Новое получение не добавляет время, а обновляет!"); activeChar.store(); } else if (flag == 2) { if ((activeChar.getInventory().getItemByItemId(L2DonateInstance.ITEM_ID) == null) || (activeChar.getInventory().getItemByItemId(L2DonateInstance.ITEM_ID).getCount() < Config.COL_PREM2)) { activeChar.sendMessage("Не хватает монет"); showPremHtm(activeChar); return false; } activeChar.destroyItemByItemId("Consume", L2DonateInstance.ITEM_ID, Config.COL_PREM2, activeChar, false); MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2023, 1, 1, 0); activeChar.sendPacket(MSU); activeChar.broadcastPacket(MSU); L2DonateInstance.addPremiumServices(2, activeChar.getAccountName()); showPremHtm(activeChar); activeChar.sendMessage("Вы получили премиум аккаунт на 2 месяца. Новое получение не добавляет время, а обновляет!"); activeChar.store(); } else if (flag == 3) { if ((activeChar.getInventory().getItemByItemId(L2DonateInstance.ITEM_ID) == null) || (activeChar.getInventory().getItemByItemId(L2DonateInstance.ITEM_ID).getCount() < Config.COL_PREM3)) { activeChar.sendMessage("Не хватает монет"); showPremHtm(activeChar); return false; } activeChar.destroyItemByItemId("Consume", L2DonateInstance.ITEM_ID, Config.COL_PREM3, activeChar, false); MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2023, 1, 1, 0); activeChar.sendPacket(MSU); activeChar.broadcastPacket(MSU); L2DonateInstance.addPremiumServices(3, activeChar.getAccountName()); showPremHtm(activeChar); activeChar.sendMessage("Вы получили премиум аккаунт на 3 месяца. Новое получение не добавляет время, а обновляет!"); activeChar.store(); } else if (flag == 4) { showHtm(activeChar); } return true; } if (addcmd.startsWith("ip")) { int flag = Integer.parseInt(addcmd.substring(2).trim()); if (flag == 0) { ipblockadd(activeChar); this._ipblock = true; } else { ipblockdel(activeChar); this._ipblock = false; } showHtm(activeChar); return true; } if (addcmd.startsWith("evt")) { int flag = Integer.parseInt(addcmd.substring(3).trim()); if (flag == 0) { showEvtHtm(activeChar); } else if (flag == 1) { if (TvTEvent.isPlayerParticipant(activeChar.getObjectId())) { activeChar.sendMessage("Вы уже зарегистрированы на участие в ТвТ"); showEvtHtm(activeChar); return false; } if (TvTEvent.isParticipating()) { TvTEvent.addParticipant(activeChar); activeChar.sendMessage("Вы зарегистрированы на участие в ТвТ"); showEvtHtm(activeChar); } else { activeChar.sendMessage("ТвТ не активен или уже идет турнир"); showHtm(activeChar); return false; } } else if (flag == 2) { if (TvTEvent.isParticipating()) { if (!TvTEvent.isPlayerParticipant(activeChar.getObjectId())) { activeChar.sendMessage("Вы не были зарегистрированы на участие в ТвТ"); showEvtHtm(activeChar); return false; } TvTEvent.removeParticipant(activeChar.getObjectId()); activeChar.sendMessage("Вы больше не зарегистрированы на участие в ТвТ"); showEvtHtm(activeChar); } else { activeChar.sendMessage("ТвТ не активен или уже идет турнир"); showHtm(activeChar); return false; } } else if (flag == 3) { if (CTF._joining) { CTF.addPlayer(activeChar, "eventShuffle"); activeChar.sendMessage("Вы зарегистрированы на участие в CTF"); showEvtHtm(activeChar); } else { activeChar.sendMessage("CTF не активен или уже идет турнир"); showHtm(activeChar); return false; } } else if (flag == 4) { if (CTF._joining) { CTF.removePlayer(activeChar); activeChar.sendMessage("Вы больше не зарегистрированы на участие в CTF"); showEvtHtm(activeChar); } else { activeChar.sendMessage("CTF не активен или уже идет турнир"); showHtm(activeChar); return false; } } if (flag == 9) { showHtm(activeChar); } return true; } return false; } return true; } private void showHtm(L2PcInstance activeChar) { NpcHtmlMessage htm = new NpcHtmlMessage(activeChar.getLastQuestNpcObject()); String text = HtmCache.getInstance().getHtm("data/html/menu/menu.htm"); htm.setHtml(text); activeChar.sendPacket(htm); L2World.getInstance(); int realonl = L2World.getAllPlayersCount(); int nakrutka = realonl * (Config.NAKRUTKA_ONLINE / 100); String online = this.str + (realonl + nakrutka); htm.replace("%online%", online); if (activeChar.getExpOn()) { htm.replace("%gainexp%", "ON"); } else { htm.replace("%gainexp%", "OFF"); } if (activeChar.isAutoLoot()) { htm.replace("%autoloot%", "ON"); } else { htm.replace("%autoloot%", "OFF"); } if (activeChar.getTradeRefusal()) { htm.replace("%trade%", "OFF"); } else { htm.replace("%trade%", "ON"); } if (activeChar.getMessageRefusal()) { htm.replace("%pm%", "OFF"); } else { htm.replace("%pm%", "ON"); } if (_vsc) { htm.replace("%skillchance%", "ON"); } else { htm.replace("%skillchance%", "OFF"); } if (_showanim) { htm.replace("%showanim%", "ON"); } else { htm.replace("%showanim%", "OFF"); } if (this._ipblock) { htm.replace("%ip%", "ON"); } else { htm.replace("%ip%", "OFF"); } } private void repair(L2PcInstance activeChar, String nick) { Iterator i$ = activeChar.getAccountChars().entrySet().iterator(); if (i$.hasNext()) { Map.Entry entry = (Map.Entry)i$.next(); int obj_id = ((Integer)entry.getKey()).intValue(); int karma = 0; if (!activeChar.getAccountChars().containsValue(nick.substring(1))) { activeChar.sendMessage("Вы не можете восстановить персонажа с другого аккаунта или сами себя!"); return; } Connection con = null; PreparedStatement statement = null; ResultSet rset = null; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT karma FROM characters where char_name='" + nick.substring(1) +"';"); rset = statement.executeQuery(); while (rset.next()) { karma = rset.getInt("karma"); } rset.close(); statement.close(); if (karma > 0) { statement = con.prepareStatement("UPDATE `characters` SET `x`='17144', `y`='170156', `z`='-3502', `heading`='0' WHERE `obj_Id`='" + obj_id + "' LIMIT 1"); statement.executeUpdate(); statement.close(); } else { statement = con.prepareStatement("UPDATE `characters` SET `x`='82698', `y`='148638', `z`='-3470', `heading`='0' WHERE `obj_Id`='" + obj_id + "' LIMIT 1"); statement.executeUpdate(); statement.close(); } activeChar.sendMessage("Восстановление успешно!"); } catch (Exception e) { activeChar.sendMessage("Ошибка."); } finally { try { con.close(); } catch (SQLException e) { e.printStackTrace(); } } } } public void ipblockdel(L2PcInstance l2pcinstance) { try { Connection connection = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement preparedstatement = connection.prepareStatement("SELECT * FROM accounts WHERE login=?"); preparedstatement.setString(1, l2pcinstance.getAccountName()); ResultSet resultset = preparedstatement.executeQuery(); resultset.next(); PreparedStatement preparedstatement1 = connection.prepareStatement("UPDATE accounts SET IPBlock = 0 WHERE login=?"); preparedstatement1.setString(1, l2pcinstance.getAccountName()); preparedstatement1.execute(); l2pcinstance.sendMessage("Привязка аккаунта к IP снята"); } catch (SQLException sqlexception) { } } public void ipblockadd(L2PcInstance l2pcinstance) { try { Connection connection = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement preparedstatement = connection.prepareStatement("SELECT * FROM accounts WHERE login=?"); preparedstatement.setString(1, l2pcinstance.getAccountName()); ResultSet resultset = preparedstatement.executeQuery(); resultset.next(); PreparedStatement preparedstatement2 = connection.prepareStatement("UPDATE accounts SET IPBlock = 1 WHERE login=?"); preparedstatement2.setString(1, l2pcinstance.getAccountName()); preparedstatement2.execute(); l2pcinstance.sendMessage("Ваш аккаунт привязан к вашему текущему IP: " + resultset.getString("lastIP")); } catch (SQLException sqlexception) { } } private void showPremHtm(L2PcInstance activeChar) { NpcHtmlMessage htm = new NpcHtmlMessage(activeChar.getLastQuestNpcObject()); String text = HtmCache.getInstance().getHtm("data/html/menu/menu-pa.htm"); htm.setHtml(text); activeChar.sendPacket(htm); htm.replace("%price1%", this.str + Config.COL_PREM1); htm.replace("%price2%", this.str + Config.COL_PREM2); htm.replace("%price3%", this.str + Config.COL_PREM3); if (activeChar.getPremiumService() == 0) { htm.replace("%exptime%", "не активирован"); } else if (activeChar.getPremiumService() == 1) { getExpTime(activeChar.getName()); String date = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date(this.time)); htm.replace("%exptime%", date); } } private void showEvtHtm(L2PcInstance activeChar) { NpcHtmlMessage htm = new NpcHtmlMessage(activeChar.getLastQuestNpcObject()); String text = HtmCache.getInstance().getHtm("data/html/menu/menu-evt.htm"); htm.setHtml(text); activeChar.sendPacket(htm); if ((TvTEvent.isInactive()) || (TvTEvent.isInactivating())) { htm.replace("%tvt%", "<font color=ff0000>Не активен</font>"); } else if (TvTEvent.isParticipating()) { htm.replace("%tvt%", "<font color=00ff00>Регистрация</font>"); } else if ((TvTEvent.isStarted()) || (TvTEvent.isStarting()) || (TvTEvent.isRewarding())) { htm.replace("%tvt%", "<font color=0000ff>Активен</font>"); } if (CTF._joining) { htm.replace("%ctf%", "<font color=00ff00>Регистрация</font>"); } else if ((CTF._started) || (CTF._teleport)) { htm.replace("%ctf%", "<font color=0000ff>Активен</font>"); } else { htm.replace("%ctf%", "<font color=ff0000>Не активен</font>"); } } private void getExpTime(String accName) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT enddate FROM account_premium WHERE account_name=?"); statement.setString(1, accName); ResultSet rset = statement.executeQuery(); while (rset.next()) { this.time = rset.getLong("enddate"); } rset.close(); statement.close(); } catch (Exception e) { e.printStackTrace(); } finally { try { con.close(); } catch (Exception e) { } } } public St'] getVoicedCommandList() { return VOICED_COMMANDS; } }
-
потом эту же текстуру которую вы получили поставьте в encrypt.exe вы получите текстуру.utx-enc удалите -enc и у вас рабочая текстура! Спасибо если помог .
-
это сборка La2World.ws , она лежала в шаре , она и сейчас у меня есть , лучше берите фораж она улучшенная !
-
почти одинаковые , но в той которой поставил Тоширо то там исправлено много чего (шмоты , нпс и тд)
-
все спасибо , поставил Навикат 8 , и всё пашет
-
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' UPDATE `npc` SET `title`='Server'' at line 1 [Err] UPDATE `npc` SET `title`='Server'; [Msg] Finished - Unsuccessfully -------------------------------------------------- все равно не пашет
-
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE `npc` SET `title`='Server'' at line 1 [Err] UPDATE `npc` SET `title`='Server' [Msg] Finished - Unsuccessfully --------------------------------------------------
-
Кароче у меня такая проблема , хочу чтобы у всех Npc был один и тот же титул , я мучелся очень долго и не смог . Кто нибудь помогите!
-
Зависит для каких рейтов , для x50 советую L2jFrozen , для больших рейтов советую Projec-World или же l2jx
-
Cамоя хорошая зборка для тебя , ето та катороя зделаеш ты))