hello everyone !
I need help with a l2script Rev H5-Salvation/Classic build. I compiled the project, installed everything but I can't log in to the server, it won't log me in. I tried a thousand ways without good results. I leave you the error when logging in either with the H5-Salvation Client.
ERROR ---> WARN: IPBANMANAGER ---> IP !!!!
I'm waiting for help! Thank you!
Hello !
I have a problem when connecting to the pack with the Salvation client, it blocks my IP, I see that the account is created in the database but it remains logged in.
Any idea what it could be? ALso with H5 CLient !
Thank you !
Question
l2jkain
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;
+ }
11 answers to this question
Recommended Posts