l2jkain
Members-
Posts
207 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by l2jkain
-
Help Drop Item Enchanted aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
I just want to leave enchanted items dropping -
Help Drop Item Enchanted aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
only problem is if I put more than 1 item to dropa only comes 1 enchantado taking it ta 100% functional // Drop All Monsters Itens enchantados By Dev Williams if ((Config.ENABLE_DROP_ITEM_ENCHANT) && ((this instanceof Monster))) { for (int i = 1; i < 81; i++) { if (i > 10) { if (player.getLevel() == i && getLevel() < player.getLevel() - 8) return; } } if (Rnd.get(100) < Config.DROP_ITEM_ENCHANT[3]) { if (Config.AUTO_LOOT) player.getInventory().addEnchantedItem("Reward Enchant: ", Config.DROP_ITEM_ENCHANT[0], Config.DROP_ITEM_ENCHANT[1], Config.DROP_ITEM_ENCHANT[2], player, null); } } -
Help Drop Item Enchanted aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
I did it your way and it did not work. I level 81 I won the mob level 1 award. -
Help Drop Item Enchanted aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
this is a verification for player lvl 81 does not win the item killing mobe lvl 1 The auto loot was stupid, my kk. -
Hello I created this system to drop enchanted items but it drops 2 item even putting the amount 1. What can I do to improve the code ? Index: java/net/sf/l2j/gameserver/model/actor/Attackable.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/Attackable.java (revision 3) +++ java/net/sf/l2j/gameserver/model/actor/Attackable.java (working copy) @@ -1184,6 +1184,28 @@ } } + // Drop All Monsters Itens enchantados By Dev Williams + if ((Config.ENABLE_DROP_ITEM_ENCHANT) && ((this instanceof Monster))) + { + for (int i = 1; i < 81; i++) + { + if (i > 10) + { + if (player.getLevel() == i && getLevel() < player.getLevel() - 8) + return; + } + } + if (Rnd.get(100) < Config.DROP_ITEM_ENCHANT[3]) + { + IntIntHolder item = new IntIntHolder(Config.DROP_ITEM_ENCHANT[0], Config.DROP_ITEM_ENCHANT[1]); + if (Config.AUTO_LOOT) + player.doAutoLoot(this, item); + else + dropItem(player, item); + player.getInventory().addEnchantedItem("Reward Enchant: ", Config.DROP_ITEM_ENCHANT[0], Config.DROP_ITEM_ENCHANT[1], Config.DROP_ITEM_ENCHANT[2], player, null); + } + } + Index: java/net/sf/l2j/gameserver/model/itemcontainer/PcInventory.java =================================================================== --- java/net/sf/l2j/gameserver/model/itemcontainer/PcInventory.java (revision 2) +++ java/net/sf/l2j/gameserver/model/itemcontainer/PcInventory.java (working copy) @@ -17,9 +17,11 @@ import net.sf.l2j.gameserver.model.itemcontainer.listeners.ItemPassiveSkillsListener; import net.sf.l2j.gameserver.model.tradelist.TradeItem; import net.sf.l2j.gameserver.model.tradelist.TradeList; +import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate; import net.sf.l2j.gameserver.network.serverpackets.ItemList; import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate; +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; import net.sf.l2j.gameserver.taskmanager.ShadowItemTaskManager; public class PcInventory extends Inventory @@ -439,6 +441,43 @@ return item; } + + public ItemInstance addEnchantedItem(String process, int itemId, int itemCount, int enchantLevel, Player actor, WorldObject reference) + { + ItemInstance item = super.addItem(process, itemId, itemCount, actor, reference); + + if (item == null) + return null; + + if (enchantLevel > 0) + item.setEnchantLevel(enchantLevel); + + if (itemId == 57) + { + SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S1_ADENA); + smsg.addItemNumber(itemCount); + actor.sendPacket(smsg); + } + else if (itemCount > 1) + { + SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S); + smsg.addItemName(itemId); + smsg.addItemNumber(itemCount); + actor.sendPacket(smsg); + } + else + { + SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.ACQUIRED_S1_S2); + smsg.addNumber(enchantLevel); + smsg.addItemName(itemId); + actor.sendPacket(smsg); + } + StatusUpdate su = new StatusUpdate(actor); + su.addAttribute(14, actor.getCurrentLoad()); + actor.sendPacket(su); + + return item; + }
-
Help Drope Custom aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
What can I do better? private void dropItem(Player player, Map<Integer, List<Integer>> droplist) { for (Entry<Integer, List<Integer>> entry : droplist.entrySet()) { int key = entry.getKey(); List<Integer> valueList = entry.getValue(); int chance = valueList.get(0); int min = valueList.get(1); int max = valueList.get(2); int itemMin = min; int itemMax = max; int count = Rnd.get(itemMin, itemMax); int rnd = Rnd.get(100); if (rnd < chance) { IntIntHolder item = new IntIntHolder(key, count); if (Config.AUTO_LOOT) player.doAutoLoot(this, item); else dropItem(player, item); } } } -
Hello I'm creating a custom drop for Assis 374, I'm a customer but no one helped me there Well this code works perfectly until going to level 81 the dropes are all tripled does anyone help me? // Herbs. if (getTemplate().getDropHerbGroup() > 0) { for (DropCategory cat : HerbDropData.getInstance().getHerbDroplist(getTemplate().getDropHerbGroup())) { final IntIntHolder item = calculateCategorizedHerbItem(cat, levelModifier); if (item != null) { if (Config.AUTO_LOOT_HERBS) player.addItem("Loot", item.getId(), 1, this, true); else { // If multiple similar herbs drop, split them and make a unique drop per item. final int count = item.getValue(); if (count > 1) { item.setValue(1); for (int i = 0; i < count; i++) dropItem(player, item); } else dropItem(player, item); } } } } + + // Drop All Monsters + if ((Config.ALLOW_GLOBAL_DROP) && ((this instanceof Monster))) + { + int levelMobMin = 0; + for (int i = 1; i < 81; i++) + { + levelMobMin = player.getLevel() - 8; + if (i > 10) + { + if (player.getLevel() == i && getLevel() < levelMobMin) + return; + } + } + dropItem(player, Config.GLOBAL_DROP_ITEMS); + } } + + private void dropItem(Player player, Map<Integer, List<Integer>> droplist) + { + Integer key; + Integer chance; + Integer min; + Integer max; + Integer itemMin; + Integer itemMax; + Integer count; + Integer rnd; + for (Entry<Integer, List<Integer>> entry : droplist.entrySet()) + { + key = entry.getKey(); + List<Integer> valueList = entry.getValue(); + + chance = valueList.get(0); + min = valueList.get(1); + max = valueList.get(2); + + if (getLevel() > 9) + { + itemMin = getLevel() * min / 5; + itemMax = getLevel() * max / 6; + } + else + { + itemMin = min; + itemMax = max; + } + count = Rnd.get(itemMin, itemMax); + + rnd = Rnd.get(100); + + if (rnd < chance) + { + IntIntHolder item = new IntIntHolder(key, count); + if (Config.AUTO_LOOT) + player.doAutoLoot(this, item); + else + dropItem(player, item); + } + } + } + /** * Drop reward item. * @param mainDamageDealer The player who made highest damage. * @param holder The ItemHolder. * @return the dropped item instance. */ public ItemInstance dropItem(Player mainDamageDealer, IntIntHolder holder) { # Select o item for drop all monster # Example : Itemid,chance,min,max;Itemid,chance,min,max DropSystemItems = 9210,80,2,4;9211,70,1,3;9212,60,2,5;9213,40,3,5;9214,30,1,3;9215,50,2,3;9216,20,2,4
-
Could someone tell me what baium quest name?
-
WTS Rootware Service [Java Developing]
l2jkain replied to Rootware's topic in Marketplace [L2Packs & Files]
How much does your tvt, ctf and dm event cost? -
I'm going to test this Look what I'm creating is getting better and better. https://pastebin.com/xP7NFJv5
-
the participants can not attack if it generates this message, more if a nonparticipating player works, not to being able to fix this I'm going to create my engine with this base event of any kind so I'll create ctf and DM based on this https://pastebin.com/raw/ESxADxRV
-
player.java error generates here @Override public void onAction(Player player) { + // Check if this Player is in an event + if (!TeamVsTeam.onAction(player.getName(), getName())) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } +
-
I managed to fix it I will patch and update the topic.
-
yes to much what improves more the location should save correct right in my code there is nothing that of conflict and show this message
-
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
Meu código, eu não consigo encontrar o erro de qualquer maneira eu vou remover o teleport e fazer alguns testes para ver o que eu posso fazer melhor. https://pastebin.com/raw/x9GwZugx não há nada errado com o erro Player.java é gerado por player.getSavedLocation (). set (player.getPosition ()); // / implementa Runnable e inicia-se no construtor + new EventTeleport (player, team.getCoordinates (), false, false); << --- está salvando o local desde o início, mas entra no modo de exibição There is nothing wrong here Player.java that gives this error Index: java/net/sf/l2j/gameserver/model/actor/instance/Player.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/Player.java (revision 2) +++ java/net/sf/l2j/gameserver/model/actor/instance/Player.java (working copy) @@ -105,6 +105,7 @@ import net.sf.l2j.gameserver.model.entity.Hero; import net.sf.l2j.gameserver.model.entity.Siege; import net.sf.l2j.gameserver.model.entity.Siege.SiegeSide; +import net.sf.l2j.gameserver.model.entity.engine.TeamVsTeam; import net.sf.l2j.gameserver.model.group.CommandChannel; import net.sf.l2j.gameserver.model.group.Party; import net.sf.l2j.gameserver.model.group.Party.LootRule; @@ -578,6 +579,9 @@ private Door _requestedGate; + private int _eventkills; + private short _points = 0; + /** * Constructor of Player (use Creature constructor). * <ul> @@ -2897,6 +2901,13 @@ @Override public void onAction(Player player) { + // Check if this Player is in an event + if (!TeamVsTeam.onAction(player.getName(), getName())) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + // Set the target of the player if (player.getTarget() != this) player.setTarget(this); @@ -2908,7 +2919,7 @@ player.getAI().setIntention(CtrlIntention.INTERACT, this); return; } - + // Check if this Player is autoAttackable if (isAutoAttackable(player)) { @@ -2941,6 +2952,13 @@ { if (player.isGM()) AdminEditChar.showCharacterInfo(player, this); + + // Check if this Player is in an event + if (!TeamVsTeam.onAction(player.getName(), getName())) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } super.onActionShift(player); } @@ -3649,16 +3667,21 @@ if (isMounted()) stopFeed(); + // kill the player in event + getEventKills(); + synchronized (this) { if (isFakeDeath()) stopFakeDeath(true); } + TeamVsTeam.onKill(killer, this); + if (killer != null) { Player pk = killer.getActingPlayer(); - + // Clear resurrect xp calculation setExpBeforeDeath(0); @@ -3896,6 +3919,9 @@ if (player == null) return; + if (isInFunEvent() == false) + return; + if (isInDuel() && player.getDuelId() == getDuelId()) return; @@ -6296,6 +6322,10 @@ if (attacker instanceof Monster) return true; + // Check if the attacker is in events started + if (isInFunEvent()) + return true; + // Check if the attacker is not in the same party if (_party != null && _party.containsPlayer(attacker)) return false; @@ -9278,6 +9308,9 @@ if (OlympiadManager.getInstance().isRegisteredInComp(this)) OlympiadManager.getInstance().removeDisconnectedCompetitor(this); + + if (isInFunEvent()) + TeamVsTeam.removeParticipant(getName()); // Open a Html message to inform the player final NpcHtmlMessage html = new NpcHtmlMessage(0); @@ -9425,7 +9458,7 @@ if (_deathPenaltyBuffLevel >= 15) // maximum level reached return; - if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof Player) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE))) + if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof Player) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE)) && isInFunEvent()) { if (_deathPenaltyBuffLevel != 0) removeSkill(5076, false); @@ -9808,7 +9841,7 @@ if (summonerChar == null) return false; - if (summonerChar.isInOlympiadMode() || summonerChar.isInObserverMode() || summonerChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || summonerChar.isMounted()) + if (summonerChar.isInFunEvent() || summonerChar.isInOlympiadMode() || summonerChar.isInObserverMode() || summonerChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || summonerChar.isMounted()) return false; return true; @@ -9845,7 +9878,7 @@ return false; } - if (targetChar.isFestivalParticipant() || targetChar.isMounted()) + if (targetChar.isFestivalParticipant() || targetChar.isMounted() || targetChar.isInFunEvent()) { summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING); return false; @@ -10237,4 +10270,34 @@ } } } + + public int getEventKills() + { + return _eventkills; + } + + public void increaseKills() + { + _eventkills++; + } + + public short getScore() + { + return _points; + } + + public void clearPoints() + { + _points = 0; + } + + public void increaseScore() + { + _points++; + } + + public boolean isInFunEvent() + { + return ((TeamVsTeam.isStarted() && TeamVsTeam.isPlayerParticipant(getName())) && !isGM()); + } } -
Help me improve, because the only way I found it was that improvement I did not see any useless method it is well written
-
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
no matter what place it does not work I removed all restriction of the same only let the tvt and the npc register does not always work that message should be aCis bug -
Hello, this event I was creating, but I do not know what else to do, I took a lot of it out and there is a lot to be removed, I can not finish it any more, so anyone who wants to finish is a good event... https://pastebin.com/raw/x9GwZugx
-
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
Not Found man -
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
At the end of the event, the players stay where they were before the event. The only error is that they can not reach the target of the opponents and show that message. -
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
when I remove this it is normal but when the event finishes the players stay in the same place player.getSavedLocation().set(player.getPosition()); -
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
so players can attack themselves but when the event ends the players go to the spawn of the first one that registered public static int[] getOriginalCoordinates() { return _originalCoordinates; } public static void setOriginalCoordinates(int[] originalCoordinates) { _originalCoordinates = originalCoordinates; } public static void teleportPlayersToArena() { for (EventTeam team : _teams) { for (Player player : team.getParticipatedPlayers().values()) { if ((player != null)) { int[] playerCoordinates = new int[] { player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), }; setOriginalCoordinates(playerCoordinates); new EventTeleporter(player, team.getCoordinates(), false); } } } } public static void teleportPlayersBack() { for (EventTeam team : _teams) { for (Player player : team.getParticipatedPlayers().values()) { if ((player != null)) new EventTeleporter(player, getOriginalCoordinates(), false); } } } so they can not, but when the event ends, they go to where they were. public static void teleportPlayersToArena() { for (EventTeam team : _teams) { for (Player player : team.getParticipatedPlayers().values()) { if ((player != null)) { player.getSavedLocation().set(player.getPosition()); new EventTeleporter(player, team.getCoordinates(), false); } } } } public static void teleportPlayersBack() { for (EventTeam team : _teams) { for (Player player : team.getParticipatedPlayers().values()) { final Location loc = player.getSavedLocation(); if (loc.equals(Location.DUMMY_LOC)) return; player.teleToLocation(loc, 0); player.getSavedLocation().clean(); } } } -
Help Save the place before teleportation aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
created this way public static int[] getOriginalCoordinates() { return _originalCoordinates; } public static void setOriginalCoordinates(int[] originalCoordinates) { _originalCoordinates = originalCoordinates; } public static void teleportPlayersToArena() { for (EventTeam team : _teams) { for (Player player : team.getParticipatedPlayers().values()) { if ((player != null)) { int[] playerCoordinates = new int[] { player.getSavedLocation().set(player.getPosition()); player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), }; setOriginalCoordinates(playerCoordinates); new EventTeleporter(player, team.getCoordinates(), false); } } } } public static void teleportPlayersBack() { for (EventTeam team : _teams) { for (Player player : team.getParticipatedPlayers().values()) { if (player == null) return; Location loc = player.getSavedLocation(); if (loc.equals(Location.DUMMY_LOC)) return; player.teleToLocation(loc, 0); player.getSavedLocation().clean(); new EventTeleporter(player, getOriginalCoordinates(), false); } } } generated this error -
Help Save the place before teleportation aCis
l2jkain posted a question in Request Server Development Help [L2J]
Hello, I wanted to know how I can save a coordinate, because on my tvt when the event ends I'm teleported to giran I would like to know how I can get where I was This instead of putting me where I was, leaves me in the same place after the event ends. int[] playerCoordinates = new int[] { player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), player.getPosition().getHeading() }; new EventTeleporter(player, playerCoordinates, false); -
Help TownManager aCis
l2jkain replied to l2jkain's question in Request Server Development Help [L2J]
not
