Jump to content

Recommended Posts

Posted
### Eclipse Workspace Patch 1.0

#P L2jFrozen_GameServer

Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java

===================================================================

--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 573)

+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)

@@ -648,6 +648,10 @@

public String _teamNameTvT, _originalTitleTvT;

public int _originalNameColorTvT = 0, _countTvTkills, _countTvTdies, _originalKarmaTvT;

public boolean _inEventTvT = false;



/** CTF Engine parameters */

public String _teamNameCTF,

@@ -666,7 +670,6 @@

_countDMkills,

_originalKarmaDM;

public boolean _inEventDM = false;



public int _correctWord = -1;

public boolean _stopKickBotTask = false;



@@ -900,7 +903,18 @@

private final BlockList _blockList = new BlockList();



private int _team = 0;



/**

* lvl of alliance with ketra orcs or varka silenos, used in quests and aggro checks [-5,-1] varka, 0 neutral, [1,5]

* ketra

@@ -5632,6 +5646,8 @@

// Kill the L2PcInstance

if(!super.doDie(killer))

return false;

+

+ spreeKills = 0;



Castle castle = null;

if(getClan() != null)

@@ -5834,6 +5850,22 @@

boolean isKillerPc = killer instanceof L2PcInstance;

if(isKillerPc && ((L2PcInstance) killer).getClan() != null && getClan() != null && !isAcademyMember() && !((L2PcInstance) killer).isAcademyMember() && _clan.isAtWarWith(((L2PcInstance) killer).getClanId()) && ((L2PcInstance) killer).getClan().isAtWarWith(_clan.getClanId()))

{

+ PlaySound _snd = new PlaySound(1, "enemydown", 0, 0, 0, 0, 0);

+

+ Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();

+ for (L2PcInstance onlinePlayer : pls)

+ if (onlinePlayer.isOnline() == 1)

+ {

+ if (onlinePlayer.getClan() != null)

+ {

+ if (onlinePlayer.getClan() == pk.getClan() && onlinePlayer != pk)

+ {

+ onlinePlayer.sendPacket(_snd);

+ }

+ }

+ }

+

+

if(getClan().getReputationScore() > 0)

{

((L2PcInstance) killer).getClan().setReputationScore(((L2PcInstance) killer).getClan().getReputationScore() + 2, true);

@@ -6109,11 +6141,12 @@

{

// check about wars

if(targetPlayer.getClan() != null && getClan() != null)

- {

+ {

if(getClan().isAtWarWith(targetPlayer.getClanId()))

{

if(targetPlayer.getClan().isAtWarWith(getClanId()))

- {

+ {

+

// 'Both way war' -> 'PvP Kill'

increasePvpKills();

if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL)

@@ -6296,8 +6329,51 @@

/**

* Increase the pvp kills count and send the info to the player

*/

+ private int spreeKills = 0;

public void increasePvpKills()

{

+ spreeKills++;

+

+ switch(spreeKills){

+

+ case 1:

+ PlaySound _snd1 = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);

+ sendPacket(_snd1);

+ break;

+

+ case 2:

+ PlaySound _snd2 = new PlaySound(1, "doublekill", 0, 0, 0, 0, 0);

+ sendPacket(_snd2);

+ break;

+

+ case 3:

+ PlaySound _snd3 = new PlaySound(1, "triplekill", 0, 0, 0, 0, 0);

+ sendPacket(_snd3);

+ break;

+

+ case 4:

+ PlaySound _snd4 = new PlaySound(1, "megakill", 0, 0, 0, 0, 0);

+ sendPacket(_snd4);

+ break;

+

+ case 5:

+ PlaySound _snd5 = new PlaySound(1, "ultrakill", 0, 0, 0, 0, 0);

+ sendPacket(_snd5);

+ break;

+

+ case 10:

+ PlaySound _snd10 = new PlaySound(1, "monsterkill", 0, 0, 0, 0, 0);

+ sendPacket(_snd10);

+ break;

+

+ case 15:

+ PlaySound _snd15 = new PlaySound(1, "killingspree", 0, 0, 0, 0, 0);

+ sendPacket(_snd15);

+ break;

+ default:

+ ;

+ }

+

int x,y,z;

x = getX();

y = getY();

@@ -6658,6 +6734,10 @@

{

newKarma = Integer.MAX_VALUE - getKarma();

}

+ PlaySound _snd = new PlaySound(1, "knife", 0, 0, 0, 0, 0);

+ sendPacket(_snd);

+ broadcastPacket(_snd);

+



// Add karma to attacker and increase its PK counter

int x,y,

 

Posted

I don't think there is anyone playing with sound [ON].
If someone good is playing with his clan, he is using Teamspeak ( or w/e ) and has the sound [OFF].
If anyone else is playing, he is listening some good shit gangsta music.

Posted
10 minutes ago, TeodosTv said:

Its Only PvPSounds Like DoubleKill , TripleKill , Rampage

 

I will help some peoples looking something like this!

 

:) :D :) :D

at least is something new, good.

  • Like 1
Posted (edited)

Dear god this coding... Use enums better... 

 

public enum Spree
	{
		DOUBLE_KILL(2, "Double Kill"),
		TRIPLE_KILL(3, "Triple Kill"),
		ULTRA_KILL(4, "Ultra Kill");
		
		final int kill;
		final String msg;
		
		private Spree(final int kill, final String msg)
		{
			this.kill = kill;
			this.msg = msg;
		}
		
		public void triggerBroadcast(final L2PcInstance player)
		{
			player.setSpreeKills(player.getSpreeKills() + 1);
			
			for (Spree s : Spree.values())
			{
				if (s.kill == player.getSpreeKills())
				{
					Broadcast.announceToOnlinePlayers("Player " + player.getName() + " got a " + s.msg);
				}
			}
		}
	}

Took me 45 seconds and is 2000% better than 450 lines of code you did...

Edited by Evie Frye
  • 3 months later...
Guest
This topic is now closed to further replies.


  • Posts

    • sell adena l2rebon signature x1 - 1kk = 1 dollars l2reborn x10 - 500kk = 4 dollars E-Global x Lu4 - 1kk = 2 dollars BOHPTS - x20-x500 TOP PRICE DISCORD - GODDARDSHOP TELEGRAM - MMOPROMO Also on sale are Epic jewelry, Clothes at a very good price
    • Hello Sorry, my Discord is: ave7309
    • “Hello, I’d like to present a short description of the server. Everyone starts equally at max level 80. The server includes a custom buffer, custom class master, custom weapons and armors, custom zones, custom teleporter, custom raid bosses, and much more. I’ll leave a link in the description for those who want to see how everything looks inside. The server is only open on weekends, and you can find more news via the Facebook link.”   https://www.facebook.com/profile.php?id=61578869175323
    • 1. You where subscriber 3 years ago. 2. There is no current L2jMobius 2.8 Seven Signs version. Subcriber or not. 3. You have your answer from multiple forums that more items is more delay.  
    • 1. Optimize Packet Serialization Look in ItemList.java or wherever the inventory packet is constructed. Instead of building the packet with inefficient string concatenation or repeated allocations, use a preallocated buffer and avoid creating new objects for each item. Mobius sources are Java-based, so profiling with something like VisualVM or YourKit can help see where most time is spent. 2. Avoid Sending the Full List Each Time Modify the server to send only changed items (diff packets) when the inventory window opens. Some newer forks implement this as “lazy loading” or paged inventory so the client only loads e.g. 100 items at a time. 3. Limit the Inventory Size Per Page Instead of showing all 500 slots at once, split the inventory into pages/tabs (100 slots each). When the user switches a tab, send only that page’s items. This requires some client-side editing, but it’s the most user-friendly long-term fix. 4. Database & Cache Optimizations Ensure your items table is indexed by owner_id to make the query for player items fast. Cache item templates and static data so they are not reloaded every time the inventory is shown. ⚠️ Things to Keep in Mind Increasing slots from 80 → 500 does not just change a number — it multiplies the workload for packet building and UI rendering. You can’t fully avoid some extra cost with 500 items, but you can keep it under a few milliseconds if you optimize how and when the data is sent.    
  • Topics

×
×
  • 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