Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.29 KB | None | 0 0
  1. ابحث عن دي
  2.  
  3. if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass)
  4.  
  5. بعدين حط دي
  6.  
  7. #region DragonPunch
  8. if (attacker.DragonWarrior())
  9. {
  10. if (attacker.Owner.Spells.ContainsKey(12240))
  11. {
  12. var spell = Database.SpellTable.GetSpell(12240, attacker.Owner);
  13. if (spell != null)
  14. {
  15. spell.CanKill = true;
  16. if (Kernel.Rate(spell.Percent))
  17. {
  18. SpellUse suse = new SpellUse(true);
  19. suse.Attacker = attacker.UID;
  20. suse.SpellID = spell.ID;
  21. suse.SpellLevel = spell.Level;
  22. suse.X = attacker.X;
  23. suse.Y = attacker.Y;
  24. IMapObject lastAttacked = attacker;
  25. if (Handle.CanAttack(attacker, attacked, spell, false))
  26. {
  27. lastAttacked = attacked;
  28. uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
  29. suse.Effect1 = attack.Effect1;
  30. Handle.ReceiveAttack(attacker, attacked, attack, ref damages, spell);
  31. suse.AddTarget(attacked.UID, damages, attack);
  32. }
  33. foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  34. {
  35. if (_obj == null) continue;
  36. if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  37. {
  38. if (_obj.UID == attacked.UID) continue;
  39. var attacked1 = _obj as Entity;
  40. if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  41. {
  42. if (Handle.CanAttack(attacker, attacked1, spell, false))
  43. {
  44. lastAttacked = attacked1;
  45. uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
  46. suse.Effect1 = attack.Effect1;
  47. if (damages == 0) break;
  48. Handle.ReceiveAttack(attacker, attacked1, attack, ref damages, spell);
  49. suse.AddTarget(attacked1.UID, damages, attack);
  50. }
  51. }
  52. }
  53. else if (_obj.MapObjType == MapObjectType.SobNpc)
  54. {
  55. attackedsob = _obj as SobNpcSpawn;
  56.  
  57. if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  58. {
  59. if (Handle.CanAttack(attacker, attackedsob, spell))
  60. {
  61. lastAttacked = attackedsob;
  62. uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  63. suse.Effect1 = attack.Effect1;
  64. if (damages == 0) break;
  65. Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
  66. suse.AddTarget(attackedsob.UID, damages, attack);
  67. }
  68. }
  69. }
  70. }
  71. attacker.Owner.SendScreen(suse, true);
  72. return;
  73. }
  74. }
  75.  
  76. }
  77.  
  78. }
  79. #endregion
  80.  
  81.  
  82. تحت
  83.  
  84. attack.Effect1 = Attack.AttackEffects1.None;
  85.  
  86. Entity.cs
  87.  
  88.  
  89. public bool DragonWarrior()
  90. {
  91. if (EntityFlag == Game.EntityFlag.Player)
  92. {
  93. var weapons = Owner.Weapons;
  94. if (weapons.Item1 != null)
  95. if (weapons.Item1.ID / 1000 == 617)
  96. return true;
  97. else if (weapons.Item2 != null)
  98. if (weapons.Item2.ID / 1000 == 617)
  99. return true;
  100. }
  101. return false;
  102. }
  103.  
  104.  
  105. بس كدا يا علق
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement