Williams

Members
  • Content Count

    54
  • Joined

  • Last visited

  • Feedback

    N/A

Community Reputation

6 Neutral

About Williams

  • Rank
    Heir

Profile Information

  • Gender
    Male

Recent Profile Visitors

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

  1. yes it was a mistake so it rewards all players but it has already been fixed. the correct thing would be like this for (Player player : clan.getOnlineMembers())
  2. code removed from L2j-One the credits are not his https://raw.githubusercontent.com/L2jOne/New-L2jOne/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/Siege.java
  3. the error line. I removed this code from a java 8 project I have no error on my Eclipse would it be a java 8 to 11 compatibility error?
  4. You are right, I did as you say more, the players use the CTRL to attack the same team. And yet non-participating players attack participating players. what you told me to do ? diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java index 224fed7..747e01d 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Skill.java @@ -1633,12 +1633,6 @@ if ((obj.getAllyId() == 0 || obj.getAllyId() != player.getAllyId()) && (obj.getClan() == null || obj.getClanId() != player.getClanId())) continue; + if (obj.getTeam().getId() > 0) + { + if (player.getTeam() != obj.getTeam()) + continue; + } + if (player.isInDuel()) { if (player.getDuelId() != obj.getDuelId()) @@ -1744,12 +1738,6 @@ if (obj == null || obj == player) continue; - if (obj .getTeam().getId() > 0) - { - if (player.getTeam() != obj.getTeam()) - continue; - } - if (player.isInDuel()) { if (player.getDuelId() != obj.getDuelId()) @@ -2068,12 +2056,6 @@ if (player.getParty().getCommandChannel() != null && player.getParty().getCommandChannel() == targetPlayer.getParty().getCommandChannel()) return false; } + + if (player.getTeam().getId() > 0) + { + if (player.getTeam() == targetPlayer.getTeam()) + return false; + } if (!sourceInArena && !(targetPlayer.isInsideZone(ZoneId.PVP) && !targetPlayer.isInsideZone(ZoneId.SIEGE))) { diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java index fc8ae4e..b061496 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java @@ -6241,15 +6241,6 @@ return false; } + // Check if attacker is in event + if (cha.getEvent() != null && cha.getEvent() == getEvent()) + { + if (cha.getTeam().getId() > 0 && cha.getTeam() == getTeam()) + return false; + + return true; + } + // is AutoAttackable if both players are in the same duel and the duel is still going on if (getDuelState() == DuelState.DUELLING && getDuelId() == cha.getDuelId()) return true; @@ -2901,12 +2901,6 @@ @Override public void onAction(Player player) { - if (!TvTEvent.getInstance().canTarget(this, player)) - { - player.sendPacket(ActionFailed.STATIC_PACKET); - return; - } - // Set the target of the player if (player.getTarget() != this) player.setTarget(this); @@ -2949,12 +2943,6 @@ @Override public void onActionShift(Player player) { - if (!TvTEvent.getInstance().canTarget(this, player)) - { - player.sendPacket(ActionFailed.STATIC_PACKET); - return; - } - if (player.isGM()) AdminEditChar.showCharacterInfo(player, this); diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Cubic.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Cubic.java index 524e44a..f3bcb7f 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Cubic.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/Cubic.java @@ -23,7 +23,6 @@ import net.sf.l2j.gameserver.model.actor.Playable; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.actor.Summon; -import net.sf.l2j.gameserver.model.entity.events.Event; import net.sf.l2j.gameserver.model.group.Party; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse; @@ -257,21 +256,6 @@ return; } + // Events + Event event = _owner.getEvent(); + if (event != null && event.isStarted()) + { + final Player target = ownerTarget.getActingPlayer(); + if (target != null && target.getEvent() == event && (_owner.getTeam().getId() == 0 || _owner.getTeam() != target.getTeam())) + { + _target = (Creature)ownerTarget; + // Dead target + if (_target.isDead()) + _target = null; + } + return; + } + // Olympiad targeting if (_owner.isInOlympiadMode()) {
  5. Hello, I would like help because I do not understand very well, I made a restriction so that players of the same team do not kill themselves more players who do not participate can kill the participants. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java index 70589d9..ba98048 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java @@ -133,6 +133,7 @@ import net.sf.l2j.gameserver.model.entity.Castle; import net.sf.l2j.gameserver.model.entity.Duel.DuelState; import net.sf.l2j.gameserver.model.entity.events.Event; +import net.sf.l2j.gameserver.model.entity.events.TvTEvent; import net.sf.l2j.gameserver.model.entity.Siege; import net.sf.l2j.gameserver.model.group.CommandChannel; import net.sf.l2j.gameserver.model.group.Party; @@ -2899,6 +2900,12 @@ @Override public void onAction(Player player) { + if (!TvTEvent.getInstance().canTarget(this, player)) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + // Set the target of the player if (player.getTarget() != this) player.setTarget(this); diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/events/TvTEvent.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/events/TvTEvent.java index 017c0d5..70c66e4 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/events/TvTEvent.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/entity/events/TvTEvent.java @@ -523,6 +523,18 @@ } @Override + public boolean canTarget(Player player, Player target) + { + if (player.getTeam() == TeamType.BLUE && target.getTeam() == TeamType.BLUE) + return false; + + if (player.getTeam() == TeamType.RED && target.getTeam() == TeamType.RED) + return false; + + return true; + } + + @Override public void onRevive(Creature killer) { if (killer == null) I define my teams by TeamType, BLUE and RED I added this check for players without a team it works, unregistered players can't kill registered players and RED and Azul team players can't kill themselves what did I do wrong? @Override public boolean canTarget(Player player, Player target) { + if (player.getTeam().getId() > 0 && player.getTeam() == target.getTeam()) + return false; + if (player.getTeam() == TeamType.BLUE && target.getTeam() == TeamType.BLUE) return false; if (player.getTeam() == TeamType.RED && target.getTeam() == TeamType.RED) return false; return true; }
  6. Hello what can I improve my script? https://pastebin.com/raw/FXFZVPaF
  7. 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); } } }
  8. 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
  9. Main topic updated with corrections and restrictions.
  10. 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
  11. topic updated with version 2 at a glance now written in xml
  12. 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