Jump to content

xXObanXx

Members
  • Posts

    416
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by xXObanXx

  1. Readability, easy code maintenance, easy to edit values (no need to recompile) externalizing configs. Basically said, whatever a developer seek coding.

     

    Your code works that's not the problem, but if L2J was coded like your custom... Well it would give L2JFrozen.

     

    :happyforever:

    Well for me it's easy to read/maintenance and i'll make it easy to edit the values... xD

    But I don't actually get it how it could work with Maps

     

     

    when i said skill, you can configuer weapon dmg and etc from there

    Indeed this is an option but by changing the values there, you're changing the damage for all the classes... against all the armor types... so you can make a weapon (and a class that needs the current weapon) weak.. and it's not worth it at all

  2. I'm sorry boys but I don't get it..

    It doesn't need to store all these informations into Maps.

    Each player has a different class and weapon.. but I don't get it why I should do all this...

    It's like a duplicate of the whole class/weapon system because all these weapons and classes are stored in enums and i call them directly from their classes...

    My current code is probably barely readable but it's simple and easy to understand..

     

    Edit: Btw I'm currently opening the server from eclipse debugging so I don't need to recompile and change .jar files to change the value... i just change it from eclipse/save it and boum... the value has change and gets immediate effect... I will think about placing in properties or an xml later..

  3. Your code is barely readable, and hard to maintain.

    If you read and understand the first class, then you know the rest of the code... It's not hardcoded at all but i wanted to keep the performance part, that's why i didn't use any Map.

    And I steel don't know what this code's performance would be in a live server, that's why i asked for a feedback, to tell me your thoughts :)

  4. I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

     

    You, you want to retrieve player classid, then retrieve weapon type, then only you refer to array of values.

     

    From what I understand, it fits.

     

    https://xp-dev.com/svn/aCis_community/aCis_gameserver/java/net/sf/l2j/gameserver/datatables/BufferTable.java

     

    See _schemesTable implementation.

     

    PS : you are right, you can't put twice the same key, otherwise it replaces. So you have to feed entirely map2, then only when map2 is fed you place on correct classid. Then you clear() map2, refeed it with correct info, and put it on another classid. Do the same for all classes.

     

    Your Map would probably be Map<Integer, HashMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

     

    AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

     

    You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

    hmmm bad idea... to much Map calculations...

    The code gets the final outcome from Formula.java and it gets calculated with the code (%) and gives the final damage...

    I think your thought could cause performance issues.. Imagine all these Map calculations in each hit or skill.. On a server with more than 20 people pvp'ing, the server would lag really badly i guess, wouldn't it?

     

    Edit: I'm not using string.. It doesn't need too actually... I think xml would be better than properties... too much values...

  5. Create a table, array or whatever container to hold the values you want to edit, and then simply call it.

     

    Example Map<Integer, int[]> : first int would be clas id, and then the array holds the value. Eventually imbricated Maps if you want to put weapon types : Map<Integer, Map<WeaponType, int[]>>.

     

    Your code is barely readable, and hard to maintain.

    Finally a real feedback.

    Thank you for your answer but i think you are kinda wrong...

    I can't hold 2 Map values with the same key, can I?

    I mean... to do that i must put

    Map.put("Class 96", Map2.get("SWORD",
    {
         1.2,
         1.1,
         1.3
    };)

    and then

    Map.put("Class 96", Map2.get("DUAL_SWORD",
    {
         1.0,
         1.2,
         1.3
    };)
    

    Can i actually do that?

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

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

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

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

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

  11. Hello guys!

     

    I'm selling high five packs with source with the custom mods (or not) you want..

     

    What I mean? You send me an e-mail about what your pack you want to buy and i'm making it! :)

    I'm offering 30 days support after your purchase.

    I'm working only with L2J High Five Packs!

     

    You can trust me 100%

     

    If you want to contact with me, just send an e-mail on:

    hapor_345@hotmail.com

    The price is changing with the number of customs...

    The lowest price's 2€

     

    I accept paypal and paysafe only!

  12. Since i know how does it works, trust me no chance, unfortunately you can't edit them directly and you won't find any tools such as "map editor".

    What i want to say is that, it's impossible to decrypt them if you don't got the basic knowledge.

    Sad bad true, you have to pay a lot in order to re-edit the maps.

     or to read a lot to make something by yourself!!

    too bad :(

  13. Hello guys... so i have l2jserver High Five (unstable) and i updated it to the latest revision.. so i have many custom codes and features in my pack and i've got a problem that pissed me off!!

     

    so the file is this:

    /*
     * This program is free software: you can redistribute it and/or modify it under
     * the terms of the GNU General Public License as published by the Free Software
     * Foundation, either version 3 of the License, or (at your option) any later
     * version.
     * 
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     * details.
     * 
     * You should have received a copy of the GNU General Public License along with
     * this program. If not, see <http://www.gnu.org/licenses/>.
     */
    package handlers.bypasshandlers;
    
    import java.text.DecimalFormat;
    
    import com.l2jserver.gameserver.datatables.ItemTable;
    import com.l2jserver.gameserver.enums.InstanceType;
    import com.l2jserver.gameserver.handler.IBypassHandler;
    import com.l2jserver.gameserver.model.L2Object;
    import com.l2jserver.gameserver.model.actor.L2Character;
    import com.l2jserver.gameserver.model.actor.L2Npc;
    import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
    import com.l2jserver.gameserver.model.items.L2Item;
    import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
    import com.l2jserver.util.StringUtil;
    
    public class DropInfo implements IBypassHandler
    {
    	private static final String[] COMMANDS =
    	{
    		"drop",
    		"spoil",
    		"info",
    		"dropquest"
    	};
    	
    	@Override
    	public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
    	{
    		try
    		{
    			final NpcHtmlMessage html = new NpcHtmlMessage(0);
    			L2Object targetmob = activeChar.getTarget();
    			L2Npc npc = (L2Npc) targetmob;
    			String droptext = "";
    			
    			if (command.startsWith("drop"))
    			{
    				try
    				{
    					html.setFile(activeChar.getHtmlPrefix(), "data/html/dropinfo/mobdrop.htm");
    					
    					if (!(npc.isChampion() || npc.isMinion() || (npc.getInstanceType() == InstanceType.L2GrandBossInstance) || npc.isRaid() || npc.isRaidMinion() || npc.isMob()))
    					{
    						return false;
    					}
    					if (npc.getTemplate().getDropLists().isEmpty())
    					{
    						droptext = "WARNING: This Npc has no Drops!";
    						html.replace("%drops%", droptext);
    						activeChar.sendPacket(html);
    						return false;
    					}
    					String champ = "";
    					String imgsg = "<img src=\"l2ui.squaregray\" width=\"274\" height=\"1\">";
    					String ta_op = "<table bgcolor=333333 cellspacing=2 cellpadding=1><tr><td height=38 fixwidth=36><img src=\"";
    					String ta_op2 = "\" height=32 width=32></td><td fixwidth=234><table VALIGN=top valing = top width=234 cellpadding=0 cellspacing=0><tr>";
    					
    					final StringBuilder droptext1 = StringUtil.startAppend(9000, champ + "<br>" + imgsg);
    					for (L2DropCategory cat : npc.getTemplate().getDropLists())
    					{
    						for (L2DropData drop : cat.getAllDrops())
    						{
    							final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());
    							if (item == null)
    							{
    								continue;
    							}
    							if (cat.isSweep())
    							{
    								continue;
    							}
    							if (drop.isQuestDrop())
    							{
    								continue;
    							}
    							
    							String smind = null, drops = null;
    							String name = item.getName();
    							double chance = (drop.getChance() / 10000);
    							
    							if (item.getCrystalType() == 0)
    							{
    								smind = "<img src=\"L2UI_CH3.joypad_shortcut\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 1)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_D\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 2)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_C\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 3)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_B\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 4)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_A\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 5)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_S\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 6)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_80\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 7)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_84\" width=16 height=16>";
    							}
    							
    							if (chance <= 0.001)
    							{
    								DecimalFormat df = new DecimalFormat("#.####");
    								drops = df.format(chance);
    							}
    							else if (chance <= 0.01)
    							{
    								DecimalFormat df = new DecimalFormat("#.###");
    								drops = df.format(chance);
    							}
    							else
    							{
    								DecimalFormat df = new DecimalFormat("##.##");
    								drops = df.format(chance);
    							}
    							if (name.startsWith("Recipe - Sealed"))
    							{
    								name = "<font color=00FF00>(Re)</font><font color=FF00FF>(Sl)</font>" + name.substring(16);
    							}
    							if (name.startsWith("Sealed "))
    							{
    								name = "<font color=FF00FF>(Sl)</font>" + name.substring(7);
    							}
    							if (name.startsWith("Common Item - "))
    							{
    								name = "<font color=00FFFF>(Ci)</font>" + name.substring(14);
    							}
    							if (name.startsWith("Recipe: "))
    							{
    								name = "<font color=00FF00>(Re)</font>" + name.substring(8);
    							}
    							if (name.startsWith("Recipe -"))
    							{
    								name = "<font color=00FF00>(Re)</font>" + name.substring(8);
    							}
    							if (name.startsWith("Mid-Grade Life Stone"))
    							{
    								name = "<font color=fff600>Mid-Grade LS</font>" + name.substring(20);
    							}
    							if (name.startsWith("High-Grade Life Stone"))
    							{
    								name = "<font color=fff600>High-Grade LS</font>" + name.substring(21);
    							}
    							if (name.startsWith("Top-Grade Life Stone"))
    							{
    								name = "<font color=fff600>Top-Grade LS</font>" + name.substring(20);
    							}
    							if (name.startsWith("Forgotten Scroll - "))
    							{
    								name = "<font color=fff600>FS - </font>" + name.substring(19);
    							}
    							if (name.startsWith("Greater Dye of "))
    							{
    								name = "<font color=fff600>G Dye of </font>" + name.substring(15);
    							}
    							
    							droptext1.append(ta_op + item.getIcon() + ta_op2 + "<td align=left width=16>" + smind + "</td><td align=left width=260><font color=fff600>" + name + "</font></td></tr><tr><td align=left width=16><img src=\"L2UI_CH3.QuestWndToolTipBtn\" width=16 height=16></td><td align=left width=55><font color=E15656>" + drops + "%</font></td></tr></table></td></tr></table>" + imgsg);
    						}
    					}
    					droptext = droptext1.toString();
    					html.replace("%drops%", droptext);
    					activeChar.sendPacket(html);
    				}
    				catch (Exception e)
    				{
    					activeChar.sendMessage("Something went wrong with the drop preview.");
    				}
    			}
    			if (command.startsWith("spoil"))
    			{
    				try
    				{
    					html.setFile(activeChar.getHtmlPrefix(), "data/html/dropinfo/mobspoil.htm");
    					
    					if (!(npc.isChampion() || npc.isMinion() || npc.isRaid() || npc.isRaidMinion() || npc.isMob()))
    					{
    						return false;
    					}
    					if (npc.getTemplate().getDropLists().isEmpty())
    					{
    						droptext = "WARNING: This Npc has no Drops!";
    						html.replace("%drops%", droptext);
    						activeChar.sendPacket(html);
    						return false;
    					}
    					String champ = "";
    					String imgsg = "<img src=\"l2ui.squaregray\" width=\"274\" height=\"1\">";
    					String ta_op = "<table bgcolor=333333 cellspacing=2 cellpadding=1><tr><td height=38 fixwidth=36><img src=\"";
    					String ta_op2 = "\" height=32 width=32></td><td fixwidth=234><table VALIGN=top valing = top width=234 cellpadding=0 cellspacing=1><tr>";
    					final StringBuilder droptext1 = StringUtil.startAppend(1000, champ + "<br>" + imgsg);
    					for (L2DropCategory cat : npc.getTemplate().getDropLists())
    					{
    						for (L2DropData drop : cat.getAllDrops())
    						{
    							final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());
    							if (item == null)
    							{
    								continue;
    							}
    							if (!(cat.isSweep()))
    							{
    								continue;
    							}
    							
    							String smind = null, drops = null;
    							String name = item.getName();
    							double chance = (drop.getChance() / 10000);
    							
    							if (item.getCrystalType() == 0)
    							{
    								smind = "<img src=\"L2UI_CH3.joypad_shortcut\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 1)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_D\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 2)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_C\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 3)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_B\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 4)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_A\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 5)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_S\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 6)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_80\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 7)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_84\" width=16 height=16>";
    							}
    							
    							if (chance <= 0.001)
    							{
    								DecimalFormat df = new DecimalFormat("#.####");
    								drops = df.format(chance);
    							}
    							else if (chance <= 0.01)
    							{
    								DecimalFormat df = new DecimalFormat("#.###");
    								drops = df.format(chance);
    							}
    							else
    							{
    								DecimalFormat df = new DecimalFormat("##.##");
    								drops = df.format(chance);
    							}
    							if (name.startsWith("Recipe - Sealed"))
    							{
    								name = "<font color=00FF00>(Re)</font><font color=FF00FF>(Sl)</font>" + name.substring(16);
    							}
    							if (name.startsWith("Sealed "))
    							{
    								name = "<font color=FF00FF>(Sl)</font>" + name.substring(7);
    							}
    							if (name.startsWith("Common Item - "))
    							{
    								name = "<font color=00FFFF>(Ci)</font>" + name.substring(14);
    							}
    							if (name.startsWith("Recipe: "))
    							{
    								name = "<font color=00FF00>(Re)</font>" + name.substring(8);
    							}
    							if (name.startsWith("Recipe -"))
    							{
    								name = "<font color=00FF00>(Re)</font>" + name.substring(8);
    							}
    							if (name.startsWith("Mid-Grade Life Stone"))
    							{
    								name = "<font color=fff600>Mid-Grade LS</font>" + name.substring(20);
    							}
    							if (name.startsWith("High-Grade Life Stone"))
    							{
    								name = "<font color=fff600>High-Grade LS</font>" + name.substring(21);
    							}
    							if (name.startsWith("Top-Grade Life Stone"))
    							{
    								name = "<font color=fff600>Top-Grade LS</font>" + name.substring(20);
    							}
    							if (name.startsWith("Forgotten Scroll - "))
    							{
    								name = "<font color=fff600>FS - </font>" + name.substring(19);
    							}
    							if (name.startsWith("Greater Dye of "))
    							{
    								name = "<font color=fff600>G Dye of </font>" + name.substring(15);
    							}
    							
    							droptext1.append(ta_op + item.getIcon() + ta_op2 + "<td align=left width=16>" + smind + "</td><td align=left width=260><font color=fff600>" + name + "</font></td></tr><tr><td align=left width=16><img src=\"L2UI_CH3.QuestWndToolTipBtn\" width=16 height=16></td><td align=left width=55><font color=E15656>" + drops + "%</font></td></tr></table></td></tr></table>" + imgsg);
    						}
    					}
    					droptext = droptext1.toString();
    					html.replace("%drops%", droptext);
    					activeChar.sendPacket(html);
    				}
    				catch (Exception e)
    				{
    					activeChar.sendMessage("Something went wrong with the drop preview.");
    				}
    			}
    			if (command.startsWith("dropquest"))
    			{
    				try
    				{
    					html.setFile(activeChar.getHtmlPrefix(), "data/html/dropinfo/mobquest.htm");
    					
    					if (!(npc.isChampion() || npc.isMinion() || npc.isRaid() || npc.isRaidMinion() || npc.isMob()))
    					{
    						return false;
    					}
    					if (npc.getTemplate().getDropLists().isEmpty())
    					{
    						droptext = "WARNING: This Npc has no Drops!";
    						html.replace("%drops%", droptext);
    						activeChar.sendPacket(html);
    						return false;
    					}
    					String champ = "";
    					String imgsg = "<img src=\"l2ui.squaregray\" width=\"274\" height=\"1\">";
    					String ta_op = "<table bgcolor=333333 cellspacing=2 cellpadding=1><tr><td height=38 fixwidth=36><img src=\"";
    					String ta_op2 = "\" height=32 width=32></td><td fixwidth=234><table VALIGN=top valing = top width=234 cellpadding=0 cellspacing=1><tr>";
    					final StringBuilder droptext1 = StringUtil.startAppend(1000, champ + "<br>" + imgsg);
    					for (L2DropCategory cat : npc.getTemplate().getDropLists())
    					{
    						for (L2DropData drop : cat.getAllDrops())
    						{
    							final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());
    							if (item == null)
    							{
    								continue;
    							}
    							if (!(drop.isQuestDrop()))
    							{
    								continue;
    							}
    							
    							String smind = null, drops = null;
    							String name = item.getName();
    							double chance = (drop.getChance() / 10000);
    							
    							if (item.getCrystalType() == 0)
    							{
    								smind = "<img src=\"L2UI_CH3.joypad_shortcut\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 1)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_D\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 2)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_C\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 3)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_B\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 4)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_A\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 5)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_S\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 6)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_80\" width=16 height=16>";
    							}
    							else if (item.getCrystalType() == 7)
    							{
    								smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_84\" width=16 height=16>";
    							}
    							
    							if (chance <= 0.001)
    							{
    								DecimalFormat df = new DecimalFormat("#.####");
    								drops = df.format(chance);
    							}
    							else if (chance <= 0.01)
    							{
    								DecimalFormat df = new DecimalFormat("#.###");
    								drops = df.format(chance);
    							}
    							else
    							{
    								DecimalFormat df = new DecimalFormat("##.##");
    								drops = df.format(chance);
    							}
    							if (name.startsWith("Recipe - Sealed"))
    							{
    								name = "<font color=00FF00>(Re)</font><font color=FF00FF>(Sl)</font>" + name.substring(16);
    							}
    							if (name.startsWith("Sealed "))
    							{
    								name = "<font color=FF00FF>(Sl)</font>" + name.substring(7);
    							}
    							if (name.startsWith("Common Item - "))
    							{
    								name = "<font color=00FFFF>(Ci)</font>" + name.substring(14);
    							}
    							if (name.startsWith("Recipe: "))
    							{
    								name = "<font color=00FF00>(Re)</font>" + name.substring(8);
    							}
    							if (name.startsWith("Recipe -"))
    							{
    								name = "<font color=00FF00>(Re)</font>" + name.substring(8);
    							}
    							if (name.startsWith("Mid-Grade Life Stone"))
    							{
    								name = "<font color=fff600>Mid-Grade LS</font>" + name.substring(20);
    							}
    							if (name.startsWith("High-Grade Life Stone"))
    							{
    								name = "<font color=fff600>High-Grade LS</font>" + name.substring(21);
    							}
    							if (name.startsWith("Top-Grade Life Stone"))
    							{
    								name = "<font color=fff600>Top-Grade LS</font>" + name.substring(20);
    							}
    							if (name.startsWith("Forgotten Scroll - "))
    							{
    								name = "<font color=fff600>FS - </font>" + name.substring(19);
    							}
    							if (name.startsWith("Greater Dye of "))
    							{
    								name = "<font color=fff600>G Dye of </font>" + name.substring(15);
    							}
    							
    							droptext1.append(ta_op + item.getIcon() + ta_op2 + "<td align=left width=16>" + smind + "</td><td align=left width=260><font color=fff600>" + name + "</font></td></tr><tr><td align=left width=16><img src=\"L2UI_CH3.QuestWndToolTipBtn\" width=16 height=16></td><td align=left width=55><font color=E15656>" + drops + "%</font></td></tr></table></td></tr></table>" + imgsg);
    						}
    					}
    					droptext = droptext1.toString();
    					html.replace("%drops%", droptext);
    					activeChar.sendPacket(html);
    				}
    				catch (Exception e)
    				{
    					activeChar.sendMessage("Something went wrong with the drop preview.");
    				}
    			}
    		}
    		catch (Exception e)
    		{
    			activeChar.sendMessage("You cant use this option with this target.");
    		}
    		return false;
    	}
    	
    	@Override
    	public String[] getBypassList()
    	{
    		return COMMANDS;
    	}
    }
    

    so i have problem with these:

     

    for (L2DropCategory cat : npc.getTemplate().getDropLists())
                        {
                            for (L2DropData drop : cat.getAllDrops())

     

     

    these codes are placed 3 times in the whole file..!

    I'll appreciate your help a lot!
    (P.S. these methods (L2DropData and L2DropCategory) have been removed by L2JServer team... but i didn't found any other way to solve these problems!)

×
×
  • Create New...