Jump to content

Question

Posted

who can help me to import pvp/pk circle  on 1 private project ..source acis

 

video with code done but not mine :(

 

 

this is code

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer_tests
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java	(revision 488)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -5845,6 +5845,7 @@
 		}
 
 		setPvpFlag(0); // Clear the pvp flag
+		setTeam(0);
 
 		// Unsummon Cubics
 		if(_cubics.size() > 0)
@@ -6698,6 +6699,7 @@
 		}
 
 		//Update the character's title color if they reached any of the 5 PK levels.
+		setTeam(2);
 		updatePkColor(getPkKills());
 		broadcastUserInfo();
 
Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/L2Character.java	(revision 488)
+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java	(working copy)
@@ -189,6 +189,7 @@
 	private double _hpUpdateDecCheck = .0;
 	private double _hpUpdateInterval = .0;
 	private boolean _champion = false;
+	private int _team = 0;
 	/** Table of Calculators containing all used calculator */
 	private Calculator[] _calculators;
 
@@ -8161,6 +8162,7 @@
 	{
 		_pvpFlagLasts = time;
 	}
+	
 
 	public long getPvpFlagLasts()
 	{
@@ -8170,10 +8172,24 @@
 	public void startPvPFlag()
 	{
 		updatePvPFlag(1);
+		setTeam(1);
 
 		_PvPRegTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PvPFlag(), 1000, 1000);
 	}
 
+	/**
+	 * @param i
+	 */
+	public void setTeam(int team)
+	{
+		_team = team;
+	}
+
+	public int getTeam()
+	{
+		return _team;
+	}
+
 	public void stopPvpRegTask()
 	{
 		if(_PvPRegTask != null)
@@ -8185,7 +8201,7 @@
 	public void stopPvPFlag()
 	{
 		stopPvpRegTask();
-
+		setTeam(0);
 		updatePvPFlag(0);
 
 		_PvPRegTask = null;

Recommended Posts

  • 0
Posted

Okay, I just checked the video to see what you want to achieve, since your posts mislead me, lol

 

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (revision 343)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
@@ -1312,6 +1312,7 @@
             sendPacket(new RelationChanged(getPet(), getRelation(this), false));
         
         broadcastRelationsChanges();
+        broadcastUserInfo();
     }
     
     @Override
@@ -4228,7 +4229,10 @@
         PvpFlagTaskManager.getInstance().add(this, Config.PVP_NORMAL_TIME);
         
         if (getPvpFlag() == 0)
+        {
             updatePvPFlag(1);
+            setTeam(1);
+        }
     }
     
     public void updatePvPStatus(L2Character target)
@@ -4245,7 +4249,10 @@
             PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME);
             
             if (getPvpFlag() == 0)
+            {
                 updatePvPFlag(1);
+                setTeam(1);
+            }
         }
     }
     
Index: java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
===================================================================
--- java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java    (revision 343)
+++ java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java    (working copy)
@@ -82,6 +82,7 @@
             if (currentTime > timeLeft)
             {
                 entry.getKey().updatePvPFlag(0);
+                entry.getKey().setTeam(0);
                 iterator.remove();
             }
             // Time almost runned out, update to blinking PvP flag.
  • 0
Posted

setTeam method already exist. Probably part of event engine to set teams, or custom zone which set the team - randomly or not - to ppl who enter to the zone.

  • 0
Posted

In your case, a getter and setter with this names already exists... choose something different, and use this code:

Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java	(revision 1)
+++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java	(working copy)
@@ -192,9 +192,9 @@
 		writeD((int) _activeChar.getCurrentCp());
 		writeC(_activeChar.isMounted() ? 0 : _activeChar.getEnchantEffect());
 		
-		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()))
+		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()) || (_activeChar.getTeam() == 1))
 			writeC(0x01); // team circle around feet 1= Blue, 2 = red
-		else if (_activeChar.getTeam() == 2)
+		else if ((_activeChar.getTeam() == 2) || (_activeChar.getTeam() == 2))
 			writeC(0x02); // team circle around feet 1= Blue, 2 = red
 		else
 			writeC(0x00); // team circle around feet 1= Blue, 2 = red
Index: java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java	(revision 1)
+++ java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java	(working copy)
@@ -247,9 +247,9 @@
 		writeD((int) _activeChar.getCurrentCp());
 		writeC(_activeChar.isMounted() ? 0 : _activeChar.getEnchantEffect());
 		
-		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()))
+		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()) || (_activeChar.getTeam() == 1))
 			writeC(0x01); // team circle around feet 1= Blue, 2 = red
-		else if (_activeChar.getTeam() == 2)
+		else if ((_activeChar.getTeam() == 2) || (_activeChar.getTeam() == 2))
 			writeC(0x02); // team circle around feet 1= Blue, 2 = red
 		else
 			writeC(0x00); // team circle around feet 1= Blue, 2 = red

The circle is a part of the User / Char info packet.

  • 0
Posted (edited)

In your case, a getter and setter with this names already exists... choose something different, and use this code:

Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java	(revision 1)
+++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java	(working copy)
@@ -192,9 +192,9 @@
 		writeD((int) _activeChar.getCurrentCp());
 		writeC(_activeChar.isMounted() ? 0 : _activeChar.getEnchantEffect());
 		
-		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()))
+		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()) || (_activeChar.getTeam() == 1))
 			writeC(0x01); // team circle around feet 1= Blue, 2 = red
-		else if (_activeChar.getTeam() == 2)
+		else if ((_activeChar.getTeam() == 2) || (_activeChar.getTeam() == 2))
 			writeC(0x02); // team circle around feet 1= Blue, 2 = red
 		else
 			writeC(0x00); // team circle around feet 1= Blue, 2 = red
Index: java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java	(revision 1)
+++ java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java	(working copy)
@@ -247,9 +247,9 @@
 		writeD((int) _activeChar.getCurrentCp());
 		writeC(_activeChar.isMounted() ? 0 : _activeChar.getEnchantEffect());
 		
-		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()))
+		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()) || (_activeChar.getTeam() == 1))
 			writeC(0x01); // team circle around feet 1= Blue, 2 = red
-		else if (_activeChar.getTeam() == 2)
+		else if ((_activeChar.getTeam() == 2) || (_activeChar.getTeam() == 2))
 			writeC(0x02); // team circle around feet 1= Blue, 2 = red
 		else
 			writeC(0x00); // team circle around feet 1= Blue, 2 = red

The circle is a part of the User / Char info packet.

 

i add  your code and  when i hit don't have animations but dmg give... and after make karma get red cirlce if i change karma to 0 red cirlce don't  disappear

but pvp blu circle won't work and same problem no have animation :(

post-110568-0-90261100-1426022775_thumb.jpg

Edited by Tachi
  • 0
Posted (edited)

Why is it in L2Character?

l2character.txt

 

i fixed problem  with gameserver ..but now nothing happened..no circle with  yuo code ...

Edited by Tachi
  • 0
Posted

i make the code..but  i have some problems 

 

 

where to add  0x00 in when players are with circle

whats the correct broadcast to make all players able to see the color circles

and where to place it

  • 0
Posted

updatePvPStatus(, onKillUpdatePvPKarma( ..

 

Check mothers and ses how the flag / karma is working and follow the logic.

  • 0
Posted (edited)

updatePvPStatus(, onKillUpdatePvPKarma( ..

 

Check mothers and ses how the flag / karma is working and follow the logic.

so  code pvp circle work but after flag going off pvp circle is on ..and he wont remove..

 

what i need to to

 

this is code on l2pcinstance

	public void updatePvPStatus(L2Character target)
	{
		final L2PcInstance player = target.getActingPlayer();
		if (player == null)
			return;
		
		if (EventManager.getInstance().isRegistered(this) && EventManager.getInstance().isRunning())
			return;
		
		if (isInDuel() && player.getDuelId() == getDuelId())
			return;
		
		if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0)
		{
			PvpFlagTaskManager.getInstance().add(this, System.currentTimeMillis() + ((checkIfPvP(player)) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME));
			
			if (getPvpFlag() == 0)
			{

				target.setTeam(2);
				player.setTeam(1);
				updatePvPFlag(1);
			}
			else
			{
				target.setTeam(0);
				player.setTeam(0);

			}
			// 1 of those 3 should work but only 1
			broadcastRelationsChanges();
			broadcastCharInfo();
			broadcastUserInfo();
		}
	}
	

charinfo.java code

		
		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()))
			writeC(0x01); // team circle around feet 1= Blue, 2 = red
		else if (_activeChar.getTeam() == 2)
			writeC(0x02); // team circle around feet 1= Blue, 2 = red
		else
			writeC(0x00); // team circle around feet 1= Blue, 2 = red

userinfo.java code

		if (_activeChar.getTeam() == 1 || (Config.PLAYER_SPAWN_PROTECTION > 0 && _activeChar.isSpawnProtected()))
			writeC(0x01); // team circle around feet 1= Blue, 2 = red
		else if (_activeChar.getTeam() == 2)
			writeC(0x02); // team circle around feet 1= Blue, 2 = red
		else
			writeC(0x00); // team circle around feet 1= Blue, 2 = red

l2character.java code

	private int _team = 0;
		public void setTeam(int team)
		{
			_team = team;
		}
	
		public int getTeam()
		{
			return _team;
		}
}
Edited by Tachi
  • 0
Posted

How its supposed to work? Red circle for attacker and blue for victim?

 

As I said track how flag works.

  • 0
Posted

How its supposed to work? Red circle for attacker and blue for victim?

 

As I said track how flag works.

The problem is that blue circle not always work,
 
and the red did not work
Guest
This topic is now closed to further replies.
  • Posts

    • You should buy it then I’ll make a discount  
    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
  • 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..

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