Williams

Members
  • Content Count

    48
  • Joined

  • Last visited

  • Feedback

    N/A

Community Reputation

6 Neutral

About Williams

  • Rank
    Vassal

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello what can I improve my script? https://pastebin.com/raw/FXFZVPaF
  2. Hello I already did everything and can not solve what I did wrong? Code : private void showRaidBossDrop(Player player, int bossId, int pageId) { final NpcTemplate npc = NpcData.getInstance().getTemplate(bossId); if (npc == null) return; final List<DropCategory> list = new ArrayList<>(); npc.getDropData().forEach(c -> list.add(c)); Collections.reverse(list); final int limit = Config.RAID_BOSS_DROP_PAGE_LIMIT; final int max = list.size() / limit + (list.size() % limit == 0 ? 0 : 1); list.subList((pageId - 1) * limit, Math.min(pageId * limit, list.size())); final StringBuilder sb = new StringBuilder(); for (DropCategory cat : list) { for (DropData drop : cat.getAllDrops()) { sb.append("<html>"); sb.append("<center>"); sb.append("<body>"); sb.append("<table width=\"256\">"); sb.append("<tr><td width=\"256\" align=\"center\">%name%</td></tr>"); sb.append("</table>"); sb.append("<br>"); sb.append("<table width=\"256\">"); sb.append("<tr><td width=\"256\" align=\"left\">" + _messages[1][Rnd.get(_messages.length)].replace("%boss%", npc.getName()) + "</td></tr>"); sb.append("</table>"); sb.append("<br>"); sb.append("<table width=\"224\" bgcolor=\"000000\">"); sb.append("<tr><td width=\"224\" align=\"center\">Raid Boss Drops</td></tr>"); sb.append("</table>"); sb.append("<br>"); final Item item = ItemTable.getInstance().getTemplate(drop.getItemId()); String name = item.getName(); if (name.length() >= 43) name = name.substring(0, 40) + "..."; sb.append("<table width=280 bgcolor=000000><tr>"); sb.append("<td width=44 height=41 align=center><table bgcolor=FFFFFF cellpadding=6 cellspacing=\"-5\"><tr><td><button width=32 height=32 back=" + item.getIcon() + " fore=" + item.getIcon() + "></td></tr></table></td>"); sb.append("<td width=236>" + name + "</td>"); sb.append("</tr></table><img src=L2UI.SquareGray width=280 height=1>"); sb.append("<br>"); sb.append("<table width=\"64\" cellspacing=\"2\">"); sb.append("<tr>"); for (int x = 0; x < max; x++) { final int pageNr = x + 1; if (pageId == pageNr) sb.append("<td align=\"center\">" + pageNr + "</td>"); else sb.append("<td align=\"center\"><a action=\"bypass -h npc_%objectId%_RaidBossDrop " + bossId + " " + pageNr + "\">" + pageNr + "</a></td>"); } sb.append("</tr>"); sb.append("</table>"); sb.append("<br>"); sb.append("<table width=\"160\" cellspacing=\"2\">"); sb.append("<tr>"); sb.append("<td width=\"160\" align=\"center\"><a action=\"bypass -h npc_%objectId%_RaidBossInfo " + _lastPage.get(player.getObjectId()) + "\">Return</a></td>"); sb.append("</tr>"); sb.append("</table>"); sb.append("<br>"); sb.append("<table width=\"256\">"); sb.append("<tr><td width=\"256\" align=\"center\">L2EUA</td></tr>"); sb.append("</table>"); sb.append("</center>"); sb.append("</body>"); sb.append("</html>"); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setHtml(sb.toString()); html.replace("%name%", getName()); html.replace("%objectId%", getObjectId()); player.sendPacket(html); } } }
  3. hello would you like help with this for (ItemTemplateHolder holder : template.getItems()) html.replace("%items%", ItemTable.getInstance().getTemplate(holder.getId()).getIcon()); I want that whenever I add items in the class xml generate the icon of the item in an html
  4. Main topic updated with corrections and restrictions.
  5. I come to share something I did for my server. improvements please can comment, please remove the part of Event code : https://pastebin.com/raw/Xa9dU7zd
  6. topic updated with version 2 at a glance now written in xml
  7. Good night, I come to share a code that I made for my project, I will give a simple tutorial how to use the music part of it. Code: https://pastebin.com/raw/ezfEX1kJ Well I made the code simple and very easy to edit, you only need to edit in one place to add messages, music, PVP amount !! The format is PVP, Message and Music quantity. PVP amount = 2 Generated Message = Double Kill Music = "" here the music. DOUBLE_KILL (2, "Double Kill", "YOUR MUSIC"), The song is on you, I hope you like it and don't forget to like it. here is version 2 in xml and totally redone by Tryskell's tips thanks to @StinkyMadness for the idea of creating in xml Version 2 : https://pastebin.com/raw/5cwXuTTc Credits for the idea @Kara` Unfinished credits @Williams ATTENTION : I'm sorry for some BR messages
  8. did not work if (schemeSkills.contains(skillId)) StringUtil.append(sb, (skillId == 4699 || skillId == 4700 ? "icon.skill1331" : skillId == 4702 || skillId == 4703 ? "icon.skill1332" : skillId < 100 ? "icon.skill00" + skillId : skillId < 1000 ? "icon.skill0" + skillId : "icon.skill" + skillId));
  9. ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/model/L2Skill.java =================================================================== --- java/net/sf/l2j/gameserver/model/L2Skill.java (revision 2) +++ java/net/sf/l2j/gameserver/model/L2Skill.java (working copy) @@ -113,6 +113,7 @@ private final int _level; private final String _name; + private final String _icon; private final SkillOpType _operateType; private final boolean _magic; @@ -248,6 +250,7 @@ _level = set.getInteger("level"); _name = set.getString("name"); + _icon = set.getString("icon", "icon.noimage"); _operateType = set.getEnum("operateType", SkillOpType.class); _magic = set.getBool("isMagic", false); @@ -842,7 +846,15 @@ { return _name; } - + + /** + * @return Returns the icon. + */ + public String getIcon() + { + return _icon; + } + /** * @return Returns the reuseDelay. */ ### Eclipse Workspace Patch 1.0 #P aCis_datapack Index: data/xml/skills/4700-4799.xml =================================================================== --- data/xml/skills/4700-4799.xml (revision 2) +++ data/xml/skills/4700-4799.xml (working copy) @@ -5,9 +5,9 @@ <table name="#mpConsume"> 122 157 194 202 207 212 215 220 224 229 233 237 242 </table> <table name="#pAtk"> 1.06 1.08 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 </table> <table name="#accCombat"> 2 2 3 3 3 3 3 3 3 3 3 3 3 </table> <table name="#time"> 120 120 120 150 165 180 195 210 225 240 255 270 285 </table> <table name="#power"> 541 611 659 666 669 673 676 679 681 684 687 689 692 </table> <table name="#stackOrder"> 1 2 3 3 3 3 3 3 3 3 3 3 3 </table> + <set name="icon" val="icon.skill1331" /> <set name="mpConsume" val="#mpConsume" /> <set name="target" val="TARGET_PARTY" /> <set name="skillRadius" val="1000" /> @@ -48,9 +48,9 @@ <table name="#magicLvl"> 57 66 75 77 78 79 80 81 82 83 84 85 86 </table> <table name="#mpConsume"> 122 157 194 202 207 212 215 220 224 229 233 237 242 </table> <table name="#regMp"> 1.3 1.32 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 </table> <table name="#time"> 120 120 120 150 165 180 195 210 225 240 255 270 285 </table> <table name="#power"> 541 611 659 666 669 673 676 679 681 684 687 689 692 </table> <table name="#stackOrder"> 1 2 3 3 3 3 3 3 3 3 3 3 3 </table> + <set name="icon" val="icon.skill1332" /> <set name="mpConsume" val="#mpConsume" /> <set name="target" val="TARGET_PARTY" /> <set name="skillRadius" val="1000" /> @@ -71,9 +71,9 @@ <table name="#magicLvl"> 57 66 75 77 78 79 80 81 82 83 84 85 86 </table> <table name="#mpConsume"> 122 157 194 202 207 212 215 220 224 229 233 237 242 </table> <table name="#mReuse"> 0.7 0.68 0.65 0.65 0.65 0.65 0.65 0.65 0.65 0.65 0.65 0.65 0.65 </table> <table name="#time"> 120 120 120 150 165 180 195 210 225 240 255 270 285 </table> <table name="#power"> 541 611 659 666 669 673 676 679 681 684 687 689 692 </table> <table name="#stackOrder"> 1 2 3 3 3 3 3 3 3 3 3 3 3 </table> + <set name="icon" val="icon.skill1332" /> <set name="mpConsume" val="#mpConsume" /> <set name="target" val="TARGET_PARTY" /> <set name="skillRadius" val="1000" /> Index: data/xml/skills/4600-4699.xml =================================================================== --- data/xml/skills/4600-4699.xml (revision 2) +++ data/xml/skills/4600-4699.xml (working copy) @@ -1776,8 +1776,8 @@ <table name="#magicLvl"> 57 66 75 77 78 79 80 81 82 83 84 85 86 </table> <table name="#rCrit"> 0.25 0.27 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 </table> <table name="#cAtk"> 1.2 1.22 1.25 1.25 1.25 1.25 1.25 1.25 1.25 1.25 1.25 1.25 1.25 </table> <table name="#time"> 120 120 120 150 165 180 195 210 225 240 255 270 285 </table> <table name="#stackOrder"> 1 2 3 3 3 3 3 3 3 3 3 3 3 </table> + <set name="icon" val="icon.skill1331" /> <set name="magicLvl" val="#magicLvl" /> <set name="target" val="TARGET_PARTY" /> <set name="skillType" val="BUFF" /> I'll see if this works
  10. Well I adding the buffs in my buff for aCis, I came across this, where do I fix this? I believe that here generates the icons if (skillId < 100) { if (schemeSkills.contains(skillId)) StringUtil.append(sb, "<td height=40 width=40><img src=\"icon.skill00", skillId, "\" width=32 height=32></td><td width=190>", SkillTable.getInstance().getInfo(skillId, 1).getName(), "<br1><font color=\"B09878\">", BufferManager.getInstance().getAvailableBuff(skillId).getDescription(), "</font></td><td><button action=\"bypass npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", skillId, " ", page, "\" width=32 height=32 back=\"L2UI_CH3.mapbutton_zoomout2\" fore=\"L2UI_CH3.mapbutton_zoomout1\"></td>"); else StringUtil.append(sb, "<td height=40 width=40><img src=\"icon.skill00", skillId, "\" width=32 height=32></td><td width=190>", SkillTable.getInstance().getInfo(skillId, 1).getName(), "<br1><font color=\"B09878\">", BufferManager.getInstance().getAvailableBuff(skillId).getDescription(), "</font></td><td><button action=\"bypass npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, " ", page, "\" width=32 height=32 back=\"L2UI_CH3.mapbutton_zoomin2\" fore=\"L2UI_CH3.mapbutton_zoomin1\"></td>"); } else if (skillId < 1000) { if (schemeSkills.contains(skillId)) StringUtil.append(sb, "<td height=40 width=40><img src=\"icon.skill0", skillId, "\" width=32 height=32></td><td width=190>", SkillTable.getInstance().getInfo(skillId, 1).getName(), "<br1><font color=\"B09878\">", BufferManager.getInstance().getAvailableBuff(skillId).getDescription(), "</font></td><td><button action=\"bypass npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", skillId, " ", page, "\" width=32 height=32 back=\"L2UI_CH3.mapbutton_zoomout2\" fore=\"L2UI_CH3.mapbutton_zoomout1\"></td>"); else StringUtil.append(sb, "<td height=40 width=40><img src=\"icon.skill0", skillId, "\" width=32 height=32></td><td width=190>", SkillTable.getInstance().getInfo(skillId, 1).getName(), "<br1><font color=\"B09878\">", BufferManager.getInstance().getAvailableBuff(skillId).getDescription(), "</font></td><td><button action=\"bypass npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, " ", page, "\" width=32 height=32 back=\"L2UI_CH3.mapbutton_zoomin2\" fore=\"L2UI_CH3.mapbutton_zoomin1\"></td>"); } else { if (schemeSkills.contains(skillId)) StringUtil.append(sb, "<td height=40 width=40><img src=\"icon.skill", skillId, "\" width=32 height=32></td><td width=190>", SkillTable.getInstance().getInfo(skillId, 1).getName(), "<br1><font color=\"B09878\">", BufferManager.getInstance().getAvailableBuff(skillId).getDescription(), "</font></td><td><button action=\"bypass npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", skillId, " ", page, "\" width=32 height=32 back=\"L2UI_CH3.mapbutton_zoomout2\" fore=\"L2UI_CH3.mapbutton_zoomout1\"></td>"); else StringUtil.append(sb, "<td height=40 width=40><img src=\"icon.skill", skillId, "\" width=32 height=32></td><td width=190>", SkillTable.getInstance().getInfo(skillId, 1).getName(), "<br1><font color=\"B09878\">", BufferManager.getInstance().getAvailableBuff(skillId).getDescription(), "</font></td><td><button action=\"bypass npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, " ", page, "\" width=32 height=32 back=\"L2UI_CH3.mapbutton_zoomin2\" fore=\"L2UI_CH3.mapbutton_zoomin1\"></td>"); } How do I generate the icon of these 4 buffs??