Advertisement
warc222

Skills Stats te0x

Oct 15th, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.31 KB | None | 0 0
  1. hello
  2. i was playing with some skills stats like
  3.  
  4. PVP_PHYSICAL_DMG("pvpPhysDmg"),
  5. PVP_MAGICAL_DMG("pvpMagicalDmg"),
  6. PVP_PHYS_SKILL_DMG("pvpPhysSkillsDmg"),
  7.  
  8. and i saw a guy asking somewhere for pvpPhysicalDef stats so i tryed to make em.. its based on l2jfrozen also.
  9.  
  10. com.l2jfrozen.gameserver.skills.stats
  11. find this
  12. PVP_PHYS_SKILL_DMG("pvpPhysSkillsDmg"),
  13. and below add these
  14.  
  15. PVP_PHYSICAL_DEF("pvpPhysDef"),
  16. PVP_MAGICAL_DEF("pvpMagicalDef"),
  17. PVP_PHYS_SKILL_DEF("pvpPhysSkillsDef"),
  18. now go to
  19. com.l2jfrozen.gameserver.skills.formulas
  20. find always the first line and add the +
  21. if((attacker instanceof L2PcInstance || attacker instanceof L2Summon) && (target instanceof L2PcInstance || target instanceof L2Summon))
  22. {
  23. if(skill == null)
  24. {
  25. damage *= attacker.calcStat(Stats.PVP_PHYSICAL_DMG, 1, null, null);
  26. +damage /= target.calcStat(Stats.PVP_PHYSICAL_DEF, 1, null, null);
  27. }
  28. else
  29. {
  30. damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null);
  31. +damage /= target.calcStat(Stats.PVP_PHYS_SKILL_DEF, 1, null, null);
  32. }
  33. }
  34. // Pvp bonusses for dmg
  35. if((attacker instanceof L2PcInstance || attacker instanceof L2Summon) && (target instanceof L2PcInstance || target instanceof L2Summon))
  36. {
  37. if(skill.isMagic())
  38. {
  39. damage *= attacker.calcStat(Stats.PVP_MAGICAL_DMG, 1, null, null);
  40. +damage /= target.calcStat(Stats.PVP_MAGICAL_DEF, 1, null, null);
  41. }
  42. else
  43. {
  44. damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null);
  45. +damage /= target.calcStat(Stats.PVP_PHYS_SKILL_DEF, 1, null, null);
  46. }
  47. }
  48. // Dmg bonusses in PvP fight
  49. if(isPvP)
  50. {
  51. if(skill == null)
  52. {
  53. damage *= attacker.calcStat(Stats.PVP_PHYSICAL_DMG, 1, null, null);
  54. +damage /= target.calcStat(Stats.PVP_PHYSICAL_DEF, 1, null, null);
  55. }
  56. else
  57. {
  58. damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null);
  59. damage /= target.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null);
  60. }
  61. }
  62. so you can go ingame and use as stats "pvpPhysDef" , "pvpMagicalDef" , "pvpPhysSkillsDef"
  63. its tested and works fine.
  64.  
  65. also something else to make a better balance with the mages. Its exactly the same with the critical damage that fighters got. this is for mages magical critical damage in a better way than it is.
  66. com.l2jfrozen.gameserver.skills.stats
  67. find
  68. CRITICAL_DAMAGE_ADD("cAtkAdd"),
  69. and below add
  70. MAGICAL_CRITICAL_DAMAGE("mcAtk"),
  71. MCRITICAL_DAMAGE_ADD("mAtkAdd"),
  72. MCRIT_VULN("mCritVuln"),
  73. now go to
  74. com.l2jfrozen.gameserver.model.actor.stats.CharStat
  75. find
  76. public final double getCriticalDmg(L2Character target, double init)
  77. {
  78. return calcStat(Stats.CRITICAL_DAMAGE, init, target, null);
  79. }
  80. and below add
  81. /**
  82. * Return the MCritical Damage rate (base+modifier) of the L2Character.
  83. *
  84. * @param target the target
  85. * @param init the init
  86. * @return the critical dmg
  87. */
  88. public final double getMagicalCriticalDmg(L2Character target, double init)
  89. {
  90. return calcStat(Stats.MAGICAL_CRITICAL_DAMAGE, init, target, null);
  91. }
  92. now go to
  93. com.l2jfrozen.gameserver.datatables.xml.AugmentationData
  94. find and delete this line
  95. if(as.getStat() == Stats.CRITICAL_DAMAGE)
  96. and add this one
  97. if(as.getStat() == Stats.CRITICAL_DAMAGE || as.getStat() == Stats.MAGICAL_CRITICAL_DAMAGE)
  98. finally go to
  99. com.l2jfrozen.gameserver.skills.formulas
  100. find
  101. else if(mcrit)
  102. {
  103. //damage *= 4;
  104. damage *= Config.MAGIC_CRITICAL_POWER;
  105. }and replace it with
  106. else if (mcrit)
  107. {
  108. //Finally retail like formula
  109. double mAtkMultiplied = damage + attacker.calcStat(Stats.MAGICAL_CRITICAL_DAMAGE, damage, target, skill);
  110. double mAtkVuln = target.calcStat(Stats.MCRIT_VULN, 1, target, null);
  111. double improvedDamageBymriticalMulAndVuln = mAtkMultiplied * mAtkVuln;
  112. double improvedDamageBymriticalMulAndAdd = improvedDamageBymriticalMulAndVuln + attacker.calcStat(Stats.MCRITICAL_DAMAGE_ADD, 0, target, skill);
  113.  
  114.  
  115. damage = improvedDamageBymriticalMulAndAdd;
  116.  
  117.  
  118. }
  119. now you will have stats "mcAtk" , "mAtkAdd", "mCritVuln".
  120.  
  121. also i've got a cp drain and mp drain on attack. its like "absorbDam"
  122. com.l2jfrozen.gameserver.skills.stats
  123. find
  124. ABSORB_DAMAGE_PERCENT("absorbDam"),
  125. and below add
  126. ABSORB_CP_PERCENT("absorbCp"),
  127. ABSORB_MP_PERCENT("absorbMp"),
  128. now go to
  129. com.l2jfrozen.gameserver.model.L2Characters
  130. find
  131. double absorbPercent = getStat().calcStat(Stats.ABSORB_DAMAGE_PERCENT, 0, null, null);
  132.  
  133.  
  134. if (absorbPercent > 0)
  135. {
  136. int maxCanAbsorb = (int) (getMaxHp() - getCurrentHp());
  137. int absorbDamage = (int) (absorbPercent / 100. * damage);
  138.  
  139.  
  140. if (absorbDamage > maxCanAbsorb)
  141. {
  142. absorbDamage = maxCanAbsorb; // Can't absord more than max hp
  143. }
  144.  
  145.  
  146. if (absorbDamage > 0)
  147. {
  148. setCurrentHp(getCurrentHp() + absorbDamage);
  149.  
  150.  
  151. // Custom messages - nice but also more network load
  152. // Custom messages - nice but also more network load
  153. if (Config.CUSTOM_MSG)
  154. {
  155. if (this instanceof L2PcInstance)
  156. ((L2PcInstance) this).sendMessage("You absorbed " + absorbDamage + " Hp.");
  157. }
  158. }
  159. }
  160.  
  161.  
  162.  
  163. and below add
  164.  
  165. // Absorb CP from the damage inflicted
  166. double absorbCPPercent = getStat().calcStat(Stats.ABSORB_CP_PERCENT, 0, null, null);
  167.  
  168.  
  169. if (absorbCPPercent > 0)
  170. {
  171. int maxCanAbsorb = (int) (getMaxCp() - getCurrentCp());
  172. int absorbDamage = (int) (absorbCPPercent / 100. * damage);
  173.  
  174.  
  175. if (absorbDamage > maxCanAbsorb)
  176. {
  177. absorbDamage = maxCanAbsorb; // Can't absord more than max hp
  178. }
  179.  
  180.  
  181. if (absorbDamage > 0)
  182. {
  183. setCurrentCp(getCurrentCp() + absorbDamage);
  184.  
  185.  
  186. // Custom messages - nice but also more network load
  187. // Custom messages - nice but also more network load
  188. if (Config.CUSTOM_MSG)
  189. {
  190. if (this instanceof L2PcInstance)
  191. ((L2PcInstance) this).sendMessage("You absorbed " + absorbDamage + " Cp.");
  192. }
  193. }
  194. }
  195.  
  196.  
  197. // Absorb HP from the damage inflicted
  198. double absorbMPPercent = getStat().calcStat(Stats.ABSORB_MP_PERCENT, 0, null, null);
  199.  
  200.  
  201. if (absorbMPPercent > 0)
  202. {
  203. int maxCanAbsorb = (int) (getMaxMp() - getCurrentMp());
  204. int absorbDamage = (int) (absorbMPPercent / 100. * damage);
  205.  
  206.  
  207. if (absorbDamage > maxCanAbsorb)
  208. {
  209. absorbDamage = maxCanAbsorb; // Can't absord more than max hp
  210. }
  211.  
  212.  
  213. if (absorbDamage > 0)
  214. {
  215. setCurrentMp(getCurrentMp() + absorbDamage);
  216.  
  217.  
  218. // Custom messages - nice but also more network load
  219.  
  220.  
  221. // Custom messages - nice but also more network load
  222. if (Config.CUSTOM_MSG)
  223. {
  224. if (this instanceof L2PcInstance)
  225. ((L2PcInstance) this).sendMessage("You absorbed " + absorbDamage + " Mp.");
  226. }
  227. }
  228. }
  229. so u can use "absorbCp", "absorbMp"
  230.  
  231. well thats all ;D its nothing special but it can help
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement