Jump to content

Recommended Posts

Posted

This is an unique Faction System. Same as the well-known GvE engines, but it's a bit different.

This is a gender-based GvE engine, with a really special reward.

We're recommend to use this engine with player Naked Mode without clothes.

 

/*
* This program is a private software, based on java source code.
* To share, distribute or redistribute this software is forbidden,
* except if someone approve it from RaveN Network INC. team.
* 
* Copyrights (c) 2012 RaveN Network INC. All rights reserved.
*/
package custom.genderGvE;

import net.l2emuproject.gameserver.gameobjects.L2Character;
import net.l2emuproject.gameserver.gameobjects.L2Player;
import net.l2emuproject.gameserver.model.restriction.global.AbstractRestriction;
import net.l2emuproject.gameserver.model.restriction.global.GlobalRestrictions;
import net.l2emuproject.gameserver.model.restriction.global.GlobalRestrictions.CombatState;
import net.l2emuproject.tools.random.Rnd;

/**
* @author lord_rex
* 	<br> This is an unique Faction System. Same as the well-known GvE engines, but it's a bit different.
* 	<br> This is a gender-based GvE engine, with a really special reward.
* 	<br> We're recommend to use this engine with player Naked Mode without clothes.
*/
public final class UniqueFactionRestriction extends AbstractRestriction
{
@Override
public CombatState getCombatState(L2Player activeChar, L2Player target)
{
	// feel free to attack players if the gender is different
	if (hasDifferentGender(activeChar, target))
		return CombatState.ENEMY;

	return CombatState.NEUTRAL;
}

@Override
public boolean canInviteToParty(L2Player activeChar, L2Player target)
{
	if (hasDifferentGender(activeChar, target))
	{
		activeChar.requestFailed("You cannot invite different gender players to your party!");
		return false;
	}

	return true;
}

@Override
public boolean playerKilled(L2Character activeChar, L2Player target, L2Player killer)
{
	if (hasDifferentGender(target, killer))
	{
		killer.sendMessage("Congratulation! You've killed one of the different gender! Your reward is a random porn URL: "
				+ getRandomPornURL());
		return true;
	}

	return true;
}

private String getRandomPornURL()
{
	switch (Rnd.get(3))
	{
		case 0:
			return "http://www.youngpornvideos.com/galleries/0515/69578/teenage-blonde-cutie-alyona-smashed-in-her-tight-a.php";
		case 1:
			return "http://www.youngpornvideos.com/galleries/0746/32082/teen-getting-fucked-and-taking-creampie.php";
		case 2:
			return "http://www.youngpornvideos.com/galleries/0215/69821/big-ass-blondie-girlfriend-tries-out-hardcore-anal.php";
		default:
			throw new InternalError();
	}
}

@Override
public int getNameColor(L2Player activeChar)
{
	return getGenderColor(activeChar);
}

@Override
public int getTitleColor(L2Player activeChar)
{
	return getGenderColor(activeChar);
}

private int getGenderColor(L2Player activeChar)
{
	if (isFemale(activeChar))
		return 0xFF00FF;

	if (isMale(activeChar))
		return 0xFF0033;

	return -1;
}

/**
 * @param activeChar
 * @param target
 * @return gender is different or no
 */
private boolean hasDifferentGender(L2Player activeChar, L2Player target)
{
	// activeChar is female and target is male
	if (isFemale(activeChar) && isMale(target))
		return true;

	// activeChar is male and target is female
	if (isMale(activeChar) && isFemale(target))
		return true;

	return false;
}

private boolean isFemale(L2Player activeChar)
{
	return activeChar.getAppearance().getSex();
}

private boolean isMale(L2Player activeChar)
{
	return !activeChar.getAppearance().getSex();
}

public static void main(String[] args)
{
	GlobalRestrictions.activate(new UniqueFactionRestriction());
}
}

Posted

private boolean hasDifferentGender(L2Player activeChar, L2Player target)
{
	// activeChar is female and target is male
	if (isFemale(activeChar) && isMale(target))
		return true;

	// activeChar is male and target is female
	if (isMale(activeChar) && isFemale(target))
		return true;

	return false;
}

==

private boolean hasDifferentGender(L2Player activeChar, L2Player target)
{
	return isMale(activeChar) != isMale(target);
}

 

thx for share :)

Posted

private boolean hasDifferentGender(L2Player activeChar, L2Player target)
{
	// activeChar is female and target is male
	if (isFemale(activeChar) && isMale(target))
		return true;

	// activeChar is male and target is female
	if (isMale(activeChar) && isFemale(target))
		return true;

	return false;
}

==

private boolean hasDifferentGender(L2Player activeChar, L2Player target)
{
	return isMale(activeChar) != isMale(target);
}

 

thx for share :)

np. btw mine one is more understandable :P

Posted

less code = better

Of course. But my version is more obviously for non-java-knowing-noobs.. and this changeset is a FUN section :)

 

PS: I could even use...

public boolean hasDifferentGender(final L2Player player, final L2Player target)
{
	return player.getAppearance().getSex() != target.getAppearance().getSex();
}

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

    • What can I say other than that I’m satisfied with the order I made. The guy is reliable and very good at what he does. I recommend him 100%.
    • Lineage2 Freya High Five @ Reshade with fog and rain etc @ Gracia final epilogue atmosphere   this reshade will eat lots of GPU power 50% or more of an RTX 3060 so be carefull depending on what effects are activated and their settings will eat even more GPU recomended 60hz monitor settings and via nvidia panel in Lineage2 game profile vsync settings to on effects are set up till film deck and the rest are not used but still working again this can eat alot of GPU Don't overheat GPU this is for freya high five but might work on others too copy in the  System  folder the folder  reshade-shaders  and the files  d3d9.dll  ReShade.ini  ReShadePreset.ini  ReShade.log  CccDddCcc.ini insert opens the menu and delete is on and of some settings need  ctrl + left click  to be changed   making another profile will reset the not activated effects to their default values so just copy the profile  CccDddCcc  and rename if needed also something needs to be closed from settings in game menu, the blur at distance and advanced shaders but keeping the advanced water effects all reflections   for those that don't like the h5 look of the sky and the red fog and rain and ambien red at night on all maps well if we want the cool gracia final epilogue back then we need to do this rename the  Maps  folder to Mapsretail or whatever copy the  Maps  folder from gracia final epilogue to h5 also we need the  L2_Skies.utx  from gracia final epilogue  Textures  folder to be replaced and also we need to do the same to the files  timeenv0.int  timeenv1.int  timeenv2.int  timeenv3.int  found in  system  folder   another setting that will probably be needed but not really tested out is to open file  option.ini  from  system  folder and add cachesize like this   [FirstRun] FirstRun=2   [Engine.GameEngine] CacheSizeMegs=512   also maybe is good to change those to 4.000000   [ClippingRange] Terrain=4.000000 Actor=4.000000 StaticMesh=4.000000 StaticMeshLod=4.000000 Pawn=4.000000       sorry bad english   https://mega.nz/file/aRNXxDrQ#mbxrNERBtW0XEEezK6w8-86oZWuX1k6NgtR6RZWKRVM   the compression on the video is kinda bad but meh    
    • Thanks, tho if possible let's lock the topic. I decided to finish up myself as I only created this to save up my time, but seems that while waiting for prop dev. finished myself.
    • Plus he have Discord where using Celestine, Nightwolf and others names to ensure that he is legit, what a looser, that's why mxc have bad reputation, coming here is like 50/50 get scammed.
  • 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..