Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. #region WrathoftheEmperor
  2. case 12570:
  3. {
  4. if (CanUseSpell(spell, attacker.Owner))
  5. {
  6. PrepareSpell(spell, attacker.Owner);
  7. SpellUse suse = new SpellUse(true);
  8. suse.Attacker = attacker.UID;
  9. suse.SpellID = SpellID;
  10. suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
  11. suse.X = X;
  12. suse.Y = Y;
  13. suse.SpellEffect = 1;
  14. foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  15. {
  16. if (_obj == null) continue;
  17. if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  18. {
  19. attacked = _obj as Entity;
  20. if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 2)
  21. {
  22. if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  23. {
  24. uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  25. suse.Effect1 = attack.Effect1;
  26. attack.Effect1 = Attack.AttackEffects1.None;
  27. ReceiveAttack(attacker, attacked, attack, ref damage, spell);
  28. suse.AddTarget(attacked, damage, attack);
  29. }
  30. }
  31. }
  32. else if (_obj.MapObjType == MapObjectType.SobNpc)
  33. {
  34. attackedsob = _obj as SobNpcSpawn;
  35. if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 2)
  36. {
  37. if (CanAttack(attacker, attackedsob, spell))
  38. {
  39. uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  40. suse.Effect1 = attack.Effect1;
  41. attack.Effect1 = Attack.AttackEffects1.None;
  42. ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  43. suse.AddTarget(attackedsob, damage, attack);
  44. }
  45. }
  46. }
  47. }
  48. attacker.Owner.SendScreen(suse, true);
  49. }
  50. break;
  51. }
  52. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement