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

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


  • Posts

    • EspadaWorld Reborn - Lineage 2 High Five Private Server Official Website: https://l2espadaworld.com   GitHub Presentation: https://github.com/worldespada-cloud/EspadaWorld   About EspadaWorld Reborn   EspadaWorld Reborn is a cinematic Lineage 2 High Five private server project built on a customized FandC / L2J-style High Five core. The project is focused on balanced gameplay, PvP competition, PvE progression, custom systems, vote rewards, rankings, protection integration, website features, and long-term stability. EspadaWorld is not a clean stock pack. The server has been extended with custom systems, website integration, vote reward logic, protection-related modules, custom instance content, gameplay improvements, and server-side adjustments. Server Foundation Chronicle: Lineage 2 High Five Base: FandC High Five core, heavily customized Core style: L2J-based server architecture Build system: Apache Ant Java target: Java 25 Database: MySQL Project type: Active development / production server environment Main Features - Custom Lineage 2 High Five server environment - FandC-based core with custom improvements - Custom Community Board systems - Player ranking systems - PvP-focused gameplay logic - PvE progression support - Custom Espada instance and custom gameplay content - Vote reward system with multiple vote website integrations - Unified .getreward command - Website, account, ranking, vote, media, and download integration - Protection module integration - Admin tools and server management systems - Datapack and server packaging scripts Vote Reward System EspadaWorld includes a custom vote reward flow based around the .getreward command. The system verifies votes from all enabled vote websites and gives one unified global reward only after all required votes are confirmed. Current vote integration includes: - iTopZ - HopZone - L2Network - L2JBrasil - L2TopZone - L2Votes Vote system features: - Unified reward after all votes are confirmed - Configurable global reward list - Item amount and chance configuration - Cooldown / reuse protection - HWID / IP-based reward protection - Debug logging for vote verification - Anti-abuse logic for repeated reward claims Protection & Security The project includes protection-related modules and integration points designed to improve server and client-side security. Protection-related areas include: - Runtime protection module integration - Client protection support - Server-side validation systems - Anti-abuse logic around vote rewards and account actions - Configuration-driven security behavior - Release packaging support for protected builds Private protection details, keys, internal configuration, and production security data are not public. Custom Gameplay Content EspadaWorld Reborn includes custom gameplay work designed to give the server its own identity while keeping the Lineage 2 High Five feeling. Examples of custom content and systems: - Custom Espada instance - PvP-oriented systems and zones - PvE progression systems - Ranking and competition systems - Community Board extensions - Custom HTML and datapack content - Gameplay scripts and server-side feature extensions - Vote reward progression Website & Community Platform EspadaWorld also includes a modern web platform connected to the server community. Website features include: - Modern responsive website - Account panel - Download section - Vote section - Ranking pages - Media section - News and information system - Admin-controlled website settings - Theme/template system - SEO optimization - Performance optimization The website has been optimized for speed, accessibility, best practices, and SEO, offering a clean public presentation for the server and community. Useful Links Website: https://l2espadaworld.com   GitHub Presentation: https://github.com/worldespada-cloud/EspadaWorld   EspadaWorld Reborn is a cinematic Lineage 2 High Five private server project built on a customized FandC-based core.     Preserving safety and trust within our community is our priority. Thank you for your understanding and support!   Best regards,VastoLordes. Contact Information :  support@l2espadaworld.com
    • Hi,im looking for "stable" mid rate high five l2j files source included,i prefer not clean files but something already used by another server in the past,if you have something intrested and not shared pm me.
    • Hello, We are currently looking for an experienced Lineage 2 High Five client developer for our project EldoriaWorld. At the moment we need help with: High Five client edits Launcher integration Interface/UI improvements Branding changes Textures/icons/loading screens System modifications Client optimization We already have website, launcher setup and server infrastructure prepared. If interested, please message me with: your experience previous projects/work contact details Contact: Telegram: FrankJan Discord: LosBanannos Regards, Frank EldoriaWorld
    • Hi guys, I am interested. Added you on Telegram. Please reply.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..