Jump to content
  • 0

Spawn Protecion Effect


Question

Recommended Posts

  • 0
Posted

 

if (protect) {
    ThreadPoolManager.getInstance().scheduleGeneral(new TeleportProtectionFinalizer(this), (Config.PLAYER_SPAWN_PROTECTION - 1) * 1000);
    startAbnormalEffect(L2Character.ABNORMAL_EFFECT_IMPRISIONING_2);
}
This "{" and "}" are called a brackets (or curly brackets)...

I think he cant find the right place to put the code..

  • 0
Posted

// Hate Mode ON

 

Look at this shit...

	/**
	 * Set _protectEndTime according settings.
	 * @param protect the new protection
	 */
	public void setProtection(final boolean protect)
	{
		if (Config.DEVELOPER && (protect || _protectEndTime > 0))
			LOGGER.info(getName() + ": Protection " + (protect ? "ON " + (GameTimeController.getGameTicks() + Config.PLAYER_SPAWN_PROTECTION * GameTimeController.TICKS_PER_SECOND) : "OFF") + " (currently " + GameTimeController.getGameTicks() + ")");
		
		if (isInOlympiadMode())
			return;
		
		_protectEndTime = protect ? GameTimeController.getGameTicks() + Config.PLAYER_SPAWN_PROTECTION * GameTimeController.TICKS_PER_SECOND : 0;
		
		if (protect)
			ThreadPoolManager.getInstance().scheduleGeneral(new TeleportProtectionFinalizer(this), (Config.PLAYER_SPAWN_PROTECTION - 1) * 1000);
	}
	
	/**
	 * Set _teleportProtectEndTime according settings.
	 * @param protect the new protection
	 */
	public void setTeleportProtection(final boolean protect)
	{
		if (Config.DEVELOPER && (protect || _teleportProtectEndTime > 0))
			LOGGER.warn(getName() + ": Tele Protection " + (protect ? "ON " + (GameTimeController.getGameTicks() + Config.PLAYER_TELEPORT_PROTECTION * GameTimeController.TICKS_PER_SECOND) : "OFF") + " (currently " + GameTimeController.getGameTicks() + ")");
		
		_teleportProtectEndTime = protect ? GameTimeController.getGameTicks() + Config.PLAYER_TELEPORT_PROTECTION * GameTimeController.TICKS_PER_SECOND : 0;
		
		if (protect)
			ThreadPoolManager.getInstance().scheduleGeneral(new TeleportProtectionFinalizer(this), (Config.PLAYER_TELEPORT_PROTECTION - 1) * 1000);
	}
	
	static class TeleportProtectionFinalizer implements Runnable
	{
		private final L2PcInstance _activeChar;
		
		TeleportProtectionFinalizer(final L2PcInstance activeChar)
		{
			_activeChar = activeChar;
		}
		
		@Override
		public void run()
		{
			try
			{
				if (_activeChar.isSpawnProtected())
					_activeChar.sendMessage("The effect of Spawn Protection has been removed.");
				else if (_activeChar.isTeleportProtected())
					_activeChar.sendMessage("The effect of Teleport Spawn Protection has been removed.");
				
				if (Config.PLAYER_SPAWN_PROTECTION > 0)
					_activeChar.setProtection(false);
				
				if (Config.PLAYER_TELEPORT_PROTECTION > 0)
					_activeChar.setTeleportProtection(false);
			}
			catch (final Throwable e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
			}
		}
	}

Who the hell is the author of this piece of crap? And what's more important, who the hell will want to use such a crappy platform?

 

First: Two methods, doing exactly the same thing. These are probably used in different conditions, but... if you don't want to use something somewhere, simply don't use it there.

 

Second: Two completely useless if statements...

				if (Config.PLAYER_SPAWN_PROTECTION > 0)
					_activeChar.setProtection(false);
				
				if (Config.PLAYER_TELEPORT_PROTECTION > 0)
					_activeChar.setTeleportProtection(false);

If you are currently in this thread, you obviously use WHATEVER_PROTECTION > 0...

 

 

And finaly: This thing is probably written by an idiot...

			catch (final Throwable e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
			}

// Hate Mode OFF

 

Don't use L2JFrozen, pls!

  • 0
Posted

// Hate Mode ON

 

Look at this shit...

 

/**
	 * Set _protectEndTime according settings.
	 * @param protect the new protection
	 */
	public void setProtection(final boolean protect)
	{
		if (Config.DEVELOPER && (protect || _protectEndTime > 0))
			LOGGER.info(getName() + ": Protection " + (protect ? "ON " + (GameTimeController.getGameTicks() + Config.PLAYER_SPAWN_PROTECTION * GameTimeController.TICKS_PER_SECOND) : "OFF") + " (currently " + GameTimeController.getGameTicks() + ")");
		
		if (isInOlympiadMode())
			return;
		
		_protectEndTime = protect ? GameTimeController.getGameTicks() + Config.PLAYER_SPAWN_PROTECTION * GameTimeController.TICKS_PER_SECOND : 0;
		
		if (protect)
			ThreadPoolManager.getInstance().scheduleGeneral(new TeleportProtectionFinalizer(this), (Config.PLAYER_SPAWN_PROTECTION - 1) * 1000);
	}
	
	/**
	 * Set _teleportProtectEndTime according settings.
	 * @param protect the new protection
	 */
	public void setTeleportProtection(final boolean protect)
	{
		if (Config.DEVELOPER && (protect || _teleportProtectEndTime > 0))
			LOGGER.warn(getName() + ": Tele Protection " + (protect ? "ON " + (GameTimeController.getGameTicks() + Config.PLAYER_TELEPORT_PROTECTION * GameTimeController.TICKS_PER_SECOND) : "OFF") + " (currently " + GameTimeController.getGameTicks() + ")");
		
		_teleportProtectEndTime = protect ? GameTimeController.getGameTicks() + Config.PLAYER_TELEPORT_PROTECTION * GameTimeController.TICKS_PER_SECOND : 0;
		
		if (protect)
			ThreadPoolManager.getInstance().scheduleGeneral(new TeleportProtectionFinalizer(this), (Config.PLAYER_TELEPORT_PROTECTION - 1) * 1000);
	}
	
	static class TeleportProtectionFinalizer implements Runnable
	{
		private final L2PcInstance _activeChar;
		
		TeleportProtectionFinalizer(final L2PcInstance activeChar)
		{
			_activeChar = activeChar;
		}
		
		@Override
		public void run()
		{
			try
			{
				if (_activeChar.isSpawnProtected())
					_activeChar.sendMessage("The effect of Spawn Protection has been removed.");
				else if (_activeChar.isTeleportProtected())
					_activeChar.sendMessage("The effect of Teleport Spawn Protection has been removed.");
				
				if (Config.PLAYER_SPAWN_PROTECTION > 0)
					_activeChar.setProtection(false);
				
				if (Config.PLAYER_TELEPORT_PROTECTION > 0)
					_activeChar.setTeleportProtection(false);
			}
			catch (final Throwable e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
			}
		}
	}
Who the hell is the author of this piece of crap? And what's more important, who the hell will want to use such a crappy platform?

 

First: Two methods, doing exactly the same thing. These are probably used in different conditions, but... if you don't want to use something somewhere, simply don't use it there.

 

Second: Two completely useless if statements...

if (Config.PLAYER_SPAWN_PROTECTION > 0)
					_activeChar.setProtection(false);
				
				if (Config.PLAYER_TELEPORT_PROTECTION > 0)
					_activeChar.setTeleportProtection(false);
If you are currently in this thread, you obviously use WHATEVER_PROTECTION > 0...

 

 

And finaly: This thing is probably written by an idiot...

catch (final Throwable e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
			}
// Hate Mode OFF

 

Don't use L2JFrozen, pls!

And just he could use && idk nothink from frozen :p

 

P.s i will help him when i go home with team viewer just lock the topic

  • 0
Posted

And just he could use && idk nothink from frozen :p

P.s i will help him when i go home with team viewer just lock the topic

I'm not talking about his problem... it's all about how bad the whole L2JFrozen project is designed (I'm not sure if they actually know how to design a project), and why using it is a bad idea. Seriously, it lacks basic programming principles... just read something about coupling and cohesion, and then look at L2JFrozen's source.
  • 0
Posted

I'm not talking about his problem... it's all about how bad the whole L2JFrozen project is designed (I'm not sure if they actually know how to design a project), and why using it is a bad idea. Seriously, it lacks basic programming principles... just read something about coupling and cohesion, and then look at L2JFrozen's source.

Im using l2jacis so i dont care about frozen..but i mean about this 2 checks about spawn protection...can be done with a better way or drop once

  • 0
Posted

it's all about how bad the whole L2JFrozen project is designed

That's mostly russian style and Shyla/Nefer coding style is also.. ugly m5TqppM.png

 

People don't care about quality, is it working? I take it  :happyforever:

  • 0
Posted

That's mostly russian style and Shyla/Nefer coding style is also.. ugly m5TqppM.png

 

People don't care about quality, is it working? I take it  :happyforever:

As i have read thats true :p

Sweets you can lock this topic i will help him later..we have already speak on skype

Guest
This topic is now closed to further replies.


  • Posts

    • Good day! Due to the increasing number of questions, "Do you provide services for the client?" - I decided to answer with a separate topic. I provide services for editing/modifying the client and individual files, namely: 1. Transfer/Creation/Editing locations, geodata.   2. All kinds of work with NPCs, including transfer, animation, adding effects to them and logos.   3. Actually, Transfer/Creation/Edit any EFFECTS, including Abnormal Effects.   4. Any work with weapons, armor, accessories and everything related to it.   5. Create or edit textures, including dynamic textures.   6. Creating a Lobby Screen, Lobby Char Selection (character selection window) and Lobby Char Creation (character creation window). What I don't do: 1. Coding in any form (except for CB).   I started publishing my work recently, here - YouTube And here - RuTube If required, I respect confidentiality. Any other questions? Welcome to Telegram or PM.
    • 🎮https://discord.gg/yyVRtna9RB 🌎https://l2-forever.com L2 Forever was the best mid rates PvP server back in C4 and C5 and we want to give players the same experience with Interlude!   # L2-Forever * EXP: 50x * Adena: 200x * Spoil: 5x * Drops: 5x   # ENCHANTS *Safe Enchant : 3 *Max. Enchant : 20 *Normal Scroll chance : 65% *Blessed Scroll chance : 70%   # NEW PLAYERS * Start with Coupons allowing you to get free top D-grade * Start at level 20 * Main Town Giran Harbor   # BOOSTED AREA'S * Execution Grounds [ 20 - 40] * Cruma Tower [40-52] * Antharas Lair [52-61] * Antharas Heart [61-80] * Giran Harbor - Shopping Area   # END GAME FARMING AREAS * Monastery of Silence and Primeval Island customized for group farm # PLATINUM ARMORS * Platinum Armors get dropped by raids, allowing everyone to obtain a set and not only donators * Many Raids all over the L2 world drop parts of the Platinum Armors   # BUFFS * Buff duration is set at 1 hour for normal buffs (Buffs and Songs / Dances) * Town Buffers in all main towns with all available buffs Giran Harbor (GH) is the place to be for all your trades and item needs! Platinum Armors   # FOREVER ITEMS * Unique Forever weapons & armors # UNIQUE L2 FOREVER AUGMENTATION SYSTEM * We don't use retail augmentations, we use our own unique system and glows!   # OTHER CUSTOM FEATURES * Global Gatekeeper * NPC Class Changer * Auction House * Unique Augmenter * Subclass with Adena or from Cabrio * Nobless - Barakiel * Useless S weapon Special abilities like (Cheap shot) are changed
    • 🎮https://discord.gg/yyVRtna9RB 🌎https://l2-forever.com L2 Forever was the best mid rates PvP server back in C4 and C5 and we want to give players the same experience with Interlude!   # L2-Forever * EXP: 50x * Adena: 200x * Spoil: 5x * Drops: 5x   # ENCHANTS *Safe Enchant : 3 *Max. Enchant : 20 *Normal Scroll chance : 65% *Blessed Scroll chance : 70%   # NEW PLAYERS * Start with Coupons allowing you to get free top D-grade * Start at level 20 * Main Town Giran Harbor   # BOOSTED AREA'S * Execution Grounds [ 20 - 40] * Cruma Tower [40-52] * Antharas Lair [52-61] * Antharas Heart [61-80] * Giran Harbor - Shopping Area   # END GAME FARMING AREAS * Monastery of Silence and Primeval Island customized for group farm # PLATINUM ARMORS * Platinum Armors get dropped by raids, allowing everyone to obtain a set and not only donators * Many Raids all over the L2 world drop parts of the Platinum Armors   # BUFFS * Buff duration is set at 1 hour for normal buffs (Buffs and Songs / Dances) * Town Buffers in all main towns with all available buffs Giran Harbor (GH) is the place to be for all your trades and item needs! Platinum Armors   # FOREVER ITEMS * Unique Forever weapons & armors # UNIQUE L2 FOREVER AUGMENTATION SYSTEM * We don't use retail augmentations, we use our own unique system and glows!   # OTHER CUSTOM FEATURES * Global Gatekeeper * NPC Class Changer * Auction House * Unique Augmenter * Subclass with Adena or from Cabrio * Nobless - Barakiel * Useless S weapon Special abilities like (Cheap shot) are changed
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...