Jump to content
  • 0

Lethal power


TreVor
 Share

Question

11 answers to this question

Recommended Posts

  • 0
<skill id="344" levels="1" name="Lethal Blow">
	<set name="power" val="5773"/>
	<set name="lethal1" val="5"/>
	<set name="lethal2" val="2"/>
</skill>

Link to comment
Share on other sites

  • 0

Mhm ok i'm check :) how to disable on raid boss?

 

<skill id="344" levels="1" name="Lethal Blow" enchantGroup1="6" enchantGroup2="6" enchantGroup3="6" enchantGroup4="6" enchantGroup5="6" enchantGroup6="6" enchantGroup7="6">
	<!-- Confirmed CT2.5 -->
	<table name="#enchantMagicLvl"> 81 81 81 82 82 82 83 83 83 84 84 84 85 85 85 </table>
	<table name="#ench1Power"> 6502 6535 6568 6601 6634 6667 6700 6733 6766 6799 6833 6866 6899 6932 6965 </table>
	<table name="#ench2CritRate"> 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 </table>
	<table name="#enchelementPower"> 3 6 10 13 16 20 23 26 30 33 36 40 43 46 50 </table>
	<table name="#ench7Duel"> 5880 5986 6092 6198 6304 6410 6516 6622 6728 6834 6940 7046 7152 7258 7364 </table>
	<set name="baseCritRate" val="20" />
	<set name="blowChance" val="30" />
	<set name="castRange" val="40" />
	<set name="condition" val="16" /> <!-- Crit -->
	<set name="effectRange" val="400" />
	<set name="hitTime" val="1800" />
	<set name="lethal1" val="5" /> <!-- Half-Kill -->
	<set name="magicLvl" val="76" />
	<set name="mpConsume" val="77" />
	<set name="nextActionAttack" val="true" />
	<set name="operateType" val="A1" />
	<set name="overHit" val="true" />
	<set name="power" val="5000" />
	<set name="reuseDelay" val="4000" />
	<set name="skillType" val="BLOW" />
	<set name="SSBoost" val="1.5" />
	<set name="target" val="TARGET_ONE" />
	<set name="trait" val="DEATH" />
	<enchant1 name="magicLvl" val="#enchantMagicLvl" />
	<enchant1 name="power" val="#ench1Power" />
	<enchant2 name="magicLvl" val="#enchantMagicLvl" />
	<enchant2 name="baseCritRate" val="#ench2CritRate" />
	<enchant3 name="magicLvl" val="#enchantMagicLvl" />
	<enchant3 name="element" val="0" /> <!-- Fire -->
	<enchant3 name="elementPower" val="#enchelementPower" />
	<enchant4 name="magicLvl" val="#enchantMagicLvl" />
	<enchant4 name="element" val="1" /> <!-- Water -->
	<enchant4 name="elementPower" val="#enchelementPower" />
	<enchant5 name="magicLvl" val="#enchantMagicLvl" />
	<enchant5 name="element" val="2" /> <!-- Wind -->
	<enchant5 name="elementPower" val="#enchelementPower" />
	<enchant6 name="magicLvl" val="#enchantMagicLvl" />
	<enchant6 name="element" val="3" /> <!-- Earth -->
	<enchant6 name="elementPower" val="#enchelementPower" />
	<enchant7 name="magicLvl" val="#enchantMagicLvl" />
	<enchant7 name="pvpPower" val="#ench7Duel" />
	<cond msgId="113" addName="1">
		<using kind="Dagger,Dual Dagger" />
	</cond>
</skill>

Link to comment
Share on other sites

  • 0

Mhm ok i'm check :) how to disable on raid boss?

 

<skill id="344" levels="1" name="Lethal Blow" enchantGroup1="6" enchantGroup2="6" enchantGroup3="6" enchantGroup4="6" enchantGroup5="6" enchantGroup6="6" enchantGroup7="6">
	<!-- Confirmed CT2.5 -->
	<table name="#enchantMagicLvl"> 81 81 81 82 82 82 83 83 83 84 84 84 85 85 85 </table>
	<table name="#ench1Power"> 6502 6535 6568 6601 6634 6667 6700 6733 6766 6799 6833 6866 6899 6932 6965 </table>
	<table name="#ench2CritRate"> 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 </table>
	<table name="#enchelementPower"> 3 6 10 13 16 20 23 26 30 33 36 40 43 46 50 </table>
	<table name="#ench7Duel"> 5880 5986 6092 6198 6304 6410 6516 6622 6728 6834 6940 7046 7152 7258 7364 </table>
	<set name="baseCritRate" val="20" />
	<set name="blowChance" val="30" />
	<set name="castRange" val="40" />
	<set name="condition" val="16" /> <!-- Crit -->
	<set name="effectRange" val="400" />
	<set name="hitTime" val="1800" />
	<set name="lethal1" val="5" /> <!-- Half-Kill -->
	<set name="magicLvl" val="76" />
	<set name="mpConsume" val="77" />
	<set name="nextActionAttack" val="true" />
	<set name="operateType" val="A1" />
	<set name="overHit" val="true" />
	<set name="power" val="5000" />
	<set name="reuseDelay" val="4000" />
	<set name="skillType" val="BLOW" />
	<set name="SSBoost" val="1.5" />
	<set name="target" val="TARGET_ONE" />
	<set name="trait" val="DEATH" />
	<enchant1 name="magicLvl" val="#enchantMagicLvl" />
	<enchant1 name="power" val="#ench1Power" />
	<enchant2 name="magicLvl" val="#enchantMagicLvl" />
	<enchant2 name="baseCritRate" val="#ench2CritRate" />
	<enchant3 name="magicLvl" val="#enchantMagicLvl" />
	<enchant3 name="element" val="0" /> <!-- Fire -->
	<enchant3 name="elementPower" val="#enchelementPower" />
	<enchant4 name="magicLvl" val="#enchantMagicLvl" />
	<enchant4 name="element" val="1" /> <!-- Water -->
	<enchant4 name="elementPower" val="#enchelementPower" />
	<enchant5 name="magicLvl" val="#enchantMagicLvl" />
	<enchant5 name="element" val="2" /> <!-- Wind -->
	<enchant5 name="elementPower" val="#enchelementPower" />
	<enchant6 name="magicLvl" val="#enchantMagicLvl" />
	<enchant6 name="element" val="3" /> <!-- Earth -->
	<enchant6 name="elementPower" val="#enchelementPower" />
	<enchant7 name="magicLvl" val="#enchantMagicLvl" />
	<enchant7 name="pvpPower" val="#ench7Duel" />
	<cond msgId="113" addName="1">
		<using kind="Dagger,Dual Dagger" />
	</cond>
</skill>

 

Edit Blow skillhandler.

Link to comment
Share on other sites

  • 0

Mhm please send to me :) tutorial on edit power and disable on raid boss ;/ Very Thanks Tryskell

calcLethalHit( in Formulas.java

 

That stuff already exists on L2J since a long time.

Link to comment
Share on other sites

  • 0

/**
    * Calculate value of blow success 
    * @param activeChar 
    * @param target 
    * @param chance 
    * @return
    */
   public static final boolean calcBlow(L2Character activeChar, L2Character target, int chance)
   {
      return activeChar.calcStat(Stats.BLOW_RATE, chance*(1.0+(activeChar.getDEX()-20)/100), target, null)>Rnd.get(100);
   }
   /**
    * Calculate value of lethal chance 
    * @param activeChar 
    * @param target 
    * @param baseLethal 
    * @param magiclvl 
    * @return
    */
   public static final double calcLethal(L2Character activeChar, L2Character target, int baseLethal, int magiclvl)
   {
      double chance = 0;
      if (magiclvl > 0)
      {
         int delta = ((magiclvl + activeChar.getLevel()) / 2) - 1 - target.getLevel();
         
         // delta [-3,infinite)
         if (delta >= -3)
         {
            chance = (baseLethal * ((double) activeChar.getLevel() / target.getLevel()));
         }
         // delta [-9, -3[
         else if (delta < -3 && delta >= -9)
         {
            //               baseLethal
            // chance = -1 * -----------
            //               (delta / 3)
            chance = (-3) * (baseLethal / (delta));
         }
         //delta [-infinite,-9[
         else
         {
            chance = baseLethal / 15;
         }
      }
      else
      {
         chance = (baseLethal * ((double) activeChar.getLevel() / target.getLevel()));
      }
      return 10 * activeChar.calcStat(Stats.LETHAL_RATE, chance, target, null);
   }
   
   public static final boolean calcLethalHit(L2Character activeChar, L2Character target, L2Skill skill)
   {
      if (!target.isRaid() && !(target instanceof L2DoorInstance)
            && !(target instanceof L2Npc && ((L2Npc) target).getNpcId() == 35062))
      {
         //activeChar.sendMessage(Double.toString(chance));
         //activeChar.sendMessage(Double.toString(calcLethal(activeChar, target, skill.getLethalChance2(),skill.getMagicLevel())));
         //activeChar.sendMessage(Double.toString(calcLethal(activeChar, target, skill.getLethalChance1(),skill.getMagicLevel())));
         
         // 2nd lethal effect activate (cp,hp to 1 or if target is npc then hp to 1)
         if (skill.getLethalChance2() > 0 && Rnd.get(1000) < calcLethal(activeChar, target, skill.getLethalChance2(),skill.getMagicLevel()))
         {
            if (target instanceof L2Npc)
               target.reduceCurrentHp(target.getCurrentHp() - 1, activeChar, skill);
            else if (target instanceof L2PcInstance) // If is a active player set his HP and CP to 1
            {
               L2PcInstance player = (L2PcInstance) target;
               if (!player.isInvul())
               {
                  if (!(activeChar instanceof L2PcInstance &&
                        (((L2PcInstance)activeChar).isGM() && !((L2PcInstance)activeChar).getAccessLevel().canGiveDamage())))
                  {
                     player.setCurrentHp(1);
                     player.setCurrentCp(1);
                     player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.LETHAL_STRIKE_SUCCESSFUL));
                  }
               }
            }
            activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.LETHAL_STRIKE));
         }
         else if (skill.getLethalChance1() > 0 && Rnd.get(1000) < calcLethal(activeChar, target, skill.getLethalChance1(),skill.getMagicLevel()))
         {
            if (target instanceof L2PcInstance)
            {
               L2PcInstance player = (L2PcInstance) target;
               if (!player.isInvul())
               {
                  if (!(activeChar instanceof L2PcInstance &&
                        (((L2PcInstance)activeChar).isGM() && !((L2PcInstance)activeChar).getAccessLevel().canGiveDamage())))
                  {
                     player.setCurrentCp(1); // Set CP to 1
                     player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CP_DISAPPEARS_WHEN_HIT_WITH_A_HALF_KILL_SKILL));
                     activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.HALF_KILL));
                  }
               }
            }
            //TODO: remove half kill since SYSMsg got changed.
            /*else if (target instanceof L2Npc) // If is a monster remove first damage and after 50% of current hp
                    target.reduceCurrentHp(target.getCurrentHp() / 2, activeChar, skill);*/
            
         }
         else
            return false;
      }
      else
         return false;
      
      return true;
   }

 

This is my code on formulas.java please check :) mhm how to disable lethal on raidboss?

Link to comment
Share on other sites

  • 0

Dude I'm not your mama. If you can't use search tool alone, forget the idea to open a server, even for fun.

 

	   public static final boolean calcLethalHit(L2Character activeChar, L2Character target, L2Skill skill)
   {
      if (!target.isRaid() && !(target instanceof L2DoorInstance)

 

Your code got it already. Now if it doesn't work, that's another problem.

Link to comment
Share on other sites

  • 0

Now, if you are 100% SURE (and don't say "i'm probably sure", be SURE) when you hit a raidboss you can lethal it, here are some tracks :

 

- the target isn't a raidboss (type of the L2Npc in npc.sql MUST BE RaidBossInstance or GrandBossInstance).

- isRaid() check is wrong (either doesn't check one of instances I said higher, or return false anytime).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • 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 Disbaled AdBlock