All pastes #39138 Raw Edit

Untitled

public text v1 · immutable
#39138 ·published 2006-01-30 17:47 UTC
rendered paste body
Index: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/skills/Formulas.java 
=================================================================== 
--- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/skills/Formulas.java   (revision 2220) 
+++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/skills/Formulas.java   (working copy) 
@@ -1146,13 +1146,14 @@ 
       { 
        case STUN: 
           // For normal Stun Attack, with skillType = STUN 
-      pAtk = player.getPAtk(target); 
-      pDef = target.getPDef(player); 
-      pDef = target.calcStat(Stats.STUN_RES,pDef,target,null); 
-      value = 30 * 100 + (int)(70 * 100 * ((float)skill.getLevel()/maxLevel)); 
-      if (pDef > 0 && pAtk > 0) 
-          value *= 0.6 * pAtk/pDef; 
-           modifier    = 100 * target.getCON()/30; 
+          int basechance = 80; 
+          int perLevelBonus = 2; 
+          pDef = target.calcStat(Stats.STUN_RES,0,target,null); 
+          value = 750 * (basechance + perLevelBonus * skill.getLevel()); 
+          modifier = target.getLevel()*(target.getCON() + pDef); 
+          // CHANCE to stun gets no modifier from shots, whatsoever. 
+          //stun+damage skills get a modifier in the damage part ONLY. 
+          ssmodifier = 1; 
           break; 
        case CONFUSION: 
             mAtk = player.getMAtk(target, skill); 
@@ -1203,18 +1204,17 @@ 
            modifier    = 100 * target.getDEX()/30; 
           break; 
        default: 
-          // For normal Stun attack with skillType = PDAM 
-           pAtk = (int)skill.getPower(); 
-      pDef = target.getPDef(player); 
-      pDef = target.calcStat(Stats.STUN_RES,pDef,target,null); 
-//      value = 30 * 100 + (int)(70 * 100 * ((float)skill.getLevel()/maxLevel)); 
-      value = 100 * 100; 
-      if (pDef > 0 && pAtk > 0) 
-          value *= 0.6 * pAtk/pDef; 
-           modifier    = 100 * target.getCON()/30; 
-          break; 
+            basechance = 50; 
+           perLevelBonus = 1; 
+           pDef = target.calcStat(Stats.STUN_RES,0,target,null); 
+           value = 750 * (basechance + perLevelBonus * skill.getLevel()); 
+           modifier = target.getLevel()*(target.getCON() + pDef); 
+           //CHANCE to stun gets no modifier from shots, whatsoever. 
+           //stun+damage skills get a modifier in the damage part ONLY. 
+           ssmodifier = 1; 
+           break; 
       } 
- 
+           
         if (modifier == 0) 
         { 
             _log.warning("Name: "+target.getName()+" has bad base stat value. Fix datapack or notify dp ppl"); 
Index: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/ai/L2CharacterAI.java 
=================================================================== 
--- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/ai/L2CharacterAI.java   (revision 2220) 
+++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/ai/L2CharacterAI.java   (working copy) 
@@ -1051,13 +1051,20 @@ 
     * 
     * @param target The targeted L2Object 
     * 
-    * @return True if the target is lost or dead 
+    * @return True if the target is lost or dead (false if fakedeath) 
     * 
     */ 
    protected boolean checkTargetLostOrDead(L2Character target) 
    { 
       if (target == null || target.isAlikeDead()) 
       { 
+         //check if player is fakedeath 
+         if (target.isFakeDeath()) 
+         { 
+            target.stopFakeDeath(null); 
+            return false; 
+         } 
+                   
          // Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast) 
          clientStopAutoAttack(); 
  
@@ -1102,6 +1109,17 @@ 
     */ 
    protected boolean checkTargetLost(L2Object target) 
    { 
+      // check if player is fakedeath 
+      if (target instanceof L2PcInstance) 
+      { 
+         L2PcInstance target2 = (L2PcInstance)target;  //convert object to chara 
+       
+         if (target2.isFakeDeath()) 
+         {    
+            target2.stopFakeDeath(null); 
+            return false; 
+         } 
+      } 
       if (target == null) 
       { 
             /*