A Project for Chronicle 4 based on L2JServer.


    Critical Heal & critical ManaHeal

    Share
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Critical Heal & critical ManaHeal

    Post  Karakan on 23rd March 2014, 21:11

    Some features taken from Gracia chronicles
    have fun



    Critical Heal


    Code:
    Index: D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Heal.java
    ===================================================================
    --- D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Heal.java   (revision 471)
    +++ D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Heal.java   (working copy)
    @@ -33,6 +33,7 @@
     import net.sf.l2j.gameserver.model.actor.instance.L2SiegeFlagInstance;
     import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
     import net.sf.l2j.gameserver.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.skills.Formulas;
     import net.sf.l2j.gameserver.skills.Stats;
     /**
      * This class ...
    @@ -136,6 +137,15 @@
                    else if (skill.getSkillType() != SkillType.HEAL_PERCENT)
                        hp *= target.calcStat(Stats.HEAL_EFFECTIVNESS, 100, null, null) / 100;
     
    +                // Heal critical, since CT2.3 Gracia Final
    +                if (skill.getSkillType() == SkillType.HEAL && Formulas.getInstance().calcMCrit(activeChar.getMCriticalHit(target, skill)))
    +                {
    +                    hp *= 3;
    +                    activeChar.sendPacket(new SystemMessage(SystemMessage.CRITICAL_HIT_MAGIC));
    +                }               
    +               
    +               
    +
           target.setCurrentHp(hp + target.getCurrentHp());
           target.setLastHealAmount((int)hp);           
           StatusUpdate su = new StatusUpdate(target.getObjectId());




    Critical ManaHeal (aka Recharge)


    Code:
    Index: D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/ManaHeal.java
    ===================================================================
    --- D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/ManaHeal.java   (revision 471)
    +++ D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/ManaHeal.java   (working copy)
    @@ -19,6 +19,7 @@
     package net.sf.l2j.gameserver.handler.skillhandlers;
     
     import net.sf.l2j.gameserver.handler.ISkillHandler;
    +import net.sf.l2j.gameserver.handler.SkillHandler;
     import net.sf.l2j.gameserver.model.L2Character;
     import net.sf.l2j.gameserver.model.L2Object;
     import net.sf.l2j.gameserver.model.L2Skill;
    @@ -26,6 +27,7 @@
     import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
     import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
     import net.sf.l2j.gameserver.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.skills.Formulas;
     import net.sf.l2j.gameserver.skills.Stats;
     
     /**
    @@ -55,7 +57,15 @@
                target = (L2Character)targets[index];
     
                double mp = (skill.getSkillType() == SkillType.MANARECHARGE) ? target.calcStat(Stats.RECHARGE_MP_RATE, skill.getPower(), null, null) : skill.getPower();
    -            target.setLastHealAmount((int)mp);
    +
    +         // Mana Heal critical, since CT2.3 Gracia Final
    +            if (skill.getSkillType() == SkillType.MANARECHARGE && Formulas.getInstance().calcMCrit(activeChar.getMCriticalHit(target, skill)))
    +            {
    +                mp *= 3;
    +                activeChar.sendPacket(new SystemMessage(SystemMessage.CRITICAL_HIT_MAGIC));
    +            }
    +   
    +         target.setLastHealAmount((int)mp);
                target.setCurrentMp(mp+target.getCurrentMp());
                StatusUpdate sump = new StatusUpdate(target.getObjectId());
                sump.addAttribute(StatusUpdate.CUR_MP, (int)target.getCurrentMp());

      Current date/time is 19th November 2017, 13:56