Jump to content
  • 0

Genre switching without relogin


Question

Posted

recently i redid my code and i change gender and update for the other players and not for me which package needs to be updated?

 

View from another player:

 

my vision:

 

Screenshot_92.png.39b3df74a3b33cff0ea3a3691e2f7e1f.png

 

Recommended Posts

  • 1
Posted
47 minutes ago, Vince* said:

 

If i am not mistaken you're not the only one who faced up that client side issue, many interlude servers that was trying to activate same feature had difficulties, so the only option you will have is to make restart whenever you're changing Genre.... It's the only way to work correctly..

 

indeed, and i remember that in a server i joined last time i saw the same issue, so owner said that you should do restart whenever you were requested to change genre or even by donating for it...

 

  • Thanks 1
  • 0
Posted
46 minutes ago, HyperBlown said:

CharInfo, UserInfo ? Usually transforming and untransforming works.

 

he is using C6 client or less

  • 0
Posted (edited)
2 hours ago, Williams said:

recently i redid my code and i change gender and update for the other players and not for me which package needs to be updated?

 

View from another player:

 

my vision:

 

Screenshot_92.png.39b3df74a3b33cff0ea3a3691e2f7e1f.png

 

 

If i am not mistaken you're not the only one who faced up that client side issue, many interlude servers that was trying to activate same feature had difficulties, so the only option you will have is to make restart whenever you're changing Genre.... It's the only way to work correctly..

26 minutes ago, xdem said:

 

he is using C6 client or less

 

indeed, and i remember that in a server i joined last time i saw the same issue, so owner said that you should do restart whenever you were requested to change genre or even by donating for it...

Edited by Vince*
  • 0
Posted (edited)
6 minutes ago, AbsolutePower said:

 

 

Dunno which client the user is using abso, But many servers that they were having same feature, they couldn't fix it.... thanks for this usefull video anyways, you're hero! 🙏🏻

Edited by Vince*
  • 0
Posted
27 minutes ago, Vince* said:

 

Não sei qual cliente o usuário está usando abso, mas muitos servidores que eles estavam tendo o mesmo recurso, eles não poderiam corrigi-lo.... obrigado por este vídeo útil de qualquer maneira, você é herói! 🙏🏻

I'm using a clean c6 client I'm working on it the way I found to fix it was using aCis templates soon I'll post the result.

  • 0
Posted
1 hour ago, Williams said:

I'm using a clean c6 client I'm working on it the way I found to fix it was using aCis templates soon I'll post the result.

 

Any news????? Is anything aight so far?

  • 0
Posted (edited)

player.decayMe();
player.spawnMe();

 

mobius c6 does use it. dunno if other c6 use it tho. but if im not wrong mobius is based on acis

 

below u can see the code for the item im using. most likely can be improved since im a beginer.

(note that this code is not from c6 but newer version so it needs changes but .decayMe and .spawnMe where used in c6).

 

/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package handlers.itemhandlers;

import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.util.Broadcast;

/**
 * @author Drazeal
 */
public class SexChange implements IItemHandler
{
	
	/*
	 * (non-Javadoc)
	 * @see org.l2jmobius.gameserver.handler.IItemHandler#useItem(org.l2jmobius.gameserver.model.actor.Playable, org.l2jmobius.gameserver.model.items.instance.ItemInstance, boolean)
	 */
	@Override
	public boolean useItem(Playable playable, Item item, boolean forceUse)
	{
		if (!(playable instanceof Player))
		{
			return true;
		}
		
		Player player = (Player) playable;
		MagicSkillUse msk;
		
		if (player.isInCombat())
		{
			player.sendMessage("Cannot use while in combat.");
			return false;
		}
		if (player.isInOlympiadMode() || player.isInDuel() || player.isOnEvent())
		{
			
			player.sendMessage("Cannot use while in Olympiad/Duel/Event.");
			return false;
		}
		
		if (player.getAppearance().isFemale())
		{
			player.getAppearance().setMale();
		}
		else
		{
			player.getAppearance().setFemale();
		}
		msk = new MagicSkillUse(player, player, 837, 1, 1000, 0);
		Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 1500);
		player.sendMessage("Your gender has been changed");
		player.broadcastUserInfo();
		player.decayMe();
		player.spawnMe();
		player.destroyItem("Consume", item.getObjectId(), 1, null, false);
		return false;
	}
}

 

Edited by Drazeal
  • 0
Posted

try to do this:

 

Magic Human -> Fighter Human

Magic Orc       -> Fighter Orc

 

or vice versa

 

stuck will happen ALWAYS

  • 0
Posted
2 hours ago, Drazeal said:

player.decayMe();
player.spawnMe();

 

mobius c6 usa. não sei se outros c6 usá-lo tho. mas se eu não estou mobius errado é baseado em acis

 

abaixo você pode ver o código para o item im usando. provavelmente pode ser melhorado desde im um iniciante.

(note que este código não é do c6, mas da versão mais recente, por isso precisa de alterações, mas .decayMe e .spawnMe onde usado em c6).

 

/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package handlers.itemhandlers;

import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.util.Broadcast;

/**
 * @author Drazeal
 */
public class SexChange implements IItemHandler
{
	
	/*
	 * (non-Javadoc)
	 * @see org.l2jmobius.gameserver.handler.IItemHandler#useItem(org.l2jmobius.gameserver.model.actor.Playable, org.l2jmobius.gameserver.model.items.instance.ItemInstance, boolean)
	 */
	@Override
	public boolean useItem(Playable playable, Item item, boolean forceUse)
	{
		if (!(playable instanceof Player))
		{
			return true;
		}
		
		Player player = (Player) playable;
		MagicSkillUse msk;
		
		if (player.isInCombat())
		{
			player.sendMessage("Cannot use while in combat.");
			return false;
		}
		if (player.isInOlympiadMode() || player.isInDuel() || player.isOnEvent())
		{
			
			player.sendMessage("Cannot use while in Olympiad/Duel/Event.");
			return false;
		}
		
		if (player.getAppearance().isFemale())
		{
			player.getAppearance().setMale();
		}
		else
		{
			player.getAppearance().setFemale();
		}
		msk = new MagicSkillUse(player, player, 837, 1, 1000, 0);
		Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 1500);
		player.sendMessage("Your gender has been changed");
		player.broadcastUserInfo();
		player.decayMe();
		player.spawnMe();
		player.destroyItem("Consume", item.getObjectId(), 1, null, false);
		return false;
	}
}

 

 

This won't work for aCis as you need to reformulate the World and WorldObject the error is there

  • 0
Posted
6 minutes ago, Williams said:

 

This won't work for aCis as you need to reformulate the World and WorldObject the error is there

 

what ?

  • 0
Posted (edited)
59 minutes ago, xdem said:

 

que?

I redid all the code on l2jmobius c6 and yes there it is perfect but on acis when you remove the object it does not add when you use spawnme and on mobius it works perfect

Edited by Williams
  • 0
Posted (edited)
On 9/26/2022 at 12:15 AM, xdem said:

Are you aware of the fact that this is a client bug ? 

what you give me if i can make it work only editing server side on acis ?

you use requestrestart to relog a player without player making any client action

Edited by arm4729

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...