XConquer

MY SKILLS NOT WORK

Sep 14th, 2020
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #region FrostArrows
  2. case 14280:
  3. {
  4. if (Handle.CanUseSpell(spell, attacker.Owner))
  5. {
  6. Handle.PrepareSpell(spell, attacker.Owner);
  7. MsgMagicEffect suse = new MsgMagicEffect(true);
  8. suse.Attacker = attacker.UID;
  9. suse.SpellID = spell.ID;
  10. suse.SpellLevel = spell.Level;
  11. suse.X = X;
  12. suse.Y = Y;
  13. foreach (IMapObject _obj in attacker.Owner.Screen.Objects)
  14. {
  15. if (_obj.MapObjType == MapObjectType.Player)
  16. {
  17. attacked = _obj as Player;
  18. if (Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
  19. {
  20. if (Handle.CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
  21. {
  22. int potDifference = attacker.BattlePower - attacked.BattlePower;
  23. int rate = (byte)spell.Percent + potDifference;
  24.  
  25. if (Kernel.Rate(rate))
  26. {
  27. attacked.AddSpellFlag(MsgUpdate.Flags.FrostArrows, spell.Duration, true);
  28. attacked.Stamina -= 10;
  29. }
  30. }
  31. }
  32. }
  33. }
  34. attacker.Owner.SendScreen(suse, true);
  35. }
  36. break;
  37. }
  38. #endregion
  39. #region Infinity
  40. case 14380:
  41. {
  42. if (Handle.CanUseSpell(spell, attacker.Owner))
  43. {
  44. Handle.PrepareSpell(spell, attacker.Owner);
  45. MsgMagicEffect suse = new MsgMagicEffect(true);
  46. suse.Attacker = attacker.UID;
  47. suse.SpellID = spell.ID;
  48. suse.SpellLevel = spell.Level;
  49. suse.X = X;
  50. suse.Y = Y;
  51. attacker.InfinityDamage = (int)spell.Damage1;
  52. if (attacker.ContainsFlag((ulong)MsgUpdate.Flags.Ride))
  53. attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
  54. attacker.AddSpellFlag(MsgUpdate.Flags.Infinity, spell.Duration, true);
  55. attacker.AddSpellFlag(MsgUpdate.Flags.Fly, spell.Duration, true);
  56. MsgUpdate upgrade = new MsgUpdate(true);
  57. upgrade.UID = attacker.UID;
  58. upgrade.Append(103, 215, (uint)spell.Duration, 0, 0);
  59. attacker.Owner.Send(upgrade.ToArray());
  60. suse.AddTarget(attacker.UID, 0, null);
  61. attacker.Owner.SendScreen(suse, true);
  62. }
  63. break;
  64. }
  65. #endregion
RAW Paste Data