Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Epico Ninja
- #region TwilightDance
- case 12070:
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- PrepareSpell(spell, attacker.Owner);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- ushort _X = attacker.X, _Y = attacker.Y;
- ushort _tX = X, _tY = Y;
- byte dist = (byte)spell.Distance;
- var Array = attacker.Owner.Screen.Objects;
- InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
- InLineAlgorithm.Algorithm.DDA);
- X = attacker.X;
- Y = attacker.Y;
- var count = (double)algo.lcoords.Count / 3;
- int i = 0;
- for (i = 0; i < 4; i++)
- {
- var selected = i * (int)count;
- selected = Math.Min(algo.lcoords.Count - 1, selected);
- X = (ushort)algo.lcoords[selected].X;
- Y = (ushort)algo.lcoords[selected].Y;
- suse.X = X;//
- suse.Y = Y;
- if (!attacker.Owner.Map.Floor[X, Y, MapObjectType.Player, null])
- return;
- double disth = 6.3;
- if (attacker.MapID == DeathMatch.MAPID) disth = 1;
- foreach (Interfaces.IMapObject _obj in Array)
- {
- bool hit = false;
- for (int j = 0; j < i; j++)
- if (Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
- hit = true;
- if (hit)
- {
- if (_obj.MapObjType == MapObjectType.Monster)
- {
- attacked = _obj as Entity;
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- damage = (damage * 2) / 2;
- switch (i)
- {
- case 1:
- // damage *= 9 / 10;
- break;
- case 2:
- // damage *= 10 / 10;
- break;
- default:
- // damage *= 12 / 13;
- break;
- }
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- }
- }
- else if (_obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- // damage = (damage * 5) / 10;
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as SobNpcSpawn;
- if (CanAttack(attacker, attackedsob, spell))
- {
- var damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- }
- }
- }
- }
- SendTwilightEffect(suse, X, Y);
- var map = attacker.Owner.Map;
- FloorItem floorItem = new FloorItem(true);
- attacker.Owner.SendScreen(suse, true);
- System.Threading.Thread.Sleep(250);
- floorItem.Type = FloorItem.RemoveEffect;
- map.RemoveFloorItem(floorItem);
- attacker.Owner.SendScreenSpawn(floorItem, true);
- }
- }
- break;
- }
- #endregion
- #region SuperTwofoldBlade
- case 12080:
- {
- if (Time32.Now >= attacker.SpellStamp.AddMilliseconds(500))
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- ushort Xx, Yx;
- if (attacked != null)
- {
- Xx = attacked.X;
- Yx = attacked.Y;
- }
- else
- {
- Xx = attackedsob.X;
- Yx = attackedsob.Y;
- }
- if (Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= spell.Distance)
- {
- if (attackedsob == null)
- if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
- return;
- if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
- return;
- PrepareSpell(spell, attacker.Owner);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- suse.X = X;
- suse.Y = Y;
- //suse.SpellLevelHu = client_Spell.LevelHu2;
- bool send = false;
- if (attackedsob == null)
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- attack.Effect1 = Attack.AttackEffects1.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
- damage = (uint)((damage)* 1);
- var dist = Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y);
- if (dist <= 3)
- {
- damage *= 2;
- }
- else
- {
- damage = (uint)(damage * 9 / 11d);
- }
- suse.Effect1 = attack.Effect1;
- ReceiveAttack(attacker, attacked, attack, ref damage, spell);
- suse.AddTarget(attacked, damage, attack);
- send = true;
- if (attacker.Owner.Spells.ContainsKey(11230) && !attacked.Dead)
- {
- var s = attacker.Owner.Spells[11230];
- var spellz = Database.SpellTable.SpellInformations[s.ID][s.Level];
- if (spellz != null)
- {
- if (CM.Arg.Kernel.Rate(spellz.Percent))
- {
- SpellUse ssuse = new SpellUse(true);
- ssuse.Attacker = attacker.UID;
- ssuse.SpellID = spellz.ID;
- ssuse.SpellLevel = spellz.Level;
- damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- ssuse.AddTarget(attacked, new SpellUse.DamageClass().Damage = damage, attack);
- ReceiveAttack(attacker, attacked, attack, ref damage, spellz);
- attacker.Owner.SendScreen(ssuse, true);
- }
- }
- }
- }
- }
- else
- {
- if (CanAttack(attacker, attackedsob, spell))
- {
- attack.Effect1 = Attack.AttackEffects1.None;
- uint damage = Calculate.Melee(attacker, attackedsob, ref attack);
- damage = (uint)(damage * spell.PowerPercent);
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.Effect1 = attack.Effect1;
- suse.AddTarget(attackedsob, damage, attack);
- send = true;
- }
- }
- if (send)
- attacker.Owner.SendScreen(suse, true);
- attacker.SpellStamp = Time32.Now;
- }
- else
- {
- attacker.AttackPacket = null;
- }
- }
- }
- break;
- }
- #endregion
- #region ShadowClone
- case 12090:
- {
- attacker.AttackPacket = null;
- if (attacker.MyClones.Count > 0)
- {
- var clones = attacker.MyClones.Values.ToArray();
- for (int i = 0; i < clones.Length; i++)
- {
- var item = clones[i];
- if (item == null)
- continue;
- Data data = new Data(true);
- data.UID = item.UID;
- data.ID = Network.GamePackets.Data.RemoveEntity;
- attacker.Owner.SendScreen(data);
- attacker.MyClones[item.UID] = null;
- }
- attacker.MyClones.Clear();
- }
- else
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- PrepareSpell(spell, attacker.Owner);
- SpellUse spellUse = new SpellUse(true);
- spellUse.Attacker = attacker.UID;
- spellUse.SpellID = spell.ID;
- spellUse.SpellLevel = spell.Level;
- spellUse.X = X;
- spellUse.Y = Y;
- attacker.AddClone("ShadowClone", 3);
- attacker.AddClone("ShadowClone", 10003);
- foreach (var item in attacker.MyClones.Values)
- spellUse.AddTarget(item, 0, attack);
- attacker.Owner.SendScreen(spellUse, true);
- }
- }
- break;
- }
- #endregion
- #region FatalSpin
- case 12110:
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- PrepareSpell(spell, attacker.Owner);
- Game.Attacking.InLineAlgorithm ila = new CM.Arg.Game.Attacking.InLineAlgorithm(attacker.X,
- X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = SpellID;
- suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
- suse.X = X;
- suse.Y = Y;
- //suse.SpellLevelHu = client_Spell.LevelHu2;
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj == null)
- continue;
- if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (ila.InLine(attacked.X, attacked.Y))
- {
- if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- continue;
- attack.Effect1 = Attack.AttackEffects1.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
- damage = (uint)((damage) / 6);
- suse.Effect1 = attack.Effect1;
- 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 (ila.InLine(attackedsob.X, attackedsob.Y))
- {
- if (!CanAttack(attacker, attackedsob, spell))
- continue;
- attack.Effect1 = Attack.AttackEffects1.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- // damage = (uint)(damage * spell.PowerPercent);
- damage = (uint)((damage) / 6);
- attack.Damage = damage;
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.AddTarget(attackedsob, damage, attack);
- }
- }
- }
- attacker.Owner.SendScreen(suse, true);
- }
- break;
- }
- #endregion
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement