Перейти к содержанию

BBMAXI

Постоялец
  • Публикаций

    131
  • Зарегистрирован

  • Посещение

  • Отзывы

    0%

Весь контент BBMAXI

  1. BBMAXI

    [manual] Rebirth Event

    Эвент "Система перерождения" Кому непонятно, читаем код Эвента. Index: /trunk/gameserver/java/config/additions.ini =================================================================== --- /trunk/gameserver/java/config/additions.ini (revision 282) +++ /trunk/gameserver/java/config/additions.ini (revision 311) @@ -1,13 +1,37 @@ +#----------------------------------- +# Эвент перерождение +#----------------------------------- +REBIRTH_ALLOW_REBIRTH = True +REBIRTH_MIN_LEVEL = 80 +REBIRTH_ITEM1_NEEDED = 57 +REBIRTH_ITEM1_AMOUNT = 1000 +REBIRTH_ITEM2_NEEDED = 57 +REBIRTH_ITEM2_AMOUNT = 2000 +REBIRTH_ITEM3_NEEDED = 57 +REBIRTH_ITEM3_AMOUNT = 3000 +REBIRTH_MAGE_SKILL1_ID = 1062 +REBIRTH_MAGE_SKILL1_LEVEL = 2 +REBIRTH_MAGE_SKILL2_ID = 1085 +REBIRTH_MAGE_SKILL2_LEVEL = 3 +REBIRTH_MAGE_SKILL3_ID = 1059 +REBIRTH_MAGE_SKILL3_LEVEL = 3 +REBIRTH_FIGHTER_SKILL1_ID = 1045 +REBIRTH_FIGHTER_SKILL1_LEVEL = 6 +REBIRTH_FIGHTER_SKILL2_ID = 1048 +REBIRTH_FIGHTER_SKILL2_LEVEL = 6 +REBIRTH_FIGHTER_SKILL3_ID = 1086 +REBIRTH_FIGHTER_SKILL3_LEVEL = 2 + Index: /trunk/gameserver/java/net/sf/engine/rebirth/BypassHandler.java =================================================================== --- /trunk/gameserver/java/net/sf/engine/rebirth/BypassHandler.java (revision 311) +++ /trunk/gameserver/java/net/sf/engine/rebirth/BypassHandler.java (revision 311) @@ -0,0 +1,55 @@ +/* + * 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.engine.rebirth; + +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * This 'Bypass Handler' is a handy tool indeed!<br> + * Basically, you can send any custom bypass commmands to it from ANY + * npc and it will call the appropriate function.<br> + * + * <strong>Example:</strong><br> + * <button value=" Request Rebirth " action="bypass -h custom_rebirth_confirmrequest" width=110 height=36 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> + * + * @author JStar + */ +public class BypassHandler +{ + private static BypassHandler _instance = null; + + private BypassHandler() + { + //Do Nothing ^_- + } + + /** Receives the non-static instance of the RebirthManager.*/ + public static BypassHandler getInstance() + { + if(_instance == null) + { + _instance = new BypassHandler(); + } + return _instance; + } + + /** Handles player's Bypass request to the Custom Content. */ + public void handleBypass(L2PcInstance player, String command) + { + if(command.startsWith("custom_rebirth")){//Rebirth Manager and Engine Caller + RebirthManager.getInstance().handleCommand(player, command); + } + } +} Index: /trunk/gameserver/java/net/sf/engine/rebirth/CustomAdminCommandHandler.java =================================================================== --- /trunk/gameserver/java/net/sf/engine/rebirth/CustomAdminCommandHandler.java (revision 311) +++ /trunk/gameserver/java/net/sf/engine/rebirth/CustomAdminCommandHandler.java (revision 311) @@ -0,0 +1,46 @@ +/* + * 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.engine.rebirth; + +import net.sf.l2j.gameserver.handler.IAdminCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + *A 'Custom' Admin Handler for all your custom content. + * + * @author JStar + */ +public class CustomAdminCommandHandler implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_custom_reconfig" + }; + + public boolean useAdminCommand(String command, L2PcInstance player) + { + if(command.startsWith("admin_custom_reconfig")) + { + player.sendMessage("Успешная перезагрузка 'Custom Content' файла конфига."); + } + + return true; + } + + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} Index: /trunk/gameserver/java/net/sf/engine/rebirth/WorldHandler.java =================================================================== --- /trunk/gameserver/java/net/sf/engine/rebirth/WorldHandler.java (revision 311) +++ /trunk/gameserver/java/net/sf/engine/rebirth/WorldHandler.java (revision 311) @@ -0,0 +1,58 @@ +/* + * 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.engine.rebirth; + +import net.sf.engine.rebirth.RebirthManager; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + *This will simply manage any custom 'Enter World callers' needed.<br> + *Rather then having to add them to the core's. (yuck!) + * + * @author JStar + */ +public class WorldHandler +{ + + private static WorldHandler _instance = null; + + private WorldHandler() + { + //Do Nothing ^_- + } + + /** Receives the non-static instance of the RebirthManager.*/ + public static WorldHandler getInstance() + { + if(_instance == null) + { + _instance = new WorldHandler(); + } + return _instance; + } + + /** Requests entry into the world - manages appropriately. */ + public void enterWorld(L2PcInstance player) + { + RebirthManager.getInstance().grantRebirthSkills(player);//Rebirth Caller - if player has any skills, they will be granted them. + } + + /** Requests removal from the world - manages appropriately. */ + public void exitWorld(L2PcInstance player) + { + //TODO: Remove the rebirth engine's bonus skills from player? + } + +} Index: /trunk/gameserver/java/net/sf/engine/rebirth/RebirthManager.java =================================================================== --- /trunk/gameserver/java/net/sf/engine/rebirth/RebirthManager.java (revision 311) +++ /trunk/gameserver/java/net/sf/engine/rebirth/RebirthManager.java (revision 311) @@ -0,0 +1,415 @@ +/* + * 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.engine.rebirth; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.HashMap; + +import javolution.text.TextBuilder; +import net.sf.l2j.Config; +import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.datatables.ItemTable; +import net.sf.l2j.gameserver.datatables.SkillTable; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.L2Skill; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.base.Experience; +import net.sf.l2j.gameserver.serverpackets.CreatureSay; +import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage; +import net.sf.l2j.gameserver.serverpackets.SocialAction; + + + +/** + * <strong>This 'Custom Engine' was developed for L2J Forum Member 'sauron3256' on November 1st, 2008.</strong><br><br> + * <strong>Quick Summary:</strong><br> + * This engine will grant the player special bonus skills at the cost of reseting him to level 1.<br> + * The -USER- can set up to 3 Rebirths, the skills received and their respective levels, and the item and price of each rebirth.<br> + * PLAYER's information is stored in an SQL Db under the table name: REBIRTH_MANAGER.<br> + * + * @author <strong>JStar</strong> + */ +public class RebirthManager +{ + /** The current instance - static repeller */ + private static RebirthManager _instance = null; + + /** Basically, this will act as a cache so it doesnt have to read DB information on relog. */ + private HashMap<Integer,Integer> _playersRebirthInfo = new HashMap<Integer,Integer>(); + + /** Creates a new NON-STATIC instance */ + private RebirthManager() + { + //Do Nothing ^_- + } + + /** Receives the non-static instance of the RebirthManager.*/ + public static RebirthManager getInstance() + { + if(_instance == null) + { + _instance = new RebirthManager(); + } + return _instance; + } + + /** This is what it called from the Bypass Handler. (I think that's all thats needed here).*/ + public void handleCommand(L2PcInstance player,String command) + { + if(command.startsWith("custom_rebirth_requestrebirth")) + { + displayRebirthWindow(player); + } + else if(command.startsWith("custom_rebirth_confirmrequest")) + { + requestRebirth(player); + } + } + + /** Display's an HTML window with the Rebirth Options */ + public void displayRebirthWindow(L2PcInstance player) + { + try + { + int currBirth = getRebirthLevel(player); + if(currBirth >= 3) + { + player.sendMessage("Вы уже сделали максимальное количество перерождений!"); + return; + } + + boolean isMage = player.getBaseTemplate().classId.isMage(); + L2Skill skill = getRebirthSkill((currBirth + 1), isMage); + + String icon = ""+skill.getId(); + if(icon.length() < 4) + { + icon = "0"+icon; + } + + String playerName = "<font color=FF9900>"+player.getName()+"</font>";//return the player's name. + + TextBuilder text = new TextBuilder(); + text.append("<html>"); + text.append("<body>"); + text.append("<center>"); + text.append("<title>- Меню перерождения -</title>"); + text.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32>"); + text.append("<br>"); + text.append("<table border=1 cellspacing=1 cellpadding=1 height=37><tr><td valign=top>"); + text.append("<img src=\"icon.skill3123\" width=32 height=32>");//Cool rebirth icon 'logo' :P + text.append("</td></tr></table>"); + text.append("<br>"); + text.append("<table width=240 bgcolor=555555 border=1 cellpadding=1 cellspacing=0><tr>"); + text.append("<td height=40 width=35><img src=\"icon.skill"+icon+"\" width=32 height=32 align=left></td>"); + text.append("<td height=40 width=140><center><font color=\"FFFFCC\">Bonus Skill Recieved</font><br1><font color=\"FF9900\">" + skill.getName() + "</font></td>"); + text.append("<td height=40 width=100><center><font color=\"66CC66\">Skill Lvl</font><br1><font color=\"FFFF99\">" + skill.getLevel() + "</font></center></td>"); + text.append("</tr></table>"); + text.append("<br>"); + text.append("<img src=\"L2UI.SquareWhite\" width=\"280\" height=\"1\"><br1>"); + text.append("<table bgcolor=555555 width=270 height=80><tr><td valign=center align=center>- [ <font color=\"66CC66\">Rebirth Information</font> ] -<br1>"); + text.append("<table bgcolor=555555 width=250 height=150><tr><td valign=top align=center><center>"); + text.append("So, " + playerName + ", you wish to be <font color=Level>Reborn</font>? "); + text.append("Being <font color=Level>Reborn</font> has it's advantages, and it's disadvantages you know. "); + text.append("When you are <font color=Level>Reborn</font> you are granted a new bonus skill (listed above), "); + text.append("but your character is reset to level 1 and returned to his starting class. So "); + text.append("<font color=LEVEL>choose wisely</font> " + playerName + ".<br1>"); + text.append("</center></td></tr></table>"); + text.append("</td></tr></table>"); + text.append("<img src=\"L2UI.SquareWhite\" width=\"280\" height=\"1\"><br>"); + text.append("<center><button value=\" Request Rebirth \" action=\"bypass -h custom_rebirth_confirmrequest\" width=250 height=36 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); + text.append("</center>"); + text.append("</body>"); + text.append("</html>"); + + NpcHtmlMessage html = new NpcHtmlMessage(1); + html.setHtml(text.toString()); + player.sendPacket(html); + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + /** Checks to see if the player is eligible for a Rebirth, if so it grants it and stores information */ + public void requestRebirth(L2PcInstance player) + { + if(!Config.REBIRTH_ALLOW_REBIRTH) + { //See if the Rebirth Engine is currently allowed. + player.sendMessage("The 'Rebirth Engine' is currently offline. Try again later!"); + return; + } + + else if(player.getLevel() < Config.REBIRTH_MIN_LEVEL) + { //Check the player's level. + player.sendMessage("You do not meet the level requirement for a Rebirth!"); + return; + } + + else if(player.isSubClassActive()) + { + player.sendMessage("Please switch to your Main Class before attempting a Rebirth."); + return; + } + + int currBirth = getRebirthLevel(player); + int itemNeeded = 0; + int itemAmount = 0; + + if(currBirth >= 3) + { + player.sendMessage("You are currently at your maximum rebirth count!"); + return; + } + + switch(currBirth) + {//Get the requirements + case 0: itemNeeded = Config.REBIRTH_ITEM1_NEEDED; itemAmount = Config.REBIRTH_ITEM1_AMOUNT; break; + case 1: itemNeeded = Config.REBIRTH_ITEM2_NEEDED; itemAmount = Config.REBIRTH_ITEM2_AMOUNT; break; + case 2: itemNeeded = Config.REBIRTH_ITEM3_NEEDED; itemAmount = Config.REBIRTH_ITEM3_AMOUNT; break; + } + + if(itemNeeded != 0) + {//Their is an item required + if(!playerIsEligible(player, itemNeeded, itemAmount)){//Checks to see if player has required items, and takes them if so. + return; + } + } + + boolean firstBirth = currBirth == 0;//Check and see if its the player's first Rebirth calling. + grantRebirth(player,(currBirth + 1), firstBirth); //Player meets requirements and starts Rebirth Process. + } + + /** Physically rewards player and resets status to nothing. */ + public void grantRebirth(L2PcInstance player, int newBirthCount, boolean firstBirth) + { + try{ + + player.removeExpAndSp(player.getExp() - Experience.LEVEL[1], 0);//Set player to level 1. + player.setClassId(player.getBaseClass());//Resets character to first class. + for (L2Skill skill : player.getAllSkills()){//Remove the player's current skills. + player.removeSkill(skill); + } + player.giveAvailableSkills();//Give players their eligible skills. + player.store(); //Updates the player's information in the Character Database. + + if(firstBirth) storePlayerBirth(player); + else updatePlayerBirth(player,newBirthCount); + + grantRebirthSkills(player);//Give the player his new Skills. + displayCongrats(player);//Displays a congratulation message to the player. + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + /** Special effects when the player levels. */ + public void displayCongrats(L2PcInstance player) + { + player.broadcastPacket(new SocialAction(player.getObjectId(), 3));//Victory Social Action. + player.sendMessage("Congratulations "+player.getName()+"! You have been Reborn!"); + } + + /** Check and verify the player DOES have the item required for a request. Also, remove the item if he has.*/ + public boolean playerIsEligible(L2PcInstance player, int itemId, int itemAmount) + { + String itemName = ItemTable.getInstance().getTemplate(itemId).getName(); + L2ItemInstance itemNeeded = player.getInventory().getItemByItemId(itemId); + + if(itemNeeded == null || itemNeeded.getCount() < itemAmount) + { + player.sendMessage("You need atleast "+itemAmount+" [ "+itemName+" ] to request a Rebirth!"); + return false; + } + + //Player has the required items, so we're going to take them! + + player.getInventory().destroyItemByItemId("Rebirth", itemId, itemAmount, player, null); + + player.sendMessage("Removed "+itemAmount+" "+itemName+" from your inventory!"); + return true; + } + + /** Gives the available Bonus Skills to the player. */ + public void grantRebirthSkills(L2PcInstance player) + { + int rebirthLevel = getRebirthLevel(player); //returns the current Rebirth Level + boolean isMage = player.getBaseTemplate().classId.isMage(); //Returns true if BASE CLASS is a mage. + + //Simply return since no bonus skills are granted. + if(rebirthLevel == 0) return; + + //Load the bonus skills unto the player. + CreatureSay rebirthText = null; + for(int i = 0; i < rebirthLevel; i++) + { + L2Skill bonusSkill = getRebirthSkill((i + 1), isMage); + player.addSkill(bonusSkill, false); + + //If you'd rather make it simple, simply comment this out and replace with a simple player.sendmessage(); + rebirthText = new CreatureSay(0, 18, "Rebirth Manager ", " Granted you [ "+bonusSkill.getName()+" ] level [ "+bonusSkill.getLevel()+" ]!"); + player.sendPacket(rebirthText); + } + } + + /** Return the player's current Rebirth Level */ + public int getRebirthLevel(L2PcInstance player) + { + int playerId = player.getObjectId(); + if(_playersRebirthInfo.get(playerId) == null) + { + loadRebirthInfo(player); + } + return _playersRebirthInfo.get(playerId); + } + + /** Return the L2Skill the player is going to be rewarded. */ + public L2Skill getRebirthSkill(int rebirthLevel,boolean mage) + { + L2Skill skill = null; + if(mage) + { //Player is a Mage. + switch(rebirthLevel) + { + case 1:skill = SkillTable.getInstance().getInfo(Config.REBIRTH_MAGE_SKILL1_ID, Config.REBIRTH_MAGE_SKILL1_LEVEL); break; + case 2:skill = SkillTable.getInstance().getInfo(Config.REBIRTH_MAGE_SKILL2_ID, Config.REBIRTH_MAGE_SKILL2_LEVEL); break; + case 3:skill = SkillTable.getInstance().getInfo(Config.REBIRTH_MAGE_SKILL3_ID, Config.REBIRTH_MAGE_SKILL3_LEVEL); break; + } + } + else + { //Player is a Fighter. + switch(rebirthLevel) + { + case 1:skill = SkillTable.getInstance().getInfo(Config.REBIRTH_FIGHTER_SKILL1_ID, Config.REBIRTH_FIGHTER_SKILL1_LEVEL); break; + case 2:skill = SkillTable.getInstance().getInfo(Config.REBIRTH_FIGHTER_SKILL2_ID, Config.REBIRTH_FIGHTER_SKILL2_LEVEL); break; + case 3:skill = SkillTable.getInstance().getInfo(Config.REBIRTH_FIGHTER_SKILL3_ID, Config.REBIRTH_FIGHTER_SKILL3_LEVEL); break; + } + } + return skill; + } + + /** Database caller to retrieve player's current Rebirth Level */ + public void loadRebirthInfo(L2PcInstance player) + { + int playerId = player.getObjectId(); + int rebirthCount = 0; + + Connection con = null; + try + { + ResultSet rset; + con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement + ("SELECT * FROM `rebirth_manager` WHERE playerId = ?"); + statement.setInt(1, playerId); + rset = statement.executeQuery(); + + while (rset.next()) + { + rebirthCount = rset.getInt("rebirthCount"); + } + + rset.close(); + statement.close(); + + } + catch(Exception e) + { + e.printStackTrace(); + } + finally + { + try + { + con.close(); + } + catch (Exception e) + { + + } + } + _playersRebirthInfo.put(playerId, rebirthCount); + } + + /** Stores the player's information in the DB. */ + public void storePlayerBirth(L2PcInstance player) + { + Connection con = null; + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement + ("INSERT INTO `rebirth_manager` (playerId,rebirthCount) VALUES (?,1)"); + statement.setInt(1, player.getObjectId()); + statement.execute(); + + _playersRebirthInfo.put(player.getObjectId(), 1); + + } + catch(Exception e) + { + e.printStackTrace(); + } + finally + { + try + { + con.close(); + } + catch (Exception e) + { + } + } + } + + /** Updates the player's information in the DB. */ + public void updatePlayerBirth(L2PcInstance player,int newRebirthCount) + { + Connection con = null; + try + { + int playerId = player.getObjectId(); + + con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement + ("UPDATE `rebirth_manager` SET rebirthCount = ? WHERE playerId = ?"); + statement.setInt(1, newRebirthCount); + statement.setInt(2, playerId); + statement.execute(); + + _playersRebirthInfo.put(playerId, newRebirthCount); + + } + catch(Exception e) + { + e.printStackTrace(); + } + finally + { + try + { + con.close(); + } + catch (Exception e) + { + } + } + } +} Index: /trunk/gameserver/java/net/sf/l2j/Config.java =================================================================== --- /trunk/gameserver/java/net/sf/l2j/Config.java (revision 282) +++ /trunk/gameserver/java/net/sf/l2j/Config.java (revision 311) @@ -63,4 +63,25 @@ public static boolean ALLOW_LOGIN_OPTIMIZE; + /** Rebirth Engine */ + public static boolean REBIRTH_ALLOW_REBIRTH; + public static int REBIRTH_MIN_LEVEL; + public static int REBIRTH_ITEM1_NEEDED; + public static int REBIRTH_ITEM1_AMOUNT; + public static int REBIRTH_ITEM2_NEEDED; + public static int REBIRTH_ITEM2_AMOUNT; + public static int REBIRTH_ITEM3_NEEDED; + public static int REBIRTH_ITEM3_AMOUNT; + public static int REBIRTH_MAGE_SKILL1_ID; + public static int REBIRTH_MAGE_SKILL1_LEVEL; + public static int REBIRTH_MAGE_SKILL2_ID; + public static int REBIRTH_MAGE_SKILL2_LEVEL; + public static int REBIRTH_MAGE_SKILL3_ID; + public static int REBIRTH_MAGE_SKILL3_LEVEL; + public static int REBIRTH_FIGHTER_SKILL1_ID; + public static int REBIRTH_FIGHTER_SKILL1_LEVEL; + public static int REBIRTH_FIGHTER_SKILL2_ID; + public static int REBIRTH_FIGHTER_SKILL2_LEVEL; + public static int REBIRTH_FIGHTER_SKILL3_ID; + public static int REBIRTH_FIGHTER_SKILL3_LEVEL; // CTF EVENT OPEN @@ -2276,4 +2297,25 @@ is.close(); + REBIRTH_ALLOW_REBIRTH = Boolean.parseBoolean(additionsSettings.getProperty("REBIRTH_ALLOW_REBIRTH", "False")); + REBIRTH_MIN_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MIN_LEVEL","80")); + REBIRTH_ITEM1_NEEDED = Integer.parseInt(additionsSettings.getProperty("REBIRTH_ITEM1_NEEDED","0")); + REBIRTH_ITEM1_AMOUNT = Integer.parseInt(additionsSettings.getProperty("REBIRTH_ITEM1_AMOUNT","0")); + REBIRTH_ITEM2_NEEDED = Integer.parseInt(additionsSettings.getProperty("REBIRTH_ITEM2_NEEDED","0")); + REBIRTH_ITEM2_AMOUNT = Integer.parseInt(additionsSettings.getProperty("REBIRTH_ITEM2_AMOUNT","0")); + REBIRTH_ITEM3_NEEDED = Integer.parseInt(additionsSettings.getProperty("REBIRTH_ITEM3_NEEDED","0")); + REBIRTH_ITEM3_AMOUNT = Integer.parseInt(additionsSettings.getProperty("REBIRTH_ITEM3_AMOUNT","0")); + REBIRTH_MAGE_SKILL1_ID = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MAGE_SKILL1_ID","0")); + REBIRTH_MAGE_SKILL1_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MAGE_SKILL1_LEVEL","0")); + REBIRTH_MAGE_SKILL2_ID = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MAGE_SKILL2_ID","0")); + REBIRTH_MAGE_SKILL2_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MAGE_SKILL2_LEVEL","0")); + REBIRTH_MAGE_SKILL3_ID = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MAGE_SKILL3_ID","0")); + REBIRTH_MAGE_SKILL3_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_MAGE_SKILL3_LEVEL","0")); + REBIRTH_FIGHTER_SKILL1_ID = Integer.parseInt(additionsSettings.getProperty("REBIRTH_FIGHTER_SKILL1_ID","0")); + REBIRTH_FIGHTER_SKILL1_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_FIGHTER_SKILL1_LEVEL","0")); + REBIRTH_FIGHTER_SKILL2_ID = Integer.parseInt(additionsSettings.getProperty("REBIRTH_FIGHTER_SKILL2_ID","0")); + REBIRTH_FIGHTER_SKILL2_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_FIGHTER_SKILL2_LEVEL","0")); + REBIRTH_FIGHTER_SKILL3_ID = Integer.parseInt(additionsSettings.getProperty("REBIRTH_FIGHTER_SKILL3_ID","0")); + REBIRTH_FIGHTER_SKILL3_LEVEL = Integer.parseInt(additionsSettings.getProperty("REBIRTH_FIGHTER_SKILL3_LEVEL","0")); + CTF_EVEN_TEAMS = additionsSettings.getProperty("CTFEvenTeams", "BALANCE"); CTF_ALLOW_INTERFERENCE = Boolean.parseBoolean(additionsSettings.getProperty("CTFAllowInterference", "false")); Index: /trunk/gameserver/java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java =================================================================== --- /trunk/gameserver/java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java (revision 288) +++ /trunk/gameserver/java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java (revision 311) @@ -4,4 +4,5 @@ import java.util.logging.Logger; +import net.sf.engine.rebirth.BypassHandler; import net.sf.l2j.Config; import net.sf.l2j.gameserver.ai.CtrlIntention; @@ -168,4 +169,9 @@ player.processQuestEvent(p.substring(0, idx), p.substring(idx).trim()); } + else if(_command.startsWith("custom_")) + { + L2PcInstance player = getClient().getActiveChar(); + BypassHandler.getInstance().handleBypass(player, _command); + } } catch (Exception e) Index: /trunk/gameserver/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java =================================================================== --- /trunk/gameserver/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java (revision 271) +++ /trunk/gameserver/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java (revision 311) @@ -7,4 +7,5 @@ import net.sf.engine.Heroes; +import net.sf.engine.rebirth.WorldHandler; import net.sf.l2j.Base64; import net.sf.l2j.Config; @@ -68,4 +69,5 @@ import net.sf.l2j.util.Rnd; +@SuppressWarnings("unused") public class EnterWorld extends L2GameClientPacket { @@ -364,4 +366,5 @@ } RegionBBSManager.getInstance().changeCommunityBoard(); + WorldHandler.getInstance().enterWorld(activeChar); if (CTF._savePlayers.contains(activeChar.getName())) Index: /trunk/datapack/sql/rebirth_manager.sql =================================================================== --- /trunk/datapack/sql/rebirth_manager.sql (revision 312) +++ /trunk/datapack/sql/rebirth_manager.sql (revision 312) @@ -0,0 +1,13 @@ +-- ---------------------------- +-- Table structure for rebirth_manager +-- ---------------------------- +CREATE TABLE IF NOT EXISTS `rebirth_manager`( + `playerId` int(20) NOT NULL, + `rebirthCount` int(2) NOT NULL, + PRIMARY KEY (`playerId`) +); + + +-- ---------------------------- +-- Records +-- ---------------------------- Index: /trunk/datapack/sql/npc.sql =================================================================== --- /trunk/datapack/sql/npc.sql (revision 193) +++ /trunk/datapack/sql/npc.sql (revision 312) @@ -8377,4 +8377,5 @@ (70010, 31606, "Catrina", 1, "TvT Event Manager", 1, "Monster2.queen_of_cat", 8, 15, 70, "female", "L2TvTEventNpc", 40, 3862, 1493, 11.85, 2.78, 40, 43, 30, 21, 20, 10, 0, 0, 1314, 470, 780, 382, 278, 0, 333, 0, 0, 0, 28, 132, "NULL", 0, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"); +INSERT INTO `npc` VALUES ('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'L2Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT','0', '0', '0', 'mage'), INSERT INTO `npc` VALUES ('99999', '30134', 'Buffer', '1', 'L2j-Device', '1', 'Monster3.Elite_Mage', '6.50', '21.96', '70', 'male', 'L2Buff', '40', '10', '10', '10.00', '10.00', '40', '43', '30', '21', '20', '10', '0', '0', '10', '470', '10', '382', '278', '0', '333', '6579', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT', '0', '0', '0', 'mage'); INSERT INTO `npc` VALUES ('100000', '30134', 'Color Manager', '1', 'L2j-Device', '1', 'Monster3.Elite_Mage', '6.50', '21.96', '70', 'male', 'L2CustomColorManager', '40', '10', '10', '10.00', '10.00', '40', '43', '30', '21', '20', '10', '0', '0', '10', '470', '10', '382', '278', '0', '333', '6579', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT', '0', '0', '0', 'mage'); Index: /trunk/datapack/tools/Installer.cmd =================================================================== --- /trunk/datapack/tools/Installer.cmd (revision 101) +++ /trunk/datapack/tools/Installer.cmd (revision 312) @@ -379,4 +379,7 @@ %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/ctf_teams.sql @cls +echo ***** ������� 98 ����⮢ ***** +%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/rebirth_manager.sql +@cls echo ***** ������� 100 ����⮢ ***** %mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle_manor_production.sql Index: /trunk/datapack/tools/full_install.sql =================================================================== --- /trunk/datapack/tools/full_install.sql (revision 21) +++ /trunk/datapack/tools/full_install.sql (revision 312) @@ -84,2 +84,3 @@ DROP TABLE IF EXISTS castle_manor_procure; DROP TABLE IF EXISTS castle_manor_production; +DROP TABLE IF EXISTS rebirth_manager; Index: /trunk/datapack/data/html/default/55555.htm =================================================================== --- /trunk/datapack/data/html/default/55555.htm (revision 312) +++ /trunk/datapack/data/html/default/55555.htm (revision 312) @@ -0,0 +1,16 @@ +<html> +<body> +<title>- Rebirth Request Menu -</title> +<br> +<br> +<br> +So, you wish to be Reborn? +Being Reborn has it's advantages, and it's disadvantages you know. <br> +When you are Reborn you are granted a new bonus skill (listed above), <br> +but your character is reset to level 1 and returned to his starting class. So <br> +choose wisely.<br> +<br> +<br> +<button value=" Request Rebirth " action="bypass -h custom_rebirth_confirmrequest" width=250 height=36 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"/> +</body> +</html>
  2. Скрипт Casino(лотерея) Подходите к НПС, даёте ему 100кк и либо оставляете их у него, либо у Вас 200кк. Пойдет под любой l2j сервер. Удачи. /* * 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 2, 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * <http://www.gnu.org/copyleft/gpl.html> */ package net.sf.l2j.gameserver.model.actor.instance; import net.sf.l2j.gameserver.GameTimeController; import net.sf.l2j.gameserver.ThreadPoolManager; import net.sf.l2j.gameserver.ai.CtrlIntention; import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage; import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUser; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.SetupGauge; import net.sf.l2j.gameserver.network.serverpackets.SocialAction; import net.sf.l2j.gameserver.templates.L2NpcTemplate; import net.sf.l2j.gameserver.util.Broadcast; import net.sf.l2j.util.Rnd; import javolution.text.TextBuilder; public class L2CasinoInstance extends L2NpcInstance { private String filename; public L2CasinoInstance(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; } if(command.startsWith("play1")) Casino1(player); if(command.startsWith("play2")) Casino2(player); if(command.startsWith("play3")) Casino3(player); if(command.startsWith("play4")) Casino4(player); } public static void displayCongrats(L2PcInstance player) { player.broadcastPacket(new SocialAction(player.getObjectId(), 3));//Victory Social Action. MagicSkillUser MSU = new MagicSkillUser(player, player, 2024, 1, 1, 0);//Fireworks Display player.broadcastPacket(MSU); ExShowScreenMessage screen = new ExShowScreenMessage("Congratulations "+player.getName()+"! You won!", 15000); player.sendPacket(screen); } public static void displayCongrats2(L2PcInstance player) { ExShowScreenMessage screen = new ExShowScreenMessage(""+player.getName()+"! You lost!", 15000); player.sendPacket(screen); } @Override public void showChatWindow(L2PcInstance player, int val) { filename = (getHtmlPath(getNpcId(), val)); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(casinoWindow(player)); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } private String casinoWindow(L2PcInstance player) { TextBuilder replyMSG = new TextBuilder(); replyMSG.append("<html><title>Casino Manager</title><body>"); replyMSG.append("<center>"); replyMSG.append("<br>"); replyMSG.append("<font color=\"999999\">Chance to win : 50%</font><br>"); replyMSG.append("<img src=\"L2UI.SquareGray\" width=\"200\" height=\"1\"><br>"); replyMSG.append("Welcome "+player.getName()+"<br>"); replyMSG.append("<tr><td>Double or Nothing ?</td></tr><br>"); replyMSG.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); replyMSG.append("<center>"); replyMSG.append("Place your bets"); replyMSG.append("</center>"); replyMSG.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); replyMSG.append("<br>"); replyMSG.append("<center>"); replyMSG.append("<tr>"); replyMSG.append("<td><button value= 100KK action=\"bypass -h npc_%objectId%_play1\" width=130 height=25 back = sek.cbui94 fore = sek.cbui92></td>"); replyMSG.append("<td><button value= 300KK action=\"bypass -h npc_%objectId%_play2\" width=130 height=25 back = sek.cbui94 fore = sek.cbui92></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td><button value= 500KK action=\"bypass -h npc_%objectId%_play3\" width=130 height=25 back = sek.cbui94 fore = sek.cbui92></td>"); replyMSG.append("<td><button value= 1KKK action=\"bypass -h npc_%objectId%_play4\" width=130 height=25 back = sek.cbui94 fore = sek.cbui92></td>"); replyMSG.append("</tr>"); replyMSG.append("</center>"); replyMSG.append("<center><img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\">"); replyMSG.append("</body></html>"); return replyMSG.toString(); } public static void Casino1(L2PcInstance player) { int unstuckTimer = (1*1000 ); player.setTarget(player); player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); player.disableAllSkills(); MagicSkillUser msk = new MagicSkillUser(player, 361, 1, unstuckTimer, 0); Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); SetupGauge sg = new SetupGauge(0, unstuckTimer); player.sendPacket(sg); Casino1 ef = new Casino1(player); player.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer)); player.setSkillCastEndTime(10+GameTimeController.getGameTicks()+unstuckTimer/GameTimeController.MILLIS_IN_TICK); } static class Casino1 implements Runnable { private L2PcInstance _player; Casino1(L2PcInstance player) { _player = player; } public void run() { if (_player.isDead()) return; _player.setIsIn7sDungeon(false); _player.enableAllSkills(); int chance = Rnd.get(2); if (_player.isNoble() && _player.getInventory().getInventoryItemCount(57, 0) >= 100000000) { if(chance == 0) { displayCongrats(_player); _player.getInventory().addItem("Adena", 57, 100000000, _player, null); } if (chance == 1) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 100000000, _player, null); } } else { _player.sendMessage("You do not have eneough items."); } } } public static void Casino2(L2PcInstance player) { int unstuckTimer = (1*1000 ); player.setTarget(player); player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); player.disableAllSkills(); MagicSkillUser msk = new MagicSkillUser(player, 361, 1, unstuckTimer, 0); Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); SetupGauge sg = new SetupGauge(0, unstuckTimer); player.sendPacket(sg); Casino2 ef = new Casino2(player); player.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer)); player.setSkillCastEndTime(10+GameTimeController.getGameTicks()+unstuckTimer/GameTimeController.MILLIS_IN_TICK); } static class Casino2 implements Runnable { private L2PcInstance _player; Casino2(L2PcInstance player) { _player = player; } public void run() { if (_player.isDead()) return; _player.setIsIn7sDungeon(false); _player.enableAllSkills(); int chance = Rnd.get(3); if (_player.isNoble() && _player.getInventory().getInventoryItemCount(57, 0) >= 300000000) { if(chance == 0) { displayCongrats(_player); _player.getInventory().addItem("Adena", 57, 300000000, _player, null); } if (chance == 1) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 300000000, _player, null); } if (chance == 2) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 300000000, _player, null); } } else { _player.sendMessage("You do not have eneough items."); } } } public static void Casino3(L2PcInstance player) { int unstuckTimer = (1*1000 ); player.setTarget(player); player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); player.disableAllSkills(); MagicSkillUser msk = new MagicSkillUser(player, 361, 1, unstuckTimer, 0); Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); SetupGauge sg = new SetupGauge(0, unstuckTimer); player.sendPacket(sg); Casino3 ef = new Casino3(player); player.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer)); player.setSkillCastEndTime(10+GameTimeController.getGameTicks()+unstuckTimer/GameTimeController.MILLIS_IN_TICK); } static class Casino3 implements Runnable { private L2PcInstance _player; Casino3(L2PcInstance player) { _player = player; } public void run() { if (_player.isDead()) return; _player.setIsIn7sDungeon(false); _player.enableAllSkills(); int chance = Rnd.get(3); if (_player.isNoble() && _player.getInventory().getInventoryItemCount(57, 0) >= 500000000) { if(chance == 0) { displayCongrats(_player); _player.getInventory().addItem("Adena", 57, 500000000, _player, null); } if (chance == 1) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 500000000, _player, null); } if (chance == 2) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 500000000, _player, null); } } else { _player.sendMessage("You do not have eneough items."); } } } public static void Casino4(L2PcInstance player) { int unstuckTimer = (1*1000 ); player.setTarget(player); player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); player.disableAllSkills(); MagicSkillUser msk = new MagicSkillUser(player, 361, 1, unstuckTimer, 0); Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); SetupGauge sg = new SetupGauge(0, unstuckTimer); player.sendPacket(sg); Casino4 ef = new Casino4(player); player.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer)); player.setSkillCastEndTime(10+GameTimeController.getGameTicks()+unstuckTimer/GameTimeController.MILLIS_IN_TICK); } static class Casino4 implements Runnable { private L2PcInstance _player; Casino4(L2PcInstance player) { _player = player; } public void run() { if (_player.isDead()) return; _player.setIsIn7sDungeon(false); _player.enableAllSkills(); int chance = Rnd.get(3); if (_player.isNoble() && _player.getInventory().getInventoryItemCount(57, 0) >= 1000000000) { if(chance == 0) { displayCongrats(_player); _player.getInventory().addItem("Adena", 57, 1000000000, _player, null); } if (chance == 1) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 1000000000, _player, null); } if (chance == 2) { displayCongrats2(_player); _player.getInventory().destroyItemByItemId("Adena", 57, 1000000000, _player, null); } } else { _player.sendMessage("You do not have eneough items."); } } } }
  3. Index: /java/lt/equal/gameserver/skills/l2skills/L2SkillSummon.java =================================================================== --- /java/lt/equal/gameserver/skills/l2skills/L2SkillSummon.java (revision 1) +++ /java/lt/equal/gameserver/skills/l2skills/L2SkillSummon.java (revision 51) @@ -183,4 +183,7 @@ summon.setName(summonTemplate.name); + if (Config.ENABLE_CUSTOM_SUMMON_NAME) + summon.setTitle(Config.CUSTOM_SUMMON_NAME); + else summon.setTitle(activeChar.getName()); summon.setExpPenalty(_expPenalty); Index: /java/lt/equal/Config.java =================================================================== --- /java/lt/equal/Config.java (revision 50) +++ /java/lt/equal/Config.java (revision 51) @@ -797,5 +797,7 @@ public static boolean NOT_CONSUME_SHOTS; public static boolean NOT_CONSUME_POTS; - public static boolean NOT_CONSUME_SCROLLS; + public static boolean NOT_CONSUME_SCROLLS; + public static boolean ENABLE_CUSTOM_SUMMON_NAME; + public static String CUSTOM_SUMMON_NAME; // RATES_CONFIG_FILE @@ -1134,4 +1136,6 @@ SIDE_BLOW_SUCCESS = Byte.parseByte(altSettings.getProperty("SideBlow", "60")); ALT_REPUTATION_SCORE_PER_KILL = Integer.parseInt(altSettings.getProperty("ReputationScorePerKill", "1")); + ENABLE_CUSTOM_SUMMON_NAME = Boolean.valueOf(altSettings.getProperty("EnableSummonCustomTitle", "False")); + CUSTOM_SUMMON_NAME = altSettings.getProperty("SummonCustomTitle", "postpacific.ru"); _log.info("# " + ALT_SETTINGS_FILE + " Sucessfully LOADED #"); Index: /config/altsettings.properties =================================================================== --- /config/altsettings.properties (revision 45) +++ /config/altsettings.properties (revision 51) @@ -399,2 +399,11 @@ # Retail: 1 ReputationScorePerKill = 1 + +#--------------------------------------------- +# Custom Titles on Summons +#--------------------------------------------- +#Enable custom titles on summons? +EnableSummonCustomTitle = False + +#Enter custom title +SummonCustomTitle = L2Maxi.ru Пользуемся и дополняем свои сервера вкусностями.
  4. BBMAXI

    [manual] Skillseller

    Что может этот НПС? и что это вообще? 1. Продает скилы, все скилы указываются в нужной БД. 2. После рестарта проданные скилы не изчезают. 3. Может продавать вещи (мультиселл) Index: java/net/sf/l2j/gameserver/model/L2TraderSkillLearn.java =================================================================== --- java/net/sf/l2j/gameserver/model/L2TraderSkillLearn.java (revision 0) +++ java/net/sf/l2j/gameserver/model/L2TraderSkillLearn.java (revision 0) +/* +* 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.model; + +/** + * This class ... + * + * @version $Revision: 1.2.4.2 $ $Date: 2005/03/27 15:29:33 $ + */ +public final class L2TraderSkillLearn +{ + // these two build the primary key + private final int _id; + private final int _level; + + // not needed, just for easier debug + private final String _name; + + private final int _spCost; + private final int _minLevel; + private final int _costid; + private final int _costcount; + + public L2TraderSkillLearn(int id, int lvl, int minLvl, String name, int cost, int costid, int costcount) + { + _id = id; + _level = lvl; + _minLevel = minLvl; + _name = name.intern(); + _spCost = cost; + _costid = costid; + _costcount = costcount; + } + + /** + * @return Returns the id. + */ + public int getId() + { + return _id; + } + + /** + * @return Returns the level. + */ + public int getLevel() + { + return _level; + } + + /** + * @return Returns the minLevel. + */ + public int getMinLevel() + { + return _minLevel; + } + + /** + * @return Returns the name. + */ + public String getName() + { + return _name; + } + + /** + * @return Returns the spCost. + */ + public int getSpCost() + { + return _spCost; + } + public int getIdCost() + { + return _costid; + } + public int getCostCount() + { + return _costcount; + } +} No newline at end of file Index: java/net/sf/l2j/gameserver/model/actor/instance/L2TraderManagerInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2TraderManagerInstance.java (revision 0) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2TraderManagerInstance.java (revision 0) +/* + * 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.model.actor.instance; + +import java.util.StringTokenizer; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.TradeController; +import net.sf.l2j.gameserver.datatables.SkillTable; +import net.sf.l2j.gameserver.datatables.SkillTreeTable; +import net.sf.l2j.gameserver.model.L2Skill; +import net.sf.l2j.gameserver.model.L2TraderSkillLearn; +import net.sf.l2j.gameserver.model.L2Multisell; +import net.sf.l2j.gameserver.model.L2TradeList; +import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.AcquireSkillList; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; +import net.sf.l2j.gameserver.network.serverpackets.BuyList; +import net.sf.l2j.gameserver.network.serverpackets.SellList; +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge; +import net.sf.l2j.gameserver.network.serverpackets.ShopPreviewList; +import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate; +import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate; +import net.sf.l2j.gameserver.util.StringUtil; + +public class L2TraderManagerInstance extends L2NpcInstance +{ + + /** + * @param objectId + * @param template + */ + public L2TraderManagerInstance(int objectId, L2NpcTemplate template) + { + super(objectId, template); + } + + @Override + public String getHtmlPath(int npcId, int val) + { + String pom = ""; + + if (val == 0) + pom = "" + npcId; + else + pom = npcId + "-" + val; + + return "data/html/skill_trader/" + pom + ".htm"; + } + + + protected final void showSellWindow(L2PcInstance player) + { + if (Config.DEBUG) _log.fine("Showing selllist"); + + + player.sendPacket(new SellList(player)); + + if (Config.DEBUG) _log.fine("Showing sell window"); + + player.sendPacket(ActionFailed.STATIC_PACKET); + } + + @Override + public void onBypassFeedback(L2PcInstance player, String command) + { + StringTokenizer st = new StringTokenizer(command, " "); + String actualCommand = st.nextToken(); // Get actual command + + + if (command.startsWith("TraderSkillList")) + { + player.setSkillLearningClassId(player.getClassId()); + showTraderSkillList(player); + } + else if (actualCommand.equalsIgnoreCase("Sell")) + { + showSellWindow(player); + } + else if (actualCommand.equalsIgnoreCase("Multisell")) + { + if (st.countTokens() < 1) return; + + int val = Integer.parseInt(st.nextToken()); + L2Multisell.getInstance().separateAndSend(val, player, false, getCastle().getTaxRate()); + } + else if (actualCommand.equalsIgnoreCase("Exc_Multisell")) + { + if (st.countTokens() < 1) return; + + int val = Integer.parseInt(st.nextToken()); + L2Multisell.getInstance().separateAndSend(val, player, true, getCastle().getTaxRate()); + } + else + { + super.onBypassFeedback(player, command); + } + } + + /** + * this displays TraderSkillList to the player. + * @param player + */ + public void showTraderSkillList(L2PcInstance player) + { + L2TraderSkillLearn[] skills = SkillTreeTable.getInstance().getAvailableTraderSkills(player); + AcquireSkillList asl = new AcquireSkillList(AcquireSkillList.SkillType.Usual); + int counts = 0; + + for (L2TraderSkillLearn s: skills) + { + L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel()); + if (sk == null) + continue; + + counts++; + + asl.addSkill(s.getId(), s.getLevel(), s.getLevel(), s.getSpCost(), 1); + } + + if (counts == 0) + { + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); + int minlevel = SkillTreeTable.getInstance().getMinLevelForNewTraderSkill(player); + + if (minlevel > 0) + { + // No more skills to learn, come back when you level. + + SystemMessage sm = new SystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN); + sm.addNumber(minlevel); + player.sendPacket(sm); + } + else + { + html.setHtml( + "<html><head><body>" + + "You've learned all skills.<br>" + + "</body></html>" + ); + player.sendPacket(html); + + } + } + else + { + player.sendPacket(asl); + } + + player.sendPacket(ActionFailed.STATIC_PACKET); + } +} No newline at end of file Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestAquireSkill.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestAquireSkill.java (revision 0) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestAquireSkill.java (revision 0) @@ 27 import net.sf.l2j.gameserver.model.L2Skill; import net.sf.l2j.gameserver.model.L2SkillLearn; import net.sf.l2j.gameserver.model.L2TransformSkillLearn; +import net.sf.l2j.gameserver.model.L2TraderSkillLearn; import net.sf.l2j.gameserver.model.actor.L2Npc; @@ 35 import net.sf.l2j.gameserver.model.actor.instance.L2TransformManagerInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2TraderManagerInstance; import net.sf.l2j.gameserver.model.actor.instance.L2VillageMasterInstance; @@ 152 player.sendPacket(sm); sm = null; return; } break; } + + if (trainer instanceof L2TraderManagerInstance) // Trader skills + { + int costid = 0; + int costcount = 0; + // Skill Learn bug Fix + L2TraderSkillLearn[] skillsc = SkillTreeTable.getInstance().getAvailableTraderSkills(player); + + for (L2TraderSkillLearn s : skillsc) + { + L2Skill sk = SkillTable.getInstance().getInfo(s.getId(),s.getLevel()); + + if (sk == null || sk != skill) + continue; + + counts++; + costid = s.getIdCost(); + costcount = s.getCostCount(); + _requiredSp = s.getSpCost(); + } + + if (counts == 0) + { + player.sendMessage("You are trying to learn skill that u can't.."); + Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " tried to learn skill that he can't!!!", IllegalPlayerAction.PUNISH_KICK); + return; + } + + if (player.getSp() >= _requiredSp) + { + if (!player.destroyItemByItemId("Consume", costid, costcount, trainer, false)) + { + // Haven't spellbook + player.sendPacket(new SystemMessage(SystemMessageId.ITEM_MISSING_TO_LEARN_SKILL)); + return; + } + + SystemMessage sm = new SystemMessage(SystemMessageId.S2_S1_DISAPPEARED); + sm.addItemName(costid); + sm.addItemNumber(costcount); + sendPacket(sm); + sm = null; + } + else + { + SystemMessage sm = new SystemMessage(SystemMessageId.NOT_ENOUGH_SP_TO_LEARN_SKILL); + player.sendPacket(sm); + sm = null; + return; + } + break; + } + // normal skills L2SkillLearn[] skills = SkillTreeTable.getInstance().getAvailableSkills(player, player.getSkillLearningClassId()); Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestAquireSkillInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestAquireSkillInfo.java (revision 0) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestAquireSkillInfo.java (revision 0) @@ 26 import net.sf.l2j.gameserver.model.L2TransformSkillLearn; +import net.sf.l2j.gameserver.model.L2TraderSkillLearn; import net.sf.l2j.gameserver.model.actor.L2Npc; import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance; @@ 31 import net.sf.l2j.gameserver.model.actor.instance.L2TransformManagerInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2TraderManagerInstance; import net.sf.l2j.gameserver.network.serverpackets.AcquireSkillInfo; @@ 82 } if (_skillType == 0) { + + if (trainer instanceof L2TraderManagerInstance) + { + + int costid = 0; + int costcount = 0; + int spCost = 0; + L2TraderSkillLearn[] skillst = SkillTreeTable.getInstance().getAvailableTraderSkills(activeChar); + + for (L2TraderSkillLearn s : skillst) + { + if (s.getId() == _id && s.getLevel() == _level) + { + canteach = true; + costid = s.getIdCost(); + costcount = s.getCostCount(); + spCost = s.getSpCost(); + break; + } + } + + if (!canteach) + return; // cheater + + int requiredSp = 10; + AcquireSkillInfo asi = new AcquireSkillInfo(skill.getId(), skill.getLevel(), spCost,0); + asi.addRequirement(4, costid, costcount, 0); + + sendPacket(asi); + return; + } + if (trainer instanceof L2TransformManagerInstance) { int itemId = 0; L2TransformSkillLearn[] skillst = SkillTreeTable.getInstance().getAvailableTransformSkills(activeChar); for (L2TransformSkillLearn s : skillst) { if (s.getId() == _id && s.getLevel() == _level) Index: java/net/sf/l2j/gameserver/datatables/SkillTreeTable.java =================================================================== --- java/net/sf/l2j/gameserver/datatables/SkillTreeTable.java (revision 0) +++ java/net/sf/l2j/gameserver/datatables/SkillTreeTable.java (revision 0) @@ 32 import net.sf.l2j.gameserver.model.L2SkillLearn; import net.sf.l2j.gameserver.model.L2TransformSkillLearn; +import net.sf.l2j.gameserver.model.L2TraderSkillLearn; import net.sf.l2j.gameserver.model.L2EnchantSkillLearn.EnchantSkillDetail; @@ 62 private List<L2TransformSkillLearn> _TransformSkillTrees; // Transform Skills (Test) +private List<L2TraderSkillLearn> _TraderSkillTrees; // Transform Skills (Test) private FastList<L2SkillLearn> _specialSkillTrees; @@ 143 int count6 = 0; int count7 = 0; + int count8 = 0; Connection con = null; @@ 406 } catch (Exception e) { _log.severe("Error while creating special skill table: " + e); } } catch (Exception e) { _log.log(Level.SEVERE, "Error while skill tables ", e); } + //Skill tree for Trader skill + try + { + _TraderSkillTrees = new FastList<L2TraderSkillLearn>(); + + PreparedStatement statement = con.prepareStatement("SELECT skill_id, level, name, sp, min_level, costid, cost FROM trader_skill_trees ORDER BY skill_id, level"); + ResultSet skilltree7 = statement.executeQuery(); + + int prevSkillId = -1; + + + while (skilltree7.next()) + { + int id = skilltree7.getInt("skill_id"); + int lvl = skilltree7.getInt("level"); + String name = skilltree7.getString("name"); + int minLvl = skilltree7.getInt("min_level"); + int cost = skilltree7.getInt("sp"); + int costId = skilltree7.getInt("costid"); + int costCount = skilltree7.getInt("cost"); + + if (prevSkillId != id) + prevSkillId = id; + + L2TraderSkillLearn skill = new L2TraderSkillLearn(id, lvl, minLvl, name, cost, costId, costCount); + + + _TraderSkillTrees.add(skill); + } + + skilltree7.close(); + statement.close(); + + count8 = _TraderSkillTrees.size(); + } + catch (Exception e) + { + _log.severe("Error while creating tarder skill table: " + e); + } finally { try { con.close(); } catch (Exception e) { } @@ 724 } return result.toArray(new L2PledgeSkillLearn[result.size()]); } + public L2TraderSkillLearn[] getAvailableTraderSkills(L2PcInstance cha) + { + List<L2TraderSkillLearn> result = new FastList<L2TraderSkillLearn>(); + List<L2TraderSkillLearn> skills = new FastList<L2TraderSkillLearn>(); + + skills.addAll(_TraderSkillTrees); + + if (skills == null) + { + // the skilltree for this class is undefined, so we give an empty list + _log.warning("Skilltree for fishing is not defined !"); + return new L2TraderSkillLearn[0]; + } + + L2Skill[] oldSkills = cha.getAllSkills(); + + for (L2TraderSkillLearn temp : skills) + { + if (temp.getMinLevel() <= cha.getLevel()) + { + boolean knownSkill = false; + + for (int j = 0; j < oldSkills.length && !knownSkill; j++) + { + if (oldSkills[j].getId() == temp.getId()) + { + knownSkill = true; + + if (oldSkills[j].getLevel() == temp.getLevel() - 1) + { + // this is the next level of a skill that we know + result.add(temp); + } + } + } + + if (!knownSkill && temp.getLevel() == 1) + { + // this is a new skill + result.add(temp); + } + } + } + + return result.toArray(new L2TraderSkillLearn[result.size()]); + } + /** * Returns all allowed skills for a given class. * @param classId @@ 856 } return minLevel; } + public int getMinLevelForNewTraderSkill(L2PcInstance cha) + { + int minLevel = 0; + List<L2TraderSkillLearn> skills = new FastList<L2TraderSkillLearn>(); + + skills.addAll(_TraderSkillTrees); + + if (skills == null) + { + // the skilltree for this class is undefined, so we give an empty list + _log.warning("SkillTree for Trader Skills is not defined !"); + return minLevel; + } + + for (L2TraderSkillLearn s : skills) + { + if (s.getMinLevel() > cha.getLevel()) + if (minLevel == 0 || s.getMinLevel() < minLevel) + minLevel = s.getMinLevel(); + } + + return minLevel; + } + public int getSkillCost(L2PcInstance player, L2Skill skill) { Авторство этой статьи принадлежит sterser.
  5. http://forummaxi.ru/index.php?showtopic=1550
  6. BBMAXI

    Lineage 2 Chronicle 1

    1 хроники называются Prelude вроде, я пробовал ставить с3 сервер. И то толку 0 от него. Еле нашел клиент и патч. И что самое обидное не запускается клиент с3 на 7 винде. Че только не пробовал ) так что нафиг надо.
  7. 1.Debian хорош на серверах, Ubuntu лучше подходит для десктопов. 2.Установка Debian требует предварительной подготовки, Ubuntu в состоянии установить и домохозяйка (вариант – даже секретарша-блондика). 3.В Debian софт устаревший, но стабильный, в Ubuntu – самый современный, но возможны глюки. 4.Debian может быть установлен в минимальной комплектации и в дальнейшем наращиваться по потребностям; Ubuntu устанавливает массу «юзерофильной хрени» (выражение с одного из форумов). 5.В Debian все мультимедийные кодеки устанавливаются по умолчанию, в Ubuntu их нужно докачивать и устанавливать специально. 6.Ubuntu абсолютно бесплатно рассылается по всему миру, дистрибутивы Debian надо либо покупать, либо скачивать. 7.Debian – полностью свободный дистрибутив, разрабатываемый сообществом, тогда как разработка Ubuntu контролируется коммерческой фирмой (имя которой, заметим в скобках, Canonical). 8.В Ubuntu нет root'а! Объясню 1 пункт: 1. Debian хорош на серверах, Ubuntu лучше подходит для десктопов Начинаем, так сказать, с ориентации – что десктоп и что сервер. Да, говорят (и у меня не оснований не верить утверждающим это), что Debian в роли сервера очень хорош. Но ведь и Ubuntu способен показать себя здесь не хуже. Тот, кто внимательно читал меню его инсталлятора, наверняка обратил внимание на пункт, касающийся серверной установки – по его выборе инсталлируется стандартный LAMP (устоявшееся название для связки Linux, Apache, MySQL и PHP - то, под чем крутится подавляющее большинство web-серверов мира). Вполне готовый к употреблению – особенно с учетом долгосрочной техподдержки (от 3 до 5 лет, в зависимости от версии).
  8. Обвязка STRESSWEB 10 (лицензия) Сборка От феникса. Защита Лейм Гвард. (от разработчиков) ОС лучше ставить на мой взгляд Debian х64. Самый лучший вариант. Со своим стажем 5.5 года (лучше варианта пока не знаю) Расход денег = 7450 рублей.
  9. 1. Летим в Гиран, выбираем место респауна вводим команду /loc 2. Списываем координаты 3. делаем такой запрос в БД. REPLACE INTO char_templates VALUES (0, "Human Fighter", 0, 40, 43, 30, 21, 11, 25, 4, 72, 3, 47, 330, 213, 33, 44, 33, 115, 81900, -83063, 150791, -3133, 0, "1.1", "1.188", 9, 23, "1.1", "1.188", 8, "23.5", 34, 26, 68, 4222, 5588); REPLACE INTO char_templates VALUES (18, "Elf Fighter", 1, 36, 36, 35, 23, 14, 26, 4, 72, 3, 47, 345, 249, 36, 46, 36, 125, 73000, -83063, 150791, -3133, 0, "1.15", "1.242", "7.5", 24, "1.15", "1.242", "7.5", 23, 34, 26, 68, 4222, 5588); REPLACE INTO char_templates VALUES (31, "DE Fighter", 2, 41, 32, 34, 25, 12, 26, 4, 72, 3, 47, 342, 226, 35, 45, 35, 122, 69000, -83063, 150791, -3133, 0, "1.14", "1.2312", "7.5", 24, "1.14", "1.2312", 7, "23.5", 34, 26, 68, 4222, 5588); REPLACE INTO char_templates VALUES (44,'Orc Fighter', 3, 40, 47, 26, 18, 12, 27, 4, 72, 2, 48, 318, 226, 31, 42, 31, 117, 87000, -83063, 150791, -3133, 0, "1.06", "1.144800", 11.0, 28.0,1.06, "1.144800", 7.0, 27.0, 34, 26, 257, 0, 5588); REPLACE INTO char_templates VALUES (53, "Dwarf Fighter", 4, 39, 45, 29, 20, 10, 27, 4, 72, 3, 48, 327, 203, 33, 43, 33, 115, 83000, -83063, 150791, -3133, 1, "1.09", "1.487196", 9, 18, "1.09", "1.487196", 5, 19, 34, 26, 87, 4222, 5588); REPLACE INTO char_templates VALUES (10, "Human Mage", 0, 22, 27, 21, 41, 20, 39, 2, 48, 7, 54, 303, 333, 28, 40, 28, 120, 62500, -83063, 150791, -3133, 0, "1.01", "0.87264", "7.5", "22.8", "1.01", "0.87264", "6.5", "22.5", 1105, 1102, 177, 0, 5588); REPLACE INTO char_templates VALUES (25, "Elf Mage", 1, 21, 25, 24, 37, 23, 40, 2, 48, 6, 54, 312, 386, 30, 41, 30, 122, 62400, -83063, 150791, -3133, 0, "1.04", "0.89856", "7.5", 24, "1.04", "0.89856", "7.5", 23, 1105, 1102, 177, 0, 5588); REPLACE INTO char_templates VALUES (38, "DE Mage", 2, 23, 24, 23, 44, 19, 37, 2, 48, 7, 53, 309, 316, 29, 41, 29, 122, 61000, -83063, 150791, -3133, 0, "1.14", "1.2312", "7.5", 24, "1.03", "0.88992", 7, "23.5", 1105, 1102, 177, 0, 5588); REPLACE INTO char_templates VALUES (49, "Orc Mage", 3, 27, 31, 24, 31, 15, 42, 2, 48, 4, 56, 312, 265, 30, 41, 30, 121, 68000, -83063, 150791, -3133, 0, "1.04", "0.89856", 7, "27.5", "1.04", "0.89856", 8, "25.5", 1105, 1102, 257, 0, 5588); Заменяем стандартные координаты -83063, 150791, -3133 на полученные вами командой /loc Рб все 80 лвл кроме Эпиков: UPDATE `npc` SET `level`='80' WHERE `type`='L2RaidBoss'; Для Эпиков 80 лвл: UPDATE `npc` SET `level`='80' WHERE `type`='L2GrandBoss';
  10. BBMAXI

    Id

    Мдяяя дожили, Заходишь в навикат в таблицу NPC, ищешь по ID своего Нпц и меняешься 1 столбец ID. IDteplate не трогаешь. И правишь уже HTML на нужный ID.
  11. Знаете, первый раз вижу сборку где не достают SQL предметы. Это просто мелочи но все же.... можно сделать выводы. Это не возможно что не грузятся SQL файлы из-за инсерта предмета. Вы не допустили ошибку ранее ? и скиньте пожалуйста мне из папки tools или как там ваш SQL файл на etcitem По поводу выше написанного, не грузится раздел армора. А не ETCITEM.
  12. Зайди в консоль базы и вбей INSERT INTO `etcitem` VALUES ('6393', 'Event - Glittering Medal', 'false', 'none', '0', 'stackable', 'steel', 'none', '-1', '0', '0', 'true', 'true', 'true', 'true', 'C4Item', 'none');
  13. Если они там имеются это уже + их отключить не реально. Я честно не ставил сборку эту, но просмотри в принципе конфиги. А вот вопрос, при создании пишется что типа предмет с ID 6393 был создан в инвентаре ? Либо патч кривой - мало вероятно.
  14. Это как вообще ? В базе смотрел ? etcitem ? имеются ли они там ?
  15. Напишу по существу, с данной проблемой лучше тебе обратиться к разработчиком этого ПО, вернее защиты. Здесь думаю долго будешь ждать ответ. Т.к команда новая пользователей не очень много.
  16. BBMAXI

    Help

    В чем ошибка заключается ? сборка какая ?
  17. Включить комп => Зайти в инет => Navicat => Spawnlist => Filter Wizard => где галочка ставим npc_templateid => вбиваем ID моба => CTRL+A => DELETE => OK. И радуешься проделанной столь сложной операции )
  18. Пробуй в игре добавить эти скиллы в ручную себе, если они работоспособны тогда ройся в skill_trees. Если скиллы не пашут смотри статы в XML. Если не то не другое не поможет Выкинь сборку в корзину.
  19. Просмотри таблицу в базе skill_trees Стоит ли там изучение скиллов для классов 3 профы.
  20. BBMAXI

    Пролблема Входа

    Game # --------------------------------------------------------------------------- # Настройки соединения # --------------------------------------------------------------------------- # Общие настройки: # 127.0.0.1 - Если вы играете только на тестовом сервере или один. # Или пропишите ваш внешний IP адрес для того что бы к вам могли подключиться из интернета. # Что бы узнать свой внешний IP пройдите по ссылке http://www.whatismyip.com/. Там будет написано Your IP Address Is (тут ваш IP адрес (внешний)). # По умолчанию: 127.0.0.1 ExternalHostname = l2genius1.no-ip.biz # --------------------------------------------------------------------------- # Подключение внутри сети. Тоесть для тех людей, которые находятся с вами в одной сети. # Или 127.0.0.1 если хотите играть один (тестировать сервер). # По умолчанию: 127.0.0.1 InternalHostname = l2genius1.no-ip.biz # --------------------------------------------------------------------------- # По умолчанию: 127.0.0.1 LoginHost = l2genius1.no-ip.biz # По умолчанию: 9014 LoginPort = 9014 # По умолчанию: 127.0.0.1 GameserverHostname = l2genius1.no-ip.biz # По умолчанию: 7777 GameserverPort = 7777 # --------------------------------------------------------------------------- # Настройки подключения к базе данных # --------------------------------------------------------------------------- # Уберите # перед соответствующим драйвером URL для базы данных. Если вы не знаете что это такое ---> www.google.com или yandex.ru # Driver = com.mysql.jdbc.Driver (По умолчанию) # Driver = org.hsqldb.jdbcDriver # Driver = com.microsoft.sqlserver.jdbc.SQLServerDriver Driver = com.mysql.jdbc.Driver # Database URL # URL = jdbc:mysql://localhost/l2jdb (По умолчанию) # URL = jdbc:hsqldb:hsql://localhost/l2open_DB # URL = jdbc:sqlserver://localhost/database = l2jdb/user = sa/password = root # Для русских ников и названий кланов... #URL = jdbc:mysql://localhost/l2jdb?useUnicode=true&characterEncoding=utf-8 URL = jdbc:mysql://localhost/l2jdb # База данных - Информация о пользователе (с использованием корневого (root) пользователя не рекомендуется). Login = Жорик # Пароль к базе данных. Password = СамыйКрутой # Default: 100 MaximumDbConnections = 100 # Default: 0 MaximumDbIdleTime = 0 # Default: True AllowDualBox = True Login # --------------------------------------------------------------------------- # Настройки соединения # --------------------------------------------------------------------------- # Это файл настроек Логин Сервера. Здесь вы можете настроить соединение для вашего сервера. # LAN (Local Area Network) - как правило, сетевая система все компьютеры находятся в одной сети. # WAN (Wide Area Network) - как правило, состоит из компьютеров внешнего окружения (т.е. Интернета). # 127.x.x.x - Формат один IP-адрес. Не включать (x) в настройках. Должны быть только реальные цифры. # Так же возможно подключение URL адреса на подобие NO-IP # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- # Сетевые настройки # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- # Это подключение клиентов из внешней сети (интернета), должен быть внешний IP # Общие настройки... # Поставьте 127.0.0.1 - Если вы играете только на тестовом сервере или один. # Или пропишите ваш внешний IP адрес для того что бы к вам могли подключиться из интернета. # Что бы узнать свой внешний IP пройдите по ссылке http://www.whatismyip.com/. # Там будет написан ваш IP(внешний). # По умолчанию: 127.0.0.1 ExternalHostname = l2genius1.no-ip.biz # --------------------------------------------------------------------------- # Подключение внутри сети. Для тех людей которые играют с вами в одной сети. # Или 127.0.0.1 если хотите играть один (тестировать сервер). # По умолчанию: 127.0.0.1 InternalHostname = l2genius1.no-ip.biz # --------------------------------------------------------------------------- # Если у вас есть роутер, который использует локальный IP для Port Forwarding, то стерите # перед RouterHostname, # и впишите туда свой локальный IP если хотите, чтоб люди не из вашей сети могли подключится к вашему серверу. # --------------------------------------------------------------------------- # RouterHostname = # --------------------------------------------------------------------------- # Привязка IP к LoginServer, используйте * чтобы связать все доступные IP-адреса. (Не меняйте параметр *). # По умолчанию: 127.0.0.1 LoginserverHostname = l2genius1.no-ip.biz # Порт логин сервера # По умолчанию: 2106 LoginserverPort = 2106 # Адрес, к которому будет подключатся Login для GameServers, используйте * чтобы связать все доступные IP-адреса (Не меняйте параметр *). # По умолчанию: 127.0.0.1 LoginHostname = l2genius1.no-ip.biz # Оставьте этот порт по умолчанию. # По умолчанию: 9014 LoginPort = 9014 # --------------------------------------------------------------------------- # Настройки подключения к Database # --------------------------------------------------------------------------- # Укажите название вашей базы (к примеру l2open_DB) Логин и Пароль. Driver = com.mysql.jdbc.Driver URL = jdbc:mysql://localhost/l2jdb # Информация о пользователе (с использованием root пользователя не рекомендуется) Login = Жорик Password = СамыйКрутой # По умолчанию: 10 MaximumDbConnections = 10 # Задержка в минутах, после чего логин обновляет gameservers IP's (полезно, при динамичном IP). # По умолчанию: 15 IpUpdateTime = 15 # По умолчанию: 15 FastConnectionLimit = 15 # По умолчанию: 700 NormalConnectionTime = 700 # По умолчанию: 350 FastConnectionTime = 350 # По умолчанию: 50 MaxConnectionPerIP = 50
  21. Проблему я решил, но на будущие из-за защиты Fatal_world. Мы не трогаем порт прослушки 8956 ( тогда не зайдем на сервер) вот правильные настройки конфигов ЛС и ГС Login #### ## Основные настройки # Внешний IP ExternalHostname = 127.0.0.1 # Внутренний IP InternalHostname = 127.0.0.1 # IP, на котором будет висеть логин; в локалке ни ставил, лучше указать внешний (ExternalHostname) LoginserverHostname = 127.0.0.1 # Порт логина LoginserverPort = 2106 # База данных Driver=com.mysql.jdbc.Driver URL=jdbc:mysql://localhost/l2jdb Login = root Password = Ваш пароль MaximumDbConnections = 65535 # Авторег AutoCreateAccounts = True # Аксесс аккаунта для доступа на закрытый серв GMMinLevel = 100 # IP геймсервера; если ГС на этой же машине, оставляем тут звездочку LoginHostname = 127.0.0.1 # Порт прослушки геймсервера LoginPort = 8956 #### ## Про остальные настройки в этом файле можно забыть # If set to true any GameServer can register on your login's free slots AcceptNewGameServer = True # If false, the licence (after the login) will not be shown # It is highly recomended for Account Seciurity to leave this option as defalut (True) ShowLicence = True # The delay in minutes after which the login updates the gameservers IP's (usefull when their ip is dynamic) IpUpdateTime = 15 # ============================================================== # Test server setting, shoudnt be touched in online game server # ============================================================== Debug = False Assert = False Developer = False # Enforce GG Authorization from client # Login server will kick client if client bypassed GameGuard authentication ForceGGAuth = False #FloodProtection. time in ms EnableFloodProtection = True FastConnectionLimit = 15 NormalConnectionTime = 700 FastConnectionTime = 350 MaxConnectionPerIP = 3 # ================================================================= # Threads configuration - Take care changing this # ================================================================= ThreadPoolSizeEffects = 30 ThreadPoolSizeGeneral = 33 #Default 2 UrgentPacketThreadCoreSize = 16 #Default 4 GeneralPacketThreadCoreSize = 16 #Default 4 GeneralThreadCoreSize = 16 AiMaxThread = 30 Game # Bind ip of the gameserver, use * to bind on all available IPs GameserverHostname = 127.0.0.1 GameserverPort = 7776 # This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname # If this ip is resolvable by Login just leave * ExternalHostname = 127.0.0.1 # This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname # If this ip is resolvable by Login just leave * InternalHostname = 127.0.0.1 # The Loginserver host and port LoginPort = 8956 LoginHost = 127.0.0.1 # This is the server id that the gameserver will request (i.e. 1 is Bartz) RequestServerID = 1 # If set to true, the login will give an other id to the server if the requested id is allready reserved AcceptAlternateID = True # Database info Driver=com.mysql.jdbc.Driver URL=jdbc:mysql://localhost/l2jdb?useUnicode=true&characterEncoding=UTF-8 Login = root Password = Ваш Пароль MaximumDbConnections = 65535 # Define character name template # Example to use only : CnameTemplate=[A-Z][a-z]{3,3}[A-Za-z0-9]* # will allow names with first capital letter, next three small letters, # and any (capital or not) letter or number, like ZbigN1eW # Most rational to have CnameTemplate=[A-Z][a-z]* # meaning names only of letters with first one capital, like Zbigniew # Default .* - any namy of any symbols CnameTemplate=[A-Za-z0-9\-]{3,16} PetNameTemplate=[A-Za-z0-9\-]{3,16} # Maximum number of chars per account - Default 7 (0 = unlimited [7 is the client limit]) CharMaxNumber = 7 # Define how many players are allowed to play simultaneously on your server. MaximumOnlineUsers = 1000 # Minimum and maximum protocol revision that server allow to connect. # You must keep MinProtocolRevision <= MaxProtocolRevision. MinProtocolRevision = 1 MaxProtocolRevision = 999 #Выводить левый протокол в консоль? только для палева л2топа. не актуально ShowProtocolsInConsole = False #проверка на мертвые треды, в милисекундах DeadLockCheck = 10000 #очистка сборщика мусора, в секундах, 3600 GCTaskDelay = 1800
  22. напиши в пм аську, решим вопрос.
  23. Хммм, есть какие нибудь действия в ЛС ? логи идут какие нибудь ? когда ты пробуешь зарегатся. Попробуй патч поменять еще.
  24. конфинги гс сервера: # Bind ip of the gameserver, use * to bind on all available IPs GameserverHostname = 127.0.0.1 GameserverPort = 7777 # This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname # If this ip is resolvable by Login just leave * ExternalHostname = 127.0.0.1 # This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname # If this ip is resolvable by Login just leave * InternalHostname = 127.0.0.1 # The Loginserver host and port LoginPort = 9014 LoginHost = 127.0.0.1 # This is the server id that the gameserver will request (i.e. 1 is Bartz) RequestServerID = 1 # If set to true, the login will give an other id to the server if the requested id is allready reserved AcceptAlternateID = True # Database info Driver=com.mysql.jdbc.Driver URL=jdbc:mysql://localhost/l2jdb Login = root Password = ******** MaximumDbConnections = 1000 # Define character name template # Example to use only : CnameTemplate=[A-Z][a-z]{3,3}[A-Za-z0-9]* # will allow names with first capital letter, next three small letters, # and any (capital or not) letter or number, like ZbigN1eW # Most rational to have CnameTemplate=[A-Z][a-z]* # meaning names only of letters with first one capital, like Zbigniew # Default .* - any namy of any symbols CnameTemplate=[A-Za-z0-9\-]{3,16} PetNameTemplate=[A-Za-z0-9\-]{3,16} # Maximum number of chars per account - Default 7 (0 = unlimited [7 is the client limit]) CharMaxNumber = 7 # Define how many players are allowed to play simultaneously on your server. MaximumOnlineUsers = 1000 # Minimum and maximum protocol revision that server allow to connect. # You must keep MinProtocolRevision <= MaxProtocolRevision. MinProtocolRevision = 1 MaxProtocolRevision = 999 #Выводить левый протокол в консоль? только для палева л2топа. не актуально ShowProtocolsInConsole = true #проверка на мертвые треды, в милисекундах DeadLockCheck = 10000 #очистка сборщика мусора, в секундах, 3600 GCTaskDelay = 1800 конфинги лс сервера: #### ## Основные настройки # Внешний IP ExternalHostname = 127.0.0.1 # Внутренний IP InternalHostname = 127.0.0.1 # IP, на котором будет висеть логин; в локалке ни ставил, лучше указать внешний (ExternalHostname) LoginserverHostname = 127.0.0.1 # Порт логина LoginserverPort = 2107 # База данных Driver=com.mysql.jdbc.Driver URL=jdbc:mysql://localhost/l2jdb Login = root Password = ****** MaximumDbConnections = 65535 # Авторег AutoCreateAccounts = True # Аксесс аккаунта для доступа на закрытый серв GMMinLevel = 100 # IP геймсервера; если ГС на этой же машине, оставляем тут звездочку LoginHostname = 127.0.0.1 # Порт прослушки геймсервера LoginPort = 9014 #### ## Про остальные настройки в этом файле можно забыть # If set to true any GameServer can register on your login's free slots AcceptNewGameServer = true # If false, the licence (after the login) will not be shown # It is highly recomended for Account Seciurity to leave this option as defalut (True) ShowLicence = True # The delay in minutes after which the login updates the gameservers IP's (usefull when their ip is dynamic) IpUpdateTime = 15 # ============================================================== # Test server setting, shoudnt be touched in online game server # ============================================================== Debug = False Assert = False Developer = False # Enforce GG Authorization from client # Login server will kick client if client bypassed GameGuard authentication ForceGGAuth = False #FloodProtection. time in ms EnableFloodProtection = True FastConnectionLimit = 15 NormalConnectionTime = 700 FastConnectionTime = 350 MaxConnectionPerIP = 3 # ================================================================= # Threads configuration - Take care changing this # ================================================================= ThreadPoolSizeEffects = 30 ThreadPoolSizeGeneral = 33 #Default 2 UrgentPacketThreadCoreSize = 16 #Default 4 GeneralPacketThreadCoreSize = 16 #Default 4 GeneralThreadCoreSize = 16 AiMaxThread = 30 Пробуй, в патче просто стандарт такой коннект идет на 2107 порт. Не поможет, пробуй отклоючить антивирус либо брендмаузер. (т.к он блочит порты) Если не поможет, будем копаться глубже Просмотри, на всякий случай еще Hexid
×
×
  • Создать...