Jump to content
  • 0

I Am Stuck And My Code Doesnt Work


Akken

Question

I still get mastery penalty even with this 

if (!_bow_mastery && !_blunt_mastery && !_dagger_mastery && !_fist_mastery && !_dual_mastery && !_pole_mastery && !_sword_mastery && !_2hands_mastery)
{ // not completed 1st class transfer or not acquired yet the mastery skills
newMasteryPenalty = 0;
}
else
{
for (L2ItemInstance item : getInventory().getItems())
{
if (item != null && item.isEquipped() && item.getItem() instanceof L2Weapon && !isCursedWeaponEquiped())
{
// No penality for cupid's bow

+if (item.isCupidBow() || item.getItemId() == 10010 || item.getItemId() == 10011) 
continue;
Edited by Akken
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Hello 

 

Your check is fine Akken, try to search xmls you might have something custom that gives you a penalty like some skills that are using 

usekind="sword,bow" and such stuff

Edited by Ayami-
Link to comment
Share on other sites

  • 0

Just need to add a check for 2 weapons so they wont get penalty and i am stuck

/**
* Refresh mastery weap penality.
*/
public void refreshMasteryWeapPenality()
{
if (!Config.MASTERY_WEAPON_PENALTY || this.getLevel() <= Config.LEVEL_TO_GET_WEAPON_PENALITY)
return;
 
_blunt_mastery = false;
_bow_mastery = false;
_dagger_mastery = false;
_fist_mastery = false;
_dual_mastery = false;
_pole_mastery = false;
_sword_mastery = false;
_2hands_mastery = false;
 
L2Skill[] char_skills = this.getAllSkills();
 
for (L2Skill actual_skill : char_skills)
{
 
if (actual_skill.getName().contains("Sword Blunt Mastery"))
{
_sword_mastery = true;
_blunt_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Blunt Mastery"))
{
_blunt_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Bow Mastery"))
{
_bow_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Dagger Mastery"))
{
_dagger_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Fist Mastery"))
{
_fist_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Dual Weapon Mastery"))
{
_dual_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Polearm Mastery"))
{
_pole_mastery = true;
continue;
}
 
if (actual_skill.getName().contains("Two-handed Weapon Mastery"))
{
_2hands_mastery = true;
continue;
}
}
 
int newMasteryPenalty = 0;
 
if (!_bow_mastery && !_blunt_mastery && !_dagger_mastery && !_fist_mastery && !_dual_mastery && !_pole_mastery && !_sword_mastery && !_2hands_mastery)
{ // not completed 1st class transfer or not acquired yet the mastery skills
newMasteryPenalty = 0;
}
else
{
for (L2ItemInstance item : getInventory().getItems())
{
if (item != null && item.isEquipped() && item.getItem() instanceof L2Weapon && !isCursedWeaponEquiped())
{
// No penality for cupid's bow
if (item.isCupidBow())
continue;
 
L2Weapon weap_item = (L2Weapon) item.getItem();
 
switch (weap_item.getItemType())
{
 
case BIGBLUNT:
case BIGSWORD:
{
if (!_2hands_mastery)
newMasteryPenalty++;
}
break;
case BLUNT:
{
if (!_blunt_mastery)
newMasteryPenalty++;
}
break;
case BOW:
{
if (!_bow_mastery)
newMasteryPenalty++;
}
break;
case DAGGER:
{
if (!_dagger_mastery)
newMasteryPenalty++;
}
break;
case DUAL:
{
if (!_dual_mastery)
newMasteryPenalty++;
}
break;
case DUALFIST:
case FIST:
{
if (!_fist_mastery)
newMasteryPenalty++;
}
break;
case POLE:
{
if (!_pole_mastery)
newMasteryPenalty++;
}
break;
case SWORD:
{
if (!_sword_mastery)
newMasteryPenalty++;
}
break;
 
}
}
}
 
}
Edited by Akken
Link to comment
Share on other sites

  • 0
if (!_bow_mastery && !_blunt_mastery && !_dagger_mastery && !_fist_mastery && !_dual_mastery && !_pole_mastery && !_sword_mastery && !_2hands_mastery)
{ // not completed 1st class transfer or not acquired yet the mastery skills
newMasteryPenalty = 0;
}
else if (item.isCupidBow() || item.getItemId() == 10010 || item.getItemId() == 10011)  {
newMasteryPenalty = 0;
}
else
{
for (L2ItemInstance item : getInventory().getItems())
{
if (item != null && item.isEquipped() && item.getItem() instanceof L2Weapon && !isCursedWeaponEquiped())
{

something like that dunno ;D

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock