Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region SeaBurial
- case 14680:
- {
- if (attacker.EpicPirate())
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- PrepareSpell(spell, attacker.Owner);
- ushort xX = X, yY = Y;
- Map.Pushback(ref xX, ref yY, Kernel.GetAngle(attacker.X, attacker.Y, X, Y), spell.Distance);
- var map = Kernel.Maps[attacker.MapID];
- Game.Attacking.InLineAlgorithm ila = new Alchemist.Game.Attacking.InLineAlgorithm(attacker.X,
- X, attacker.Y, Y, (byte)spell.Distance);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = SpellID;
- suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
- suse.X = xX;
- suse.Y = yY;
- /* foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj == null)
- continue;
- if (_obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (attacked == null) break;
- foreach (var i in ila.lcoords)
- if (Kernel.GetDDistance(attacked.X, attacked.Y, (ushort)i.X, (ushort)i.Y) <= 2)
- {
- if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- continue;
- attack.Flag = Attack.AttackFlag.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
- suse.Flag = attack.Flag;
- attack.Damage = damage;
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- }
- }
- else if (_obj.MapObjType == MapObjectType.Monster)
- {
- attacked = _obj as Entity;
- if (attacked == null) break;
- foreach (var i in ila.lcoords)
- if (Kernel.GetDDistance(attacked.X, attacked.Y, (ushort)i.X, (ushort)i.Y) <= 2)
- {
- // if (ila.InLine(attacked.X, attacked.Y))
- {
- if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- continue;
- attack.Flag = Attack.AttackFlag.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
- suse.Flag = attack.Flag;
- attack.Damage = damage;
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as SobNpcSpawn;
- if (attackedsob == null) break;
- if (ila.InLine(attackedsob.X, attackedsob.Y))
- {
- if (!CanAttack(attacker, attackedsob, spell))
- continue;
- foreach (var i in ila.lcoords)
- if (Kernel.GetDDistance(attackedsob.X, attackedsob.Y, (ushort)i.X, (ushort)i.Y) <= 2)
- {
- attack.Flag = Attack.AttackFlag.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- suse.Flag = attack.Flag;
- attack.Damage = damage;
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.AddTarget(attackedsob, damage, attack);
- }
- }
- }
- }*/
- attacker.Owner.SendScreen(suse, true);
- Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
- flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
- while (map.Npcs.ContainsKey(flooritem.UID))
- flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
- flooritem.ItemID = FloorItem.SeaBurial;
- flooritem.X = attacker.X;
- flooritem.Y = attacker.Y;
- flooritem.Type = FloorItem.CastTrap;
- flooritem.mColor = 16;
- flooritem.OwnerUID = attacker.UID;
- flooritem.OwnerGuildUID = attacker.GuildID;
- flooritem.MapID = map.ID;
- flooritem.FlowerType = 3;
- flooritem.Unknown37 = 0x6D;
- flooritem.time = 3;
- flooritem.OwnerX = X;
- flooritem.OwnerY = Y;
- flooritem.Name2 = "SeaBurialTrap";
- flooritem.Owner = attacker.Owner;
- flooritem.OnFloor = Time32.Now;
- flooritem.Attack = suse;
- map.AddFloorItem(flooritem);
- attacker.Owner.SendScreenSpawn(flooritem, true);
- attacker.AttackPacket = null;
- }
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement