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

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

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


×
×
  • Create New...