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

gvb

Заблокирован
  • Публикаций

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

  • Посещение

  • Победитель дней

    46
  • Отзывы

    98%

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

  1. Тему CLOSED, Спасибо Temptation
  2. q8018_CngNick, а это случаем не скрипт? У меня нету его
  3. Что мне написать чтобы скомпилировала?
  4. reducecoin_of_luck так? У меня не компилит ошибку пишет я то дагадуюсь только не знаю как правельно написать
  5. А что мне заменить? Я тут id вообще не вижу)
  6. У меня в коде такой строки нету
  7. Вот код подскажите как сделать чтобы он брал итем за смену ника не адену, а коин оф лак } if (ChangeType == 1 && player.getInventory().[color=#ff0000]getAdena[/color]() < _priceForName || ChangeType == 2 && player.getInventory().[color=#ff0000]getAdena[/color]() < _priceForTitle) { player.sendMessage("Incorrect Adena in you inventory. You do not have required Adena."); return false; } Я так понял тут, а что поставить чтобы Coin of Luck забирал? /* * 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 javolution.text.TextBuilder; import net.sf.l2j.Config; import net.sf.l2j.gameserver.templates.L2NpcTemplate; import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.services.HtmlPathService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import java.util.StringTokenizer; /** * @author: Aquanox * @description: Class for name and title color change * @version: 0.7.2 */ public class L2CustomColorManagerInstance extends L2NpcInstance { private static final Log _log = LogFactory.getLog(L2CustomColorManagerInstance.class); /** Get info from CONFIG */ private final static boolean _isColorManagerEnabled = Config.CM_ALLOW_COLOR_MANAGER; private final static boolean _allowTitleChange = Config.CM_ALLOW_TITLE_COLOR_CHANGE; private final static boolean _allowNameChange = Config.CM_ALLOW_NAME_COLOR_CHANGE; private final static int _priceForName = Config.CM_CHANGE_NAME_COLOR_PRICE; private final static int _priceForTitle = Config.CM_CHANGE_TITLE_COLOR_PRICE; private final static int _minLevel = Config.CM_PLAYER_MIN_LEVEL; /** * @description Main colors datatable */ protected final static int[][] COLORS_DATA = new int[][] { {0,0,0},{0,0,51},{0,0,102},{0,0,153},{0,0,204},{0,0,255},{0,51,0},{0,51,51}, {0,51,102},{0,51,153},{0,51,204},{0,51,255},{0,102,0},{0,102,51},{0,102,102},{0,102,153}, {0,102,204},{0,102,255},{0,153,0},{0,153,51},{0,153,102},{0,153,153},{0,153,204},{0,153,255}, {0,204,0},{0,204,51},{0,204,102},{0,204,153},{0,204,204},{0,204,255},{0,255,0},{0,255,51}, {0,255,102},{0,255,153},{0,255,204},{0,255,255},{51,0,0},{51,0,51},{51,0,102}, {51,0,153},{51,0,204},{51,0,255},{51,51,0},{51,51,51},{51,51,102},{51,51,153},{51,51,204},{51,51,255}, {51,102,0},{51,102,51},{51,102,102},{51,102,153},{51,102,204},{51,102,255}, {51,153,0},{51,153,51},{51,153,102},{51,153,153},{51,153,204},{51,153,255}, {51,204,0},{51,204,51},{51,204,102},{51,204,153},{51,204,204},{51,204,255}, {51,255,0},{51,255,51},{51,255,102},{51,255,153},{51,255,204},{51,255,255}, {102,0,0},{102,0,51},{102,0,102},{102,0,153},{102,0,204},{102,0,255}, {102,51,0},{102,51,51},{102,51,102},{102,51,153},{102,51,204},{102,51,255}, {102,102,0},{102,102,51},{102,102,102},{102,102,153},{102,102,204},{102,102,255}, {102,153,0},{102,153,51},{102,153,102},{102,153,153},{102,153,204},{102,153,255}, {102,204,0},{102,204,51},{102,204,102},{102,204,153},{102,204,204},{102,204,255}, {102,255,0},{102,255,51},{102,255,102},{102,255,153},{102,255,204},{102,255,255}, {153,0,0},{153,0,51},{153,0,102},{153,0,153},{153,0,204},{153,0,255}, {153,51,0},{153,51,51},{153,51,102},{153,51,153},{153,51,204},{153,51,255}, {153,102,0},{153,102,51},{153,102,102},{153,102,153},{153,102,204},{153,102,255}, {153,153,0},{153,153,51},{153,153,102},{153,153,153},{153,153,204},{153,153,255}, {153,204,0},{153,204,51},{153,204,102},{153,204,153},{153,204,204},{153,204,255}, {153,255,0},{153,255,51},{153,255,102},{153,255,153},{153,255,204},{153,255,255}, {204,0,0},{204,0,51},{204,0,102},{204,0,153},{204,0,204},{204,0,255}, {204,51,0},{204,51,51},{204,51,102},{204,51,153},{204,51,204},{204,51,255}, {204,102,0},{204,102,51},{204,102,102},{204,102,153},{204,102,204},{204,102,255}, {204,153,0},{204,153,51},{204,153,102},{204,153,153},{204,153,204},{204,153,255}, {204,204,0},{204,204,51},{204,204,102},{204,204,153},{204,204,204},{204,204,255}, {204,255,0},{204,255,51},{204,255,102},{204,255,153},{204,255,204},{204,255,255}, {255,0,0},{255,0,51},{255,0,102},{255,0,153},{255,0,204},{255,0,255}, {255,51,0},{255,51,51},{255,51,102},{255,51,153},{255,51,204},{255,51,255}, {255,102,0},{255,102,51},{255,102,102},{255,102,153},{255,102,204},{255,102,255}, {255,153,0},{255,153,51},{255,153,102},{255,153,153},{255,153,204},{255,153,255}, {255,204,0},{255,204,51},{255,204,102},{255,204,153},{255,204,204},{255,204,255}, {255,255,0},{255,255,51},{255,255,102},{255,255,153},{255,255,204},{255,255,255} }; private final static int _colorsPerPage = 18; private final static int _maxPages = (COLORS_DATA.length/_colorsPerPage); /** * @param objectId - ObjectId * @param template - Template */ public L2CustomColorManagerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } /** * @param npcId NpcId * @param val ChatId * @return String path to html-file */ @Override public String getHtmlPath(int npcId, int val) { return HtmlPathService.getPath(HtmlPathService.ADDONS_CLR_MANAGER_PATH,npcId,val); } /** * @param red Red Color * @param green Green Color * @param blue Blue color * @return HEX Color */ protected String getHexColor(int red,int green,int blue) { String _red = Integer.toHexString(red); if (_red.length() == 1) _red = "0"+_red; String _green = Integer.toHexString(green); if (_green.length() == 1) _green = "0"+_green; String _blue = Integer.toHexString(blue); if (_blue.length() == 1) _blue = "0"+_blue; return (_red + _green + _blue); } /** * * @param player L2PcInstance * @param type int * @param val int */ protected void showColorsListPage(L2PcInstance player,int type ,int val) { NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); TextBuilder sb = new TextBuilder(); if (val <= 0 || val > _maxPages) return; String Command; String bypass; String Header; if (type == 1) { Command = "SetNameColor"; bypass = "NColorsList"; Header = "Name Color Change"; } else { Command = "SetTitleColor"; bypass = "TColorsList"; Header = "Title Color Change"; } sb.append("<html><body>" + getName() + " - " + Header + "<br1>"); sb.append("<table>\n"); int _start = _colorsPerPage*(val-1); int _end = _colorsPerPage*val-1; int objId = getObjectId(); for (int i=_start;i <= _end;i++) { int[] ColorData = COLORS_DATA[i]; String HexColor = getHexColor(ColorData[0],ColorData[1],ColorData[2]); sb.append("<tr><td><a action=\"bypass -h npc_" + objId + "_" + Command + " " + i + "\"><font color=\"" + HexColor + "\" >### COLOR ###</font></a></td></tr>\n"); } sb.append("</table>\n"); if (val == 1) { sb.append("<center><button value=\"NEXT >>\" action=\"bypass -h npc_" + objId + "_" + bypass + " " + (val+1) + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normal\" fore=\"L2UI_ch3.Btn1_normal\"></center>"); } else if (val == _maxPages) { sb.append("<center><button value=\"<< BACK\" action=\"bypass -h npc_" + objId + "_" + bypass + " " + (val-1) + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normal\" fore=\"L2UI_ch3.Btn1_normal\"></center>"); } else if ((val > 1) && (val < _maxPages)) { sb.append("<table><tr><td><button value=\"<< BACK\" action=\"bypass -h npc_" + objId + "_" + bypass + " " + (val-1) + "\" width=75 height=21 back=\"L2UI_ch3.Btn1_normal\" fore=\"L2UI_ch3.Btn1_normal\"></td><td><button value=\"NEXT >>\" action=\"bypass -h npc_"+objId+"_"+bypass+" "+ (val+1) +"\" width=75 height=21 back=\"L2UI_ch3.Btn1_normal\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>"); } sb.append("</body></html>"); html.setHtml(sb.toString()); player.sendPacket(html); } /** * @param player L2PcInstance * @param ColorId int * @param ChangeType int * @return boolean */ protected static boolean ChangeCharColor(L2PcInstance player, int ColorId, int ChangeType) { if (!_isColorManagerEnabled) { player.sendMessage("Not allowed by the server cofiguration"); return false; } int pLevel = player.getLevel(); if (pLevel < _minLevel) { player.sendMessage("Yor level is too low. Min level is " + _minLevel); return false; } if (ColorId < 0 || ColorId > COLORS_DATA.length) { player.sendMessage("Incorrect action."); return false; } if (ChangeType == 1 && player.getInventory().getAdena() < _priceForName || ChangeType == 2 && player.getInventory().getAdena() < _priceForTitle) { player.sendMessage("Incorrect Adena in you inventory. You do not have required Adena."); return false; } try { if (ChangeType == 1) { // Name color change if (!_allowNameChange) { player.sendMessage("Name color change is disabled."); return true; } player.getAppearance().setNameColor(COLORS_DATA[ColorId][0] , COLORS_DATA[ColorId][1], COLORS_DATA[ColorId][2]); player.reduceAdena("BuyNameColorChange", _priceForName, player.getLastFolkNPC(), true); player.broadcastUserInfo(); player.store(); } else if (ChangeType == 2) { // Title color change if (!_allowTitleChange) { player.sendMessage("Title color change is disabled."); return true; } player.getAppearance().setTitleColor(COLORS_DATA[ColorId][0] , COLORS_DATA[ColorId][1], COLORS_DATA[ColorId][2]); player.reduceAdena("BuyTitleColorChange", _priceForTitle, player.getLastFolkNPC(), true); player.broadcastUserInfo(); player.store(); } player.sendMessage("Enjoy your new color!"); return true; } catch (Exception e) { _log.warn("An exception from L2CustomColorManager",e); player.sendMessage("Incorrect action."); return false; } } /** * * @param player L2PcInstance * @param command String */ @Override public void onBypassFeedback(L2PcInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String actualCommand = st.nextToken(); if (actualCommand.equalsIgnoreCase("SetNameColor")) { if (st.countTokens() < 1) return; int ColorId = Integer.parseInt(st.nextToken()); ChangeCharColor(player,ColorId,1); } else if (actualCommand.equalsIgnoreCase("SetTitleColor")) { if (st.countTokens() < 1) return; int ColorId = Integer.parseInt(st.nextToken()); ChangeCharColor(player,ColorId,2); } else if (actualCommand.equalsIgnoreCase("NColorsList")) { if (st.countTokens() < 1) return; int val = Integer.parseInt(st.nextToken()); showColorsListPage(player,1,val); } else if (actualCommand.equalsIgnoreCase("TColorsList")) { if (st.countTokens() < 1) return; int val = Integer.parseInt(st.nextToken()); showColorsListPage(player,2,val); } } }
  8. gvb

    Rt

    Какая версия РТ?
  9. Есть ПВ дп скилов? А то это походу брак
  10. gvb

    Noblessrb Квест

    Всеровно выдает (failed to import quest : noblessrb)
  11. Дальность магов и лукарей одинаковая, как урезать дальность магов? Чутка позже скину скрины дальности магов Сборка PW
  12. gvb

    Noblessrb Квест

    Этот скрипт не инит файл, он находиться в АИ файл noblessrb назыв
  13. gvb

    Script Pw

    Спс помог лови + Тема закрыта
  14. gvb

    Script Pw

    Добавил
  15. gvb

    Script Pw

    У меня лежат они в jscript, вы знаете решение? Можете дать контактные данные?
  16. gvb

    Script Pw

    Ты понимаешь что я не глуп и раз 5 путь проверил к файлу он есть! Решение бы проблеммы найти
  17. gvb

    Script Pw

    Есть скайп?
  18. gvb

    Script Pw

    GameServer: Loading Server Scripts Failed executing script: E:\PW\server\gameserver\data\scripts\custom\q8019_SetHe ro\__init__.py. See __init__.py.error.log for details. GameServer: Compiled Scripts Cache is disabled.
  19. gvb

    Script Pw

    GameServer: Loading Server Scripts Failed loading: (E:\PW\server\gameserver\data\scripts\custom\q8019_SetHero\__ini t__.py) @ scripts.cfg:14 - Reason: doesnt exists or is not a file. GameServer: Compiled Scripts Cache is disabled. Любой загружающийся скрипт выдает ошибку, в чем может быть проблемма? ----------------------------------------------------------------------------------------------------------------- Вот еррор Error on: E:\PW\server\gameserver\data\scripts\custom\q8019_SetHero\__init__.py.error.log Line: -1 - Column: -1 No engine registered for extension (py)
  20. gvb

    Script Pw

    GameServer: Loading Server Scripts Failed loading: (E:\PW\server\gameserver\data\scripts\custom\q8019_SetHero\__ini t__.py) @ scripts.cfg:14 - Reason: doesnt exists or is not a file. GameServer: Compiled Scripts Cache is disabled. Любой загружающийся скрипт выдает ошибку, в чем может быть проблемма?
  21. gvb

    Noblessrb Квест

    failed to import quest : noblessrb Я проверил пути импорты в порядке вот код сборка PW Кто шарит в чем проблемма, помогите! import sys from java.util.concurrent import TimeUnit from net.sf.l2j.gameserver import GeoData from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest from java.lang import System qn = "noblessrb" #респаун в минутах RESPAWN = TimeUnit.MINUTES.toMillis(60) class noblessrb (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def spawnMe(self): self.addSpawn(25325,90819,-85871,GeoData.getInstance().getSpawnHeight(90819, -85871, -2735, -2735),30000,False,0) self.saveGlobalQuestVar("status", "1") self.deleteGlobalQuestVar("respawn") return def init_LoadGlobalData(self): status = self.loadGlobalQuestVar("status") if status == "0": temp = long(self.loadGlobalQuestVar("respawn")) - System.currentTimeMillis() if temp > 0 : self.startQuestTimer("resp", temp, None, None) return self.spawnMe() return def onAdvEvent (self,event,npc,player): if event == "resp": self.spawnMe() self.cancelQuestTimer("resp",None,None) return def onKill(self,npc,player,isPet): self.saveGlobalQuestVar("status", "0") self.saveGlobalQuestVar("respawn", str(System.currentTimeMillis() + RESPAWN)) self.startQuestTimer("resp", RESPAWN, None, None) return QUEST = noblessrb(-1, qn, "ai") QUEST.addKillId(25325)
  22. У нас не было квеста на демон оружия! Это ты ошибаешься на какой сборке стоит твой серв?
×
×
  • Создать...