Welcome to MaxCheaters.com

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

ThelwHelpRePaidia

Members
  • Posts

    234
  • Joined

  • Last visited

  • Feedback

    0%

About ThelwHelpRePaidia

Contact Methods

  • Website URL
    www.l2cutlass.net

Profile Information

  • Current Mood
    Sneaky
  • Gender
    Male
  • Country
    Greece
  • Location
    Στο Περίπτερο

Recent Profile Visitors

2,017 profile views

ThelwHelpRePaidia's Achievements

  1. Hello i have this AuctionManager i took him from a pack it's working very good but does anyone know how can i make it like this https://prnt.sc/w2o4wm from this https://prnt.sc/w2o5rm i want to have 2 choices with what currency i have to sell my items adena(57) and this Gold Dragon(3481) for now it's only adena..here is the code package l2r.gameserver.model.entity.auction; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javolution.util.FastMap; import l2r.gameserver.Config; import l2r.gameserver.dao.ItemsDAO; import l2r.gameserver.data.xml.holder.HennaHolder; import l2r.gameserver.data.xml.holder.SoulCrystalHolder; import l2r.gameserver.database.DatabaseFactory; import l2r.gameserver.idfactory.IdFactory; import l2r.gameserver.model.GameObjectsStorage; import l2r.gameserver.model.Player; import l2r.gameserver.model.items.AuctionStorage; import l2r.gameserver.model.items.ItemAttributes; import l2r.gameserver.model.items.ItemInstance; import l2r.gameserver.model.items.ItemInstance.ItemLocation; import l2r.gameserver.model.items.PcInventory; import l2r.gameserver.templates.item.ArmorTemplate.ArmorType; import l2r.gameserver.templates.item.EtcItemTemplate.EtcItemType; import l2r.gameserver.templates.item.ItemTemplate; import l2r.gameserver.templates.item.ItemTemplate.Grade; import l2r.gameserver.templates.item.WeaponTemplate.WeaponType; import l2r.gameserver.utils.ItemActionLog; import l2r.gameserver.utils.ItemFunctions; import l2r.gameserver.utils.ItemStateLog; import l2r.gameserver.utils.Log; import l2r.gameserver.utils.TradeHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class AuctionManager { private static AuctionManager _instance; private static final Logger _log = LoggerFactory.getLogger(AuctionManager.class); private static final int MAX_AUCTIONS_PER_PLAYER = 10; private final Map<Integer, Auction> _auctions = new FastMap<>(); private final List<Integer> _deadAuctions = new ArrayList<>(); private final Map<Integer, Long> _lastMadeAuction = new FastMap<>(); private int _lastId = -1; private AuctionManager() { loadAuctions(); } public Auction getAuction(int auctionId) { return _auctions.get(auctionId); } public Auction getAuction(ItemInstance item) { for (Auction auction : getAllAuctions()) if (auction.getItem().equals(item)) return auction; return null; } public Collection<Auction> getAllAuctions() { return _auctions.values(); } public Collection<Auction> getMyAuctions(Player player) { return getMyAuctions(player.getObjectId()); } public Collection<Auction> getMyAuctions(int playerObjectId) { Collection<Auction> coll = new ArrayList<>(); for (Auction auction : getAllAuctions()) { if (auction != null && auction.getSellerObjectId() == playerObjectId) coll.add(auction); } return coll; } private void loadAuctions() { AuctionStorage.getInstance(); try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT * FROM auctions"); ResultSet rset = statement.executeQuery()) { while (rset.next()) { int id = rset.getInt("auction_id"); int sellerObjectId = rset.getInt("seller_object_id"); String sellerName = rset.getString("seller_name"); int itemObjectId = rset.getInt("item_object_id"); long pricePerItem = rset.getLong("price_per_item"); ItemInstance item = AuctionStorage.getInstance().getItemByObjectId(itemObjectId); // Saving last Id if (id > _lastId) _lastId = id; if (item != null) { Auction auction = new Auction(id, sellerObjectId, sellerName, item, pricePerItem, item.getCount(), getItemGroup(item), false); _auctions.put(id, auction); } else { _deadAuctions.add(id); } } } catch (SQLException e) { _log.error("Error while loading Auctions", e); } } public void addAuctionToDatabase(Auction auction) { try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("INSERT INTO auctions VALUES(?,?,?,?,?)")) { statement.setInt(1, auction.getAuctionId()); statement.setInt(2, auction.getSellerObjectId()); statement.setString(3, auction.getSellerName()); statement.setInt(4, auction.getItem().getObjectId()); statement.setLong(5, auction.getPricePerItem()); statement.execute(); } catch (SQLException e) { _log.error("Error while adding auction to database:", e); } } /** * Adding adena by database * @param sellerObjectId * @param adena */ public void addAdenaToSeller(int sellerObjectId, long adena) { int objId = -1; try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT object_id FROM items WHERE item_id=57 AND owner_id=" + sellerObjectId + " AND loc='INVENTORY'"); ResultSet rset = statement.executeQuery()) { if (rset.next()) objId = rset.getInt("object_id"); } catch (SQLException e) { _log.error("Error while selecting adena:", e); } if (objId == -1) { ItemInstance item = ItemFunctions.createItem(57); item.setCount(adena); item.setOwnerId(sellerObjectId); item.setLocation(ItemLocation.INVENTORY); ItemsDAO.getInstance().save(item); } else { try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE items SET count=count+" + adena + " WHERE object_id=" + objId)) { statement.execute(); } catch (SQLException e) { _log.error("Error while selecting adena:", e); } ItemsDAO.getInstance().getCache().remove(objId); } } private void deleteAuctionFromDatabase(Auction auction) { try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("DELETE FROM auctions WHERE auction_id = ?")) { statement.setInt(1, auction.getAuctionId()); statement.execute(); } catch (SQLException e) { _log.error("Error while deleting auction from database:", e); } } public void deleteAuction(Player seller, ItemInstance item) { Auction auction = null; for (Auction anyAuction : getMyAuctions(seller)) if (anyAuction.getItem().equals(item)) { auction = anyAuction; break; } deleteAuction(seller, auction); } public void deleteAuction(Player seller, Auction auction) { if (auction == null) { sendMessage(seller, "This auction doesnt exist anymore!"); return; } ItemInstance item = auction.getItem(); if (!Config.ALLOW_AUCTION_OUTSIDE_TOWN && !seller.isInPeaceZone()) { sendMessage(seller, "You cannot delete auction outside town!"); } _auctions.remove(auction.getAuctionId()); PcInventory inventory = seller.getInventory(); AuctionStorage storage = AuctionStorage.getInstance(); inventory.writeLock(); storage.writeLock(); try { inventory.addItem(item, "Deleting Auction"); storage.removeItem(item, null, null); } finally { storage.writeUnlock(); inventory.writeUnlock(); } seller.sendChanges(); deleteAuctionFromDatabase(auction); sendMessage(seller, "Auction has been removed!"); } public Auction addNewStore(Player seller, ItemInstance item, long salePrice, long count) { int id = getNewId(); AuctionItemTypes type = getItemGroup(item); return addAuction(seller, id, item, salePrice, count, type, true); } public void removeStore(Player seller, int auctionId) { if (!Config.AUCTION_PRIVATE_STORE_AUTO_ADDED) return; if (auctionId <= 0) return; Auction a = getAuction(auctionId); if (a == null || !a.isPrivateStore() || a.getSellerObjectId() != seller.getObjectId()) return; _auctions.remove(auctionId); } public synchronized void removePlayerStores(Player player) { if (!Config.AUCTION_PRIVATE_STORE_AUTO_ADDED) return; int playerObjId = player.getObjectId(); List<Integer> keysToRemove = new ArrayList<>(); for (Entry<Integer, Auction> auction : _auctions.entrySet()) { if (auction.getValue().getSellerObjectId() == playerObjId && auction.getValue().isPrivateStore()) keysToRemove.add(auction.getKey()); } for (Integer key : keysToRemove) { _auctions.remove(key); } } public void setNewCount(int auctionId, long newCount) { if (auctionId <= 0) return; _auctions.get(auctionId).setCount(newCount); } public void buyItem(Player buyer, ItemInstance item, long quantity) { Auction auction = getAuction(item); if (auction == null) { sendMessage(buyer, "This auction doesnt exist anymore!"); return; } if (buyer.isBlocked()) { sendMessage(buyer, "You cannot buy items while being blocked!"); return; } if (auction.getSellerObjectId() == buyer.getObjectId()) { sendMessage(buyer, "You cannot win your own auction!"); return; } if (quantity <= 0) { sendMessage(buyer, "You need to buy at least one item!"); return; } if (item.getCount() < quantity) { sendMessage(buyer, "You are trying to buy too many items!"); return; } if (auction.getPricePerItem() * quantity > buyer.getAdena()) { sendMessage(buyer, "You don't have enough adena!"); return; } if (!Config.ALLOW_AUCTION_OUTSIDE_TOWN && !buyer.isInPeaceZone()) { sendMessage(buyer, "You cannot use buy that item outside town!"); return; } if (auction.isPrivateStore()) { Player seller = GameObjectsStorage.getPlayer(auction.getSellerObjectId()); if (seller == null) { sendMessage(buyer, "This auction doesnt exist anymore !"); return; } TradeHelper.buyFromStore(seller, buyer, 1, new int[] { item.getObjectId() }, new long[] { quantity }, new long[] { auction.getPricePerItem() }); return; } if (AuctionStorage.getInstance().getItemByObjectId(item.getObjectId()) == null) { _log.error("Error! Auction Item: " + item.toString() + " wasn't found in Auction Storage! Removed from Auction House"); _auctions.remove(auction.getAuctionId()); deleteAuctionFromDatabase(auction); sendMessage(buyer, "Auction doesnt exist"); return; } final Collection<ItemActionLog> logs = new ArrayList<ItemActionLog>(4); final long totalAdenaCost = auction.getPricePerItem() * quantity; logs.add(new ItemActionLog(ItemStateLog.EXCHANGE_LOSE, "AuctionHouse", buyer, buyer.getInventory().getItemByItemId(57), totalAdenaCost)); buyer.getInventory().reduceAdena(totalAdenaCost, null); final PcInventory inventory = buyer.getInventory(); final AuctionStorage storage = AuctionStorage.getInstance(); inventory.writeLock(); storage.writeLock(); try { ItemInstance gainedItem; if (item.getCount() == quantity) { item.setOwnerId(buyer.getObjectId()); final ItemInstance lostItem = storage.removeItem(item, null, null); logs.add(new ItemActionLog(ItemStateLog.EXCHANGE_LOSE, "AuctionHouse", auction.getSellerObjectId(), lostItem, quantity)); gainedItem = inventory.addItem(item, null); deleteAuctionFromDatabase(auction); _auctions.remove(auction.getAuctionId()); } else { final ItemInstance newItem = copyItem(item, quantity); newItem.setOwnerId(buyer.getObjectId()); logs.add(new ItemActionLog(ItemStateLog.EXCHANGE_LOSE, "AuctionHouse", auction.getSellerObjectId(), newItem, quantity)); storage.removeItem(item, quantity, null, null); gainedItem = inventory.addItem(newItem, "Auction Part Bought"); inventory.refreshEquip(); auction.setCount(auction.getCountToSell() - quantity); } logs.add(new ItemActionLog(ItemStateLog.EXCHANGE_GAIN, "AuctionHouse", buyer, gainedItem, quantity)); } finally { storage.writeUnlock(); inventory.writeUnlock(); } buyer.sendChanges(); final Player seller2 = GameObjectsStorage.getPlayer(auction.getSellerObjectId()); if (seller2 != null) { seller2.sendMessage(item.getName() + " has been bought by " + buyer.getName() + "!"); seller2.addAdena(auction.getPricePerItem() * quantity, true, null); logs.add(new ItemActionLog(ItemStateLog.EXCHANGE_GAIN, "AuctionHouse", seller2, seller2.getInventory().getItemByItemId(57), auction.getPricePerItem() * quantity)); } else { addAdenaToSeller(auction.getSellerObjectId(), auction.getPricePerItem() * quantity); logs.add(new ItemActionLog(ItemStateLog.EXCHANGE_GAIN, "AuctionHouse", auction.getSellerName() + '[' + auction.getSellerObjectId() + ']', "Adena", totalAdenaCost)); } Log.logItemActions("AuctionId_" + auction.getAuctionId(), logs); buyer.sendMessage("You have bought " + item.getName()); } public void checkAndAddNewAuction(Player seller, ItemInstance item, long quantity, long salePrice) { if (!checkIfItsOk(seller, item, quantity, salePrice)) return; int id = getNewId(); if (id < 0) { sendMessage(seller, "There are currently too many auctions!"); return; } AuctionItemTypes type = getItemGroup(item); PcInventory inventory = seller.getInventory(); AuctionStorage storage = AuctionStorage.getInstance(); Auction auction = null; inventory.writeLock(); storage.writeLock(); try { if (item.getCount() > quantity) { ItemInstance newItem = copyItem(item, quantity); seller.getInventory().removeItem(item, quantity, "Creating Auction"); inventory.refreshEquip(); storage.addItem(newItem, null, null); auction = addAuction(seller, id, newItem, salePrice, quantity, type, false); } else { inventory.removeItem(item, "Creating Auction"); item.setCount(quantity); storage.addFullItem(item); auction = addAuction(seller, id, item, salePrice, quantity, type, false); } } finally { storage.writeUnlock(); inventory.writeUnlock(); } seller.sendChanges(); _lastMadeAuction.put(seller.getObjectId(), System.currentTimeMillis() + Config.SECONDS_BETWEEN_ADDING_AUCTIONS * 1000); seller.getInventory().reduceAdena(Config.AUCTION_FEE, "Create Auctino Fee"); addAuctionToDatabase(auction); sendMessage(seller, "Auction has been created!"); } private Auction addAuction(Player seller, int auctionId, ItemInstance item, long salePrice, long sellCount, AuctionItemTypes itemType, boolean privateStore) { Auction newAuction = new Auction(auctionId, seller.getObjectId(), seller.getName(), item, salePrice, sellCount, itemType, privateStore); _auctions.put(auctionId, newAuction); return newAuction; } public void sendMessage(Player player, String message) { player.sendMessage(message); } private ItemInstance copyItem(ItemInstance oldItem, long quantity) { ItemInstance item = new ItemInstance(IdFactory.getInstance().getNextId(), oldItem.getItemId()); item.setOwnerId(oldItem.getOwnerId()); item.setCount(quantity); item.setEnchantLevel(oldItem.getEnchantLevel()); item.setLocation(ItemLocation.VOID); item.setLocData(-1); item.setCustomType1(oldItem.getCustomType1()); item.setCustomType2(oldItem.getCustomType2()); item.setLifeTime(oldItem.getLifeTime()); item.setCustomFlags(oldItem.getCustomFlags()); item.setAugmentationId(oldItem.getAugmentationId()); ItemAttributes oldAtt = oldItem.getAttributes(); ItemAttributes att = new ItemAttributes(oldAtt.getFire(), oldAtt.getWater(), oldAtt.getWind(), oldAtt.getEarth(), oldAtt.getHoly(), oldAtt.getUnholy()); item.setAttributes(att); item.setAgathionEnergy(oldItem.getAgathionEnergy()); item.setLocation(ItemLocation.VOID); return item; } private synchronized int getNewId() { return ++_lastId; } private boolean checkIfItsOk(Player seller, ItemInstance item, long quantity, long salePrice) { if (seller == null) return false; if (item == null) { sendMessage(seller, "Item you are trying to sell, doesn't exist!"); return false; } if (item.getOwnerId() != seller.getObjectId() || seller.getInventory().getItemByObjectId(item.getObjectId()) == null) { sendMessage(seller, "Item you are trying to sell, doesn't exist!"); return false; } if (item.isEquipped()) { sendMessage(seller, "You need to unequip that item first!"); return false; } if (item.isAugmented()) { sendMessage(seller, "You cannot sell Augmented weapons!"); return false; } if (item.getTemplate().isQuest()) { sendMessage(seller, "You can't sell quest items!"); return false; } if (!item.canBeTraded(seller)) { sendMessage(seller, "You cannot sell this item!"); return false; } if (seller.getPet() != null && item.getItemType() == EtcItemType.PET_COLLAR) { sendMessage(seller, "Please unsummon your pet before trying to sell this item."); return false; } if (seller.getPet() != null && item.isSummon() && item.getTemplate().isForPet()) { sendMessage(seller, "Please unsummon your pet before trying to sell this item."); return false; } // Synerge - Dont allow equipment No-Grade and D-Grade if ((item.isWeapon() || item.isArmor() || item.isAccessory()) && (item.getCrystalType() == Grade.NONE || item.getCrystalType() == Grade.D)) { sendMessage(seller, "You can only sell items C-Grade and upper"); return false; } if (quantity < 1) { sendMessage(seller, "Quantity is too low!"); return false; } if (seller.getAdena() < Config.AUCTION_FEE) { sendMessage(seller, "You don't have enough adena, to pay the fee!"); return false; } if (item.getCount() < quantity) { sendMessage(seller, "You don't have enough items to sell!"); return false; } if (salePrice <= 0) { sendMessage(seller, "Sale price is too low!"); return false; } if (salePrice > 999999999999L) { sendMessage(seller, "Price is too high!"); return false; } if (seller.isBlocked()) { sendMessage(seller, "Cannot create auctions while being Blocked!"); return false; } if (getMyAuctions(seller).size() >= MAX_AUCTIONS_PER_PLAYER) { sendMessage(seller, "You can have just " + MAX_AUCTIONS_PER_PLAYER + " auction(s) at the same time!"); return false; } if (!Config.ALLOW_AUCTION_OUTSIDE_TOWN && !seller.isInPeaceZone()) { sendMessage(seller, "You cannot add new Auction outside town!"); return false; } if (seller.isInStoreMode()) { sendMessage(seller, "Close your store before creating new Auction!"); return false; } if (!seller.getPermissions().canLoseItem(item, false)) { sendMessage(seller, seller.getPermissions().getLoseItemDeniedPermission(item).getPermissionDeniedError(seller, item)); return false; } if (_lastMadeAuction.containsKey(seller.getObjectId())) { if (_lastMadeAuction.get(seller.getObjectId()) > System.currentTimeMillis()) { sendMessage(seller, "You cannot do it so often!"); return false; } } return true; } private AuctionItemTypes getItemGroup(ItemInstance item) { if (item.isEquipable()) { if (item.getBodyPart() == (ItemTemplate.SLOT_L_EAR | ItemTemplate.SLOT_R_EAR)) return AccessoryItemType.Earring; if (item.getBodyPart() == (ItemTemplate.SLOT_L_FINGER | ItemTemplate.SLOT_R_FINGER)) return AccessoryItemType.Ring; if (item.getBodyPart() == ItemTemplate.SLOT_NECK) return AccessoryItemType.Necklace; if (item.getBodyPart() == ItemTemplate.SLOT_L_BRACELET || item.getBodyPart() == ItemTemplate.SLOT_R_BRACELET) return AccessoryItemType.Bracelet; if (item.getBodyPart() == ItemTemplate.SLOT_HAIR || item.getBodyPart() == ItemTemplate.SLOT_HAIRALL || item.getBodyPart() == ItemTemplate.SLOT_DHAIR) return AccessoryItemType.Accessory; } if (item.isArmor()) { if (item.getBodyPart() == ItemTemplate.SLOT_HEAD) return ArmorItemType.Helmet; if (item.getBodyPart() == ItemTemplate.SLOT_CHEST) return ArmorItemType.Chest; if (item.getBodyPart() == ItemTemplate.SLOT_LEGS) return ArmorItemType.Legs; if (item.getBodyPart() == ItemTemplate.SLOT_GLOVES) return ArmorItemType.Gloves; if (item.getBodyPart() == ItemTemplate.SLOT_FEET) return ArmorItemType.Shoes; if (item.getTemplate().isCloak()) return ArmorItemType.Cloak; if (item.getTemplate().isUnderwear()) return ArmorItemType.Shirt; if (item.getTemplate().isBelt()) return ArmorItemType.Belt; } if (item.getTemplate().isEnchantScroll()) return EtcAuctionItemType.Enchant; if (item.getTemplate().isLifeStone()) return EtcAuctionItemType.Life_stone; if (item.getTemplate().isAttributeCrystal() || item.getTemplate().isAttributeStone()) return EtcAuctionItemType.Attribute; if (item.getTemplate().isCodexBook()) return EtcAuctionItemType.Codex; if (item.getTemplate().isForgottenScroll()) return EtcAuctionItemType.Forgotten_scroll; if (SoulCrystalHolder.getInstance().getCrystal(item.getItemId()) != null) return EtcAuctionItemType.SA_crystal; if (item.isPet()) return PetItemType.Pet; if (item.getItemType() == EtcItemType.PET_COLLAR) return PetItemType.Pet; if (item.getTemplate().isForPet()) return PetItemType.Gear; if (isBabyFoodOrShot(item.getItemId())) return PetItemType.Other; if (item.getItemType() == EtcItemType.POTION) return SuppliesItemType.Elixir; if (HennaHolder.getInstance().isHenna(item.getItemId())) return SuppliesItemType.Dye; if (item.getItemType() == EtcItemType.SCROLL) return SuppliesItemType.Scroll; if (item.getTemplate().isKeyMatherial()) return SuppliesItemType.Key_Material; if (item.getTemplate().isRecipe()) return SuppliesItemType.Recipe; if (item.getItemType() == EtcItemType.MATERIAL) return SuppliesItemType.Material; if (item.getItemType() instanceof EtcItemType) return SuppliesItemType.Miscellaneous; if (item.isWeapon()) { if (item.getItemType() == WeaponType.SWORD) return WeaponItemType.Sword; if (item.getItemType() == WeaponType.ANCIENTSWORD) return WeaponItemType.Ancient_sword; if (item.getItemType() == WeaponType.BIGSWORD) return WeaponItemType.Big_sword; if (item.getItemType() == WeaponType.BLUNT) return WeaponItemType.Blunt; if (item.getItemType() == WeaponType.BIGBLUNT) return WeaponItemType.Big_blunt; if (item.getItemType() == WeaponType.DAGGER) return WeaponItemType.Dagger; if (item.getItemType() == WeaponType.DUALDAGGER) return WeaponItemType.Dual_dagger; if (item.getItemType() == WeaponType.BOW) return WeaponItemType.Bow; if (item.getItemType() == WeaponType.CROSSBOW) return WeaponItemType.Crossbow; if (item.getItemType() == WeaponType.POLE) return WeaponItemType.Pole; if (item.getItemType() == WeaponType.DUALFIST) return WeaponItemType.Fists; if (item.getItemType() == WeaponType.RAPIER) return WeaponItemType.Rapier; return WeaponItemType.Other; } if (item.getBodyPart() == ItemTemplate.SLOT_L_HAND) if (item.getItemType() == ArmorType.SIGIL) return ArmorItemType.Sigil; else return ArmorItemType.Shield; return SuppliesItemType.Miscellaneous; } private static final int[] PET_FOOD_OR_SHOT = { 6316, 2515, 4038, 5168, 5169, 7582, 9668, 10425, 6645, 20332, 20329, 20326, 10515, 6647, 6646, 20334, 20333, 20331, 20330, 20329, 20327, 10517, 10516 }; private boolean isBabyFoodOrShot(int id) { for (int i : PET_FOOD_OR_SHOT) if (i == id) return true; return false; } public static AuctionManager getInstance() { if (_instance == null) _instance = new AuctionManager(); return _instance; } }
  2. Hello im using one shared sunrise source and im having a problem here after 20-30 mins i get this error https://prnt.sc/vxqfyw
  3. hello can some help me to add this to acis? ### Eclipse Workspace Patch 1.0 #P elfobitch Index: gameserver/head-src/com/l2jfrozen/gameserver/model/L2Attackable.java =================================================================== --- gameserver/head-src/com/l2jfrozen/gameserver/model/L2Attackable.java (revision 903) +++ gameserver/head-src/com/l2jfrozen/gameserver/model/L2Attackable.java (working copy) @@ -244,12 +244,22 @@ protected int _itemId; protected int _count; + private int _enchant = -1; + private int _chance = 0; + public RewardItem(int itemId, int count) { _itemId = itemId; _count = count; } + public RewardItem(int itemId, int count, int enchant, int chance) + { + this(itemId, count); + _enchant = enchant; + _chance = chance; + } + public int getItemId() { return _itemId; @@ -259,6 +269,9 @@ { return _count; } + + public int getEnchant() { return _enchant; } + public int getEnchantChance() { return _chance; } } /** @@ -1560,7 +1573,7 @@ } if(itemCount > 0) - return new RewardItem(drop.getItemId(), itemCount); + return new RewardItem(drop.getItemId(), itemCount, drop.getEnchant(), drop.getEnchantChance()); else if(itemCount == 0 && Config.DEBUG) { _log.fine("Roll produced 0 items to drop..."); @@ -1845,7 +1858,7 @@ } if(itemCount > 0) - return new RewardItem(drop.getItemId(), itemCount); + return new RewardItem(drop.getItemId(), itemCount, drop.getEnchant(), drop.getEnchantChance()); else if(itemCount == 0 && Config.DEBUG) { _log.fine("Roll produced 0 items to drop..."); @@ -2503,6 +2516,16 @@ // Init the dropped L2ItemInstance and add it in the world as a visible object at the position where mob was last ditem = ItemTable.getInstance().createItem("Loot", item.getItemId(), item.getCount(), mainDamageDealer, this); ditem.getDropProtection().protect(mainDamageDealer); + if(item.getEnchant() > 0) + { + if(ditem.getItem().getType1() == L2Item.TYPE1_WEAPON_RING_EARRING_NECKLACE + || ditem.getItem().getType1() == L2Item.TYPE1_SHIELD_ARMOR) + { + double chance = Rnd.get(1, 100); + if(chance <= item.getEnchantChance()) + ditem.setEnchantLevel(item.getEnchant()); + } + } ditem.dropMe(this, newX, newY, newZ); // Add drop to auto destroy item task Index: gameserver/head-src/com/l2jfrozen/gameserver/datatables/sql/NpcTable.java =================================================================== --- gameserver/head-src/com/l2jfrozen/gameserver/datatables/sql/NpcTable.java (revision 903) +++ gameserver/head-src/com/l2jfrozen/gameserver/datatables/sql/NpcTable.java (working copy) @@ -247,7 +247,7 @@ { statement = con.prepareStatement("SELECT " + L2DatabaseFactory.getInstance().safetyString(new String[] { - "mobId", "itemId", "min", "max", "category", "chance" + "mobId", "itemId", "min", "max", "category", "chance", "enchant", "enchantChance" }) + " FROM custom_droplist ORDER BY mobId, chance DESC"); ResultSet dropData = statement.executeQuery(); @@ -270,6 +270,8 @@ dropDat.setMinDrop(dropData.getInt("min")); dropDat.setMaxDrop(dropData.getInt("max")); dropDat.setChance(dropData.getInt("chance")); + dropDat.setEnchant(dropData.getInt("enchant")); + dropDat.setEnchantChance(dropData.getInt("enchantChance")); int category = dropData.getInt("category"); @@ -295,7 +297,7 @@ { statement = con.prepareStatement("SELECT " + L2DatabaseFactory.getInstance().safetyString(new String[] { - "mobId", "itemId", "min", "max", "category", "chance" + "mobId", "itemId", "min", "max", "category", "chance", "enchant", "enchantChance" }) + " FROM droplist ORDER BY mobId, chance DESC"); ResultSet dropData = statement.executeQuery(); L2DropData dropDat = null; @@ -319,6 +321,8 @@ dropDat.setMinDrop(dropData.getInt("min")); dropDat.setMaxDrop(dropData.getInt("max")); dropDat.setChance(dropData.getInt("chance")); + dropDat.setEnchant(dropData.getInt("enchant")); + dropDat.setEnchantChance(dropData.getInt("enchantChance")); int category = dropData.getInt("category"); Index: gameserver/head-src/com/l2jfrozen/gameserver/script/faenor/FaenorInterface.java =================================================================== --- gameserver/head-src/com/l2jfrozen/gameserver/script/faenor/FaenorInterface.java (revision 903) +++ gameserver/head-src/com/l2jfrozen/gameserver/script/faenor/FaenorInterface.java (working copy) @@ -82,6 +82,27 @@ addDrop(npc, drop, false); } + public void addQuestDrop(int npcID, int itemID, int min, int max, int chance, String questID, String[] states, + int enchant, int enchantChance) + { + L2NpcTemplate npc = npcTable.getTemplate(npcID); + if (npc == null) + { + _log.info("FeanorInterface: Npc "+npcID+" is null.."); + return; + } + L2DropData drop = new L2DropData(); + drop.setItemId(itemID); + drop.setMinDrop(min); + drop.setMaxDrop(max); + drop.setEnchant(enchant); + drop.setEnchantChance(enchantChance); + drop.setChance(chance); + drop.setQuestID(questID); + drop.addStates(states); + addDrop(npc, drop, false); + } + /** * Adds a new Drop to an NPC * @@ -106,7 +127,31 @@ addDrop(npc, drop, sweep); } + + public void addDrop(int npcID, int itemID, int min, int max, boolean sweep, int chance, + int enchant, int enchantChance) throws NullPointerException + { + L2NpcTemplate npc = npcTable.getTemplate(npcID); + if (npc == null) + { + if (Config.DEBUG) + { + _log.warning("Npc doesnt Exist"); + } + throw new NullPointerException(); + } + L2DropData drop = new L2DropData(); + drop.setItemId(itemID); + drop.setMinDrop(min); + drop.setMaxDrop(max); + drop.setChance(chance); + drop.setEnchant(enchant); + drop.setEnchantChance(enchantChance); + + addDrop(npc, drop, sweep); + } + /** * Adds a new drop to an NPC. If the drop is sweep, it adds it to the NPC's Sweep category If the drop is non-sweep, * it creates a new category for this drop. Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminEditNpc.java =================================================================== --- gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminEditNpc.java (revision 903) +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminEditNpc.java (working copy) @@ -407,7 +407,7 @@ e.printStackTrace(); } } - else if(st.countTokens() == 6) + else if(st.countTokens() == 8) { try { @@ -417,8 +417,10 @@ int min = Integer.parseInt(st.nextToken()); int max = Integer.parseInt(st.nextToken()); int chance = Integer.parseInt(st.nextToken()); + int enchant = Integer.parseInt(st.nextToken()); + int enchantChance = Integer.parseInt(st.nextToken()); - updateDropData(activeChar, npcId, itemId, min, max, category, chance); + updateDropData(activeChar, npcId, itemId, min, max, category, chance, enchant, enchantChance); } catch(Exception e) { @@ -430,7 +432,7 @@ } else { - activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]"); + activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance> <enchant> <enchantChance>]"); } st = null; @@ -440,7 +442,7 @@ if(Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); - activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]"); + activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance> <enchant> <enchantChance>]"); } } else if(command.startsWith("admin_add_drop ")) @@ -474,7 +476,7 @@ npcData = null; } } - else if(st.countTokens() == 6) + else if(st.countTokens() == 8) { try { @@ -484,8 +486,10 @@ int min = Integer.parseInt(st.nextToken()); int max = Integer.parseInt(st.nextToken()); int chance = Integer.parseInt(st.nextToken()); + int enchant = Integer.parseInt(st.nextToken()); + int enchantChance = Integer.parseInt(st.nextToken()); - addDropData(activeChar, npcId, itemId, min, max, category, chance); + addDropData(activeChar, npcId, itemId, min, max, category, chance, enchant, enchantChance); } catch(Exception e) { @@ -497,7 +501,7 @@ } else { - activeChar.sendMessage("Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance>]"); + activeChar.sendMessage("Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance> <enchant> <enchantChance>]"); } st = null; @@ -507,7 +511,7 @@ if(Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); - activeChar.sendMessage("Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance>]"); + activeChar.sendMessage("Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance> <enchant> <enchantChance>]"); } } else if(command.startsWith("admin_del_drop ")) @@ -1323,7 +1327,7 @@ { con = L2DatabaseFactory.getInstance().getConnection(false); - PreparedStatement statement = con.prepareStatement("SELECT mobId, itemId, min, max, category, chance FROM droplist WHERE mobId=" + npcId + " AND itemId=" + itemId + " AND category=" + category); + PreparedStatement statement = con.prepareStatement("SELECT mobId, itemId, min, max, category, chance, enchant, enchantChance FROM droplist WHERE mobId=" + npcId + " AND itemId=" + itemId + " AND category=" + category); ResultSet dropData = statement.executeQuery(); NpcHtmlMessage adminReply = new NpcHtmlMessage(5); @@ -1340,9 +1344,11 @@ replyMSG.append("<tr><td>MIN(" + dropData.getInt("min") + ")</td><td><edit var=\"min\" width=80></td></tr>"); replyMSG.append("<tr><td>MAX(" + dropData.getInt("max") + ")</td><td><edit var=\"max\" width=80></td></tr>"); replyMSG.append("<tr><td>CHANCE(" + dropData.getInt("chance") + ")</td><td><edit var=\"chance\" width=80></td></tr>"); + replyMSG.append("<tr><td>ENC-VALUE(" + dropData.getInt("enchant") + ")</td><td><edit var=\"enchant\" width=80></td></tr>"); + replyMSG.append("<tr><td>ENC-CHANCE(" + dropData.getInt("enchantChance") + ")</td><td><edit var=\"enchantChance\" width=80></td></tr>"); replyMSG.append("</table>"); replyMSG.append("<center>"); - replyMSG.append("<button value=\"Save Modify\" action=\"bypass -h admin_edit_drop " + npcId + " " + itemId + " " + category + " $min $max $chance\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">"); + replyMSG.append("<button value=\"Save Modify\" action=\"bypass -h admin_edit_drop " + npcId + " " + itemId + " " + category + " $min $max $chance $enchant $enchantChance\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">"); replyMSG.append("<br><button value=\"DropList\" action=\"bypass -h admin_show_droplist " + dropData.getInt("mobId") + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">"); replyMSG.append("</center>"); } @@ -1383,9 +1389,11 @@ replyMSG.append("<tr><td>MAX</td><td><edit var=\"max\" width=80></td></tr>"); replyMSG.append("<tr><td>CATEGORY(sweep=-1)</td><td><edit var=\"category\" width=80></td></tr>"); replyMSG.append("<tr><td>CHANCE(0-1000000)</td><td><edit var=\"chance\" width=80></td></tr>"); + replyMSG.append("<tr><td>ENC-VALUE(0-65535)</td><td><edit var=\"enchant\" width=80></td></tr>"); + replyMSG.append("<tr><td>ENC-CHANCE(0-100)</td><td><edit var=\"enchantChance\" width=80></td></tr>"); replyMSG.append("</table>"); replyMSG.append("<center>"); - replyMSG.append("<button value=\"SAVE\" action=\"bypass -h admin_add_drop " + npcData.npcId + " $itemId $category $min $max $chance\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">"); + replyMSG.append("<button value=\"SAVE\" action=\"bypass -h admin_add_drop " + npcData.npcId + " $itemId $category $min $max $chance $enchant $enchantChance\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">"); replyMSG.append("<br><button value=\"DropList\" action=\"bypass -h admin_show_droplist " + npcData.npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">"); replyMSG.append("</center>"); replyMSG.append("</body></html>"); @@ -1397,7 +1405,7 @@ replyMSG = null; } - private void updateDropData(L2PcInstance activeChar, int npcId, int itemId, int min, int max, int category, int chance) + private void updateDropData(L2PcInstance activeChar, int npcId, int itemId, int min, int max, int category, int chance, int enchant, int enchantChance) { Connection con = null; @@ -1405,13 +1413,15 @@ { con = L2DatabaseFactory.getInstance().getConnection(false); - PreparedStatement statement = con.prepareStatement("UPDATE droplist SET min=?, max=?, chance=? WHERE mobId=? AND itemId=? AND category=?"); + PreparedStatement statement = con.prepareStatement("UPDATE droplist SET min=?, max=?, chance=?, enchant=?, enchantChance=? WHERE mobId=? AND itemId=? AND category=?"); statement.setInt(1, min); statement.setInt(2, max); statement.setInt(3, chance); statement.setInt(4, npcId); statement.setInt(5, itemId); statement.setInt(6, category); + statement.setInt(7, enchant); + statement.setInt(8, enchantChance); statement.execute(); statement.close(); @@ -1464,7 +1474,7 @@ } } - private void addDropData(L2PcInstance activeChar, int npcId, int itemId, int min, int max, int category, int chance) + private void addDropData(L2PcInstance activeChar, int npcId, int itemId, int min, int max, int category, int chance, int enchant, int enchantChance) { Connection con = null; @@ -1472,13 +1482,16 @@ { con = L2DatabaseFactory.getInstance().getConnection(false); - PreparedStatement statement = con.prepareStatement("INSERT INTO droplist(mobId, itemId, min, max, category, chance) values(?,?,?,?,?,?)"); + PreparedStatement statement = con.prepareStatement("INSERT INTO droplist(mobId, itemId, min, max, category, chance, enchant, enchantChance) values(?,?,?,?,?,?,?,?)"); statement.setInt(1, npcId); statement.setInt(2, itemId); statement.setInt(3, min); statement.setInt(4, max); statement.setInt(5, category); statement.setInt(6, chance); + statement.setInt(7, enchant); + statement.setInt(8, enchantChance); + statement.execute(); statement.close(); statement = null; @@ -1573,7 +1586,7 @@ PreparedStatement statement = con.prepareStatement("SELECT " + L2DatabaseFactory.getInstance().safetyString(new String[] { - "mobId", "itemId", "min", "max", "category", "chance" + "mobId", "itemId", "min", "max", "category", "chance", "enchant", "enchantChance" }) + " FROM droplist WHERE mobId=?"); statement.setInt(1, npcId); ResultSet dropDataList = statement.executeQuery(); @@ -1586,6 +1599,8 @@ dropData.setMinDrop(dropDataList.getInt("min")); dropData.setMaxDrop(dropDataList.getInt("max")); dropData.setChance(dropDataList.getInt("chance")); + dropData.setEnchant(dropDataList.getInt("enchant")); + dropData.setEnchantChance(dropDataList.getInt("enchantChance")); int category = dropDataList.getInt("category"); Index: gameserver/head-src/com/l2jfrozen/gameserver/model/L2DropData.java =================================================================== --- gameserver/head-src/com/l2jfrozen/gameserver/model/L2DropData.java (revision 903) +++ gameserver/head-src/com/l2jfrozen/gameserver/model/L2DropData.java (working copy) @@ -33,6 +33,8 @@ private int _minDrop; private int _maxDrop; private int _chance; + private int _dropEnchant = -1; + private int _enchantChance = 0; private String _questID = null; private String[] _stateID = null; @@ -55,7 +57,17 @@ { _itemId = itemId; } - + + public void setEnchant(final int enchant) + { + _dropEnchant = enchant; + } + + public void setEnchantChance(final int chance) + { + _enchantChance = chance; + } + /** * Returns the minimum quantity of items dropped * @@ -86,6 +98,16 @@ return _chance; } + public int getEnchant() + { + return _dropEnchant; + } + + public int getEnchantChance() + { + return _enchantChance; + } + /** * Sets the value for minimal quantity of dropped items * ALTER TABLE `droplist` ADD `enchant` int(5) DEFAULT -1; ALTER TABLE `droplist` ADD `enchantChance` int(3) DEFAULT 0; ALTER TABLE `custom_droplist` ADD `enchant` int(5) DEFAULT -1; ALTER TABLE `custom_droplist` ADD `enchantChance` int(3) DEFAULT 0;
  4. h5 doesnt neeed you to put anything in there go to the abnormal effects and you will see it
  5. Does anyone how can i make basemul work on hi5 project? i know i can use mul but as i have seen they are not working the same way
  6. Does anyone know how can i remove from the stats this numbers? here is a picture https://prnt.sc/s8acll let's say from the patk i want to remove the .0 in the end here is the code /* * Copyright (C) 2004-2015 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack 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 handlers.actionshifthandlers; import l2r.Config; import l2r.gameserver.data.xml.impl.ItemData; import l2r.gameserver.enums.InstanceType; import l2r.gameserver.handler.IActionShiftHandler; import l2r.gameserver.instancemanager.WalkingManager; import l2r.gameserver.model.Elementals; import l2r.gameserver.model.L2DropCategory; import l2r.gameserver.model.L2DropData; import l2r.gameserver.model.L2Object; import l2r.gameserver.model.actor.L2Attackable; import l2r.gameserver.model.actor.L2Character; import l2r.gameserver.model.actor.L2Npc; import l2r.gameserver.model.actor.instance.L2PcInstance; import l2r.gameserver.model.items.L2Item; import l2r.gameserver.model.stats.BaseStats; import l2r.gameserver.model.stats.Stats; import l2r.gameserver.network.serverpackets.NpcHtmlMessage; import l2r.util.StringUtil; public class L2NpcActionShift implements IActionShiftHandler { /** * Manage and Display the GM console to modify the L2NpcInstance (GM only).<BR> * <BR> * <B><U> Actions (If the L2PcInstance is a GM only)</U> :</B><BR> * <BR> * <li>Set the L2NpcInstance as target of the L2PcInstance player (if necessary)</li> * <li>Send a Server->Client packet MyTargetSelected to the L2PcInstance player (display the select window)</li> * <li>If L2NpcInstance is autoAttackable, send a Server->Client packet StatusUpdate to the L2PcInstance in order to update L2NpcInstance HP bar</li> * <li>Send a Server->Client NpcHtmlMessage() containing the GM console about this L2NpcInstance</li><BR> * <BR> * <FONT COLOR=#FF0000><B> <U>Caution</U> : Each group of Server->Client packet must be terminated by a ActionFailed packet in order to avoid that client wait an other packet</B></FONT><BR> * <BR> * <B><U> Example of use </U> :</B><BR> * <BR> * <li>Client packet : Action</li><BR> * <BR> */ @Override public boolean action(L2PcInstance activeChar, L2Object target, boolean interact) { // Check if the L2PcInstance is a GM if (activeChar.getAccessLevel().isGm()) { // Set the target of the L2PcInstance activeChar activeChar.setTarget(target); final NpcHtmlMessage html = new NpcHtmlMessage(); html.setFile(activeChar, activeChar.getHtmlPrefix(), "data/html/admin/npcinfo.htm"); html.replace("%objid%", String.valueOf(target.getObjectId())); html.replace("%class%", target.getClass().getSimpleName()); html.replace("%id%", String.valueOf(((L2Npc) target).getTemplate().getId())); html.replace("%lvl%", String.valueOf(((L2Npc) target).getTemplate().getLevel())); html.replace("%name%", String.valueOf(((L2Npc) target).getTemplate().getName())); html.replace("%tmplid%", String.valueOf(((L2Npc) target).getTemplate().getId())); html.replace("%aggro%", String.valueOf((target instanceof L2Attackable) ? ((L2Attackable) target).getAggroRange() : 0)); html.replace("%hp%", String.valueOf((int) ((L2Character) target).getCurrentHp())); html.replace("%hpmax%", String.valueOf(((L2Character) target).getMaxHp())); html.replace("%mp%", String.valueOf((int) ((L2Character) target).getCurrentMp())); html.replace("%mpmax%", String.valueOf(((L2Character) target).getMaxMp())); html.replace("%pAtk%", String.valueOf((int) ((L2Character) target).getPAtk(null))); html.replace("%mAtk%", String.valueOf((int) ((L2Character) target).getMAtk(null, null))); html.replace("%pDef%", String.valueOf((int) ((L2Character) target).getPDef(null))); html.replace("%mDef%", String.valueOf((int) ((L2Character) target).getMDef(null, null))); html.replace("%accu%", String.valueOf(((L2Character) target).getAccuracy())); html.replace("%evas%", String.valueOf(((L2Character) target).getEvasionRate(null))); html.replace("%crit%", String.valueOf(((L2Character) target).getCriticalHit(null, null))); html.replace("%runspd%", String.valueOf(((L2Character) target).getRunSpeed())); html.replace("%pAtkSpd%", String.valueOf(((L2Character) target).getPAtkSpd())); html.replace("%mAtkSpd%", String.valueOf(((L2Character) target).getMAtkSpd())); html.replace("%str%", String.valueOf(((L2Character) target).getSTR())); html.replace("%dex%", String.valueOf(((L2Character) target).getDEX())); html.replace("%con%", String.valueOf(((L2Character) target).getCON())); html.replace("%int%", String.valueOf(((L2Character) target).getINT())); html.replace("%wit%", String.valueOf(((L2Character) target).getWIT())); html.replace("%men%", String.valueOf(((L2Character) target).getMEN())); html.replace("%loc%", String.valueOf(target.getX() + " " + target.getY() + " " + target.getZ())); html.replace("%heading%", String.valueOf(((L2Character) target).getHeading())); html.replace("%collision_radius%", String.valueOf(((L2Character) target).getTemplate().getfCollisionRadius())); html.replace("%collision_height%", String.valueOf(((L2Character) target).getTemplate().getfCollisionHeight())); html.replace("%dist%", String.valueOf((int) activeChar.calculateDistance(target, true, false))); byte attackAttribute = ((L2Character) target).getAttackElement(); html.replace("%ele_atk%", Elementals.getElementName(attackAttribute)); html.replace("%ele_atk_value%", String.valueOf(((L2Character) target).getAttackElementValue(attackAttribute))); html.replace("%ele_dfire%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.FIRE))); html.replace("%ele_dwater%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.WATER))); html.replace("%ele_dwind%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.WIND))); html.replace("%ele_dearth%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.EARTH))); html.replace("%ele_dholy%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.HOLY))); html.replace("%ele_ddark%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.DARK))); if (((L2Npc) target).getSpawn() != null) { html.replace("%territory%", ((L2Npc) target).getSpawn().getSpawnTerritory() == null ? "None" : ((L2Npc) target).getSpawn().getSpawnTerritory().getName()); if (((L2Npc) target).getSpawn().isTerritoryBased()) { html.replace("%spawntype%", "Random"); html.replace("%spawn%", ((L2Npc) target).getSpawn().getX(target) + " " + ((L2Npc) target).getSpawn().getY(target) + " " + ((L2Npc) target).getSpawn().getZ(target)); } else { html.replace("%spawntype%", "Fixed"); html.replace("%spawn%", ((L2Npc) target).getSpawn().getX() + " " + ((L2Npc) target).getSpawn().getY() + " " + ((L2Npc) target).getSpawn().getZ()); } html.replace("%loc2d%", String.valueOf((int) target.calculateDistance(((L2Npc) target).getSpawn().getLocation(target), false, false))); html.replace("%loc3d%", String.valueOf((int) target.calculateDistance(((L2Npc) target).getSpawn().getLocation(target), true, false))); if (((L2Npc) target).getSpawn().getRespawnMinDelay() == 0) { html.replace("%resp%", "None"); } else if (((L2Npc) target).getSpawn().hasRespawnRandom()) { html.replace("%resp%", String.valueOf(((L2Npc) target).getSpawn().getRespawnMinDelay() / 1000) + "-" + String.valueOf((((L2Npc) target).getSpawn().getRespawnMaxDelay() / 1000) + " sec")); } else { html.replace("%resp%", String.valueOf(((L2Npc) target).getSpawn().getRespawnMinDelay() / 1000) + " sec"); } } else { html.replace("%territory%", "<font color=FF0000>--</font>"); html.replace("%spawntype%", "<font color=FF0000>--</font>"); html.replace("%spawn%", "<font color=FF0000>null</font>"); html.replace("%loc2d%", "<font color=FF0000>--</font>"); html.replace("%loc3d%", "<font color=FF0000>--</font>"); html.replace("%resp%", "<font color=FF0000>--</font>"); } if (((L2Npc) target).hasAI()) { html.replace("%ai_intention%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getAI().getIntention().name()) + "</td></tr></table></td></tr>"); html.replace("%ai%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>" + ((L2Npc) target).getAI().getClass().getSimpleName() + "</td></tr></table></td></tr>"); html.replace("%ai_type%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>AIType</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getAiType()) + "</td></tr></table></td></tr>"); html.replace("%ai_clan%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Clan & Range:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getClan()) + " " + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getClanRange()) + "</td></tr></table></td></tr>"); html.replace("%ai_enemy_clan%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Enemy & Range:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getEnemyClan()) + " " + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getEnemyRange()) + "</td></tr></table></td></tr>"); html.replace("%ai_can_random_walk%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Random Walk:</font></td><td align=right width=170>" + !((L2Npc) target).isNoRndWalk() + "</td></tr></table></td></tr>"); } else { html.replace("%ai_intention%", ""); html.replace("%ai%", ""); html.replace("%ai_type%", ""); html.replace("%ai_clan%", ""); html.replace("%ai_enemy_clan%", ""); html.replace("%ai_can_random_walk%", ""); } final String routeName = WalkingManager.getInstance().getRouteName((L2Npc) target); if (!routeName.isEmpty()) { html.replace("%route%", "<tr><td><table width=270 border=0><tr><td width=100><font color=LEVEL>Route:</font></td><td align=right width=170>" + routeName + "</td></tr></table></td></tr>"); } else { html.replace("%route%", ""); } activeChar.sendPacket(html); } else if (Config.ALT_GAME_VIEWNPC) { // Set the target of the L2PcInstance activeChar activeChar.setTarget(target); final NpcHtmlMessage html = new NpcHtmlMessage(); int hpMul = Math.round((float) (((L2Character) target).getStat().calcStat(Stats.MAX_HP, 1, (L2Character) target, null) / BaseStats.CON.calcBonus((L2Character) target))); if (hpMul == 0) { hpMul = 1; } final StringBuilder html1 = StringUtil.startAppend(1000, "<html><body><title> Info of " + String.valueOf(((L2Npc) target).getTemplate().getName()) + "</title>" + "<br><center><font color=\"LEVEL\">[Combat Stats]</font></center>" + "<table border=0 width=\"100%\">" + "<tr><td width=30>HP</td><td>", String.valueOf((int) ((L2Character) target).getCurrentHp()), "</td><td>MP</td><td>", String.valueOf((int) ((L2Character) target).getCurrentMp()), "</td></tr>" + "<tr><td>P.Atk</td><td>", String.valueOf(((L2Character) target).getPAtk(null)), "</td><td>M.Atk</td><td>", String.valueOf(((L2Character) target).getMAtk(null, null)), "</td></tr>" + "<tr><td>P.Def</td><td>", String.valueOf(((L2Character) target).getPDef(null)), "</td><td>M.Def</td><td>", String.valueOf(((L2Character) target).getMDef(null, null)), "</td></tr>" + "<tr><td>Accuracy</td><td>", String.valueOf(((L2Character) target).getAccuracy()), "</td><td>Evasion</td><td>", String.valueOf(((L2Character) target).getEvasionRate(null)), "</td></tr>" + "<tr><td>Critical</td><td>", String.valueOf(((L2Character) target).getCriticalHit(null, null)), "</td><td>Speed</td><td>", String.valueOf(((L2Character) target).getRunSpeed()), "</td></tr>" + "<tr><td>Atkspd</td><td>", String.valueOf(((L2Character) target).getPAtkSpd()), "</td><td>Cstspd</td><td>", String.valueOf(((L2Character) target).getMAtkSpd()), "</td></tr>" + "<tr><td>Race</td><td>", ((L2Npc) target).getTemplate().getRace().toString(), "</td><td>Respawn</td><td>", String.valueOf(((L2Npc) target).getSpawn().getRespawnMaxDelay() / 1000) + " sec" + "</td></tr>", "</table>"); if (!((L2Npc) target).getTemplate().getDropData().isEmpty()) { String dropcount = drop.getPartyDropCount() >= 1 ? drop.getPartyDropCount() + "x" + drop.getMinDrop() : drop.getMinDrop() + "-" + drop.getMaxDrop(); StringUtil.append(html1, "<tr><td><img src=\"" + item.getIcon() + "\" height=32 width=32></td>" + "<td><font color=\"", color, "\">", item.getName(), "</font></td><td>", dropcount, "</td><td>", (drop.isQuestDrop() ? "Q" : (cat.isSweep() ? "S" : "D")), "</td></tr>"); } } html1.append("</table>"); } html1.append("</body></html>"); html.setHtml(html1.toString()); activeChar.sendPacket(html); } return true; } @Override public InstanceType getInstanceType() { return InstanceType.L2Npc; } }
  7. cant i edit them to be visual like dual swords and not daggers?
  8. hello i'm trying to do somthing but i dont think im doing it right im trying to fix the animation on kamaels and orcs with dual daggers make them visible as dual swords because their animation stucks here is the weapongrp 0 16152 1 1 7 10 0 LineageWeapons.SkullEdge_m00_wp LineageWeapons.SkullEdge_m00_wp LineageWeaponsTex.SkullEdge_t00 LineageWeaponsTex.SkullEdge_t00 0 0 0 0 0 1 1 0 icon.dual_dagger_i00 -1 2050 8 1 0 0 1 7 10 2 LineageWeapons.SkullEdge_m00_wp LineageWeapons.SkullEdge_m00_wp 1 1 2 LineageWeaponsTex.SkullEdge_t00 LineageWeaponsTex.SkullEdge_t00 1 ItemSound.itemdrop_sword ItemSound.itemequip_sword 10 415 183 15 7 12 -3 0 0 0 433 0 1 1 1000 0 -1 0 LineageEffect.c_u000 LineageEffect.c_u000 -2.00000000 0.00000000 0.00000000 -5.00000000 0.00000000 0.00000000 0.69999999 1.20000005 0.89999998 0.60000002 LineageWeapons.rangesample LineageWeapons.rangesample 1.10000002 0.60000002 0.60000002 1.20000005 0.80000001 0.80000001 10.00000000 0.00000000 0.00000000 8.50000000 0.00000000 0.00000000 4 4 -1 -1 -1 -1
  9. http://www.mediafire.com/file/2v9rygc4j6tul5z/DEADZ_2.4_Fix.rar/file