Jump to content

Recommended Posts

Posted

Hello boys!
I was thinking ways that someone can make a balance into a server...
Lineage is a game with many different characters and skills... So the balance is really hard some times...
I thought that by balancing skills and stats only, doesn't fix the problem on a point of view...
so I created a code that is changing the final outcome damage to a higher or lower percentage..
I think is better to check the code by yourself and give me a feedback.

   public static double calcPhysDam(L2Character attacker, L2Character target)
   {
      L2PcInstance targetPlayer = target.getActingPlayer();
      L2PcInstance attackerPlayer = attacker.getActingPlayer();
      
      boolean isPvP = attacker.isPlayable() && target.isPlayable();
      
      final L2Weapon weapon = attacker.getActiveWeaponItem();
      L2Armor armor = targetPlayer.getActiveChestArmorItem();
      
      if (isPvP)
      {
         if (weapon != null)
         {
            if (armor != null)
            {
               switch (attackerPlayer.getClassId())
               {
               /**
                * HUMAN CLASSES
                */
                  case duelist:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUAL:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case dreadnought:
                  {
                     switch (weapon.getItemType())
                     {
                        case POLE:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case phoenixKnight:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case hellKnight:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case sagittarius:
                  {
                     switch (weapon.getItemType())
                     {
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case adventurer:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALDAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * ELF CLASSES
                   */
                  case evaTemplar:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case swordMuse:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case windRider:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALDAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case moonlightSentinel:
                  {
                     switch (weapon.getItemType())
                     {
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * DARK ELF CLASSES
                   */
                  case shillienTemplar:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case spectralDancer:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUAL:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case ghostHunter:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALDAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case ghostSentinel:
                  {
                     switch (weapon.getItemType())
                     {
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * ORC CLASSES
                   */
                  case titan:
                  {
                     switch (weapon.getItemType())
                     {
                        case TWOHAND_SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case grandKhavatari:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALFIST:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * DWARF CLASSES
                   */
                  case fortuneSeeker:
                  {
                     switch (weapon.getItemType())
                     {
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case maestro:
                  {
                     switch (weapon.getItemType())
                     {
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * KAMAEL CLASSES
                   */
                  case doombringer:
                  {
                     switch (weapon.getItemType())
                     {
                        case ANCIENTSWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case maleSoulhound:
                  {
                     switch (weapon.getItemType())
                     {
                        case RAPIER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case femaleSoulhound:
                  {
                     switch (weapon.getItemType())
                     {
                        case RAPIER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case trickster:
                  {
                     switch (weapon.getItemType())
                     {
                        case CROSSBOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case judicator:
                  {
                     switch (weapon.getItemType())
                     {
                        case RAPIER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
               }
            }
            return 0.7; // if armor == null, return this.
         }
         return 1.0; // if weapon == null, return this.
      }
      return 1.0; // Never change this value.
   }
   
   /**
    * @param attacker
    * @param target
    * @param skill
    * @return double
    */
   public static double calcMagicDam(L2Character attacker, L2Character target, Skill skill)
   {
      L2PcInstance targetPlayer = (L2PcInstance) target;
      L2PcInstance attackerPlayer = (L2PcInstance) attacker;
      
      boolean isPvP = attacker.isPlayable() && target.isPlayable();
      
      L2Armor armor = targetPlayer.getActiveChestArmorItem();
      
      if (isPvP)
      {
         if ((skill != null) && skill.isMagic())
         {
            if (armor != null)
            {
               switch (attackerPlayer.getClassId())
               {
               /**
                * HUMAN CLASSES
                */
                  case archmage:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case soultaker:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case arcanaLord:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case cardinal:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case hierophant:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  
                  /**
                   * ELF CLASSES
                   */
                  case mysticMuse:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case elementalMaster:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case evaSaint:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  
                  /**
                   * DARK ELF CLASSES
                   */
                  case stormScreamer:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case spectralMaster:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case shillienSaint:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  
                  /**
                   * ORC CLASSES
                   */
                  case dominator:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case doomcryer:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
               }
            }
            return 0.7; // if armor == null, return this.
         }
         return 1.0; // if skill == null, return this.
      }
      return 1.0; // Never change this value.
   }

With this code i can either control the OP damage from classes with other weapons like the common issue with tanks with bow...
with less words... Each character is able to deal the maximum damage he can ONLY with his weapon... not another class's weapon.

Posted

Hello boys!

I was thinking ways that someone can make a balance into a server...

Lineage is a game with many different characters and skills... So the balance is really hard some times...

I thought that by balancing skills and stats only, doesn't fix the problem on a point of view...

so I created a code that is changing the final outcome damage to a higher or lower percentage..

I think is better to check the code by yourself and give me a feedback.

   public static double calcPhysDam(L2Character attacker, L2Character target)
   {
      L2PcInstance targetPlayer = target.getActingPlayer();
      L2PcInstance attackerPlayer = attacker.getActingPlayer();
      
      boolean isPvP = attacker.isPlayable() && target.isPlayable();
      
      final L2Weapon weapon = attacker.getActiveWeaponItem();
      L2Armor armor = targetPlayer.getActiveChestArmorItem();
      
      if (isPvP)
      {
         if (weapon != null)
         {
            if (armor != null)
            {
               switch (attackerPlayer.getClassId())
               {
               /**
                * HUMAN CLASSES
                */
                  case duelist:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUAL:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case dreadnought:
                  {
                     switch (weapon.getItemType())
                     {
                        case POLE:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case phoenixKnight:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case hellKnight:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case sagittarius:
                  {
                     switch (weapon.getItemType())
                     {
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case adventurer:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALDAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * ELF CLASSES
                   */
                  case evaTemplar:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case swordMuse:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case windRider:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALDAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case moonlightSentinel:
                  {
                     switch (weapon.getItemType())
                     {
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * DARK ELF CLASSES
                   */
                  case shillienTemplar:
                  {
                     switch (weapon.getItemType())
                     {
                        case SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case spectralDancer:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUAL:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case ghostHunter:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALDAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case ghostSentinel:
                  {
                     switch (weapon.getItemType())
                     {
                        case BOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        case DAGGER:
                           return targetPlayer.isWearingHeavyArmor() ? 0.9 : targetPlayer.isWearingLightArmor() ? 0.9 : targetPlayer.isWearingMagicArmor() ? 0.9 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * ORC CLASSES
                   */
                  case titan:
                  {
                     switch (weapon.getItemType())
                     {
                        case TWOHAND_SWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case grandKhavatari:
                  {
                     switch (weapon.getItemType())
                     {
                        case DUALFIST:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * DWARF CLASSES
                   */
                  case fortuneSeeker:
                  {
                     switch (weapon.getItemType())
                     {
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case maestro:
                  {
                     switch (weapon.getItemType())
                     {
                        case BLUNT:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  
                  /**
                   * KAMAEL CLASSES
                   */
                  case doombringer:
                  {
                     switch (weapon.getItemType())
                     {
                        case ANCIENTSWORD:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case maleSoulhound:
                  {
                     switch (weapon.getItemType())
                     {
                        case RAPIER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case femaleSoulhound:
                  {
                     switch (weapon.getItemType())
                     {
                        case RAPIER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case trickster:
                  {
                     switch (weapon.getItemType())
                     {
                        case CROSSBOW:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
                  case judicator:
                  {
                     switch (weapon.getItemType())
                     {
                        case RAPIER:
                           return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                        default:
                           return 0.6;
                     }
                  }
               }
            }
            return 0.7; // if armor == null, return this.
         }
         return 1.0; // if weapon == null, return this.
      }
      return 1.0; // Never change this value.
   }
   
   /**
    * @param attacker
    * @param target
    * @param skill
    * @return double
    */
   public static double calcMagicDam(L2Character attacker, L2Character target, Skill skill)
   {
      L2PcInstance targetPlayer = (L2PcInstance) target;
      L2PcInstance attackerPlayer = (L2PcInstance) attacker;
      
      boolean isPvP = attacker.isPlayable() && target.isPlayable();
      
      L2Armor armor = targetPlayer.getActiveChestArmorItem();
      
      if (isPvP)
      {
         if ((skill != null) && skill.isMagic())
         {
            if (armor != null)
            {
               switch (attackerPlayer.getClassId())
               {
               /**
                * HUMAN CLASSES
                */
                  case archmage:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case soultaker:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case arcanaLord:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case cardinal:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case hierophant:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  
                  /**
                   * ELF CLASSES
                   */
                  case mysticMuse:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case elementalMaster:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case evaSaint:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  
                  /**
                   * DARK ELF CLASSES
                   */
                  case stormScreamer:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case spectralMaster:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case shillienSaint:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  
                  /**
                   * ORC CLASSES
                   */
                  case dominator:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case doomcryer:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
               }
            }
            return 0.7; // if armor == null, return this.
         }
         return 1.0; // if skill == null, return this.
      }
      return 1.0; // Never change this value.
   }

With this code i can either control the OP damage from classes with other weapons like the common issue with tanks with bow...

with less words... Each character is able to deal the maximum damage he can ONLY with his weapon... not another class's weapon.

achievable with just passing a skill on each class and playing with xmls, why to create so must useless stuff when you have the option to just add either mastery penalty or xml: using kind "Sword,Blunt ... etc

Posted

achievable with just passing a skill on each class and playing with xmls, why to create so must useless stuff when you have the option to just add either mastery penalty or xml: using kind "Sword,Blunt ... etc

1. Perhaps this code does something that's not that simple by editing skills, items, stats etc 1 by 1.

2. As i already said in the topic "I thought that by balancing skills and stats only, doesn't fix the problem on a point of view..."

 

The skills are skills... You can handle a weak or strong skill... but it's difficult to handle the overall damage of some character to another (e.g a good warrior like duelist and a skilled player can sometimes almost achieve a 2v1 fight with 2 mages | a good archer can kill a mage without even let him react | a good dagger can face everyone except mages because of her evasion.)

 

The balance doesn't come always from the skills and the skills doesn't always bring you balance.... Plus... with this code you can handle a part of balance really quick and easy!

Posted

Sorry, I don't share it... yet.

Atm I just want to hear some feedback from the community :)

Acctualy i had a bit same idea, but to use bots and statistic from theyr fights, to make some sort of graphic - that would show the dependence of low class vs>> over powerd class(with different items, skills, buffs, attrs, and etc)

If you're interested to cooperate - can you send me pm ?

Posted

Acctualy i had a bit same idea, but to use bots and statistic from theyr fights, to make some sort of graphic - that would show the dependence of low class vs>> over powerd class(with different items, skills, buffs, attrs, and etc)

If you're interested to cooperate - can you send me pm ?

Creating bots to test stats is so much waste of time...

and you'll never achieve something good from that...

You'll waste so much time create a code and make bots fighting like real players and it's literally much faster to finish whatever you want and open a public beta server to fix the balance + skills + stats items etc.

Posted

Creating bots to test stats is so much waste of time...

and you'll never achieve something good from that...

You'll waste so much time create a code and make bots fighting like real players and it's literally much faster to finish whatever you want and open a public beta server to fix the balance + skills + stats items etc.

The bots idea - is to not make Open beta server, cause if server is very custom and it should be noticed to earlier, then its maybe only way, i still dont get how you test your balance ? On real players ?

Posted

The bots idea - is to not make Open beta server, cause if server is very custom and it should be noticed to earlier, then its maybe only way, i still dont get how you test your balance ? On real players ?

of course.. an Open Beta server is the best way to balance your server and test for bugs/glitches etc.

BETA is this only way.. especially if you have a couple of events/codes/areas and plus to test your farm rewards, xp etc. + the balance...

By fixing all the possible bugs and balance issues by yourself or with only 2-3 people and then opening a live server... It's kinda so waste of advertisement and money for it because when people will see the bugs and the balance issues, they won't care about fixing them... they'll start hating and flaming about the server and then you've just created 1 more dead-server!

not worthy at all

Posted

                  case archmage:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case soultaker:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case arcanaLord:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case cardinal:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case hierophant:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }

use

case blabla:

case blabla:

do blabla;

 

because they all do the same:)

Posted

of course.. an Open Beta server is the best way to balance your server and test for bugs/glitches etc.

BETA is this only way.. especially if you have a couple of events/codes/areas and plus to test your farm rewards, xp etc. + the balance...

By fixing all the possible bugs and balance issues by yourself or with only 2-3 people and then opening a live server... It's kinda so waste of advertisement and money for it because when people will see the bugs and the balance issues, they won't care about fixing them... they'll start hating and flaming about the server and then you've just created 1 more dead-server!

not worthy at all

Got to agree with that.

So a possible solution is to give people live Beta since none (mby) will join a beta server to support you.

Posted
                  case archmage:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case soultaker:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case arcanaLord:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case cardinal:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }
                  case hierophant:
                  {
                     return targetPlayer.isWearingHeavyArmor() ? 1.0 : targetPlayer.isWearingLightArmor() ? 1.0 : targetPlayer.isWearingMagicArmor() ? 1.0 : 0.7;
                  }

use

case blabla:

case blabla:

do blabla;

 

because they all do the same:)

 

they do but every class is different... and i want to change their values differently from the other's if they're weak or too strong

 

 

 

Got to agree with that.

So a possible solution is to give people live Beta since none (mby) will join a beta server to support you.

advertisement for BETA. If the server is BETA and people would join, you have an excuse for the unfixed balance and bugs and people will understand and will help you.. They'd do on live server too... but there'd be much more haters and tears!

Posted

You could, indeed, get this done simply by giving characters a passive skill and applying the bonuses depending on the character class, as Kelrzher said. But you're not really going to balance anything that way.

 

Lineage II always have had its very own meaning of balance.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Reconstructed the MSNP8 client/server chain in Lineage 2 (from C4 to HFp5) with full protocol capabilities + added Discord integration    Clean MSNP8:       MSNP8 + Discord Bridge:   
    • I'm looking for the GVE code for Luecera2.
    • Recommended seller, I'm using his services. Good luck @Ave
    • https://l2.gamedream.pl/ Update #2 — GameDream Interlude (C6)     This update focuses on Epic bosses, quest chains and overall QoL :cool Highlights: Frintezza access follows a full retail-like chain: Four Goblets → Last Imperial Prince → Journey to a Settlement Retail-like entry requirements restored (scroll + Command Channel) Four Goblets quest is now available in-game Shot visuals synced with attack/skill usage Community Board Premium Shop refreshed with classic Interlude buttons and cleaner tables Epic Raidboss access: Frintezza — 4–5 party Command Channel + scroll + Antique Brooch Antharas — Portal Stone Baium — Bloody Fabric Valakas — Floating Stone Queen Ant / Core / Orfen / Zaken — no quest gates Bug Fixes & QoL: Frintezza quest chain fully fixed TvT rewards — single reward + anti-abuse protection Shots — no double triggering Premium Shop — no blank tabs Mammon NPCs in Giran working correctly Cancel works retail-like (up to 5 buffs removed) Summon Friend fixed with anti-exploit guards YetiBuffer — Saved Buff Profiles (Save / Clear / Restore) PvE — increased aggro range + balance tweaks EXP toggle commands: expoff / expon / expblock Thanks for testing and feedback — more updates coming soon ❤️
    • Hello I would like to offer You my NEW 2026 Updater / Launcher with custom skins.   - UPDATER FEATURES -   1. Performance and Intelligent Resource Management: Smart Disk Detection (SSD/HDD): The updater automatically detects the user's drive type. For SSD/NVMe drives: Launches up to 8-12 concurrent threads, utilizing the full yet optimized connection speed. For HDD drives: Limits the thread count (to 2-3) to prevent computer slowdowns and avoid overloading the drive head. Multi-threaded Downloading: Instead of downloading file by file, the updater downloads multiple files simultaneously, drastically reducing update time. ZSTD Compression: Support for the modern Zstandard compression algorithm (.zst). Files are downloaded in compressed form and decompressed on the fly, saving bandwidth and accelerating downloads. HTTP/2 and Keep-Alive Support: Utilizing the HTTP/2 protocol and persistent connections allows for the instant download of thousands of small files without establishing a new connection for each one.   2. Modern User Interface (UI/UX): Transparency and PNG Graphics: Support for irregular window shapes, allowing for the creation of a unique, modern launcher look. Taskbar Integration: The progress bar is displayed not only in the window but also on the Windows taskbar icon. Built-in News Browser (Optional): The updater features a built-in browser module that displays news/changelogs directly within the launcher (without opening an external browser). Multi-language Support (Optional): Built-in language switching system (e.g., EN/PL/RU, etc.) with dynamic loading of button graphics and text. Animated Buttons (Optional): Dedicated, animated buttons redirecting to Discord, Facebook, YouTube, Instagram, and the website.   3. Technical Features and Application Security: Anti-Dual Run (Optional): The updater checks if the game is already running to prevent file conflicts during updates. Error Diagnostics: Built-in logging system (debug_log.txt) and hardware exception handling (SEH), facilitating the diagnosis of problems for players who cannot run the game. Internal Configuration: Updater settings are stored inside the .exe file, eliminating publicly accessible configuration files.   4. File Categorization (Normal vs. Critical vs. Once): Critical Files: Critical files are verified more thoroughly (via MD5 Hash) even in quick check mode to guarantee stability. Normal Files: Standard game files (textures, models, sounds) are checked depending on the selected mode (Quick vs. Full). Once Files (Overwrite Exclusions): Applies to user configuration files (e.g., Option.ini, User.ini).   5. Check Modes (Verification Algorithms): Self-Update: The updater can update itself before checking game files, allowing for easy deployment of launcher fixes. The updater supports two main operating modes that switch intelligently based on user action: Smart Check (Startup Quick Check): Runs automatically upon updater startup or pressing the START button (unless a full check is forced). Full Check (Full MD5 Verification): Manually triggered by the player via the "Full Check" button. Automatic Update Detection: If a newer version of a file appears on the server, it is automatically detected and downloaded without player interaction. Atomic Updates: Files are downloaded and verified first, and only then saved to the disk. This prevents game client corruption in case of internet connection loss. The entire process takes seconds, even with clients weighing 30GB+. - PATCH BUILDER FEATURES -   1. Professional File Structure Management (Tree-List Hybrid): Directory Tree Visualization: Instead of a flat file list, the Builder displays a clear structure of folders and subfolders. You can collapse and expand entire tree branches, facilitating work with thousands of files. Normal and Critical Division: A clear window division into two main zones: Normal Files and Critical Files. Ghost and Excluded Files Division: The interface visually informs about the status of unchanged files (existing in the previous patch version) and files excluded from the update. Show/Hide Ghosts: With one click, you can hide unchanged files to focus solely on what you are actually sending to players in this update.   2. Intuitive Interaction: Drag & Drop: Full Drag & Drop support. You can grab files or entire folders and drag them between the "Normal" and "Critical" lists. Transfer is intelligent – it moves the entire content of selected folders. Keyboard Shortcuts: Fast workflow thanks to keyboard support: Delete, Enter, Ctrl+A / Ctrl+C (select and copy paths).   3. Advanced Filtering and Searching: Context Search: The search bar works in real-time, filtering the file tree. Type /folder: Searches only within folder names. Type *ex: Shows only excluded files. Standard Typing: Searches files by name.   4. Automation and Security: Auto Self-Update: The Builder automatically detects the updater executable file. Real-Time Statistics: The status bar continuously shows the file count (Normal/Critical), total patch weight (in Bytes/MB/GB), and the last update date. System File Protection: Files marked as "Critical" cannot be accidentally added to the exclusion list – the program blocks such actions.   5. Performance (Backend): ZSTD Compression: The Builder uses the latest Zstandard algorithm to compress files before sending, ensuring a significantly smaller patch size than standard ZIP, saving server bandwidth and player time. Multi-threading: The packing and MD5 checksum generation process utilizes multiple CPU threads, drastically reducing patch building time.   - PRICING - NEW Updater standard price: 79 euro (if You ask for mods, price will change).   - CONTACT - Discord: ave7309   CLICK HERE TO CHECK LATEST TEMPLATES!                         * I have right to REFUSE to take an order. * Supported games: Lineage 2 / Black Desert / MU Online / Tantra / Rohan / Aion / Cabal / Fiesta any more...  
  • 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..