跳转到帖子
Facebook Instagram Twitter Youtube

搜索论坛

显示结果为标签'l2j'。

  • 用标签来搜索

    用逗号分隔标签类型
  • 用作者来搜索

内容类型


论坛

  • L2Fater开源专区
    • L2Fater Team
    • 血玫瑰天堂II-HighFive-怀旧服务器
  • 服务端专区
    • L2JSERVER
    • L2JMOBIUS
    • L2JORG
    • L2JSUNRISE
    • L2SCRIPTS
    • 其它开源
    • 服务端开发工具及教程
  • 客户端专区
    • 客户端
    • 登录器
    • 开发工具
    • 各类补丁
  • Scripts专区
    • Scripts专区
  • 问题求助区
    • 问题求助区
  • 站务处理区
    • 社区公告
    • 资源中心
  • 老站数据存档
    • 【老站】服务端专区
    • 【老站】客户端专区
    • 【老站】脚本扩展专区

博客

没有结果。

类别

  • 服务端资源
  • 开发工具
  • 客户端资源

查找结果在…

查找包含的结果…


创建日期

  • 开始

    结束


最后更新

  • 开始

    结束


按数量过滤…

注册日期

  • 开始

    结束


用户组


我的资料

找到10个结果

  1. 发表于 2015-3-24 09:24:09 | 只看该作者 http://l2fater.cn/static/image/common/arw_r.gif 今天爬文的时候、才发现o大早已发布了这个教程、只是我们没发现而已!!! 看来还是要多多爬文、多多动手、多多学习!!!{:1_103:} 转自:l2jtw 原作者:otfnir 原文地址:http://www.l2jtw.com/l2jtwbbs/viewtopic.php?f=39&t=10240 腳本編寫 腳本應該放在那裡?: 這個有規定的 (其實可以亂放的 但不建意) 在 gameserver\data\scripts\custom 開一個資料夾 名字任你改 以先前寫的轉生腳本為例 (參考 http://www.l2jtw.com/l2jtwbbs/viewtopic.php?f=82&t=10234 ) 檔案都放在 gameserver\data\scripts\custom\Rebirth 資料夾裡 主要腳本檔: 這個也是沒有規定的 你喜歡用那個名也行 不過要注意副檔名 py --- jython 的腳本 (目前大部份腳本使用) java -- java 的腳本 js -- javascript 腳本 (暫時沒發現) bsh -- BeanShell 腳本 (暫時沒發現) 你可以用你喜歡的腳本語言來寫 腳本格式: 以 jpython 為例 <font color="deepskyblue">import sys from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.model.quest import QuestState from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest </font> 复制代码 參考 L2J 任務說明文件 gameserver\data\scripts\quests\documentation.txt (英文的) 這幾行是一般任務會用到的 作用是把 java 的幾個 class (中文好像稱"類") 引入 要用到那個 class 便引入那個 <font color="deepskyblue">qID = -1 #任務 ID qn = "Rebirth" #任務名 qDesc = "custom" #任務簡介/通常用於搜尋 htm 的資料夾位置 /gameserver/data/script/*****/*.htm </font> 复制代码 然後定義 3 個變數 (其實次序沒關係 不過我習慣把會改動的變數 集中在前面 當是設定檔般修改) 這三個變數 是對應到程式最尾 註冊任務時會用到 <font color="deepskyblue">QUEST = Rebirth(qID, qn, qDesc) </font> 复制代码 qID 是任務的 ID, 在遊戲中 "重新載入任務" 時會用到 qn 是任務的名稱, 跟 NPC 對話時的 HTM 會用到 "重新載入任務" 時也會用到 qDesc 是任務簡介 或用作尋找 HTM 檔時的其中一個路徑 <font color="deepskyblue">NPCID = [65535] #觸發的 NPC ID, 可多個 NPC [65535, 88888, 99999] </font> 复制代码 NPCID 是觸發這個任務的 NPC ID 剛才我們不是自訂了一個 65535 的 NPC.. <font color="deepskyblue">class Rebirth(JQuest): def __init__(self, id, name, descr): JQuest.__init__(self, id, name, descr) </font> 复制代码 定義一個 class 用來 extends (延伸) com.l2jserver.gameserver.model.quest.jython.QuestJython 這個 class 及初始化 <font color="deepskyblue"> def onFirstTalk(self, npc, player): return "onFirstTalk.htm" </font> 复制代码 onFirstTalk 是直接點 NPC 的第一次對話 這裡為了簡單講解 所以只是回傳一個 HTM 檔的內容 或者你可以直接回傳 HTM 的內文 像這樣寫 <font color="deepskyblue"> def onFirstTalk(self, npc, player): return "<html><body>你好</body></html>" </font> 复制代码 ......... <font color="deepskyblue">QUEST = Rebirth(qID, qn, qDesc) for id in NPCID: QUEST.addStartNpc(id) QUEST.addFirstTalkId(id) QUEST.addTalkId(id) </font> 复制代码 addStartNpc 註冊那個 NPC, 點了自動申請任務. 註:每個 NPC 只可註冊一個任務作為自動申請 addFirstTalkId 註冊那個 NPC, 點了會跳到 onFirstTalk addTalkId 註冊那個 NPC, 會回應 onTalk. 另外 onFirstTalk 的 bypass Quest 也需要註冊這個 整個看起來便是這樣 <font color="deepskyblue">import sys from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.model.quest import QuestState from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest qID = -1 #任務 ID qn = "Rebirth" #任務名 qDesc = "custom" #任務簡介/通常用於搜尋 htm 的資料夾位置 /gameserver/data/script/*****/*.htm NPCID = [65535] #觸發的 NPC template ID, 可多個 NPC [65535, 88888, 99999] class Rebirth(JQuest): def __init__(self, id, name, descr): JQuest.__init__(self, id, name, descr) def onFirstTalk(self, npc, player): return "<html><body>你好</body></html>" QUEST = Rebirth(qID, qn, qDesc) for id in NPCID: QUEST.addStartNpc(id) QUEST.addFirstTalkId(id) QUEST.addTalkId(id) </font> 复制代码 很簡單吧 當然這個腳本 只會說一句 "你好" 沒其他功能 留待以後再慢慢詳細解說 腳本測試及除錯 註冊自訂腳本: 自訂腳本寫好後 要在 gameserver\data\scripts.cfg 裡註冊 所謂註冊 其實只是在檔案裡 加入腳本的路徑檔案 以轉生腳本為例 加入一句便註冊了 <font color="deepskyblue">custom/Rebirth/__init__.py </font> 复制代码 召喚 "自訂 NPC" 及測試: 在遊戲內用管理員指令 輸入 //admin 出現畫面 http://img824.imageshack.us/img824/4864/34855645.jpg 輸入 "自訂 NPC" 的 ID 然後按 召喚 點看看 會說 "你好" 便成功了 除錯: 當出現錯誤時 通常會有錯誤訊息 這裡有個很重要的資訊 它會記錄你錯誤的行號.. http://img51.imageshack.us/img51/6826/74709202.jpg 重新載入腳本: 你可以在遊戲運行中 重載腳本 打腳本的名稱 或 ID 例如要重載轉生腳本 可以打 <font color="deepskyblue">//quest_reload Rebirth</font> 复制代码 可以不停修改腳本 及重載 方便測試 但如果修改腳本後 重載時出現錯誤 你會發現 即使修正了問題 還是不能重載 那麼 可以用另一個指令 //script_load 路徑 例如要載入轉生腳本 便是 <font color="deepskyblue">//script_load custom/Rebirth/__init__.py</font> 复制代码 這個方法也可以在 GS 初始化時 腳本已經出錯的時候用 很方便吧 :)
  2. 发表于 2015-3-24 15:29:42 | 只看该作者 http://l2fater.cn/static/image/common/arw_r.gif l2jtw脚本的使用方法 放到gameserver\data\scripts\custom文件夹内 然后在gameserver\data\scripts.cfg里面添加相应的链接 比如我要使用这个 【l2jtw】装备兵器譜 (歡迎參考, 抄襲, 修改, 轉發, 除錯, 使用) (出处: 血玫瑰社区) 那么下载下来之后 在gameserver\data\scripts.cfg里添加一行 custom/Rank/Rank.py 即在每次服务端启动的时候、读取了这个Rank脚本 如果不想用的时候、就 #custom/Rank/Rank.py 加个#即可
  3. ### Eclipse Workspace Patch 1.0 #P L2jFrozen_GameServer Index: head-src/com/l2jfrozen/Config.java =================================================================== --- head-src/com/l2jfrozen/Config.java (revision 986) +++ head-src/com/l2jfrozen/Config.java (working copy) @@ -2891,6 +2891,8 @@ public static int GM_OVER_ENCHANT; public static int MAX_ITEM_ENCHANT_KICK; + public static boolean ENABLE_ENCHANT_ANNOUNCE; + public static int ENCHANT_ANNOUNCE_LEVEL; //============================================================ public static void loadEnchantConfig() @@ -3196,6 +3198,8 @@ MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0")); GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0")); + ENABLE_ENCHANT_ANNOUNCE = Boolean.parseBoolean(ENCHANTSetting.getProperty("EnableEnchantAnnounce", "False")); + ENCHANT_ANNOUNCE_LEVEL = Integer.parseInt(ENCHANTSetting.getProperty("EnchantAnnounceLevel", "16")); } catch(Exception e) { Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 986) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy) @@ -25,6 +25,7 @@ import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.base.Race; +import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.EnchantResult; import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate; @@ -301,6 +302,7 @@ int chance = 0; int maxEnchantLevel = 0; int minEnchantLevel = 0; + int nextEnchantLevel = item.getEnchantLevel() + 1; if(item.getItem().getType2() == L2Item.TYPE2_WEAPON) { @@ -565,6 +567,9 @@ sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); sm.addItemName(item.getItemId()); activeChar.sendPacket(sm); + + if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0) + Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel); } else { @@ -572,6 +577,9 @@ sm.addNumber(item.getEnchantLevel()); sm.addItemName(item.getItemId()); activeChar.sendPacket(sm); + + if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel()) + Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel); } item.setEnchantLevel(item.getEnchantLevel() + Config.CUSTOM_ENCHANT_VALUE); Index: config/head/enchant.properties =================================================================== --- config/head/enchant.properties (revision 986) +++ config/head/enchant.properties (working copy) @@ -131,4 +131,14 @@ # HOW WORKS: if you set it to 20, and player have an item > 20 # he will be kicked and the item will disappear! # Enchant amount at which a player gets punished (0 disabled) -EnchantKick = 0 \ No newline at end of file +EnchantKick = 0 + +# ---------------------- +# Enchant Announce - +# ---------------------- +# Announce when a player successfully enchant an item to x +# Default: False +EnableEnchantAnnounce = False + +# The value of x is... set it here (No have default value) +EnchantAnnounceLevel = 16 玩家在强化的时候,强化成功将发公告
  4. 一般想在游戏内加载图片,都是在UTX里面加载, 这个可以添加在l2jserver的开源内,在服务端内即可加载图片!~ 效果图如下,资源搜集与互联网,不同版本需手动校正!~ 附件失效,谷歌搜索此图片
  5. 发表于 2014-3-28 22:43:52 转自l2jtw 原文如下 原作者:enping
  6. 转自l2jtw 原文如下变性脚本再用 python 改寫而成的 已測試過 原作者:otfnir 下载地址:百度网盘(2017-10-14更新下载链接) http://pan.baidu.com/s/1nuM2fyD
  7. 发表于 2014-4-1 13:58:46 转自y7y7s 原文如下 原作者:排骨米饭~ package custom.SayHello; //作者 排骨米饭~ //import com.l2jserver.gameserver.Announcements; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest; public final class SayHello extends Quest { public SayHello(int id, String name, String descr) { super(id, name, descr); setOnEnterWorld(true); } private static final String qn = "SayHello"; @Override public String onEnterWorld(L2PcInstance player) { player.addSkill(SkillTable.getInstance().getInfo(2213, 10),false); player.sendSkillList(); return ""; } public static void main(String[] args) { new SayHello(-1, qn, "custom"); } } 保存为SayHello.java存放到 game\data\scripts\custom\SayHello 记得记得在scripts.cfg里加入
  8. /* * 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 custom.RenameNPC; import com.l2jse.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jse.gameserver.datatables.CharNameTable; import com.l2jse.gameserver.datatables.ItemTable; import com.l2jse.gameserver.instancemanager.QuestManager; import com.l2jse.gameserver.model.L2World; import com.l2jse.gameserver.model.actor.L2Npc; import com.l2jse.gameserver.model.actor.instance.L2PcInstance; import com.l2jse.gameserver.model.quest.Quest; import com.l2jse.gameserver.model.quest.QuestState; import com.l2jse.gameserver.network.serverpackets.PartySmallWindowAll; import com.l2jse.gameserver.network.serverpackets.PartySmallWindowDeleteAll; import com.l2jse.gameserver.util.Util; /** * @author L0ngh0rn * @since 2009-10-25 */ public class RenameNPC extends Quest { private final static int NPC = 50024; private final static String RENAME_NPC_FEE = "57,2500000;5575,250000"; private final static int RENAME_NPC_MIN_LEVEL = 40; public RenameNPC(int questId, String name, String descr) { super(questId, name, descr); addFirstTalkId(NPC); addStartNpc(NPC); addTalkId(NPC); } @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmltext = "New Name:<br1><edit var="newname" width=70 height=10>"; String eventSplit[] = event.split(" "); QuestState st = player.getQuestState(getName()); if (eventSplit[0].equalsIgnoreCase("rename")) { st.getPlayer().setTarget(st.getPlayer()); if (eventSplit.length != 2) htmltext = "Enter a new name or remove the space between the names."; else if (st.getPlayer().getLevel() < RENAME_NPC_MIN_LEVEL) htmltext = "Minimum Level is: " + String.valueOf(RENAME_NPC_MIN_LEVEL); else if (validItemFee(st)) htmltext = "You do not have enough items for exchange."; else if (eventSplit[1].length() < 1 || eventSplit[1].length() > 16) htmltext = "Maximum number of characters: 16"; else if (!Util.isAlphaNumeric(eventSplit[1])) htmltext = "The name must only contain alpha-numeric characters."; else if (CharNameTable.getInstance().doesCharNameExist(eventSplit[1])) htmltext = "The name chosen is already in use. Choose another name."; else { try { L2World.getInstance().removeFromAllPlayers(player); player.setName(eventSplit[1]); player.store(); L2World.getInstance().addToAllPlayers(player); htmltext = "Its name was changed successfully."; player.broadcastUserInfo(); String itemFeeSplit[] = RENAME_NPC_FEE.split("\\;"); for (int i = 0; i < itemFeeSplit.length; i++) { String item[] = itemFeeSplit[i].split("\\,"); st.takeItems(Integer.parseInt(item[0]), Integer.parseInt(item[1])); } if (player.isInParty()) { player.getParty().broadcastToPartyMembers(player, new PartySmallWindowDeleteAll()); for (L2PcInstance member : player.getParty().getPartyMembers()) { if (member != player) member.sendPacket(new PartySmallWindowAll(member, player.getParty())); } } if (player.getClan() != null) player.getClan().broadcastClanStatus(); RegionBBSManager.getInstance().changeCommunityBoard(); } catch (StringIndexOutOfBoundsException e) { htmltext = "Service unavailable!"; } } return (page(htmltext, 1)); } return (page(htmltext, 0)); } @Override public String onFirstTalk(L2Npc npc, L2PcInstance player) { String htmltext = ""; QuestState st = player.getQuestState(getName()); if (st == null) { Quest q = QuestManager.getInstance().getQuest(getName()); st = q.newQuestState(player); } htmltext = page("New Name:<br1><edit var="newname" width=70 height=10>", 0); return htmltext; } public String page(String msg, int t) { String htmltext = ""; htmltext += htmlPage("Title"); htmltext += "Hello I'm here to help you change your name.<br>" + "Enter your new name, but make sure you have items for exchange:<br1>"; String itemFeeSplit[] = RENAME_NPC_FEE.split("\\;"); for (int i = 0; i < itemFeeSplit.length; i++) { String item[] = itemFeeSplit[i].split("\\,"); htmltext += "<font color="LEVEL">" + item[1] + " " + ItemTable.getInstance().getTemplate(Integer.parseInt(item[0])).getName() + "</font><br1>"; } if (t == 0) { htmltext += "<br><font color="339966">" + msg + "</font>"; htmltext += "<br><center>" + button("Renomear", "rename $newname", 70, 23) + "</center>"; } else { htmltext += "<br><font color="FF0000">" + msg + "</font>"; htmltext += "<br><center>" + button("Back", "begin", 70, 23) + "</center>"; } htmltext += htmlPage("Footer"); return htmltext; } public Boolean validItemFee(QuestState st) { String itemFeeSplit[] = RENAME_NPC_FEE.split("\\;"); for (int i = 0; i < itemFeeSplit.length; i++) { String item[] = itemFeeSplit[i].split("\\,"); if (st.getQuestItemsCount(Integer.parseInt(item[0])) < Integer.parseInt(item[1])) return true; } return false; } public String htmlPage(String op) { String texto = ""; if (op == "Title") { texto += "<html><body><title>Rename Manager</title><center><br>" + "<b><font color=ffcc00>Rename Manager Information</font></b>" + "<br><img src="L2UI_CH3.herotower_deco" width="256" height="32"><br></center>"; } else if (op == "Footer") { texto += "<br><center><img src="L2UI_CH3.herotower_deco" width="256" height="32"><br>" + "<br><font color="303030">---</font></center></body></html>"; } else { texto = "Not Found!"; } return texto; } public String button(String name, String event, int w, int h) { return "<button value="" + name + "" action="bypass -h Quest RenameNPC " + event + "" " + "width="" + Integer.toString(w) + "" height="" + Integer.toString(h) + "" " + "back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">"; } public String link(String name, String event, String color) { return "<a action="bypass -h Quest RenameNPC " + event + "">" + "<font color="" + color + "">" + name + "</font></a>"; } public static void main(String[] args) { new RenameNPC(-1, "RenameNPC", "custom"); } } 这是从l2jse的端里找出来的玩家改名脚本 如果大家想用,需要手动修改一些地方!! 感兴趣的拿走!~
  9. package seidhe.NewbieManager; import ru.catssoftware.gameserver.model.quest.Quest; import ru.catssoftware.gameserver.model.quest.QuestState; import ru.catssoftware.L2DatabaseFactory; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.actor.instance.L2NpcInstance; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; /** * @ author : Seidhe * @ date 05.09.2015 * NewbieManager for lucera. */ public class NewbieManager extends Quest { private static String qn = "NewbieManager"; private static int NEWBIE_Wings = 4037; // ID Крыльев private static int NEWBIE_Helm = 57; // ID Шлема private static int NEWBIE_Tattoo = 4037; // ID Тату private static int NPC_ID = 50030; // ID NPC public NewbieManager() { super(-1,qn,"custom"); } @Override public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player) { String []args = event.split(" "); if(args[0].startsWith("add_bonus")) { Connection con = null; ResultSet rset = null; try { con = L2DatabaseFactory.getInstance().getConnection(con); PreparedStatement statement = con.prepareStatement("SELECT isNewbie FROM `_newbie` WHERE charId=?"); statement.setInt(1,player.getObjectId()); rset = statement.executeQuery(); int isN=0; while(rset.next()) { isN= rset.getInt("isNewbie"); } if(isN==1){ statement = con.prepareStatement("REPLACE INTO _newbie VALUES(?,?)"); statement.setInt(1, player.getObjectId()); statement.setInt(2, 0); player.getInventory().addItem("Newbie_Bonus", NEWBIE_Wings, 1, player, player); player.getInventory().addItem("Newbie_Bonus", NEWBIE_Helm, 1, player, player); player.getInventory().addItem("Newbie_Bonus", NEWBIE_Tattoo, 1, player, player); statement.executeQuery(); player.sendMessage("Желаю удачи, новичёк!"); statement.close(); } else if (isN==0) { player.sendMessage("Вы уже получили награду"); return "hello.htm"; } } catch (Exception e) { e.printStackTrace(); } } return "hello.htm"; } @Override public String onFirstTalk(L2NpcInstance npc, L2PcInstance player) { return onTalk(npc, player); } @Override public String onTalk(L2NpcInstance npc, L2PcInstance player) { QuestState qs = player.getQuestState(qn); if(qs==null) qs = newQuestState(player); return "hello.htm"; } public static void main(String[] args) { NewbieManager ps = new NewbieManager(); ps.addFirstTalkId(NPC_ID); ps.addStartNpc(NPC_ID); ps.addTalkId(NPC_ID); _log.info("========================================"); _log.info("=== Newbie Manager by Seidhe LOADING ==="); _log.info("========================================"); } }
  10. 发表于 2019-2-22 18:57:00 from com.l2jserver.gameserver.instancemanager import RaidBossSpawnManager if event == "RESETBOSS": bosses = RaidBossSpawnManager.getInstance().getBosses() for boss in bosses : bosses[boss].setCurrentHp(bosses[boss].getMaxHp()) 复制代码 简介: 部分l2j服务端在boss出生的时候(包含自定义召唤的boss)会出现半血或者三分之一血量 在脚本里面找到 RaidBossSpawnManager.java 添加如上代码!

天堂2中文开源社区L2FATER.CN

专注于玩家游戏体验的交流社区.

血玫瑰社区bbs.l2fater.cn

关于血玫瑰社区

Important Links

×
×
  • 创建新的...