Jump to content
  • 0

Where to find player death


Question

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

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.

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Hello friends, good morning, good afternoon or good evening, depending on the time you are seeing this! I have been trying to decompile and compile again with only the classes that I want LineageEffect.u for a few days now, but I have not been successful. Could someone help me by clearing up some doubts about how I can do this work and be successful?!
    • **INTERLUDE REMASTERED** Moonland is a server that's been running for about three years without wipe, and they don't plan on wiping it anytime soon. I'm selling my items or even the account due to not having much time to play anymore. I'm selling only for $$$. Not going to disclose my nickname in the server, but here are some of the items: Lvl 5 equipment for both mage and fighter +100 mage pvp set 2mastery jewels for fighter, 2 for mage, blessed antharas, blessed queen ant, ring of fallen angel, earring of fafurion. 1k + col, VIP cosmetics for armor, agathion and weapons(duals + mage wep)   I'm only selling for real money via paypal or cs2 skins so don't offer me anything else.
    • ➡ Discount for your purchase: MAY2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: MAY2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
  • Topics

×
×
  • Create New...