Jump to content
  • 0

Check Class For Item


Question

Posted (edited)
Hello guys Merry Christmas, maybe someone can help me to create one code, to wearing each class his own tattoo ?

For Example: The Archer can wearing tattoo for archer if worn at dagger to get penalty "low stats" or even better to don't allow to wear.

Thanks in advance!!!

 


qIDhTAC.png


Edited by FunKermaN

14 answers to this question

Recommended Posts

  • 0
Posted (edited)

Useitem.java put a check with item id and classes you want to dissable it..

 

i have write that ... this is correct ?

 

 

if (Config.TATTOO_CHECKER)
{
if (player.getClassId().getId() == 92) //archer
{
if(activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE.getId()) == 8530)
{
setPaperdollItem(PAPERDOLL_FACE, 8530);
}
else
{
setPaperdollItem(PAPERDOLL_FACE, null);
activeChar.sendMessage("That tattoo is not allowed to wearing at your class.");
}
}
else if (player.getClassId().getId() == 93) // dagger
{
if(activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE) == 8531)
{
setPaperdollItem(PAPERDOLL_FACE, 8531);
}
else
{
setPaperdollItem(PAPERDOLL_FACE, null);
activeChar.sendMessage("That tattoo is not allowed to wearing at your class.");
}
}
}
Edited by FunKermaN
  • 0
Posted (edited)

My friend, there is a code "Daggers/archers can't use heavy". In your frozen pack on UseItem.java

just stole and modify these lines..

 

I have write that but does not work :/ "its a test code"

if (activeChar.getClassId().getId() == 92 && item.getItemType() == L2WeaponType.NONE && item.getItemId() == 15036 && item.getItemId() == 15046 && item.getItemId() != 15056 && !activeChar.isGM())
{
activeChar.sendMessage("That tattoo is not allowed to wearing at your class.");
return;
}
Edited by FunKermaN
  • 0
Posted (edited)

i can help you send me pm

or you can make tattoo give stats only in a wep non all weapon

like this
 

 <add order="0x40" stat="pAtk" val="1737">
        <using kind="Bow"/>
      </add>
Edited by tazerman2
  • 0
Posted (edited)

 

i can help you send me pm

or you can make tattoo give stats only in a wep non all weapon

like this

 

 <add order="0x40" stat="pAtk" val="1737">
        <using kind="Bow"/>
      </add>

 

and how i can prevent with this method the healers to don't use the tattoo for mages  ?

 

 

lul

&& item.getItemType() == L2WeaponType.NONE &&

what ?

 

that method does not work at interlude ?

 

<cond msgId="1518"> <!-- mdgId is showing in client to player why he cant use this item-->
<and>
<player level="81" /> <!-- here you put from what lvl you can use this item-->
<player class_id_restriction="93, 101, 108, 117" /> <!-- Here you put all classes you want to use that item -->
</and>
</cond>
Edited by FunKermaN
  • 0
Posted

hmm here is a problem... so only in useitem.java you can disable via class

but again have problem because you need block 3 class number like the human

fisrt is 0 after is like 20 and after 92 you need block all this. or you can do my option

like if player use dagger and is archer the tattoo he

down stats atk.spd,accurasy,evasion,speed and i think i can make it via class 

  • 0
Posted (edited)

My friend, there is a code "Daggers/archers can't use heavy". In your frozen pack on UseItem.java

just stole and modify these lines..

dont have anything about heavy at useitem.java

 

 

hmm here is a problem... so only in useitem.java you can disable via class

but again have problem because you need block 3 class number like the human

fisrt is 0 after is like 20 and after 92 you need block all this. or you can do my option

like if player use dagger and is archer the tattoo he

down stats atk.spd,accurasy,evasion,speed and i think i can make it via class 

 

 

give me one example! 
i use that at the item and does dont do anything 

<add order="0x40" stat="pAtk" val="1737">
        <using kind="Bow"/>
      </add>

Edited by FunKermaN
  • 0
Posted

 

dont have anything about heavy at useitem.java

 

 

 

give me one example! 
i use that at the item and does dont do anything 

<add order="0x40" stat="pAtk" val="1737">
        <using kind="Bow"/>
      </add>

 

i can help you via teamviewer send me pm if you need

  • 0
Posted (edited)

 

I have write that but does not work :/ "its a test code"

if (activeChar.getClassId().getId() == 92 && item.getItemType() == L2WeaponType.NONE && item.getItemId() == 15036 && item.getItemId() == 15046 && item.getItemId() != 15056 && !activeChar.isGM())
{
activeChar.sendMessage("That tattoo is not allowed to wearing at your class.");
return;
}
item.getItemType() == L2WeaponType.NONE

 got strictly no use (at least use the item type related to dyes - but anyway the limitation will be solved by item id just after) and 

item.getItemId() == 15036 && item.getItemId() == 15046

 is impossible to reach too ; an id can't be one AND another in same time. You lack of basic logic, I invite you to read more about OR/AND.

 

http://stackoverflow.com/questions/1795808/and-and-or-in-if-statements

 

If you got numerous items to edit, the simpliest is to add it directly to L2Item / ItemTable to avoid a fatass check which would include all classes type. If it's based on class type you can also introduce it on classes. On aCis you can check teachTo, which do exactly what you ask (NPC restraining player ids to be able to learn skills, and also numerous classes to be linked to that NPC). The whole logic exists, you only have to copy, edit it for your own stuff and put it on the good classes.

 

If one class == one tatoo, it's even simplier.

 

Or you can make a very long check with all your class ids / item ids integrated inside it.

Edited by Tryskell
Guest
This topic is now closed to further replies.


  • Posts

    • Only 3 days left and we'll start with some events, you can check our Discord for more info!
    • Tired of frantically switching between windows trying to find that specific Warlock who should be casting saves? Forgot which server you left your Warsmith on? This mod solves these problems! What it does: Turns the boring window title into an information panel: Server Name - Character Name [Class] Real-life examples: - ServerName - HardcoreFarm [Spoilerr] (who's been spoiling for 3 months already) - ServerName - ClericHelper [Buffer] (eternal buffer on standby) - ServerName - MainChar [Gladiator] (main character who's always AFK) Why you need this: For multiboxers - to avoid confusing where the DD is and where the healer is For the forgetful - if your memory is like a goldfish For streamers - viewers immediately see who's on screen For adults - when playing at work and need to quickly hide the window DLL only - no Interface files needed Installation (more complicated than making tea): 1. Download the DLL 2. Drop it into the System folder 3. Launch the client 4. Be amazed how you lived without this before! Purchase Conditions: Price: 100$ Payment Method: USDT. How to Buy: Contact me on Telegram: @kiselevwv for a quick response. I will answer all your questions and provide additional information if needed. I guarantee functionality at the moment of sale and prompt assistance with setup after purchase.
    • I agree, l2damage crap to compare to l2java which was the father of pvp servers and till this days people playing there for good time.
    • 📝 Registration — Account Registration Creating a new player account. Usually includes: login password password confirmation email Result: a new record is created in the accounts table (loginserver). 🔑 Change Password — Password Change The player changes the password knowing the current one. Required: current password new password new password confirmation Result: the password field is updated in the accounts table. ♻️ Password Recovery — Password Reset If the player forgot the password. Implementation only via email: the player enters their login, email the system sends an email with a link or code the player opens the link / enters the code sets a new password Result: the password is updated in the accounts table.   All fields are validated (required, format, length, uniqueness, security checks).   Price: 80$   and i can rewrite script for PTS server.   Contacts:   Telegram Discord
  • 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..