Jump to content
  • 0

Check Class For Item


FunKermaN

Question

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
Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

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
Link to comment
Share on other sites

  • 0

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..

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

 

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
Link to comment
Share on other sites

  • 0

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 

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

 

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

Link to comment
Share on other sites

  • 0

 

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
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • God gifted lost Lover Spells Caster Prof. Joseph to reunite you with your ex within a short period of time with too much love and respect than ever before. Many people still question whether love spells work or not, permanent or effective? This can be based from past experiences where they tried some spell casters but not fully satisfied with their results or the love spells worked for just a short period and sometimes even never saw any results. To avoid such situations you have to be careful with spell casters you approach, some are limited with certain Spiritual powers to cast good love spells to help people in their relationships or marriages. Many good love spell casters are out there in the world (Africa, Asia and so on) Yes, I Guarantee love spells really work, whether you are in a situation where you want to bring back your lost lover (lost lover spell), you want to get married to someone in a relationship(marriage spells),to increase love in your relationship (love affection spells) and many other related love spells, you will get HELP. It does not matter where you are or where your partner is, you don't have to be unhappy of a situation you can solve IMMEDIATELY, it is all about finding a GOOD, TRUE and REAL love spell caster with super natural powers in spell castings to change your love life forever. PROF. JOSEPH is a Celebrated AWARD WINNING Love Spell Caster with 50years of Casting Experience whose works have won HIM friendship all over the world from the people HE met and changed their lives. To know more about spells and his wonderful works. For reading world wide!. N.B. ALL HEART BROKEN PEOPLE & THOSE WHO HAVE BEEN SCAMMED ALOT BY FAKE ONLINE CASTERS ALL OVER THE WORLD PLEASE DON'T LOOSE HOPE,FEEL FREE TO CONSULT ME FOR INSTANT READING AND REUNION WITH YOUR EX LOVER NO MATTER THE SITUATION IN 12 HOURS ONLY. Call/WhatsApp: +27630699577 Email: babajoseph473@gmail. com Website: https://traditional-herbalist-healer.webnode.com
    • I would like to know if anyone has an interface for H5 that shows the debuff's in TargetStatusWnd or if they have the code for TargetStatusWnd.uc and TargetStatusWnd in interface.xdat with that future. I'm trying to implement this function in my interface, but I can't find any interface that has it to view the code. Thank you very much to this excellent community.
    • DISCORD : utchiha_market telegram  https://t.me/utchiha_market SELLIX STORE : https://utchiha-market.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices
    • Item creation not work in Hi5 
  • Topics

×
×
  • Create New...