Index: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/pc/PcStat.java =================================================================== --- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/pc/PcStat.java (revision 2201) +++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/pc/PcStat.java (working copy) @@ -38,7 +38,8 @@ int karmaRemove = value; karmaRemove /= Config.KARMA_XP_DIVIDER; - if (karmaRemove < 0) karmaRemove = 0; + // low level chars killing mobs with less XP than divider should still lose karma. + if (karmaRemove < 0) karmaRemove = 1; if (karmaRemove > getActiveChar().getKarma()) karmaRemove = getActiveChar().getKarma(); getActiveChar().setKarma(getActiveChar().getKarma() - karmaRemove); } Index: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/L2PcInstance.java =================================================================== --- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/L2PcInstance.java (revision 2201) +++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/L2PcInstance.java (working copy) @@ -2354,6 +2354,8 @@ */ public void doDie(L2Character killer) { + int lostXP=0; //useful for new karma reduction...Team Olympus. + // Kill the L2PcInstance super.doDie(killer); @@ -2364,15 +2366,15 @@ { if (!ZoneManager.getInstance().checkIfInZonePvP(this) && (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 4)) if(killer instanceof L2PcInstance && ((L2PcInstance)killer).getClan() != null && this.getClan() != null && this.getClan().isAtWarWith(((L2PcInstance)killer).getClanId())) - deathPenalty(true); + lostXP=deathPenalty(true); else - deathPenalty(false); + lostXP=deathPenalty(false); } onDieDropItem(killer); // Check if any item should be dropped } - onDieUpdateKarma(); + onDieUpdateKarma(lostXP); setPvpFlag(0); // Clear the pvp flag // Unsummon the Pet @@ -2417,13 +2419,14 @@ Random rand = new Random(); boolean dropGM = Config.KARMA_DROP_GM; // do GMs drop gear or not? true = yes, false = no int dropPKLim = Config.KARMA_PK_LIMIT; // you do not drop items if you have less than dropPKLim PKs + int droptype = 0; //initialize if ( thisKarma > 0 && !(this.getPkKills() < dropPKLim && killer instanceof L2NpcInstance) && !ZoneManager.getInstance().checkIfInZonePvP(this)) { // Get drop settings //boolean gmStat = false; // keeps track of if player is a gm or not and if they are able to drop items int dropConstant = Config.KARMA_DROP_CONSTANT; // a constant used for drop chance calculation - //int dropLim = Config.KARMA_DROP_ITEM_LIMIT; // dropLim items dropped at most, equipped or unequipped doesnt matter. + int dropLim = Config.KARMA_DROP_ITEM_LIMIT; // dropLim items dropped at most, equipped or unequipped doesnt matter. //int randDropLim = Config.KARMA_RANDOM_DROP_LOCATION_LIMIT; // max amount of x/y units a dropped item may be placed double dropRate = Config.RATE_DROP_EQUIPMENT; // drop rate... double dropChanceINIT = Config.KARMA_DROPCHANCE_INITIAL_CHECK; // dropChanceINIT% drop chance, initial check @@ -2440,123 +2443,163 @@ dropequipweap = (int)dropChanceEQUIP_WEAP; count = 0; while (!(isGM() && !dropGM) && - this.getPkKills() >= dropPKLim && rand.nextInt(100)0){ - int itemnrtodrop = rand.nextInt(count); - count = 0; - for (L2ItemInstance itemdrop : _inventory.getItems()){ - if (itemdrop.getItemId()!=57 && L2Item.TYPE2_QUEST != itemdrop.getItem().getType2() && - !noDropList.contains(itemdrop.getItemId()) && !petList.contains(itemdrop.getItemId())) - if ((!itemdrop.isEquipped() && droptype < dropitems) || - (itemdrop.isEquipped() && itemdrop.getItem().getType2() != L2Item.TYPE2_WEAPON && droptype < (dropitems + dropequip)) || - (itemdrop.isEquipped() && itemdrop.getItem().getType2() == L2Item.TYPE2_WEAPON && droptype >= (dropitems + dropequip))) - { - if (count == itemnrtodrop){ - if (itemdrop.isEquipped()) - this.getInventory().unEquipItemInSlotAndRecord(itemdrop.getEquipSlot()); - itemdrop = this.getInventory().dropItem(itemdrop,itemdrop.getCount()); - itemdrop.dropMe(this, this.getClientX(), this.getClientY(), this.getClientZ() + 20); - SystemMessage sm = new SystemMessage(298); - sm.addItemName(itemdrop.getItemId()); - this.sendPacket(sm); - InventoryUpdate iu = new InventoryUpdate(); // for inventory updating - iu.addRemovedItem(itemdrop); - this.sendPacket(iu); - _log.warning(getName()+" have karma and dropped id="+itemdrop.getItemId()+", count="+itemdrop.getCount()); - - break; - } - count++; - } - } - } - droppercent /= 1.5; + this.getPkKills() >= dropPKLim && rand.nextInt(100)0){ - int itemnrtodrop = rand.nextInt(count); - count = 0; - for (L2ItemInstance itemdrop : _inventory.getItems()){ - if (itemdrop.getItemId()!=57 && L2Item.TYPE2_QUEST != itemdrop.getItem().getType2() && - !noDropList.contains(itemdrop.getItemId()) && !petList.contains(itemdrop.getItemId())) - if ((!itemdrop.isEquipped() && droptype < dropitems) || - (itemdrop.isEquipped() && itemdrop.getItem().getType2() != L2Item.TYPE2_WEAPON && droptype < (dropitems + dropequip)) || - (itemdrop.isEquipped() && itemdrop.getItem().getType2() == L2Item.TYPE2_WEAPON && droptype >= (dropitems + dropequip))) - { - if (count == itemnrtodrop){ - if (itemdrop.isEquipped()) - this.getInventory().unEquipItemInSlotAndRecord(itemdrop.getEquipSlot()); - itemdrop = this.getInventory().dropItem(itemdrop,itemdrop.getCount()); - itemdrop.dropMe(this, this.getClientX(), this.getClientY(), this.getClientZ() + 20); - SystemMessage sm = new SystemMessage(298); - sm.addItemName(itemdrop.getItemId()); - this.sendPacket(sm); - InventoryUpdate iu = new InventoryUpdate(); // for inventory updating - iu.addRemovedItem(itemdrop); - this.sendPacket(iu); - _log.warning(getName()+" died and dropped id="+itemdrop.getItemId()+", count="+itemdrop.getCount()); - break; - } - count++; - } - } - } - droppercent /= 5; - } } + else if (!ZoneManager.getInstance().checkIfInZonePvP(this) || !isFestivalParticipant() ) + { + //if player haven't karma and lvl>4 and chance of drop 50% + droppercent = Config.PLAYER_RATE_DROP; + dropequip = Config.PLAYER_RATE_DROP_EQUIP; + dropequipweap = Config.PLAYER_RATE_DROP_EQUIP_WEAPON; + dropitems = Config.PLAYER_RATE_DROP_ITEM; + // whites should ONLY drop 1 item max. + if(!(isGM() && !dropGM) && killer instanceof L2NpcInstance + && getLevel()>4 && rand.nextInt(100)