Jump to content
  • 0

Where to find player death


Question

Posted

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

  • 0
Posted

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()

  • 0
Posted

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.

  • 0
Posted

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 ;)

  • 0
Posted

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;

}

}

}

}

}

 

  • 0
Posted

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

  • 0
Posted

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

  • 0
Posted

I tried to modify from this "else if (isKillerNpc && getLevel() > 4 && !isFestivalParticipant())" to this " else if (getLevel() > 4 && !isFestivalParticipant())

but it doesn't work.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock