Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.31 KB | None | 0 0
  1. #region SeaBurial
  2. case 14680:
  3. {
  4. if (attacker.EpicPirate())
  5. {
  6. if (CanUseSpell(spell, attacker.Owner))
  7. {
  8. PrepareSpell(spell, attacker.Owner);
  9. ushort xX = X, yY = Y;
  10. Map.Pushback(ref xX, ref yY, Kernel.GetAngle(attacker.X, attacker.Y, X, Y), spell.Distance);
  11. var map = Kernel.Maps[attacker.MapID];
  12. Game.Attacking.InLineAlgorithm ila = new Alchemist.Game.Attacking.InLineAlgorithm(attacker.X,
  13. X, attacker.Y, Y, (byte)spell.Distance);
  14. SpellUse suse = new SpellUse(true);
  15. suse.Attacker = attacker.UID;
  16. suse.SpellID = SpellID;
  17. suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
  18. suse.X = xX;
  19. suse.Y = yY;
  20. /* foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  21. {
  22. if (_obj == null)
  23. continue;
  24. if (_obj.MapObjType == MapObjectType.Player)
  25. {
  26. attacked = _obj as Entity;
  27. if (attacked == null) break;
  28. foreach (var i in ila.lcoords)
  29. if (Kernel.GetDDistance(attacked.X, attacked.Y, (ushort)i.X, (ushort)i.Y) <= 2)
  30. {
  31. if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  32. continue;
  33. attack.Flag = Attack.AttackFlag.None;
  34. uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
  35. suse.Flag = attack.Flag;
  36.  
  37. attack.Damage = damage;
  38.  
  39. ReceiveAttack(attacker, attacked, attack, ref damage, spell);
  40.  
  41. suse.AddTarget(attacked, damage, attack);
  42. }
  43. }
  44. else if (_obj.MapObjType == MapObjectType.Monster)
  45. {
  46. attacked = _obj as Entity;
  47. if (attacked == null) break;
  48. foreach (var i in ila.lcoords)
  49. if (Kernel.GetDDistance(attacked.X, attacked.Y, (ushort)i.X, (ushort)i.Y) <= 2)
  50. {
  51. // if (ila.InLine(attacked.X, attacked.Y))
  52. {
  53. if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  54. continue;
  55. attack.Flag = Attack.AttackFlag.None;
  56. uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
  57. suse.Flag = attack.Flag;
  58.  
  59. attack.Damage = damage;
  60.  
  61. ReceiveAttack(attacker, attacked, attack, ref damage, spell);
  62.  
  63. suse.AddTarget(attacked, damage, attack);
  64. }
  65. }
  66. }
  67. else if (_obj.MapObjType == MapObjectType.SobNpc)
  68. {
  69. attackedsob = _obj as SobNpcSpawn;
  70. if (attackedsob == null) break;
  71. if (ila.InLine(attackedsob.X, attackedsob.Y))
  72. {
  73. if (!CanAttack(attacker, attackedsob, spell))
  74. continue;
  75. foreach (var i in ila.lcoords)
  76. if (Kernel.GetDDistance(attackedsob.X, attackedsob.Y, (ushort)i.X, (ushort)i.Y) <= 2)
  77. {
  78. attack.Flag = Attack.AttackFlag.None;
  79. uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  80. suse.Flag = attack.Flag;
  81.  
  82. attack.Damage = damage;
  83.  
  84. ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  85.  
  86. suse.AddTarget(attackedsob, damage, attack);
  87. }
  88. }
  89. }
  90. }*/
  91. attacker.Owner.SendScreen(suse, true);
  92. Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  93. flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  94. while (map.Npcs.ContainsKey(flooritem.UID))
  95. flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  96. flooritem.ItemID = FloorItem.SeaBurial;
  97. flooritem.X = attacker.X;
  98. flooritem.Y = attacker.Y;
  99. flooritem.Type = FloorItem.CastTrap;
  100. flooritem.mColor = 16;
  101. flooritem.OwnerUID = attacker.UID;
  102. flooritem.OwnerGuildUID = attacker.GuildID;
  103. flooritem.MapID = map.ID;
  104. flooritem.FlowerType = 3;
  105. flooritem.Unknown37 = 0x6D;
  106. flooritem.time = 3;
  107. flooritem.OwnerX = X;
  108. flooritem.OwnerY = Y;
  109. flooritem.Name2 = "SeaBurialTrap";
  110. flooritem.Owner = attacker.Owner;
  111. flooritem.OnFloor = Time32.Now;
  112. flooritem.Attack = suse;
  113. map.AddFloorItem(flooritem);
  114. attacker.Owner.SendScreenSpawn(flooritem, true);
  115. attacker.AttackPacket = null;
  116.  
  117. }
  118. }
  119. break;
  120. }
  121. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement