AndreisS Posted May 28, 2009 Posted May 28, 2009 Hello, If anyone could tell me where to find in l2j java files. I want to make the player drop something from PVP or PK from the winning player's inventory. Thanks alot! Quote
0 NosferatusS Posted May 28, 2009 Posted May 28, 2009 u can edit that in gameserver/config... dunno exacly which file, just check a little u will find soon.. just search for karma :) Quote
0 Horus Posted May 28, 2009 Posted May 28, 2009 Hello, If anyone could tell me where to find in l2j java files. I want to make the player drop something from the pvp or pk. Thanks alot! L2PcInstance doDie() Quote
0 AndreisS Posted May 28, 2009 Author Posted May 28, 2009 sorry, i meant...drop something from PVP or PK from the winning player's inventory. Quote
0 Horus Posted May 28, 2009 Posted May 28, 2009 sorry, i meant...drop something from PVP or PK from the winning player's inventory. Get doDie() and make a random chance of player dropping a specific item. Quote
0 ult7ras Posted May 28, 2009 Posted May 28, 2009 it is a custom feature in ZeRo*'s pack! i dont know how he did that ! better ask him.. Quote
0 Horus Posted May 28, 2009 Posted May 28, 2009 it is a custom feature in ZeRo*'s pack! i dont know how he did that ! better ask him.. Its very simple actually. I did it in many other posts roby, sorry but I wont make people their code anymore. If you want special features make them, I'm here to offer support not to dev for you people ;) Quote
0 AndreisS Posted May 28, 2009 Author Posted May 28, 2009 Ok, so this is the function. I'll have to remove this "(!isInsideZone(ZONE_PVP) || pk == null) &&" (from the first if statement). From what I can tell this is the only modification needs to be made. Am I correct ? Thank you again. private void onDieDropItem(L2Character killer) { if (atEvent || killer == null) return; L2PcInstance pk = killer.getActingPlayer(); if (getKarma() <= 0 && pk != null && pk.getClan() != null && getClan() != null && ( pk.getClan().isAtWarWith(getClanId()) // || this.getClan().isAtWarWith(((L2PcInstance)killer).getClanId()) ) ) return; if ((!isInsideZone(ZONE_PVP) || pk == null) && (!isGM() || Config.KARMA_DROP_GM)) { boolean isKarmaDrop = false; boolean isKillerNpc = (killer instanceof L2Npc); int pkLimit = Config.KARMA_PK_LIMIT; int dropEquip = 0; int dropEquipWeapon = 0; int dropItem = 0; int dropLimit = 0; int dropPercent = 0; if (getKarma() > 0 && getPkKills() >= pkLimit) { isKarmaDrop = true; dropPercent = Config.KARMA_RATE_DROP; dropEquip = Config.KARMA_RATE_DROP_EQUIP; dropEquipWeapon = Config.KARMA_RATE_DROP_EQUIP_WEAPON; dropItem = Config.KARMA_RATE_DROP_ITEM; dropLimit = Config.KARMA_DROP_LIMIT; } else if (isKillerNpc && getLevel() > 4 && !isFestivalParticipant()) { dropPercent = Config.PLAYER_RATE_DROP; dropEquip = Config.PLAYER_RATE_DROP_EQUIP; dropEquipWeapon = Config.PLAYER_RATE_DROP_EQUIP_WEAPON; dropItem = Config.PLAYER_RATE_DROP_ITEM; dropLimit = Config.PLAYER_DROP_LIMIT; } int dropCount = 0; while (dropPercent > 0 && Rnd.get(100) < dropPercent && dropCount < dropLimit) { int itemDropPercent = 0; List<Integer> nonDroppableList = new FastList<Integer>(); List<Integer> nonDroppableListPet = new FastList<Integer>(); nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS; nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS; for (L2ItemInstance itemDrop : getInventory().getItems()) { // Don't drop if ( itemDrop.isShadowItem() || // Dont drop Shadow Items !itemDrop.isDropable() || itemDrop.getItemId() == 57 || // Adena itemDrop.getItem().getType2() == L2Item.TYPE2_QUEST || // Quest Items nonDroppableList.contains(itemDrop.getItemId()) || // Item listed in the non droppable item list nonDroppableListPet.contains(itemDrop.getItemId()) || // Item listed in the non droppable pet item list getPet() != null && getPet().getControlItemId() == itemDrop.getItemId() // Control Item of active pet ) continue; if (itemDrop.isEquipped()) { // Set proper chance according to Item type of equipped Item itemDropPercent = itemDrop.getItem().getType2() == L2Item.TYPE2_WEAPON ? dropEquipWeapon : dropEquip; getInventory().unEquipItemInSlotAndRecord(itemDrop.getLocationSlot()); } else itemDropPercent = dropItem; // Item in inventory // NOTE: Each time an item is dropped, the chance of another item being dropped gets lesser (dropCount * 2) if (Rnd.get(100) < itemDropPercent) { dropItem("DieDrop", itemDrop, killer, true); if (isKarmaDrop) _log.warning(getName() + " has karma and dropped id = " + itemDrop.getItemId() + ", count = " + itemDrop.getCount()); else _log.warning(getName() + " dropped id = " + itemDrop.getItemId() + ", count = " + itemDrop.getCount()); dropCount++; break; } } } } } Quote
0 Horus Posted May 28, 2009 Posted May 28, 2009 if you want it to drop even if its PK and even if they're inside non-pvp areas then sure,you should do that Quote
0 AndreisS Posted May 29, 2009 Author Posted May 29, 2009 yes but I don't want the player to drop if he's in town. (other players can make mob trains...). Any ideas ? Quote
0 Intrepid Posted May 29, 2009 Posted May 29, 2009 yes but I don't want the player to drop if he's in town. (other players can make mob trains...). Any ideas ? add a check for TOWN_ZONE and you are done Quote
0 zunix Posted May 29, 2009 Posted May 29, 2009 u just have to check if the Killer of that Player is a Player and not a mob ;) Quote
0 AndreisS Posted May 29, 2009 Author Posted May 29, 2009 I tried to modify from this "else if (isKillerNpc && getLevel() > 4 && !isFestivalParticipant())" to this " else if (getLevel() > 4 && !isFestivalParticipant()) but it doesn't work. Quote
Question
AndreisS
Hello,
If anyone could tell me where to find in l2j java files.
I want to make the player drop something from PVP or PK from the winning player's inventory.
Thanks alot!
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.