Jump to content
  • 0

I Am Stuck And My Code Doesnt Work


Question

Posted (edited)

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

13 answers to this question

Recommended Posts

  • 0
Posted (edited)

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-
  • 0
Posted

mastery penalty for weapon , so if you wear cupid bow it doesnt give you a penalty i want to add  2 more weapons so you cant get a mastery penalty  but i guess my code is wrong?

  • 0
Posted (edited)

it is interlude and l2jbroken (frozen) just learning making some tries   :P  i am just so curious why it doesnt work it is L2PcInstance

Edited by Akken
  • 0
Posted (edited)

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
  • 0
Posted
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

  • 0
Posted

his code is working i tested it on my local practise project just mine isnt l2jfrozen 

 

he propably has something custom i am sure for this.

Guest
This topic is now closed to further replies.


  • Posts

    • - New Features in Anosim https://anosim.net -   You can now share your numbers with others via a unique link - no need to give them access to your account! How to Share Number https://prnt.sc/K83lxOjS-Fyb   How to Revoke Accsess: https://prnt.sc/jkVIQS2lhxvA   --- --- --- --- --- --- --- New OTP / SMS Activation Locations: - USA  - Australia - Honduras - Kenia
    • How to Create Multi-Accounts For TikTok, Youtube, Gmail....   Short Guide to Managing Multiple TikTok Accounts TikTok's anti-spam systems detect duplicate accounts via device IDs, IP addresses, and behavior. To avoid bans, follow these methods. 1. For 3-5 Accounts (Easiest) Use TikTok's built-in feature to add accounts in your app settings. Limitation: Frequent switching on the same device/IP can still trigger restrictions. 2. For Bulk Accounts (Safest) To make each account appear unique, you need to mask your digital footprint. Unique Emails & Proxies: Use a separate email and a residential/mobile proxy (e.g., MoMoProxy) for each account. Avoid free proxies. Anti-Detect Browsers: Use tools like AdsPower or Multilogin to create unique browser profiles, each with its own proxy and randomized digital fingerprint.   MoMoProxy Integrate with Adspower Browser   Process: In each unique browser profile, log into a separate Gmail and then create the TikTok account. 3. For One Device (Limited Use) Use app cloners like Parallel Space (Android) or Dual Space (iOS). Limitation: Not foolproof, as TikTok can sometimes detect cloned apps. Key Best Practices to Avoid Bans: Isolation: Use one proxy and one device/browser profile per account. Warm-Up: Act organically—watch videos, like, and comment—before posting content. Appear Unique: Use different usernames, bios, and profile pictures for each account. Avoid VPNs: Standard VPN IPs are often detected and flagged.   Youtube Video On How to Create TikTok Accounts  https://youtu.be/ZUihXj7BO4M  
    • How to Create Multi-Accounts For TikTok, Youtube, Gmail....   Short Guide to Managing Multiple TikTok Accounts TikTok's anti-spam systems detect duplicate accounts via device IDs, IP addresses, and behavior. To avoid bans, follow these methods. 1. For 3-5 Accounts (Easiest) Use TikTok's built-in feature to add accounts in your app settings. Limitation: Frequent switching on the same device/IP can still trigger restrictions. 2. For Bulk Accounts (Safest) To make each account appear unique, you need to mask your digital footprint. Unique Emails & Proxies: Use a separate email and a residential/mobile proxy (e.g., MoMoProxy) for each account. Avoid free proxies. Anti-Detect Browsers: Use tools like AdsPower or Multilogin to create unique browser profiles, each with its own proxy and randomized digital fingerprint.   MoMoProxy Integrate with Adspower Browser   Process: In each unique browser profile, log into a separate Gmail and then create the TikTok account. 3. For One Device (Limited Use) Use app cloners like Parallel Space (Android) or Dual Space (iOS). Limitation: Not foolproof, as TikTok can sometimes detect cloned apps. Key Best Practices to Avoid Bans: Isolation: Use one proxy and one device/browser profile per account. Warm-Up: Act organically—watch videos, like, and comment—before posting content. Appear Unique: Use different usernames, bios, and profile pictures for each account. Avoid VPNs: Standard VPN IPs are often detected and flagged.   Youtube Video On How to Create TikTok Accounts  https://youtu.be/ZUihXj7BO4M        
    • If you created it yourself for the first races just duplicate it in the same way for the other races (that is make the animations for the other races as well) and everything will work
    • OpenCV bot working for all l2 clients... but need special set for each server
  • Topics

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