Advertisement
XConquer

Fix PoisonDamage

Dec 6th, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. Handler.cs buscas case 6001: y lo reemplazas Por este :
  2. #region ToxicFog
  3. case 6001://toxicfog
  4. {
  5. if (CanUseSpell(spell, attacker.Owner))
  6. {
  7. PrepareSpell(spell, attacker.Owner);
  8.  
  9. SpellUse suse = new SpellUse(true);
  10. suse.Attacker = attacker.UID;
  11. suse.SpellID = spell.ID;
  12. suse.SpellLevel = spell.Level;
  13.  
  14. suse.X = X;
  15. suse.Y = Y;
  16. if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
  17. {
  18. foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  19. {
  20. if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  21. {
  22. attacked = _obj as Entity;
  23. if (attacked.MapObjType == MapObjectType.Monster)
  24. if (attacked.Name == "TeratoDragon")//SnowBanshee
  25. continue;
  26. if (attacked.Name == "SnowBanshee")//SnowBanshee
  27. continue;
  28. if (attacked.Name == "ThrillingSpook")//SnowBanshee
  29. continue;
  30. if (attacked.Name == "SwordMaster")//SnowBanshee
  31. continue;
  32. if (attacked.Name == "LavaBeast")//SnowBanshee
  33. continue;
  34. if (attacked.Name == "Guard1")//SnowBanshee
  35. continue;
  36. if (attacked.Name == "NINJAMALIGNO")//SnowBanshee
  37. continue;
  38. if (Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
  39. {
  40. if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  41. {
  42. int potDifference = attacker.BattlePower - attacked.BattlePower;
  43.  
  44. int rate = spell.Percent + potDifference - 20;
  45.  
  46. if (Kernel.Rate(rate))
  47. {
  48. attacked.ToxicFogStamp = Time32.Now;
  49. attacked.ToxicFogLeft = 20;
  50. attacked.ToxicFogPercent = 0.5f;
  51. attacked.AddFlag(Update.Flags.Poisoned);
  52. suse.AddTarget(attacked.UID, 1, null);
  53. }
  54. else
  55. {
  56. suse.AddTarget(attacked.UID, 0, null);
  57. suse.Targets[attacked.UID].Hit = false;
  58. }
  59. }
  60. }
  61. }
  62. }
  63. }
  64. else
  65. {
  66. attacker.AttackPacket = null;
  67. }
  68. attacker.Owner.SendScreen(suse, true);
  69. }
  70. break;
  71. }
  72. #endregion
  73.  
  74. ================================================
  75. World.cs buscas #region ToxicFog o ToxicFogPercent y reemplazas :
  76.  
  77. #region ToxicFog
  78. if (client.Entity.ToxicFogLeft > 0)
  79. {
  80. if (Now >= client.Entity.ToxicFogStamp.AddSeconds(2))
  81. {
  82. float Percent = client.Entity.ToxicFogPercent;
  83. if (client.Entity.Detoxication != 0)
  84. {
  85. float immu = 1 - client.Entity.Detoxication / 100F;
  86. Percent = Percent * immu;
  87. }
  88. client.Entity.ToxicFogLeft--;
  89. if (client.Entity.ToxicFogLeft == 0)
  90. {
  91. client.Entity.RemoveFlag((ulong)Update.Flags.Poisoned);
  92. return;
  93. }
  94. client.Entity.ToxicFogStamp = Now;
  95. if (client.Entity.Hitpoints > 1)
  96. {
  97. uint damage = Game.Attacking.Calculate.Percent(client.Entity, Percent);
  98. if (client.Entity.ContainsFlag2((ulong)Update.Flags2.AzureShield))
  99. {
  100.  
  101. if (damage > client.Entity.AzureShieldDefence)
  102. {
  103. damage -= client.Entity.AzureShieldDefence;
  104. Game.Attacking.Calculate.CreateAzureDMG(client.Entity.AzureShieldDefence, client.Entity, client.Entity);
  105. client.Entity.RemoveFlag2((ulong)Update.Flags2.AzureShield);
  106. }
  107. else
  108. {
  109. Game.Attacking.Calculate.CreateAzureDMG((uint)damage, client.Entity, client.Entity);
  110. client.Entity.AzureShieldDefence -= (ushort)damage;
  111. client.Entity.AzureShieldPacket();
  112. damage = 1;
  113. }
  114. }
  115. else
  116. client.Entity.Hitpoints -= damage;
  117.  
  118. Network.GamePackets.SpellUse suse = new Network.GamePackets.SpellUse(true);
  119. suse.Attacker = client.Entity.UID;
  120. suse.SpellID = 10010;
  121. suse.AddTarget(client.Entity.UID, damage, null);
  122. client.SendScreen(suse, true);
  123. if (client != null)
  124. client.UpdateQualifier(client.ArenaStatistic.PlayWith, client, damage);
  125.  
  126. }
  127. }
  128. }
  129. else
  130. {
  131. if (client.Entity.ContainsFlag((ulong)Update.Flags.Poisoned))
  132. client.Entity.RemoveFlag((ulong)Update.Flags.Poisoned);
  133. }
  134.  
  135. #endregion
  136.  
  137. ========================================================
  138. Calculate.cs en caso de ser necesario o que no Existe dicha variable :
  139. public static void CreateAzureDMG(uint dmg, Entity attacker, Entity attacked)
  140. {
  141. Network.GamePackets.Attack attac = new Attack(true);
  142. attac.Attacker = attacker.UID;
  143. attac.Attacked = attacked.UID;
  144. attac.X = attacked.X;
  145. attac.Y = attacked.Y;
  146. attac.AttackType = 55;
  147. attac.Damage = dmg;
  148. attacked.Owner.SendScreen(attac, true);
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement