A Project for Chronicle 4 based on L2JServer.


    Improving the core buffer.

    Share
    avatar
    arteon

    Posts : 82
    Join date : 2013-12-14

    Improving the core buffer.

    Post  arteon on 26th July 2015, 16:27

    Im trying to add cancel and heal functions for pets.

    I managed to get cancel to work for pets but i have problem with getting the healing to work. Right now it only heals the HP of the pet.

    Here is what i have done for the healing function.

    Code:
    else if (command.startsWith("PetHeal"))
     {
     if (!player.isInCombat() && !AttackStanceTaskManager.getInstance().getAttackStanceTask(player))
     {
     String[] healArray = command.substring(5).split(" ");
     for (String healType : healArray)
     {
     if (healType.equalsIgnoreCase("HP"))
     {
     player.getPet().setCurrentHp(player.getMaxHp());
     }
     else if (healType.equalsIgnoreCase("MP"))
     {
     player.getPet().setCurrentHp(player.getMaxMp());
     }
     }
     }
     showChatWindow(player, 2);
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Improving the core buffer.

    Post  DnR on 26th July 2015, 23:49

    Take a closer look. You have set MP command to heal HP, too.
    avatar
    arteon

    Posts : 82
    Join date : 2013-12-14

    Re: Improving the core buffer.

    Post  arteon on 27th July 2015, 00:15

    shit, nice catch thank you.

    Sponsored content

    Re: Improving the core buffer.

    Post  Sponsored content


      Current date/time is 19th November 2017, 14:14