Telnet enchant shirt

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
dasoldier
Posts: 73
Joined: Wed May 31, 2006 6:26 pm
Location: Holland
Contact:

Telnet enchant shirt

Post by dasoldier »

datapack: 10490
Server: 6670

Hey,

I cannot get the telnet command working for enchanting the shirt of a online player.

Code: Select all

enchant username 13 18
it will say Item failed to enchant.

All the enchant commands are working for me except this one.

Greetings,
Dasoldier
elitovec
Posts: 23
Joined: Tue Aug 19, 2014 8:04 pm

Re: Telnet enchant shirt

Post by elitovec »

i'm looking for telnet app!
Do you have telnet app?
Can you give me and others?
sorry fo my eng :oops:
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Telnet enchant shirt

Post by Zoey76 »

elitovec wrote:i'm looking for telnet app!
Do you have telnet app?
Can you give me and others?
sorry fo my eng :oops:
http://www.chiark.greenend.org.uk/~sgta ... nload.html
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
dasoldier
Posts: 73
Joined: Wed May 31, 2006 6:26 pm
Location: Holland
Contact:

Re: Telnet enchant shirt

Post by dasoldier »

Since no one knows how to solve this problem some additional information.

When we go to gameserver/model/itemcontainer/Invertory.java
we will see

Code: Select all

public static final int PAPERDOLL_UNDER = 0;
This will make the itemtype 0.

Then we go to data/scripts/handlers/telnethandlers/PlayerHandler.java

And we find this part.

Code: Select all

                if ((player != null) && (itemType > 0))                {                    success = setEnchant(player, enchant, itemType);                    if (success)                    {                        _print.println("Item enchanted successfully.");                    }                }                else if (!su
Now if i change this

Code: Select all

if ((player != null) && (itemType > 0))
To this

Code: Select all

if (((player != null) && (itemType > 0)) || (itemType == 0))
Now i'm able to enchant the shirt.
But when i try to enchant a empty slot it will take the weapon slot, and then it will enchant that item instead saying "item failed to enchant".
When i try to enchant the weapon when nothing is equipped the telnet console will say nothing, not failed or successfully.

update:
changed itemtype to -1
still the same result happens.

Code: Select all

        else if (command.startsWith("enchant"))        {            StringTokenizer st = new StringTokenizer(command.substring(8), " ");            int enchant = 0, itemType = -1;                        try            {                L2PcInstance player = L2World.getInstance().getPlayer(st.nextToken());                itemType = Integer.parseInt(st.nextToken());                enchant = Integer.parseInt(st.nextToken());                                switch (itemType)                {                    case 1:                        itemType = Inventory.PAPERDOLL_HEAD;                        break;                    case 2:                        itemType = Inventory.PAPERDOLL_CHEST;                        break;                    case 3:                        itemType = Inventory.PAPERDOLL_GLOVES;                        break;                    case 4:                        itemType = Inventory.PAPERDOLL_FEET;                        break;                    case 5:                        itemType = Inventory.PAPERDOLL_LEGS;                        break;                    case 6:                        itemType = Inventory.PAPERDOLL_RHAND;                        break;                    case 7:                        itemType = Inventory.PAPERDOLL_LHAND;                        break;                    case 8:                        itemType = Inventory.PAPERDOLL_LEAR;                        break;                    case 9:                        itemType = Inventory.PAPERDOLL_REAR;                        break;                    case 10:                        itemType = Inventory.PAPERDOLL_LFINGER;                        break;                    case 11:                        itemType = Inventory.PAPERDOLL_RFINGER;                        break;                    case 12:                        itemType = Inventory.PAPERDOLL_NECK;                        break;                    case 13:                        itemType = Inventory.PAPERDOLL_UNDER;                        break;                    case 14:                        itemType = Inventory.PAPERDOLL_CLOAK;                        break;                    case 15:                        itemType = Inventory.PAPERDOLL_BELT;                        break;                    default:                        itemType = -1;                }                                if (enchant > 65535)                {                    enchant = 65535;                }                else if (enchant < 0)                {                    enchant = 0;                }                                boolean success = false;                                if ((player != null) && (itemType != -1))                {                    success = setEnchant(player, enchant, itemType);                    if (success)                    {                        _print.println("Item enchanted successfully.");                    }                }                else if (!success)                {                    _print.println("Item failed to enchant.");                }            }            catch (Exception e)            {                            }        }
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: Telnet enchant shirt

Post by AntV »

I'm not quite sure you want this code to achieve, but the following part:

Code: Select all

if ((player != null) && (itemType != -1))                {                    success = setEnchant(player, enchant, itemType);                    if (success)                    {                        _print.println("Item enchanted successfully.");                    }                }                else if (!success)                {                    _print.println("Item failed to enchant.");                }
Means if itemType was -1 it won't enchant anything.
Also the else if, should be simple else, or a nested if, because the way you have it, success is always false.

Let me clarify; the if else is an else to the first if, not the second.
dasoldier
Posts: 73
Joined: Wed May 31, 2006 6:26 pm
Location: Holland
Contact:

Re: Telnet enchant shirt

Post by dasoldier »

Ive changed that just to try nothing else.
this should be the good one.

Code: Select all

if ((player != null) && (itemType > 0))
The problem is shirt enchant will not work with the current code.

Any idea's that i can try would be usefull.
Post Reply