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

    • whats password from the archivie ?
    • All that shit are false positives of the vanganth cliext, sources are well and who sell it is a big scammer
    • Information Selling a premium Lineage 2 High Five (L2J) project with active development, available by subscription. Includes Git support and access to compiled or full source code. Ideal for serious server owners seeking stability and performance, uniqueness and well-done features.   General Project Specifications: JDK Version: 23 -> 24 Chronicle: HighFive Structure: Core & Datapack merged into a single project Database: MariaDB Database Driver: HicariCP GIT Website: gitlab.com   Features include (but are not limited to):   1. Tournament Single & Party (Check Youtube Video) 2. Faction (Check Youtube Video) 3. Event Engine (Check Youtube Video) 4. Sell Buff System (Check Youtube Video) 5. Start UP System (Check Youtube Video) 6. User Panel 7. Visual - Dress me System 8. Donate Store 9. Automatic Farm System (Check Youtube Video) 10. Captcha (Anti-BOT) (Check Youtube Video) 11. Auction (Check Youtube Video) 12. Vote (API) 13. Admin Real Time Balance (Check Youtube Video) 14. Achievements (Check Youtube Video) 15. Daily Mission (Check Youtube Video) 16. A.I. Bot (Check Youtube Video) 17. Rebirth 18. Daily Reward  19. Skill Tree - Ability System 20. Craft System 21. Twitch Automatic Reward (Check Youtube Video) 22. Quiz Game (Check Youtube Video) 23. Automatic Item Enchant (Check Youtube Video) 24. Secondary Auth Using Google Authenticator (Check Youtube Video) 25. Gm Shop - Gatekeeper - Scheme Buffer   How to get Access (Payment Subscription): To get Access you either pay monthly subscription to GIT for source or Compiled. Project is currently active and has at least 1-2 commit / day.  Clients in both Compiled & Source subscription can request features or any addon in already existing mods inside discord.   Price per Month (Source) in GIT: 250 Eur Price per Month (Compiled) in GIT: 100 Eur   Contact: To get Access or ask further information join discord  https://discord.gg/gKAsAhJNuq      
    • We're officially closing the current season today. While we focus on refining the Essence project, our resources will temporarily shift toward supporting the Classic server.
  • Topics

×
×
  • Create New...