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

Interesting code, and how you check ingame  ?

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

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

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

    • A question: I’ve had two servers that were downgraded from C6 to C4, and both would lag for players when they changed subclass, and almost every time the L2 server would crash. They say it’s a problem with the C5 skills that were added. Has anyone experienced this issue? The server would run fine without errors until people started changing classes. Has anyone gone through this and knows the solution to the problem?
    • L2jBayev Chronicle 3: Rise of Darkness – AiEngine Edition In short: this is a C3 build with a full-fledged AI engine, live mercenaries, a built-in quiz, a “personal account” in the Community Board, and server logic neatly distributed across thread pools. The project is about a living world without lags : bots farm, communicate, gather parties, teleport along routes, and the server remains cold and stable.   What's inside (the most delicious) 1) Full-fledged AI engine for characters Behavior types: farming ( FarmAI ), combat ( CombatAI ), party logic ( PartyAI ), trading/walking ( TraderAI / WalkerAI ), support roles (healer, etc.). Class profiles: for mages/archers/daggers, etc., “smart” skill rotations, distance control, sleep/save skills, healing, loot pickup, etc. are implemented (see examples of classes like SpellSingerAI , NecromancerAI , etc.). Self-healing and teleports: when dying, the bot goes through a sequence of steps without sleep()- via AITaskSequence + AITeleportToLocTask , searches for the nearest gatekeeper and teleports via TeleportationManager with routes depending on the level. Auto-support: auto-nipples, arrows/bones, smart auto-proceduring of buffs and auto-banks CP/HP/MP with thresholds - all sewn into the auxiliary EtcPlayersAi . Chat context: ChatManagerAi processes mentions, makes responses with delays (anti-flood), supports party chat and “human” reaction. Understanding: ChatManagerAi system  processes the dialogue, bots remember your aggression and insults, they start to respond less often to modern users, stop accepting or inviting to a group (party) and when it goes beyond the peak they will simply merge you, and every time they see you on the PC, there is an opportunity to measure more often, communicate respectfully and beautifully, in general, a “human” reaction. Why a player/admin needs this: bots actually “live”, farm and interact, and don’t just stand on macros. This is a great background for online and PvE action.   2) Mercenaries (Mercenary system) Full-fledged companion character : L2MercenaryInstance with its own MercenaryAI (movement, attack, support, consumables, shots). Behavior modes: DEFENDER / SUPPORT / PASSIVE - switchable to suit your playing style. Progress and trust: the mercenary's trust/exp/level grows , skills are learned according to the MercenarySkillTree (conditions are based on the trust or level of the owner). Templates and equipment: via MercenaryTemplateTable and spawner - model/weapon/type are selected. Social: MercenarySpeechManager - a set of speeches; the mercenary "comes to life" in the chat. Premium Link: Premium account owners give the mercenary additional trust (faster progress). Why: This is not a dummy pet, but a playful companion with modes, training and “character”.   3) Quiz (event viktorina ) Rounds according to schedule: pre-launch with announcements (minutes/seconds before start), registration .reg, auto-opening of the window. Multiple choice questions: question + set of answer buttons; fair processing, timings, question change. Tops and history: results table, statistics, neat UI via HTML assembly. Flexible control: you can start immediately or set a delayed start (notification package 5/2/1 min, etc.). Why: regular activity for players, “social entertainment” module right in the build.   4) Personal account in Community Board KB managers: buff cabinet, teleports, clans/forums/mail/friends, tops (PK/PvP/wealth/players), character repair, viewing skill trees , etc. Premium logic: some services/mail are limited by premium; premium also affects the visual (nickname color) and bonuses (see effect on mercenary). Single sign-on: all in one place, no team chaos. Why: conveniently manage your character and services without going into the console or installing third-party mods.   Why is the system technically valuable? Minimum load and stability Separated thread pools: AI logic, hunting, teleports, chat - on separate onesScheduledExecutorService ( AI_THREAD_POOL , MONSTER_HUNT_POOL , TELEPORT_POOL , CHAT_POOL ). No "freezing": task sequencers (teleport/recovery) work through the scheduler, not Thread.sleep(). Bot limitation: protection against overload via thresholds/counters - “extra” bots do not start. One bot - one sequence: AITaskManager ensures that the character does not have parallel conflicting tasks. Smoothing out peaks: starting tasks with offsets so that there are no simultaneous “ticks” of hundreds of bots. Monitoring/logs: own loggers (separate files for info/errors/processes/chats), CPU load monitoring. Bottom line: the build is designed for “thick online” and mass activities without TPS failures .   Additional Features Auto-alliances for farming: party logic invites suitable players (checking level/equipment/clan flags), there are “human” responses to requests. Sub/class management: out of the box helpers for changing class/subclass, auto-learning of necessary skills and selection of equipment by level. Security/protection: secondary PIN/picture password support (used in KB/voiced commands; optional). Premium accounts: privileges in KB/mail/visual and synergy with mercenary progress. Ready-made services: tops, auctions/mail, teleports from KB, buff rooms, repairs, viewing skill trees, etc.   Who is this build for? Freeshare/project admins who want a living world “from the pack”: bots and mercenaries provide a constant background of activity. Players who value convenience: personal account, premium services, events and a mercenary companion. Developers who want a clean, predictable backend with thread pools and a neat task model without “magic”.   How it differs from standard assemblies Not macros - AI profiles with “brains”: rotations, positioning, healing, decision making. Not a decoration pet - a mercenary with his own modes, progress, skill tree and lines. Not a faceless gamemod - an event quiz with UI, schedule, tops. No chaos in flows - strict pools, planning and task managers designed for online and growth. No separate scripts - a single personal account in KB for most activities.   TL;DR (one paragraph for the project card) AiEngine C3 is a build with live AI, smart bots, mercenaries (modes/progress/skills), built-in quiz, premium logic and a convenient personal account in KB. Under the hood are distributed thread pools and task managers without sleep(), so even with a dense online the server remains stable and responsive.   Additionally add - there is still a lot of interesting things command .assassin or shift+target (order murder), shift+target for admins on AI characters for control, admin panel is completely rewritten, many additional functions, mercenaries change their appearance depending on trust, deepseek and chatGPT system is connected for communication of characters like real players, GPT - for newer java, there is still a very large list of fixes after the last versions, a lot has been fixed, including height coordinates (Z) geo-Squares, pathfinding, visibility through obstacles, fix pet summons, trade packages, shop packages, many effects, quests (including the original ones like nipples, etc.), Ai behavior of NPC and RB monsters, absolutely all epics have been transferred to AiLoader no longer in python scripts. Attention! The server is suitable for both classic mode and PvP format, as well as with various mods. Absolutely everything is configured in the configurations to suit your taste and purposes of use. It is recommended to launch the server through L2ServerControl (simplifies management and control of processes). Download Servers: Chronicle 3 Server Chronicle 4 Test Upgraded Server Full Desc & screens: Post & Screens c3 Post & Desc c4    
  • 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