Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Shadow Clone Attack
- case 2812:
- {
- var attackd = BitConverter.ToUInt32(packet, 4);
- var attack = client.Entity.Shadowattack;
- ushort skillmeto = attack.MagicType;
- ushort levelmeto = attack.MagicLevel;
- attack.Attacked = attackd;
- var clonecount = packet[8];
- for (int i = 0; i < clonecount; i++)
- {
- var attackr = BitConverter.ToUInt32(packet, 9 + (i * 4));
- attack.Attacker = attackr;
- #region var
- #endregion
- if (client.Entity.MyClones.Count == 0)
- return;
- if (attackr == client.Entity.UID)
- return;
- Entity Clone = null;
- #region CloneAttack MeToOo
- if (client.Entity.MyClones.TryGetValue(attackr, out Clone))
- {
- Entity attacked = null;
- SobNpcSpawn attackedsob = null;
- if (client.Screen.TryGetValue(attackd, out attacked))
- {
- if (Game.Attacking.Handle.CanAttack(client.Entity, attacked, null, attack.AttackType == GamePackets.Attack.Melee))
- {
- var spell = Database.SpellTable.GetSpell(skillmeto, (byte)levelmeto);
- if (spell == null)
- {
- Game.Attacking.Handle.CloneEntityMelee(Clone, attacked, attackedsob, client.Entity.Shadowattack);
- }
- else
- {
- uint damage = 0;
- if (attack.AttackType == GamePackets.Attack.Melee)
- damage = Game.Attacking.Calculate.Melee(client.Entity, attacked, ref attack);
- else if (attack.AttackType == GamePackets.Attack.Ranged)
- damage = Game.Attacking.Calculate.Ranged(client.Entity, attacked, ref attack);
- if (attack.AttackType == GamePackets.Attack.Magic)
- damage = Game.Attacking.Calculate.Magic(client.Entity, attacked, spell, ref attack);
- damage = (uint)((double)damage * 0.6);
- attack.Damage = damage;
- SpellUse spellUse = new SpellUse(true);
- spellUse.Attacker = Clone.UID;
- spellUse.SpellID = spell.ID;
- spellUse.SpellLevel = spell.Level;
- spellUse.X = Clone.X;
- spellUse.Y = Clone.Y;
- spellUse.Effect1 = attack.Effect1;
- spellUse.Effect2 = attack.Effect2;
- spellUse.AddTarget(attacked.UID, damage, attack);
- Game.Attacking.Handle.ReceiveAttack(Clone, attacked, attack, damage, spell);
- client.SendScreen(spellUse, true);
- client.SendScreen(attack, true);
- }
- }
- }
- else if (client.Screen.TryGetSob(attackd, out attackedsob))
- {
- if (Game.Attacking.Handle.CanAttack(client.Entity, attackedsob, null))
- {
- var spell = Database.SpellTable.GetSpell(skillmeto, (byte)levelmeto);
- if (spell == null)
- {
- Game.Attacking.Handle.CloneEntityMelee(Clone, attacked, attackedsob, client.Entity.Shadowattack);
- }
- else
- {
- uint damage = 0;
- if (attack.AttackType == GamePackets.Attack.Melee)
- damage = Game.Attacking.Calculate.Melee(client.Entity, attackedsob, ref attack);
- else if (attack.AttackType == GamePackets.Attack.Ranged)
- damage = Game.Attacking.Calculate.Ranged(client.Entity, attackedsob, ref attack);
- if (attack.AttackType == GamePackets.Attack.Magic)
- damage = Game.Attacking.Calculate.Magic(client.Entity, attackedsob, spell, ref attack);
- damage = (uint)((double)damage * 0.6);
- attack.Damage = damage;
- SpellUse spellUse = new SpellUse(true);
- spellUse.Attacker = Clone.UID;
- spellUse.SpellID = spell.ID;
- spellUse.SpellLevel = spell.Level;
- spellUse.X = Clone.X;
- spellUse.Y = Clone.Y;
- spellUse.Effect1 = attack.Effect1;
- spellUse.Effect2 = attack.Effect2;
- spellUse.AddTarget(attackedsob.UID, damage, attack);
- Game.Attacking.Handle.ReceiveAttack(Clone, attackedsob, attack, damage, spell);
- client.SendScreen(spellUse, true);
- client.SendScreen(attack, true);
- }
- }
- }
- }
- #endregion
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement